protected boolean isEndEventInMultiInstanceSubprocess(ExecutionEntity executionEntity) { if (executionEntity.getCurrentFlowElement() instanceof EndEvent) { SubProcess subProcess = ((EndEvent) execution.getCurrentFlowElement()).getSubProcess(); return !executionEntity.getParent().isProcessInstanceType() && subProcess != null && subProcess.getLoopCharacteristics() != null && subProcess.getBehavior() instanceof MultiInstanceActivityBehavior; } return false; }
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); } }
MultiInstanceActivityBehavior multiInstanceBehavior = (MultiInstanceActivityBehavior) subProcess.getBehavior(); multiInstanceBehavior.leave(scopeExecutionEntity);
protected boolean isEndEventInMultiInstanceSubprocess(ExecutionEntity executionEntity) { if (executionEntity.getCurrentFlowElement() instanceof EndEvent) { SubProcess subProcess = ((EndEvent) execution.getCurrentFlowElement()).getSubProcess(); return !executionEntity.getParent().isProcessInstanceType() && subProcess != null && subProcess.getLoopCharacteristics() != null && subProcess.getBehavior() instanceof MultiInstanceActivityBehavior; } return false; }
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); } }
MultiInstanceActivityBehavior multiInstanceBehavior = (MultiInstanceActivityBehavior) subProcess.getBehavior(); multiInstanceBehavior.leave(scopeExecutionEntity);