public abstract class MultiInstanceActivityBehavior extends FlowNodeActivityBehavior implements SubProcessActivityBehavior, InterruptibleActivityBehaviour
ActivityBehavior that wraps the original ActivityBehavior of the activity.
Only subclasses of AbstractBpmnActivityBehavior can have multi-instance behavior. As such, special logic is contained in the AbstractBpmnActivityBehavior to delegate to the
MultiInstanceActivityBehavior if needed.| Modifier and Type | Field and Description |
|---|---|
protected org.flowable.bpmn.model.Activity |
activity |
protected org.flowable.bpmn.model.VariableAggregationDefinitions |
aggregations |
protected String |
collectionElementIndexVariable |
protected String |
collectionElementVariable |
protected Expression |
collectionExpression |
protected org.flowable.bpmn.model.CollectionHandler |
collectionHandler |
protected String |
collectionString |
protected String |
collectionVariable |
protected String |
completionCondition |
protected static String |
DELETE_REASON_END |
protected AbstractBpmnActivityBehavior |
innerActivityBehavior |
protected static org.slf4j.Logger |
LOGGER |
protected Expression |
loopCardinalityExpression |
protected static String |
NUMBER_OF_ACTIVE_INSTANCES |
protected static String |
NUMBER_OF_COMPLETED_INSTANCES |
protected static String |
NUMBER_OF_INSTANCES |
bpmnActivityBehavior| Constructor and Description |
|---|
MultiInstanceActivityBehavior(org.flowable.bpmn.model.Activity activity,
AbstractBpmnActivityBehavior innerActivityBehavior) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
aggregateVariablesForChildExecution(DelegateExecution childExecution,
DelegateExecution miRootExecution)
Aggregated the variables for the finished child multi instance execution
|
protected void |
aggregateVariablesOfAllInstances(DelegateExecution multiInstanceRootExecution)
Aggregates all variables that were stored before for each child instance
|
protected FlowableMultiInstanceActivityCompletedEvent |
buildCompletedEvent(DelegateExecution execution,
FlowableEngineEventType eventType) |
protected void |
callActivityEndListeners(DelegateExecution execution)
Since no transitions are followed when leaving the inner activity, it is needed to call the end listeners yourself.
|
protected void |
cleanupMiRoot(DelegateExecution execution) |
void |
completed(DelegateExecution execution)
called after the process instance is destroyed for this activity to perform its outgoing control flow logic.
|
void |
completing(DelegateExecution execution,
DelegateExecution subProcessInstance)
called before the process instance is destroyed to allow this activity to extract data from the sub process instance.
|
boolean |
completionConditionSatisfied(DelegateExecution execution) |
protected FlowableCollectionHandler |
createFlowableCollectionHandler(org.flowable.bpmn.model.CollectionHandler handler,
DelegateExecution execution) |
protected abstract int |
createInstances(DelegateExecution execution) |
void |
execute(DelegateExecution delegateExecution)
Default behaviour: just leave the activity with no extra functionality.
|
protected void |
executeCompensationBoundaryEvents(org.flowable.bpmn.model.FlowElement flowElement,
DelegateExecution execution) |
protected void |
executeOriginalBehavior(DelegateExecution execution,
ExecutionEntity multiInstanceRootExecution,
int loopCounter) |
protected Collection<org.flowable.bpmn.model.BoundaryEvent> |
findBoundaryEventsForFlowNode(String processDefinitionId,
org.flowable.bpmn.model.FlowElement flowElement) |
protected String |
getActiveValue(String originalValue,
String propertyName,
com.fasterxml.jackson.databind.node.ObjectNode taskElementProperties) |
org.flowable.bpmn.model.VariableAggregationDefinitions |
getAggregations() |
String |
getCollectionElementIndexVariable() |
String |
getCollectionElementVariable() |
Expression |
getCollectionExpression() |
String |
getCollectionString() |
String |
getCollectionVariable() |
String |
getCompletionCondition() |
org.flowable.bpmn.model.CollectionHandler |
getHandler() |
AbstractBpmnActivityBehavior |
getInnerActivityBehavior() |
protected DelegateExecution |
getInstanceExecution(DelegateExecution execution) |
protected Integer |
getLocalLoopVariable(DelegateExecution execution,
String variableName) |
Expression |
getLoopCardinalityExpression() |
Integer |
getLoopVariable(DelegateExecution execution,
String variableName) |
org.flowable.variable.api.persistence.entity.VariableInstance |
getLoopVariableInstance(DelegateExecution execution,
String variableName) |
protected DelegateExecution |
getMultiInstanceRootExecution(DelegateExecution execution) |
protected org.flowable.bpmn.model.Process |
getProcessDefinition(String processDefinitionId) |
protected boolean |
hasVariableAggregationDefinitions(DelegateExecution execution) |
protected void |
internalInterrupted(DelegateExecution execution) |
void |
interrupted(DelegateExecution execution) |
protected boolean |
isExtraScopeNeeded(org.flowable.bpmn.model.FlowNode flowNode) |
protected Collection |
iterableToCollection(Iterable iterable) |
void |
lastExecutionEnded(DelegateExecution execution) |
void |
leave(DelegateExecution execution)
Default way of leaving a BPMN 2.0 activity: evaluate the conditions on the outgoing sequence flow and take those that evaluate to true.
|
protected void |
logLoopDetails(DelegateExecution execution,
String custom,
int loopCounter,
int nrOfCompletedInstances,
int nrOfActiveInstances,
int nrOfInstances) |
protected Collection |
resolveAndValidateCollection(DelegateExecution execution) |
protected Object |
resolveCollection(DelegateExecution execution) |
protected int |
resolveLoopCardinality(DelegateExecution execution) |
protected int |
resolveNrOfInstances(DelegateExecution execution) |
protected void |
sendCompletedEvent(DelegateExecution execution) |
protected void |
sendCompletedWithConditionEvent(DelegateExecution execution) |
void |
setAggregations(org.flowable.bpmn.model.VariableAggregationDefinitions aggregations) |
void |
setCollectionElementIndexVariable(String collectionElementIndexVariable) |
void |
setCollectionElementVariable(String collectionElementVariable) |
void |
setCollectionExpression(Expression collectionExpression) |
void |
setCollectionString(String collectionString) |
void |
setCollectionVariable(String collectionVariable) |
void |
setCompletionCondition(String completionCondition) |
void |
setHandler(org.flowable.bpmn.model.CollectionHandler collectionHandler) |
void |
setInnerActivityBehavior(AbstractBpmnActivityBehavior innerActivityBehavior) |
void |
setLoopCardinalityExpression(Expression loopCardinalityExpression) |
protected void |
setLoopVariable(DelegateExecution execution,
String variableName,
Object value) |
void |
trigger(DelegateExecution execution,
String signalName,
Object signalData) |
protected boolean |
usesCollection() |
leaveIgnoreConditions, parseActivityTypeprotected static final org.slf4j.Logger LOGGER
protected static final String DELETE_REASON_END
protected static final String NUMBER_OF_INSTANCES
protected static final String NUMBER_OF_ACTIVE_INSTANCES
protected static final String NUMBER_OF_COMPLETED_INSTANCES
protected org.flowable.bpmn.model.Activity activity
protected AbstractBpmnActivityBehavior innerActivityBehavior
protected Expression loopCardinalityExpression
protected String completionCondition
protected Expression collectionExpression
protected String collectionVariable
protected String collectionElementVariable
protected String collectionString
protected org.flowable.bpmn.model.CollectionHandler collectionHandler
protected org.flowable.bpmn.model.VariableAggregationDefinitions aggregations
protected String collectionElementIndexVariable
public MultiInstanceActivityBehavior(org.flowable.bpmn.model.Activity activity,
AbstractBpmnActivityBehavior innerActivityBehavior)
innerActivityBehavior - The original ActivityBehavior of the activity that will be wrapped inside this behavior.public void execute(DelegateExecution delegateExecution)
FlowNodeActivityBehaviorexecute in interface ActivityBehaviorexecute in class FlowNodeActivityBehaviorprotected abstract int createInstances(DelegateExecution execution)
public void leave(DelegateExecution execution)
FlowNodeActivityBehaviorleave in class FlowNodeActivityBehaviorprotected boolean hasVariableAggregationDefinitions(DelegateExecution execution)
protected void aggregateVariablesForChildExecution(DelegateExecution childExecution, DelegateExecution miRootExecution)
childExecution - the child executionmiRootExecution - the multi instance root executionprotected void aggregateVariablesOfAllInstances(DelegateExecution multiInstanceRootExecution)
protected void cleanupMiRoot(DelegateExecution execution)
protected void executeCompensationBoundaryEvents(org.flowable.bpmn.model.FlowElement flowElement,
DelegateExecution execution)
protected Collection<org.flowable.bpmn.model.BoundaryEvent> findBoundaryEventsForFlowNode(String processDefinitionId, org.flowable.bpmn.model.FlowElement flowElement)
protected org.flowable.bpmn.model.Process getProcessDefinition(String processDefinitionId)
public void trigger(DelegateExecution execution, String signalName, Object signalData)
trigger in interface TriggerableActivityBehaviortrigger in class FlowNodeActivityBehaviorpublic void lastExecutionEnded(DelegateExecution execution)
public void completing(DelegateExecution execution, DelegateExecution subProcessInstance) throws Exception
SubProcessActivityBehaviorcompleting in interface SubProcessActivityBehaviorExceptionpublic void completed(DelegateExecution execution) throws Exception
SubProcessActivityBehaviorcompleted in interface SubProcessActivityBehaviorExceptionpublic void interrupted(DelegateExecution execution)
interrupted in interface InterruptibleActivityBehaviourprotected void internalInterrupted(DelegateExecution execution)
public boolean completionConditionSatisfied(DelegateExecution execution)
public Integer getLoopVariable(DelegateExecution execution, String variableName)
public org.flowable.variable.api.persistence.entity.VariableInstance getLoopVariableInstance(DelegateExecution execution, String variableName)
protected void sendCompletedWithConditionEvent(DelegateExecution execution)
protected void sendCompletedEvent(DelegateExecution execution)
protected FlowableMultiInstanceActivityCompletedEvent buildCompletedEvent(DelegateExecution execution, FlowableEngineEventType eventType)
protected int resolveNrOfInstances(DelegateExecution execution)
protected void executeOriginalBehavior(DelegateExecution execution, ExecutionEntity multiInstanceRootExecution, int loopCounter)
protected Collection resolveAndValidateCollection(DelegateExecution execution)
protected Collection iterableToCollection(Iterable iterable)
protected Object resolveCollection(DelegateExecution execution)
protected boolean usesCollection()
protected boolean isExtraScopeNeeded(org.flowable.bpmn.model.FlowNode flowNode)
protected int resolveLoopCardinality(DelegateExecution execution)
protected void setLoopVariable(DelegateExecution execution, String variableName, Object value)
protected Integer getLocalLoopVariable(DelegateExecution execution, String variableName)
protected void callActivityEndListeners(DelegateExecution execution)
protected void logLoopDetails(DelegateExecution execution, String custom, int loopCounter, int nrOfCompletedInstances, int nrOfActiveInstances, int nrOfInstances)
protected DelegateExecution getMultiInstanceRootExecution(DelegateExecution execution)
protected DelegateExecution getInstanceExecution(DelegateExecution execution)
protected String getActiveValue(String originalValue, String propertyName, com.fasterxml.jackson.databind.node.ObjectNode taskElementProperties)
protected FlowableCollectionHandler createFlowableCollectionHandler(org.flowable.bpmn.model.CollectionHandler handler, DelegateExecution execution)
public Expression getLoopCardinalityExpression()
public void setLoopCardinalityExpression(Expression loopCardinalityExpression)
public String getCompletionCondition()
public void setCompletionCondition(String completionCondition)
public Expression getCollectionExpression()
public void setCollectionExpression(Expression collectionExpression)
public String getCollectionVariable()
public void setCollectionVariable(String collectionVariable)
public String getCollectionElementVariable()
public void setCollectionElementVariable(String collectionElementVariable)
public String getCollectionString()
public void setCollectionString(String collectionString)
public org.flowable.bpmn.model.CollectionHandler getHandler()
public void setHandler(org.flowable.bpmn.model.CollectionHandler collectionHandler)
public org.flowable.bpmn.model.VariableAggregationDefinitions getAggregations()
public void setAggregations(org.flowable.bpmn.model.VariableAggregationDefinitions aggregations)
public String getCollectionElementIndexVariable()
public void setCollectionElementIndexVariable(String collectionElementIndexVariable)
public void setInnerActivityBehavior(AbstractBpmnActivityBehavior innerActivityBehavior)
public AbstractBpmnActivityBehavior getInnerActivityBehavior()
Copyright © 2022 Flowable. All rights reserved.