Class PvmExecutionImpl
- All Implemented Interfaces:
Serializable,BaseDelegateExecution,BpmnModelExecutionContext,DelegateExecution,ProcessEngineServicesAware,VariableScope,VariableEventDispatcher,ActivityExecution,PvmExecution,PvmProcessInstance
- Direct Known Subclasses:
ExecutionEntity,ExecutionImpl
- Author:
- Daniel Meyer, Roman Smirnov, Sebastian Menski
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ActivityImplcurrent activityprotected booleanprotected Stringthe unique id of the current activity instanceprotected intmarks the current activity instanceprotected Stringthe id of a case associated with this executionprotected List<DelayedVariableEvent>Contains the delayed variable events, which will be dispatched on a save point.protected Stringprotected booleanprotected booleanprotected booleanprotected booleanindicates if this execution represents an active path of execution.protected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleantrue for process instances in the initial phase.protected PvmActivitythe activity which is to be started nextprotected booleantransient; used for process instance modification to preserve a scope from getting deletedprotected ProcessDefinitionImplprotected PvmExecutionImplprotected ScopeInstantiationContextprotected longprotected TransitionImplthe transition that is currently being takenprotected List<PvmTransition>A list of outgoing transitions from the current activity that are going to be takenFields inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
businessKey, businessKeyWithoutCascade, eventName, eventSource, id, listenerIndex, skipCustomListeners, skipIoMapping, skipSubprocesses, tenantIdFields inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
cachedElContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidCleares the current delayed variable events.voidclearScope(String reason, boolean skipCustomListeners, boolean skipIoMappings, boolean externallyTerminated) protected voidcollectActiveActivityIds(List<String> activeActivityIds) protected voidcollectExecutions(String activityId, List<PvmExecution> executions) protected voidcontinueExecutionIfNotCanceled(Callback<PvmExecutionImpl, Void> continuation, PvmExecutionImpl execution) voidcontinueIfExecutionDoesNotAffectNextOperation(Callback<PvmExecutionImpl, Void> dispatching, Callback<PvmExecutionImpl, Void> continuation, PvmExecutionImpl execution) Executes the given depending operations with the given execution.Returns a mapping from scope activities to scope executions for all scopes that are ancestors of the activity currently executed by this execution.createActivityExecutionMapping(ScopeImpl currentScope) protected Map<ScopeImpl,PvmExecutionImpl> createActivityExecutionMapping(ScopeImpl currentScope, Map<ScopeImpl, PvmExecutionImpl> mapping) Creates an extended mapping based on this execution and the given existing mapping.abstract PvmExecutionImplcreates a new execution.createIncident(String incidentType, String configuration) Returns the newest incident in this executioncreateIncident(String incidentType, String configuration, String message) Create an incident associated with this executionprotected IncidentContextcreateIncidentContext(String configuration) abstract CmmnExecutioncreateSubCaseInstance(CmmnCaseDefinition caseDefinition) Creates a new sub case instance.abstract CmmnExecutioncreateSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey) Creates a new sub case instance.createSubProcessInstance(PvmProcessDefinition processDefinition) creates a new sub process instance.createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey) createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId) voiddelayEvent(DelayedVariableEvent delayedVariableEvent) Delays and stores the given DelayedVariableEvent on the process instance.voiddelayEvent(PvmExecutionImpl targetScope, VariableEvent variableEvent) Delays a given variable event with the given target scope.voiddeleteCascade(String deleteReason) voiddeleteCascade(String deleteReason, boolean skipCustomListeners, boolean skipIoMappings) voiddeleteCascade(String deleteReason, boolean skipCustomListeners, boolean skipIoMappings, boolean externallyTerminated, boolean skipSubprocesses) voiddestroy()voiddestroy(boolean alwaysSkipIoMappings) voiddispatchDelayedEventsAndPerformOperation(Callback<PvmExecutionImpl, Void> continuation) Dispatches the current delayed variable events and performs the given atomic operation if the current state was not changed.voiddispatchDelayedEventsAndPerformOperation(PvmAtomicOperation atomicOperation) Dispatches the current delayed variable events and performs the given atomic operation if the current state was not changed.protected voiddispatchScopeEvents(PvmExecutionImpl execution) Dispatches the current delayed variable events on the scope of the given execution.voidvoidend(boolean completeScope) Ends an execution.voidExecution finished compensation.voidinvoked to notify the execution that a new activity instance is startedvoidexecuteActivities(List<PvmActivity> activityStack, PvmActivity targetActivity, PvmTransition targetTransition, Map<String, Object> variables, Map<String, Object> localVariables, boolean skipCustomListeners, boolean skipIoMappings) Instantiates the given activity stack.voidexecuteActivitiesConcurrent(List<PvmActivity> activityStack, PvmActivity targetActivity, PvmTransition targetTransition, Map<String, Object> variables, Map<String, Object> localVariables, boolean skipCustomListeners, boolean skipIoMappings) Instantiates the given activity stack under this execution.voidexecuteActivity(PvmActivity activity) Execute an activity which is not contained in normal flow (having no incoming sequence flows).voidexecuteEventHandlerActivity(ActivityImpl eventHandlerActivity) voidfindExecution(String activityId) protected PvmExecutionImplfindExecutionForFlowScope(String targetScopeId) findExecutionForFlowScope(PvmScope targetFlowScope) For a given target flow scope, this method returns the corresponding scope execution.findExecutionForScope(ScopeImpl currentScope, ScopeImpl targetScope) findExecutions(String activityId) findInactiveChildExecutions(PvmActivity activity) findInactiveConcurrentExecutions(PvmActivity activity) Retrieves all executions which are concurrent and inactive at the given activity.findIncidentHandler(String incidentType) abstract voidprotected abstract StringgenerateActivityInstanceId(String activityId) ensures initialization and returns the activityreturn the Id of the activity instance currently executed by this executionintprotected List<PvmExecutionImpl>The business key for the root execution (e.g.Gets the id of the current activity.Gets the name of the current activity.return the Id of the current transitionThe current delayed variable events.List<? extends PvmExecutionImpl>abstract List<? extends PvmExecutionImpl>returns the list of execution of which this execution the parent of.abstract List<? extends PvmExecutionImpl>protected ScopeImplprotected PvmExecutionImplAn activity which is to be started next.List<? extends PvmExecutionImpl>returns child executions that are not event scope executions.abstract PvmExecutionImplensures initialization and returns the parentreturn the Id of the parent activity instance currently executed by this executionGets the id of the parent of this execution.getParentScopeExecution(boolean considerSuperExecution) The business key for the process instance this execution is associated with.abstract PvmExecutionImplensures initialization and returns the process instance.abstract PvmExecutionImplReturns an execution that has replaced this execution for executing activities in their shared scope.protected ScopeImpllongabstract CmmnExecutionabstract PvmExecutionImplabstract CmmnExecutionabstract PvmExecutionImplIn case this delegate execution is the process instance execution and this process instance was started by a call activity, this method returns the execution which executed the call activity in the super process instance.protected StringbooleanbooleanbooleanvoidInactivates this execution.voidprotected voidinitActivityIds(List<DelayedVariableEvent> delayedEvents, Map<PvmExecutionImpl, String> activityInstanceIds, Map<PvmExecutionImpl, String> activityIds) Initializes the given maps with the target scopes and current activity id's and activity instance id's.abstract voidabstract voidinstantiateScopes(List<PvmActivity> activityStack, boolean skipCustomListeners, boolean skipIoMappings) Instantiates the given set of activities and returns the execution for the bottom-most activityvoidInterrupts an executionvoidinterrupt(String reason, boolean skipCustomListeners, boolean skipIoMappings, boolean externallyTerminated) booleanisActive()returns whether this execution is currently active.booleanbooleanThis case is special, because the execution tree is different if an async after activity is left via transition (case 1) or not (case 2).booleanReturns whether this execution has been canceled.booleanReturns whether this execution completed the parent scope.booleanreturns whether this execution is concurrent or not.booleanbooleanisEnded()returns whether this execution has ended or not.booleanbooleanbooleanbooleanbooleanisInState(ActivityInstanceState state) booleanbooleanreturns whether this execution is a process instance or not.booleanbooleanbooleanbooleanisScope()Returns whether this execution is a scope.booleanvoidinvoked to notify the execution that an activity instance is ended.voidleaveActivityViaTransition(PvmTransition outgoingTransition) voidleaveActivityViaTransitions(List<PvmTransition> _transitions, List<? extends ActivityExecution> _recyclableExecutions) Takes the given outgoing transitions, and potentially reusing the given list of executions that were previously joined.protected abstract PvmExecutionImplvoidonConcurrentExpand(PvmExecutionImpl scopeExecution) Callback on tree expansion when this execution is used as the concurrent execution where the argument's children become a subordinate to.voidPrecondition: execution is already ended but this has not been propagated yet.voidremove()voidprotected voidprotected abstract voidvoidreplace(PvmExecutionImpl execution) Replace an execution by this execution.voidresolveIncident(String incidentId) Resolves an incident with given id.Instead ofgetReplacedBy(), which returns the execution that this execution was directly replaced with, this resolves the chain of replacements (i.e.voidsetActive(boolean isActive) makes this execution active or inactive.voidsetActivity(PvmActivity activity) voidsetActivityInstanceId(String activityInstanceId) voidsetCanceled(boolean canceled) voidsetCaseInstanceId(String caseInstanceId) voidsetCompleteScope(boolean completeScope) voidsetConcurrent(boolean isConcurrent) changes the concurrent indicator on this execution.protected voidsetDelayedPayloadToNewScope(PvmActivity activity) voidsetDeleteReason(String deleteReason) voidsetDeleteRoot(boolean deleteRoot) voidsetEnded(boolean isEnded) voidsetEventScope(boolean isEventScope) voidsetExternallyTerminated(boolean externallyTerminated) voidsetIgnoreAsync(boolean ignoreAsync) voidsetNextActivity(PvmActivity nextActivity) voidsetParent(PvmExecutionImpl parent) Sets the execution's parent and updates the old and new parents' set of child executionsabstract voidsetParentExecution(PvmExecutionImpl parent) Use #setParent to also update the child execution setsvoidsetPayloadForTriggeredScope(Map<String, Object> payloadForTriggeredScope) voidsetPreserveScope(boolean preserveScope) voidsetProcessBusinessKey(String businessKey) Configure a business key on the process instance this execution is associated with.voidsetProcessDefinition(ProcessDefinitionImpl processDefinition) abstract voidsetProcessInstance(PvmExecutionImpl pvmExecutionImpl) voidsetProcessInstanceStarting(boolean starting) voidsetScope(boolean isScope) Changes whether this execution is a scope or notvoidsetSequenceCounter(long sequenceCounter) voidsetStartContext(ScopeInstantiationContext startContext) voidsetStarting(boolean isStarting) abstract voidsetSubCaseInstance(CmmnExecution subCaseInstance) abstract voidsetSubProcessInstance(PvmExecutionImpl subProcessInstance) abstract voidsetSuperCaseExecution(CmmnExecution superCaseExecution) abstract voidsetSuperExecution(PvmExecutionImpl superExecution) voidsetTransition(PvmTransition transition) voidsetTransitionsToTake(List<PvmTransition> transitionsToTake) voidsetVariable(String variableName, Object value, String targetActivityId) Method to store variable in a specific scope identified by activity ID.voidvoidstart()voidprotected voidstart(Map<String, Object> variables, VariableMap formProperties) voidstartWithFormProperties(VariableMap formProperties) voidstartWithoutExecuting(Map<String, Object> variables) perform starting behavior but don't execute the initial activityvoidtake()toString()booleanMethods inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
getBusinessKeyWithoutCascade, getEventName, getEventSource, getId, getListenerIndex, getTenantId, invokeListener, isSkipCustomListeners, isSkipIoMappings, isSkipSubprocesses, performOperation, performOperationSync, setBusinessKey, setEventName, setEventSource, setId, setListenerIndex, setSkipCustomListeners, setSkipIoMappings, setSkipSubprocesseses, setTenantIdMethods inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
collectVariableNames, collectVariables, dispatchEvent, getCachedElContext, getSourceActivityVariableScope, getValueFromVariableInstance, getVariable, getVariable, getVariableInstance, getVariableInstanceFactory, getVariableInstanceLifecycleListeners, getVariableInstanceLocal, getVariableInstancesLocal, getVariableInstancesLocal, getVariableLocal, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariableStore, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, initializeVariableStore, invokeVariableLifecycleListenersCreate, invokeVariableLifecycleListenersCreate, invokeVariableLifecycleListenersDelete, invokeVariableLifecycleListenersDelete, invokeVariableLifecycleListenersUpdate, invokeVariableLifecycleListenersUpdate, removeVariable, removeVariable, removeVariableLocal, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setCachedElContext, setVariable, setVariable, setVariable, setVariable, setVariableLocal, setVariableLocal, setVariableLocal, setVariables, setVariables, setVariablesLocal, setVariablesLocalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution
forceUpdateMethods inherited from interface org.camunda.bpm.engine.delegate.BaseDelegateExecution
getEventName, getIdMethods inherited from interface org.camunda.bpm.engine.delegate.BpmnModelExecutionContext
getBpmnModelElementInstance, getBpmnModelInstanceMethods inherited from interface org.camunda.bpm.engine.delegate.DelegateExecution
getProcessDefinitionId, getProcessInstanceId, getTenantIdMethods inherited from interface org.camunda.bpm.engine.delegate.ProcessEngineServicesAware
getProcessEngine, getProcessEngineServicesMethods inherited from interface org.camunda.bpm.engine.impl.pvm.PvmExecution
getVariable, getVariables, hasVariable, setVariableMethods inherited from interface org.camunda.bpm.engine.delegate.VariableScope
getVariable, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, removeVariable, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setVariable, setVariableLocal, setVariables, setVariablesLocal
-
Field Details
-
processDefinition
-
scopeInstantiationContext
-
ignoreAsync
protected transient boolean ignoreAsync -
isStarting
protected transient boolean isStartingtrue for process instances in the initial phase. Currently this controls that historic variable updates created during this phase receive theinitialflag (seeHistoricVariableUpdateEventEntity.isInitial). -
activity
current activity -
nextActivity
the activity which is to be started next -
transition
the transition that is currently being taken -
transitionsToTake
A list of outgoing transitions from the current activity that are going to be taken -
activityInstanceId
the unique id of the current activity instance -
caseInstanceId
the id of a case associated with this execution -
replacedBy
-
deleteRoot
protected boolean deleteRoot -
deleteReason
-
externallyTerminated
protected boolean externallyTerminated -
isActive
protected boolean isActiveindicates if this execution represents an active path of execution. Executions are made inactive in the following situations:- an execution enters a nested scope
- an execution is split up into multiple concurrent executions, then the parent is made inactive.
- an execution has arrived in a parallel gateway or join and that join has not yet activated/fired.
- an execution is ended.
-
isScope
protected boolean isScope -
isConcurrent
protected boolean isConcurrent -
isEnded
protected boolean isEnded -
isEventScope
protected boolean isEventScope -
isRemoved
protected boolean isRemoved -
preserveScope
protected boolean preserveScopetransient; used for process instance modification to preserve a scope from getting deleted -
activityInstanceState
protected int activityInstanceStatemarks the current activity instance -
activityInstanceEndListenersFailed
protected boolean activityInstanceEndListenersFailed -
payloadForTriggeredScope
-
sequenceCounter
protected long sequenceCounter -
delayedEvents
Contains the delayed variable events, which will be dispatched on a save point.
-
-
Constructor Details
-
PvmExecutionImpl
public PvmExecutionImpl()
-
-
Method Details
-
createExecution
creates a new execution. properties processDefinition, processInstance and activity will be initialized.- Specified by:
createExecutionin interfaceActivityExecution
-
createSubProcessInstance
Description copied from interface:ActivityExecutioncreates a new sub process instance. The current execution will be the super execution of the created execution.- Specified by:
createSubProcessInstancein interfaceActivityExecution- Parameters:
processDefinition- ThePvmProcessDefinitionof the subprocess.
-
createSubProcessInstance
public PvmExecutionImpl createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey) - Specified by:
createSubProcessInstancein interfaceActivityExecution- Parameters:
processDefinition- ThePvmProcessDefinitionof the subprocess.businessKey- the business key of the process instance- See Also:
-
createSubProcessInstance
public PvmExecutionImpl createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId) - Specified by:
createSubProcessInstancein interfaceActivityExecution- Parameters:
processDefinition- ThePvmProcessDefinitionof the subprocess.businessKey- the business key of the process instancecaseInstanceId- the case instance id of the process instance- See Also:
-
newExecution
-
createSubCaseInstance
Description copied from interface:ActivityExecutionCreates a new sub case instance.
Thisexecution will be the super execution of the created sub case instance.- Specified by:
createSubCaseInstancein interfaceActivityExecution- Parameters:
caseDefinition- TheCmmnCaseDefinitionof the sub case instance.
-
createSubCaseInstance
public abstract CmmnExecution createSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey) Description copied from interface:ActivityExecutionCreates a new sub case instance.
Thisexecution will be the super execution of the created sub case instance.- Specified by:
createSubCaseInstancein interfaceActivityExecution- Parameters:
caseDefinition- TheCmmnCaseDefinitionof the sub case instance.businessKey- The businessKey to be set on sub case instance.
-
initialize
public abstract void initialize() -
initializeTimerDeclarations
public abstract void initializeTimerDeclarations() -
executeIoMapping
public void executeIoMapping() -
start
public void start()- Specified by:
startin interfacePvmProcessInstance
-
start
- Specified by:
startin interfacePvmProcessInstance
-
startWithFormProperties
-
start
-
startWithoutExecuting
perform starting behavior but don't execute the initial activity- Parameters:
variables- the variables which are used for the start
-
fireHistoricProcessStartEvent
public abstract void fireHistoricProcessStartEvent() -
destroy
public void destroy()- Specified by:
destroyin interfaceActivityExecution
-
destroy
public void destroy(boolean alwaysSkipIoMappings) - Parameters:
alwaysSkipIoMappings- set to true to always skip IO mappings, regardless of internal state of execution (=>CoreExecution.isSkipIoMappings())
-
removeAllTasks
public void removeAllTasks() -
removeEventScopes
protected void removeEventScopes() -
clearScope
public void clearScope(String reason, boolean skipCustomListeners, boolean skipIoMappings, boolean externallyTerminated) -
interrupt
Interrupts an execution- Specified by:
interruptin interfaceActivityExecution
-
interrupt
public void interrupt(String reason, boolean skipCustomListeners, boolean skipIoMappings, boolean externallyTerminated) -
end
public void end(boolean completeScope) Ends an execution. Invokes end listeners for the current activity and notifies the flow scope execution of this happening which may result in the flow scope ending.- Specified by:
endin interfaceActivityExecution- Parameters:
completeScope- true if ending the execution contributes to completing the BPMN 2.0 scope
-
endCompensation
public void endCompensation()Description copied from interface:ActivityExecutionExecution finished compensation. Removes this execution and notifies listeners.- Specified by:
endCompensationin interfaceActivityExecution
-
propagateEnd
public void propagateEnd()Precondition: execution is already ended but this has not been propagated yet.
Propagates the ending of this execution to the flowscope execution; currently only supports the process instance execution
-
remove
public void remove()- Specified by:
removein interfaceActivityExecution
-
isRemoved
public boolean isRemoved() -
createConcurrentExecution
-
tryPruneLastConcurrentChild
public boolean tryPruneLastConcurrentChild()- Specified by:
tryPruneLastConcurrentChildin interfaceActivityExecution
-
deleteCascade
- Specified by:
deleteCascadein interfacePvmProcessInstance
-
deleteCascade
-
deleteCascade
public void deleteCascade(String deleteReason, boolean skipCustomListeners, boolean skipIoMappings, boolean externallyTerminated, boolean skipSubprocesses) -
executeEventHandlerActivity
-
getReplacedBy
Returns an execution that has replaced this execution for executing activities in their shared scope.
Invariant: this execution and getReplacedBy() execute in the same scope.
-
resolveReplacedBy
Instead ofgetReplacedBy(), which returns the execution that this execution was directly replaced with, this resolves the chain of replacements (i.e. in the case the replacedBy execution itself was replaced again) -
hasReplacedParent
public boolean hasReplacedParent() -
isReplacedByParent
public boolean isReplacedByParent() -
replace
Replace an execution by this execution. The replaced execution has a pointer (
getReplacedBy()) to this execution. This pointer is maintained until the replaced execution is removed or this execution is removed/ended.This is used for two cases: Execution tree expansion and execution tree compaction
- expansion: Before:
------- | e1 | scope -------After:------- | e1 | scope ------- | ------- | e2 | cc (no scope) -------e2 replaces e1: it should receive all entities associated with the activity currently executed by e1; these are tasks, (local) variables, jobs (specific for the activity, not the scope) - compaction: Before:
------- | e1 | scope ------- | ------- | e2 | cc (no scope) -------After:------- | e1 | scope -------e1 replaces e2: it should receive all entities associated with the activity currently executed by e2; these are tasks, (all) variables, all jobs
- expansion: Before:
-
onConcurrentExpand
Callback on tree expansion when this execution is used as the concurrent execution where the argument's children become a subordinate to. Note that this case is not the inverse of replace because replace has the semantics that the replacing execution can be used to continue execution of this execution's activity instance. -
signal
- Specified by:
signalin interfaceActivityExecution- Specified by:
signalin interfacePvmExecution
-
take
public void take() -
executeActivity
Execute an activity which is not contained in normal flow (having no incoming sequence flows). Cannot be called for activities contained in normal flow.First, the ActivityStartBehavior is evaluated. In case the start behavior is not
ActivityStartBehavior.DEFAULT, the corresponding start behavior is executed before executing the activity.For a given activity, the execution on which this method must be called depends on the type of the start behavior:
- CONCURRENT_IN_FLOW_SCOPE: scope execution for
PvmScope.getFlowScope() - INTERRUPT_EVENT_SCOPE: scope execution for
PvmScope.getEventScope() - CANCEL_EVENT_SCOPE: scope execution for
PvmScope.getEventScope()
- Specified by:
executeActivityin interfaceActivityExecution- Parameters:
activity- the activity to start
- CONCURRENT_IN_FLOW_SCOPE: scope execution for
-
setDelayedPayloadToNewScope
-
executeActivitiesConcurrent
public void executeActivitiesConcurrent(List<PvmActivity> activityStack, PvmActivity targetActivity, PvmTransition targetTransition, Map<String, Object> variables, Map<String, Object> localVariables, boolean skipCustomListeners, boolean skipIoMappings) Instantiates the given activity stack under this execution. Sets the variables for the execution responsible to execute the most deeply nested activity.- Parameters:
activityStack- The most deeply nested activity is the last element in the list
-
instantiateScopes
public Map<PvmActivity,PvmExecutionImpl> instantiateScopes(List<PvmActivity> activityStack, boolean skipCustomListeners, boolean skipIoMappings) Instantiates the given set of activities and returns the execution for the bottom-most activity -
executeActivities
public void executeActivities(List<PvmActivity> activityStack, PvmActivity targetActivity, PvmTransition targetTransition, Map<String, Object> variables, Map<String, Object> localVariables, boolean skipCustomListeners, boolean skipIoMappings) Instantiates the given activity stack. Uses this execution to execute the highest activity in the stack. Sets the variables for the execution responsible to execute the most deeply nested activity.- Parameters:
activityStack- The most deeply nested activity is the last element in the list
-
findInactiveConcurrentExecutions
Description copied from interface:ActivityExecutionRetrieves all executions which are concurrent and inactive at the given activity.- Specified by:
findInactiveConcurrentExecutionsin interfaceActivityExecution
-
findInactiveChildExecutions
- Specified by:
findInactiveChildExecutionsin interfaceActivityExecution
-
getAllChildExecutions
-
leaveActivityViaTransition
- Specified by:
leaveActivityViaTransitionin interfaceActivityExecution
-
leaveActivityViaTransitions
public void leaveActivityViaTransitions(List<PvmTransition> _transitions, List<? extends ActivityExecution> _recyclableExecutions) Description copied from interface:ActivityExecutionTakes the given outgoing transitions, and potentially reusing the given list of executions that were previously joined.- Specified by:
leaveActivityViaTransitionsin interfaceActivityExecution
-
removeVariablesLocalInternal
protected abstract void removeVariablesLocalInternal() -
isActive
-
inactivate
public void inactivate()Description copied from interface:ActivityExecutionInactivates this execution. This is useful for example in a join: the execution still exists, but it is not longer active.- Specified by:
inactivatein interfaceActivityExecution
-
getExecutions
Description copied from interface:ActivityExecutionreturns the list of execution of which this execution the parent of. This is a copy of the actual list, so a modification has no direct effect.- Specified by:
getExecutionsin interfaceActivityExecution
-
getExecutionsAsCopy
-
getNonEventScopeExecutions
Description copied from interface:ActivityExecutionreturns child executions that are not event scope executions.- Specified by:
getNonEventScopeExecutionsin interfaceActivityExecution
-
getEventScopeExecutions
-
findExecution
- Specified by:
findExecutionin interfacePvmProcessInstance
-
findExecutions
- Specified by:
findExecutionsin interfacePvmProcessInstance
-
collectExecutions
-
findActiveActivityIds
- Specified by:
findActiveActivityIdsin interfacePvmProcessInstance
-
collectActiveActivityIds
-
getProcessBusinessKey
Description copied from interface:DelegateExecutionThe business key for the process instance this execution is associated with.- Specified by:
getProcessBusinessKeyin interfaceDelegateExecution
-
setProcessBusinessKey
Description copied from interface:DelegateExecutionConfigure a business key on the process instance this execution is associated with.- Specified by:
setProcessBusinessKeyin interfaceDelegateExecution- Parameters:
businessKey- the new business key
-
getBusinessKey
Description copied from interface:BaseDelegateExecutionThe business key for the root execution (e.g. process instance).- Specified by:
getBusinessKeyin interfaceBaseDelegateExecution
-
setProcessDefinition
-
getProcessDefinition
-
getProcessInstance
ensures initialization and returns the process instance.- Specified by:
getProcessInstancein interfaceDelegateExecution
-
setProcessInstance
-
getCaseInstanceId
-
setCaseInstanceId
-
getActivity
ensures initialization and returns the activity- Specified by:
getActivityin interfaceActivityExecution- Specified by:
getActivityin interfacePvmExecution
-
getActivityId
-
getCurrentActivityName
Description copied from interface:DelegateExecutionGets the name of the current activity.- Specified by:
getCurrentActivityNamein interfaceDelegateExecution
-
getCurrentActivityId
Description copied from interface:DelegateExecutionGets the id of the current activity.- Specified by:
getCurrentActivityIdin interfaceDelegateExecution
-
setActivity
- Specified by:
setActivityin interfaceActivityExecution
-
enterActivityInstance
public void enterActivityInstance()Description copied from interface:ActivityExecutioninvoked to notify the execution that a new activity instance is started- Specified by:
enterActivityInstancein interfaceActivityExecution
-
activityInstanceStarting
public void activityInstanceStarting() -
activityInstanceStarted
public void activityInstanceStarted() -
activityInstanceDone
public void activityInstanceDone() -
activityInstanceEndListenerFailure
public void activityInstanceEndListenerFailure() -
generateActivityInstanceId
-
leaveActivityInstance
public void leaveActivityInstance()Description copied from interface:ActivityExecutioninvoked to notify the execution that an activity instance is ended.- Specified by:
leaveActivityInstancein interfaceActivityExecution
-
getParentActivityInstanceId
Description copied from interface:ActivityExecutionreturn the Id of the parent activity instance currently executed by this execution- Specified by:
getParentActivityInstanceIdin interfaceActivityExecution- Specified by:
getParentActivityInstanceIdin interfaceDelegateExecution
-
setActivityInstanceId
- Specified by:
setActivityInstanceIdin interfaceActivityExecution
-
getActivityInstanceId
Description copied from interface:ActivityExecutionreturn the Id of the activity instance currently executed by this execution- Specified by:
getActivityInstanceIdin interfaceActivityExecution- Specified by:
getActivityInstanceIdin interfaceDelegateExecution
-
getParent
ensures initialization and returns the parent- Specified by:
getParentin interfaceActivityExecution
-
getParentId
Description copied from interface:DelegateExecutionGets the id of the parent of this execution. If null, the execution represents a process-instance.- Specified by:
getParentIdin interfaceDelegateExecution
-
hasChildren
public boolean hasChildren()- Specified by:
hasChildrenin interfaceActivityExecution- Returns:
- true if this execution has child executions (event scope executions or not)
-
setParent
Sets the execution's parent and updates the old and new parents' set of child executions -
setParentExecution
Use #setParent to also update the child execution sets -
getSuperExecution
Description copied from interface:DelegateExecutionIn case this delegate execution is the process instance execution and this process instance was started by a call activity, this method returns the execution which executed the call activity in the super process instance.- Specified by:
getSuperExecutionin interfaceDelegateExecution- Returns:
- the super execution or null.
-
setSuperExecution
-
getSubProcessInstance
-
setSubProcessInstance
-
getSuperCaseExecution
-
setSuperCaseExecution
-
getSubCaseInstance
-
setSubCaseInstance
-
getScopeActivity
-
isScope
public boolean isScope()Description copied from interface:ActivityExecutionReturns whether this execution is a scope.- Specified by:
isScopein interfaceActivityExecution
-
setScope
public void setScope(boolean isScope) Description copied from interface:ActivityExecutionChanges whether this execution is a scope or not- Specified by:
setScopein interfaceActivityExecution
-
findExecutionForFlowScope
For a given target flow scope, this method returns the corresponding scope execution.Precondition: the execution is active and executing an activity. Can be invoked for scope and non scope executions.
- Specified by:
findExecutionForFlowScopein interfaceActivityExecution- Parameters:
targetFlowScope- scope activity or process definition for which the scope execution should be found- Returns:
- the scope execution for the provided targetFlowScope
-
findExecutionForScope
-
createActivityExecutionMapping
-
createActivityExecutionMapping
Description copied from interface:ActivityExecutionReturns a mapping from scope activities to scope executions for all scopes that are ancestors of the activity currently executed by this execution. Assumption: the current execution is active and executing an activity (ActivityExecution.getActivity()is not null).- Specified by:
createActivityExecutionMappingin interfaceActivityExecution
-
getFlowScopeExecution
-
getFlowScope
-
createActivityExecutionMapping
protected Map<ScopeImpl,PvmExecutionImpl> createActivityExecutionMapping(ScopeImpl currentScope, Map<ScopeImpl, PvmExecutionImpl> mapping) Creates an extended mapping based on this execution and the given existing mapping. Any entrymappingin mapping that corresponds to an ancestor scope ofcurrentScopeis reused. -
toString
-
getToStringIdentity
-
getVariableScopeKey
- Specified by:
getVariableScopeKeyin interfaceVariableScope- Overrides:
getVariableScopeKeyin classAbstractVariableScope
-
getParentVariableScope
- Specified by:
getParentVariableScopein classAbstractVariableScope
-
setVariable
Method to store variable in a specific scope identified by activity ID.- Specified by:
setVariablein interfaceDelegateExecution- Parameters:
variableName- - name of the variablevalue- - value of the variabletargetActivityId- - activity ID which is associated with destination execution, if not existing - exception will be thrown
-
findExecutionForFlowScope
- Parameters:
targetScopeId- - destination scope to be found in current execution tree- Returns:
- execution with activity id corresponding to targetScopeId
-
getSequenceCounter
public long getSequenceCounter() -
setSequenceCounter
public void setSequenceCounter(long sequenceCounter) -
incrementSequenceCounter
public void incrementSequenceCounter() -
isExternallyTerminated
public boolean isExternallyTerminated() -
setExternallyTerminated
public void setExternallyTerminated(boolean externallyTerminated) -
getDeleteReason
-
setDeleteReason
-
isDeleteRoot
public boolean isDeleteRoot() -
setDeleteRoot
public void setDeleteRoot(boolean deleteRoot) -
getTransition
- Specified by:
getTransitionin interfaceActivityExecution
-
getTransitionsToTake
-
setTransitionsToTake
-
getCurrentTransitionId
Description copied from interface:DelegateExecutionreturn the Id of the current transition- Specified by:
getCurrentTransitionIdin interfaceDelegateExecution
-
setTransition
-
isConcurrent
public boolean isConcurrent()Description copied from interface:ActivityExecutionreturns whether this execution is concurrent or not.- Specified by:
isConcurrentin interfaceActivityExecution
-
setConcurrent
public void setConcurrent(boolean isConcurrent) Description copied from interface:ActivityExecutionchanges the concurrent indicator on this execution.- Specified by:
setConcurrentin interfaceActivityExecution
-
isActive
public boolean isActive()Description copied from interface:ActivityExecutionreturns whether this execution is currently active.- Specified by:
isActivein interfaceActivityExecution
-
setActive
public void setActive(boolean isActive) Description copied from interface:ActivityExecutionmakes this execution active or inactive.- Specified by:
setActivein interfaceActivityExecution
-
setEnded
public void setEnded(boolean isEnded) - Specified by:
setEndedin interfaceActivityExecution
-
isEnded
public boolean isEnded()Description copied from interface:ActivityExecutionreturns whether this execution has ended or not.- Specified by:
isEndedin interfaceActivityExecution- Specified by:
isEndedin interfacePvmProcessInstance
-
isCanceled
public boolean isCanceled()Description copied from interface:DelegateExecutionReturns whether this execution has been canceled.- Specified by:
isCanceledin interfaceDelegateExecution
-
setCanceled
public void setCanceled(boolean canceled) -
isCompleteScope
public boolean isCompleteScope()Description copied from interface:ActivityExecutionReturns whether this execution completed the parent scope.- Specified by:
isCompleteScopein interfaceActivityExecution
-
setCompleteScope
public void setCompleteScope(boolean completeScope) -
setPreserveScope
public void setPreserveScope(boolean preserveScope) -
isPreserveScope
public boolean isPreserveScope() -
getActivityInstanceState
public int getActivityInstanceState() -
isInState
-
hasFailedOnEndListeners
public boolean hasFailedOnEndListeners()- Overrides:
hasFailedOnEndListenersin classCoreExecution
-
isEventScope
public boolean isEventScope() -
setEventScope
public void setEventScope(boolean isEventScope) -
getScopeInstantiationContext
-
disposeScopeInstantiationContext
public void disposeScopeInstantiationContext() -
getNextActivity
Description copied from interface:ActivityExecutionAn activity which is to be started next.- Specified by:
getNextActivityin interfaceActivityExecution
-
isProcessInstanceExecution
public boolean isProcessInstanceExecution()Description copied from interface:ActivityExecutionreturns whether this execution is a process instance or not.- Specified by:
isProcessInstanceExecutionin interfaceActivityExecution
-
setStartContext
-
setIgnoreAsync
public void setIgnoreAsync(boolean ignoreAsync) - Specified by:
setIgnoreAsyncin interfaceActivityExecution
-
isIgnoreAsync
public boolean isIgnoreAsync() -
setStarting
public void setStarting(boolean isStarting) -
isStarting
public boolean isStarting() -
isProcessInstanceStarting
public boolean isProcessInstanceStarting() -
setProcessInstanceStarting
public void setProcessInstanceStarting(boolean starting) -
setNextActivity
-
getPayloadForTriggeredScope
-
setPayloadForTriggeredScope
-
getParentScopeExecution
-
delayEvent
Delays a given variable event with the given target scope.- Parameters:
targetScope- the target scope of the variable eventvariableEvent- the variable event which should be delayed
-
delayEvent
Delays and stores the given DelayedVariableEvent on the process instance.- Parameters:
delayedVariableEvent- the DelayedVariableEvent which should be store on the process instance
-
getDelayedEvents
The current delayed variable events.- Returns:
- a list of DelayedVariableEvent objects
-
clearDelayedEvents
public void clearDelayedEvents()Cleares the current delayed variable events. -
dispatchDelayedEventsAndPerformOperation
Dispatches the current delayed variable events and performs the given atomic operation if the current state was not changed.- Parameters:
atomicOperation- the atomic operation which should be executed
-
dispatchDelayedEventsAndPerformOperation
Dispatches the current delayed variable events and performs the given atomic operation if the current state was not changed.- Parameters:
continuation- the atomic operation continuation which should be executed
-
continueIfExecutionDoesNotAffectNextOperation
public void continueIfExecutionDoesNotAffectNextOperation(Callback<PvmExecutionImpl, Void> dispatching, Callback<PvmExecutionImpl, Void> continuation, PvmExecutionImpl execution) Executes the given depending operations with the given execution. The execution state will be checked with the help of the activity instance id and activity id of the execution before and after the dispatching callback call. If the id's are not changed the continuation callback is called.- Parameters:
dispatching- the callback to dispatch the variable eventscontinuation- the callback to continue with the next atomic operationexecution- the execution which is used for the execution
-
continueExecutionIfNotCanceled
protected void continueExecutionIfNotCanceled(Callback<PvmExecutionImpl, Void> continuation, PvmExecutionImpl execution) -
dispatchScopeEvents
Dispatches the current delayed variable events on the scope of the given execution.- Parameters:
execution- the execution on which scope the delayed variable should be dispatched
-
initActivityIds
protected void initActivityIds(List<DelayedVariableEvent> delayedEvents, Map<PvmExecutionImpl, String> activityInstanceIds, Map<PvmExecutionImpl, String> activityIds) Initializes the given maps with the target scopes and current activity id's and activity instance id's.- Parameters:
delayedEvents- the delayed events which contains the information about the target scopeactivityInstanceIds- the map which maps target scope to activity instance idactivityIds- the map which maps target scope to activity id
-
createIncident
Returns the newest incident in this execution- Specified by:
createIncidentin interfaceDelegateExecution- Parameters:
incidentType- the type of new incidentconfiguration- configuration of the incident- Returns:
- new incident
-
createIncident
Description copied from interface:DelegateExecutionCreate an incident associated with this execution- Specified by:
createIncidentin interfaceDelegateExecution- Parameters:
incidentType- the type of incident- Returns:
- a new incident
-
createIncidentContext
-
resolveIncident
Resolves an incident with given id.- Specified by:
resolveIncidentin interfaceDelegateExecution- Parameters:
incidentId-
-
findIncidentHandler
-
isExecutingScopeLeafActivity
public boolean isExecutingScopeLeafActivity() -
isAsyncAfterScopeWithoutTransition
public boolean isAsyncAfterScopeWithoutTransition()This case is special, because the execution tree is different if an async after activity is left via transition (case 1) or not (case 2). In case 1, when the execution becomes async, the scope execution is already removed. In case 2 it is not.- Returns:
- true if
- the execution is in asyncAfter state and completes
- leaves a scope activity
- completes the parent scope (i.e. does not leave via a transition but propagates control to the parent)
-