public void cancel() { while (!nodeInstances.isEmpty()) { NodeInstance nodeInstance = (NodeInstance) nodeInstances.get(0); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).cancel(); } super.cancel(); }
public void cancel() { ((InternalProcessRuntime) getProcessInstance().getKnowledgeRuntime() .getProcessRuntime()).getTimerManager().cancelTimer(timerId); super.cancel(); }
public void cancel() { super.cancel(); if (actAsWaitState()) { ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda()).deactivateRuleFlowGroup(getRuleFlowGroup()); } }
public void cancel() { WorkItem workItem = getWorkItem(); if (workItem != null && workItem.getState() != WorkItem.COMPLETED && workItem.getState() != WorkItem.ABORTED) { try { ((WorkItemManager) ((ProcessInstance) getProcessInstance()) .getKnowledgeRuntime().getWorkItemManager()).internalAbortWorkItem(workItemId); } catch (WorkItemHandlerNotFoundException wihnfe) { getProcessInstance().setState(ProcessInstance.STATE_ABORTED); throw wihnfe; } } if (exceptionHandlingProcessInstanceId > -1) { ProcessInstance processInstance = null; KieRuntime kruntime = getKieRuntimeForSubprocess(); processInstance = (ProcessInstance) kruntime.getProcessInstance(exceptionHandlingProcessInstanceId); if (processInstance != null) { processInstance.setState(ProcessInstance.STATE_ABORTED); } } super.cancel(); }
public void cancel() { super.cancel(); if (getSubProcessNode() == null || !getSubProcessNode().isIndependent()) { ProcessInstance processInstance = null; InternalKnowledgeRuntime kruntime = ((ProcessInstance) getProcessInstance()).getKnowledgeRuntime(); RuntimeManager manager = (RuntimeManager) kruntime.getEnvironment().get(EnvironmentName.RUNTIME_MANAGER); if (manager != null) { try { org.kie.api.runtime.manager.Context<?> context = ProcessInstanceIdContext.get(processInstanceId); String caseId = (String) kruntime.getEnvironment().get(EnvironmentName.CASE_ID); if (caseId != null) { context = CaseContext.get(caseId); } RuntimeEngine runtime = manager.getRuntimeEngine(context); KieRuntime managedkruntime = (KieRuntime) runtime.getKieSession(); processInstance = (ProcessInstance) managedkruntime.getProcessInstance(processInstanceId); } catch (SessionNotFoundException e) { // in case no session is found for parent process let's skip signal for process instance completion } } else { processInstance = (ProcessInstance) kruntime.getProcessInstance(processInstanceId); } if (processInstance != null) { processInstance.setState(ProcessInstance.STATE_ABORTED); } } }
public void cancel() { while (!nodeInstances.isEmpty()) { NodeInstance nodeInstance = (NodeInstance) nodeInstances.get(0); ((org.jbpm.workflow.instance.NodeInstance) nodeInstance).cancel(); } super.cancel(); }
public void cancel() { ((InternalProcessRuntime) getProcessInstance().getKnowledgeRuntime() .getProcessRuntime()).getTimerManager().cancelTimer(timerId); super.cancel(); }
public void cancel() { super.cancel(); if (actAsWaitState()) { ((InternalAgenda) getProcessInstance().getKnowledgeRuntime().getAgenda()).deactivateRuleFlowGroup(getRuleFlowGroup()); } }
public void cancel() { WorkItem workItem = getWorkItem(); if (workItem != null && workItem.getState() != WorkItem.COMPLETED && workItem.getState() != WorkItem.ABORTED) { try { ((WorkItemManager) ((ProcessInstance) getProcessInstance()) .getKnowledgeRuntime().getWorkItemManager()).internalAbortWorkItem(workItemId); } catch (WorkItemHandlerNotFoundException wihnfe) { getProcessInstance().setState(ProcessInstance.STATE_ABORTED); throw wihnfe; } } if (exceptionHandlingProcessInstanceId > -1) { ProcessInstance processInstance = null; KieRuntime kruntime = getKieRuntimeForSubprocess(); processInstance = (ProcessInstance) kruntime.getProcessInstance(exceptionHandlingProcessInstanceId); if (processInstance != null) { processInstance.setState(ProcessInstance.STATE_ABORTED); } } super.cancel(); }
public void cancel() { super.cancel(); if (getSubProcessNode() == null || !getSubProcessNode().isIndependent()) { ProcessInstance processInstance = null; InternalKnowledgeRuntime kruntime = ((ProcessInstance) getProcessInstance()).getKnowledgeRuntime(); RuntimeManager manager = (RuntimeManager) kruntime.getEnvironment().get(EnvironmentName.RUNTIME_MANAGER); if (manager != null) { try { org.kie.api.runtime.manager.Context<?> context = ProcessInstanceIdContext.get(processInstanceId); String caseId = (String) kruntime.getEnvironment().get(EnvironmentName.CASE_ID); if (caseId != null) { context = CaseContext.get(caseId); } RuntimeEngine runtime = manager.getRuntimeEngine(context); KieRuntime managedkruntime = (KieRuntime) runtime.getKieSession(); processInstance = (ProcessInstance) managedkruntime.getProcessInstance(processInstanceId); } catch (SessionNotFoundException e) { // in case no session is found for parent process let's skip signal for process instance completion } } else { processInstance = (ProcessInstance) kruntime.getProcessInstance(processInstanceId); } if (processInstance != null) { processInstance.setState(ProcessInstance.STATE_ABORTED); } } }