public void beforeProcessCompleted(ProcessCompletedEvent event) { filterLogEvent( new RuleFlowLogEvent( LogEvent.BEFORE_RULEFLOW_COMPLETED, event.getProcessInstance().getProcessId(), event.getProcessInstance().getProcessName(), event.getProcessInstance().getId()) ); }
@Override public Long call() { ProcessBag processBag = getProcessBag(); ProcessInstance processInstance = session.startProcess(processId, params); session.insert(processInstance); processBag.setProcessId(String.valueOf(processInstance.getId())); processInstance.signalEvent("FlowStartedEvent", null); return processInstance.getId(); }
private ProcessInstance getRemoteClient(ProcessInstance processInstance) { return new ProcessInstanceRemoteClient(processInstance.getId(), processInstance.getProcessId(), processInstance.getProcessName(), processInstance.getState()); } }
@Override public void afterProcessCompleted(ProcessCompletedEvent event) { String processId2 = event.getProcessInstance().getProcessId(); long id = event.getProcessInstance().getId(); LOGGER.info("process completed \"{}\". instance-ID: {}", processId2, id); } });
public String toString() { return "==>[ProcessVariableChanged(id=" + id + "; instanceId=" + instanceId + "; oldValue=" + oldValue + "; newValue=" + newValue + "; processName=" + getProcessInstance().getProcessName() + "; processId=" + getProcessInstance().getProcessId() + ")]"; } }
public Collection<Long> getRunningFlows() throws WorkflowException { Collection<ProcessInstance> processInstances = getSessionForCurrentContext().getProcessInstances(); Collection<Long> result = new HashSet<Long>(); for (ProcessInstance p : processInstances) { result.add(p.getId()); } return result; }
@Override public void afterNodeLeft(ProcessNodeLeftEvent event) { for (AuditingDomain ac : auditingConnectors) { ProcessInstance instance = event.getProcessInstance(); ac.onNodeFinish(instance.getProcessName(), instance.getId(), event.getNodeInstance().getNodeName()); } }
public static Collection<NodeInstance> getActiveNodeInstances(long processInstanceId) { ProcessInstance processInstance = getSession().getProcessInstance(processInstanceId); if (processInstance != null){ ((ProcessInstanceImpl)processInstance).setProcess(getSession().getKnowledgeBase().getProcess(processInstance.getProcessId())); Collection<NodeInstance> activeNodes = ((WorkflowProcessInstance)processInstance).getNodeInstances(); activeNodes.addAll(collectActiveNodeInstances(activeNodes)); return activeNodes; } return null; }
private void signalEventToProcesses(Event event, StatefulKnowledgeSession session, Set<Long> processIds) { for (Long pid : processIds) { ProcessInstance processInstance = session.getProcessInstance(pid); if (processInstance == null) { LOGGER.warn("processInstance with ID {} not found, maybe it already terminated", pid); } else { processInstance.signalEvent(event.getClass().getSimpleName(), event); } } }
@Override public void afterProcessCompleted(ProcessCompletedEvent event) { String processId2 = event.getProcessInstance().getProcessId(); long id = event.getProcessInstance().getId(); LOGGER.info("process completed \"{}\". instance-ID: {}", processId2, id); } });
public String toString() { return "==>[ProcessCompleted(name=" + getProcessInstance().getProcessName() + "; id=" + getProcessInstance().getProcessId() + ")]"; } }
public Collection<Long> getRunningFlows() throws WorkflowException { Collection<ProcessInstance> processInstances = getSessionForCurrentContext().getProcessInstances(); Collection<Long> result = new HashSet<Long>(); for (ProcessInstance p : processInstances) { result.add(p.getId()); } return result; }
@Override public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { for (AuditingDomain ac : auditingConnectors) { ProcessInstance instance = event.getProcessInstance(); ac.onNodeStart(instance.getProcessName(), instance.getId(), event.getNodeInstance().getNodeName()); } }
@Test public void startProcessWithParametersTest() { StatefulKnowledgeSession ksession = createProcessSession(); Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("long", 1L); ProcessInstance processInstance = ksession.startProcess("Minimal", parameters); Assert.assertNotNull(processInstance); Assert.assertEquals("Minimal", processInstance.getProcessId()); }
@SuppressWarnings("deprecation") // will be removed in 3.0 (OPENENGSB-2789) private void signalEventToProcesses(Event event, StatefulKnowledgeSession session, Set<Long> processIds) { for (Long pid : processIds) { ProcessInstance processInstance = session.getProcessInstance(pid); if (processInstance == null) { LOGGER.warn("processInstance with ID {} not found, maybe it already terminated", pid); } else { processInstance.signalEvent(event.getType(), event); } } }
public void afterProcessCompleted(ProcessCompletedEvent event) { filterLogEvent(new RuleFlowLogEvent(LogEvent.AFTER_RULEFLOW_COMPLETED, event.getProcessInstance().getProcessId(), event.getProcessInstance().getProcessName(), event.getProcessInstance().getId()) ); }
@Override public void afterProcessStarted(ProcessStartedEvent event) { String processId2 = event.getProcessInstance().getProcessId(); long id = event.getProcessInstance().getId(); LOGGER.info("started process \"{}\". instance-ID: {}", processId2, id); }
public void afterProcessCompleted(ProcessCompletedEvent event) { String outcome = null; try { ProcessInstanceImpl processInstance = (ProcessInstanceImpl) event.getProcessInstance(); outcome = processInstance.getOutcome(); } catch (Exception e) { //in case of problems with getting hold of parentProcessInstanceId don't break the operation } LogEvent logEvent = new ExtendedRuleFlowLogEvent(LogEvent.AFTER_RULEFLOW_COMPLETED, event.getProcessInstance().getProcessId(), event.getProcessInstance().getProcessName(), event.getProcessInstance().getId(), event.getProcessInstance().getState(), outcome) ; // filters are not available from super class, TODO make fireLogEvent protected instead of private in WorkinMemoryLogger logEventCreated( logEvent ); }
public String toString() { return "==>[ProcessStarted(name=" + getProcessInstance().getProcessName() + "; id=" + getProcessInstance().getProcessId() + ")]"; }
public static long startFlow(KnowledgeRuntime session, String processId, Map<String, Object> params) { ProcessBag processBag = getProcessBag(params); ProcessInstance processInstance = session.createProcessInstance(processId, params); session.insert(processInstance); processBag.setProcessId(String.valueOf(processInstance.getId())); session.startProcessInstance(processInstance.getId()); return processInstance.getId(); }