protected void handleMultiInstanceSubProcess(ExecutionEntityManager executionEntityManager, ExecutionEntity parentExecution) { List<ExecutionEntity> activeChildExecutions = getActiveChildExecutionsForExecution(executionEntityManager, parentExecution.getId()); boolean containsOtherChildExecutions = false; for (ExecutionEntity activeExecution : activeChildExecutions) { if (!activeExecution.getId().equals(execution.getId())) { containsOtherChildExecutions = true; } } if (!containsOtherChildExecutions) { // Destroy the current scope (subprocess) and leave via the subprocess ScopeUtil.createCopyOfSubProcessExecutionForCompensation(parentExecution); Context.getAgenda().planDestroyScopeOperation(parentExecution); SubProcess subProcess = execution.getCurrentFlowElement().getSubProcess(); MultiInstanceActivityBehavior multiInstanceBehavior = (MultiInstanceActivityBehavior) subProcess.getBehavior(); parentExecution.setCurrentFlowElement(subProcess); multiInstanceBehavior.leave(parentExecution); } }
SubProcess subProcess = execution.getCurrentFlowElement().getSubProcess();
protected void handleMultiInstanceSubProcess(ExecutionEntityManager executionEntityManager, ExecutionEntity parentExecution) { List<ExecutionEntity> activeChildExecutions = getActiveChildExecutionsForExecution(executionEntityManager, parentExecution.getId()); boolean containsOtherChildExecutions = false; for (ExecutionEntity activeExecution : activeChildExecutions) { if (activeExecution.getId().equals(execution.getId()) == false) { containsOtherChildExecutions = true; } } if (!containsOtherChildExecutions) { // Destroy the current scope (subprocess) and leave via the subprocess ScopeUtil.createCopyOfSubProcessExecutionForCompensation(parentExecution); Context.getAgenda().planDestroyScopeOperation(parentExecution); SubProcess subProcess = execution.getCurrentFlowElement().getSubProcess(); MultiInstanceActivityBehavior multiInstanceBehavior = (MultiInstanceActivityBehavior) subProcess.getBehavior(); parentExecution.setCurrentFlowElement(subProcess); multiInstanceBehavior.leave(parentExecution); } }
SubProcess subProcess = execution.getCurrentFlowElement().getSubProcess();