Class MultiInstanceActivityBehavior
- java.lang.Object
-
- org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior
-
- org.activiti.engine.impl.bpmn.behavior.MultiInstanceActivityBehavior
-
- All Implemented Interfaces:
Serializable,ActivityBehavior,SubProcessActivityBehavior,TriggerableActivityBehavior
- Direct Known Subclasses:
ParallelMultiInstanceBehavior,SequentialMultiInstanceBehavior
public abstract class MultiInstanceActivityBehavior extends FlowNodeActivityBehavior implements SubProcessActivityBehavior
Implementation of the multi-instance functionality as described in the BPMN 2.0 spec. Multi instance functionality is implemented as anActivityBehaviorthat wraps the originalActivityBehaviorof the activity. Only subclasses ofAbstractBpmnActivityBehaviorcan have multi-instance behavior. As such, special logic is contained in theAbstractBpmnActivityBehaviorto delegate to theMultiInstanceActivityBehaviorif needed.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Activityactivityprotected StringcollectionElementIndexVariableprotected StringcollectionElementVariableprotected ExpressioncollectionExpressionprotected StringcollectionVariableprotected ExpressioncompletionConditionExpressionprotected AbstractBpmnActivityBehaviorinnerActivityBehaviorprotected static org.slf4j.LoggerLOGGERprotected ExpressionloopCardinalityExpressionprotected static StringNUMBER_OF_ACTIVE_INSTANCESprotected static StringNUMBER_OF_COMPLETED_INSTANCESprotected static StringNUMBER_OF_INSTANCES-
Fields inherited from class org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior
bpmnActivityBehavior
-
-
Constructor Summary
Constructors Constructor Description MultiInstanceActivityBehavior(Activity activity, AbstractBpmnActivityBehavior innerActivityBehavior)
-
Method Summary
-
Methods inherited from class org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior
leave, leaveIgnoreConditions, parseActivityType
-
-
-
-
Field Detail
-
LOGGER
protected static final org.slf4j.Logger LOGGER
-
NUMBER_OF_INSTANCES
protected static final String NUMBER_OF_INSTANCES
- See Also:
- Constant Field Values
-
NUMBER_OF_ACTIVE_INSTANCES
protected static final String NUMBER_OF_ACTIVE_INSTANCES
- See Also:
- Constant Field Values
-
NUMBER_OF_COMPLETED_INSTANCES
protected static final String NUMBER_OF_COMPLETED_INSTANCES
- See Also:
- Constant Field Values
-
activity
protected Activity activity
-
innerActivityBehavior
protected AbstractBpmnActivityBehavior innerActivityBehavior
-
loopCardinalityExpression
protected Expression loopCardinalityExpression
-
completionConditionExpression
protected Expression completionConditionExpression
-
collectionExpression
protected Expression collectionExpression
-
collectionVariable
protected String collectionVariable
-
collectionElementVariable
protected String collectionElementVariable
-
collectionElementIndexVariable
protected String collectionElementIndexVariable
-
-
Constructor Detail
-
MultiInstanceActivityBehavior
public MultiInstanceActivityBehavior(Activity activity, AbstractBpmnActivityBehavior innerActivityBehavior)
- Parameters:
activity- TheActivitywhich has multi instance behaviourinnerActivityBehavior- The originalActivityBehaviorof the activity that will be wrapped inside this behavior.
-
-
Method Detail
-
execute
public void execute(DelegateExecution execution)
Description copied from class:FlowNodeActivityBehaviorDefault behaviour: just leave the activity with no extra functionality.- Specified by:
executein interfaceActivityBehavior- Overrides:
executein classFlowNodeActivityBehavior
-
createInstances
protected abstract int createInstances(DelegateExecution execution)
-
executeCompensationBoundaryEvents
protected void executeCompensationBoundaryEvents(FlowElement flowElement, DelegateExecution execution)
-
findBoundaryEventsForFlowNode
protected Collection<BoundaryEvent> findBoundaryEventsForFlowNode(String processDefinitionId, FlowElement flowElement)
-
trigger
public void trigger(DelegateExecution execution, String signalName, Object signalData)
- Specified by:
triggerin interfaceTriggerableActivityBehavior- Overrides:
triggerin classFlowNodeActivityBehavior
-
lastExecutionEnded
public void lastExecutionEnded(DelegateExecution execution)
-
completing
public void completing(DelegateExecution execution, DelegateExecution subProcessInstance) throws Exception
Description copied from interface:SubProcessActivityBehaviorcalled before the process instance is destroyed to allow this activity to extract data from the sub process instance. No control flow should be done on the execution yet.- Specified by:
completingin interfaceSubProcessActivityBehavior- Throws:
Exception
-
completed
public void completed(DelegateExecution execution) throws Exception
Description copied from interface:SubProcessActivityBehaviorcalled after the process instance is destroyed for this activity to perform its outgoing control flow logic.- Specified by:
completedin interfaceSubProcessActivityBehavior- Throws:
Exception
-
resolveNrOfInstances
protected int resolveNrOfInstances(DelegateExecution execution)
-
executeOriginalBehavior
protected void executeOriginalBehavior(DelegateExecution execution, int loopCounter)
-
resolveAndValidateCollection
protected Collection resolveAndValidateCollection(DelegateExecution execution)
-
resolveCollection
protected Object resolveCollection(DelegateExecution execution)
-
usesCollection
protected boolean usesCollection()
-
isExtraScopeNeeded
protected boolean isExtraScopeNeeded(FlowNode flowNode)
-
resolveLoopCardinality
protected int resolveLoopCardinality(DelegateExecution execution)
-
completionConditionSatisfied
protected boolean completionConditionSatisfied(DelegateExecution execution)
-
setLoopVariable
protected void setLoopVariable(DelegateExecution execution, String variableName, Object value)
-
getLoopVariable
protected Integer getLoopVariable(DelegateExecution execution, String variableName)
-
getLocalLoopVariable
protected Integer getLocalLoopVariable(DelegateExecution execution, String variableName)
-
removeLocalLoopVariable
protected void removeLocalLoopVariable(DelegateExecution execution, String variableName)
-
callActivityEndListeners
protected void callActivityEndListeners(DelegateExecution execution)
Since no transitions are followed when leaving the inner activity, it is needed to call the end listeners yourself.
-
logLoopDetails
protected void logLoopDetails(DelegateExecution execution, String custom, int loopCounter, int nrOfCompletedInstances, int nrOfActiveInstances, int nrOfInstances)
-
getMultiInstanceRootExecution
protected DelegateExecution getMultiInstanceRootExecution(DelegateExecution executionEntity)
-
dispatchActivityCompletedEvent
protected void dispatchActivityCompletedEvent(DelegateExecution execution)
-
getLoopCardinalityExpression
public Expression getLoopCardinalityExpression()
-
setLoopCardinalityExpression
public void setLoopCardinalityExpression(Expression loopCardinalityExpression)
-
getCompletionConditionExpression
public Expression getCompletionConditionExpression()
-
setCompletionConditionExpression
public void setCompletionConditionExpression(Expression completionConditionExpression)
-
getCollectionExpression
public Expression getCollectionExpression()
-
setCollectionExpression
public void setCollectionExpression(Expression collectionExpression)
-
getCollectionVariable
public String getCollectionVariable()
-
setCollectionVariable
public void setCollectionVariable(String collectionVariable)
-
getCollectionElementVariable
public String getCollectionElementVariable()
-
setCollectionElementVariable
public void setCollectionElementVariable(String collectionElementVariable)
-
getCollectionElementIndexVariable
public String getCollectionElementIndexVariable()
-
setCollectionElementIndexVariable
public void setCollectionElementIndexVariable(String collectionElementIndexVariable)
-
setInnerActivityBehavior
public void setInnerActivityBehavior(AbstractBpmnActivityBehavior innerActivityBehavior)
-
getInnerActivityBehavior
public AbstractBpmnActivityBehavior getInnerActivityBehavior()
-
getLoopDataOutputRef
public String getLoopDataOutputRef()
-
hasLoopDataOutputRef
public boolean hasLoopDataOutputRef()
-
setLoopDataOutputRef
public void setLoopDataOutputRef(String loopDataOutputRef)
-
getOutputDataItem
public String getOutputDataItem()
-
hasOutputDataItem
public boolean hasOutputDataItem()
-
setOutputDataItem
public void setOutputDataItem(String outputDataItem)
-
updateResultCollection
protected void updateResultCollection(DelegateExecution childExecution, DelegateExecution miRootExecution)
-
getResultElementItem
protected Object getResultElementItem(DelegateExecution childExecution)
-
getCommandContext
protected CommandContext getCommandContext()
-
propagateLoopDataOutputRefToProcessInstance
protected void propagateLoopDataOutputRefToProcessInstance(ExecutionEntity miRootExecution)
-
-