public abstract class MultiInstanceActivityBehavior extends FlowNodeActivityBehavior implements SubProcessActivityBehavior
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 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 String |
NUMBER_OF_ACTIVE_INSTANCES |
protected String |
NUMBER_OF_COMPLETED_INSTANCES |
protected String |
NUMBER_OF_INSTANCES |
bpmnActivityBehavior| Constructor and Description |
|---|
MultiInstanceActivityBehavior(org.flowable.bpmn.model.Activity activity,
AbstractBpmnActivityBehavior innerActivityBehavior) |
| Modifier and Type | Method and Description |
|---|---|
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,
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) |
String |
getCollectionElementIndexVariable() |
String |
getCollectionElementVariable() |
Expression |
getCollectionExpression() |
String |
getCollectionString() |
String |
getCollectionVariable() |
String |
getCompletionCondition() |
org.flowable.bpmn.model.CollectionHandler |
getHandler() |
AbstractBpmnActivityBehavior |
getInnerActivityBehavior() |
protected Integer |
getLocalLoopVariable(DelegateExecution execution,
String variableName) |
Expression |
getLoopCardinalityExpression() |
Integer |
getLoopVariable(DelegateExecution execution,
String variableName) |
protected DelegateExecution |
getMultiInstanceRootExecution(DelegateExecution executionEntity) |
protected org.flowable.bpmn.model.Process |
getProcessDefinition(String processDefinitionId) |
protected boolean |
isExtraScopeNeeded(org.flowable.bpmn.model.FlowNode flowNode) |
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 |
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 final String NUMBER_OF_INSTANCES
protected final String NUMBER_OF_ACTIVE_INSTANCES
protected 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 String collectionElementIndexVariable
public MultiInstanceActivityBehavior(org.flowable.bpmn.model.Activity activity,
AbstractBpmnActivityBehavior innerActivityBehavior)
activity - 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 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 boolean completionConditionSatisfied(DelegateExecution execution)
public Integer getLoopVariable(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, int loopCounter)
protected Collection resolveAndValidateCollection(DelegateExecution execution)
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 executionEntity)
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 String getCollectionElementIndexVariable()
public void setCollectionElementIndexVariable(String collectionElementIndexVariable)
public void setInnerActivityBehavior(AbstractBpmnActivityBehavior innerActivityBehavior)
public AbstractBpmnActivityBehavior getInnerActivityBehavior()
Copyright © 2017 Flowable. All rights reserved.