protected boolean isEventSubProcessStart(FlowElement flowElement) { return flowElement instanceof StartEvent && flowElement.getSubProcess() != null && flowElement.getSubProcess() instanceof EventSubProcess; }
private boolean isSubProcessAncestor(String subProcessId, FlowElement flowElement) { while (flowElement.getSubProcess() != null) { String execElemSubProcessId = flowElement.getSubProcess().getId(); if (execElemSubProcessId != null && execElemSubProcessId.equals(subProcessId)) { return true; } flowElement = flowElement.getSubProcess(); } return false; }
protected List<FlowElement> getFlowElementsInSubProcess(SubProcess subProcess, Collection<FlowElement> flowElements) { return flowElements.stream() .filter(e -> e.getSubProcess() != null) .filter(e -> e.getSubProcess().getId().equals(subProcess.getId())) .collect(Collectors.toList()); }
for (FlowElementMoveEntry flowElementMoveEntry : moveToFlowElements) { FlowElement newFlowElement = flowElementMoveEntry.getNewFlowElement(); SubProcess subProcess = newFlowElement.getSubProcess(); FlowElement newFlowElement = flowElementMoveEntry.getNewFlowElement(); ExecutionEntity parentExecution; if (newFlowElement.getSubProcess() != null && processInstanceChangeState.getCreatedEmbeddedSubProcesses().containsKey(newFlowElement.getSubProcess().getId())) { parentExecution = processInstanceChangeState.getCreatedEmbeddedSubProcesses().get(newFlowElement.getSubProcess().getId()); } else { parentExecution = defaultContinueParentExecution;
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); agenda.planDestroyScopeOperation(parentExecution); SubProcess subProcess = execution.getCurrentFlowElement().getSubProcess(); MultiInstanceActivityBehavior multiInstanceBehavior = (MultiInstanceActivityBehavior) subProcess.getBehavior(); parentExecution.setCurrentFlowElement(subProcess); multiInstanceBehavior.leave(parentExecution); } }
SubProcess subProcess = execution.getCurrentFlowElement().getSubProcess();