protected DelegateExecution getMultiInstanceRootExecution(DelegateExecution executionEntity) { DelegateExecution multiInstanceRootExecution = null; DelegateExecution currentExecution = executionEntity; while (currentExecution != null && multiInstanceRootExecution == null && currentExecution.getParent() != null) { if (currentExecution.isMultiInstanceRoot()) { multiInstanceRootExecution = currentExecution; } else { currentExecution = currentExecution.getParent(); } } return multiInstanceRootExecution; }
protected Integer getLoopVariable(DelegateExecution execution, String variableName) { Object value = execution.getVariableLocal(variableName); DelegateExecution parent = execution.getParent(); while (value == null && parent != null) { value = parent.getVariableLocal(variableName); parent = parent.getParent(); } return (Integer) (value != null ? value : 0); }
protected boolean isChildOfMultiInstanceExecution(DelegateExecution executionEntity, DelegateExecution multiInstanceExecution) { boolean isChild = false; DelegateExecution parentExecution = executionEntity.getParent(); if (parentExecution != null) { if (parentExecution.getId().equals(multiInstanceExecution.getId())) { isChild = true; } else { boolean isNestedChild = isChildOfMultiInstanceExecution(parentExecution, multiInstanceExecution); if (isNestedChild) { isChild = true; } } } return isChild; }
protected DelegateExecution findMultiInstanceParentExecution(DelegateExecution execution) { DelegateExecution multiInstanceExecution = null; DelegateExecution parentExecution = execution.getParent(); if (parentExecution != null && parentExecution.getCurrentFlowElement() != null) { FlowElement flowElement = parentExecution.getCurrentFlowElement(); if (flowElement instanceof Activity) { Activity activity = (Activity) flowElement; if (activity.getLoopCharacteristics() != null) { multiInstanceExecution = parentExecution; } } if (multiInstanceExecution == null) { DelegateExecution potentialMultiInstanceExecution = findMultiInstanceParentExecution(parentExecution); if (potentialMultiInstanceExecution != null) { multiInstanceExecution = potentialMultiInstanceExecution; } } } return multiInstanceExecution; }
if (concurrentExecution.isActive() && !concurrentExecution.isEnded() && concurrentExecution.getParent().isActive() && !concurrentExecution.getParent().isEnded()) { setLoopVariable(concurrentExecution, getCollectionElementIndexVariable(), loopCounter); executeOriginalBehavior(concurrentExecution, loopCounter);
lockFirstParentScope(executionEntity); if (nrOfCompletedInstances >= nrOfInstances || completionConditionSatisfied(execution.getParent())) {
protected DelegateExecution getMultiInstanceRootExecution(DelegateExecution executionEntity) { DelegateExecution multiInstanceRootExecution = null; DelegateExecution currentExecution = executionEntity; while (currentExecution != null && multiInstanceRootExecution == null && currentExecution.getParent() != null) { if (currentExecution.isMultiInstanceRoot()) { multiInstanceRootExecution = currentExecution; } else { currentExecution = currentExecution.getParent(); } } return multiInstanceRootExecution; }
protected Integer getLoopVariable(DelegateExecution execution, String variableName) { Object value = execution.getVariableLocal(variableName); DelegateExecution parent = execution.getParent(); while (value == null && parent != null) { value = parent.getVariableLocal(variableName); parent = parent.getParent(); } return (Integer) (value != null ? value : 0); }
protected boolean isChildOfMultiInstanceExecution(DelegateExecution executionEntity, DelegateExecution multiInstanceExecution) { boolean isChild = false; DelegateExecution parentExecution = executionEntity.getParent(); if (parentExecution != null) { if (parentExecution.getId().equals(multiInstanceExecution.getId())) { isChild = true; } else { boolean isNestedChild = isChildOfMultiInstanceExecution(parentExecution, multiInstanceExecution); if (isNestedChild) { isChild = true; } } } return isChild; }
protected DelegateExecution findMultiInstanceParentExecution(DelegateExecution execution) { DelegateExecution multiInstanceExecution = null; DelegateExecution parentExecution = execution.getParent(); if (parentExecution != null && parentExecution.getCurrentFlowElement() != null) { FlowElement flowElement = parentExecution.getCurrentFlowElement(); if (flowElement instanceof Activity) { Activity activity = (Activity) flowElement; if (activity.getLoopCharacteristics() != null) { multiInstanceExecution = parentExecution; } } if (multiInstanceExecution == null) { DelegateExecution potentialMultiInstanceExecution = findMultiInstanceParentExecution(parentExecution); if (potentialMultiInstanceExecution != null) { multiInstanceExecution = potentialMultiInstanceExecution; } } } return multiInstanceExecution; }
if (concurrentExecution.isActive() && !concurrentExecution.isEnded() && concurrentExecution.getParent().isActive() && !concurrentExecution.getParent().isEnded()) { setLoopVariable(concurrentExecution, getCollectionElementIndexVariable(), loopCounter); executeOriginalBehavior(concurrentExecution, loopCounter);
lockFirstParentScope(executionEntity); if (nrOfCompletedInstances >= nrOfInstances || completionConditionSatisfied(execution.getParent())) {