Class ExecutionImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
-
- org.camunda.bpm.engine.impl.core.instance.CoreExecution
-
- org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl
-
- org.camunda.bpm.engine.impl.pvm.runtime.ExecutionImpl
-
- All Implemented Interfaces:
java.io.Serializable
,BaseDelegateExecution
,BpmnModelExecutionContext
,DelegateExecution
,ProcessEngineServicesAware
,VariableScope
,VariableEventDispatcher
,ActivityExecution
,PvmExecution
,PvmProcessInstance
public class ExecutionImpl extends PvmExecutionImpl implements java.io.Serializable, ActivityExecution, PvmProcessInstance
- Author:
- Tom Baeyens, Joram Barrez, Daniel Meyer, Falko Menge
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<ExecutionImpl>
executions
nested executions representing scopes or concurrent pathsprotected ExecutionImpl
parent
the parent executionprotected ExecutionImpl
processInstance
the process instance.protected CaseExecutionImpl
subCaseInstance
reference to a subcaseinstance, not-null if currently subcase is started from this executionprotected ExecutionImpl
subProcessInstance
reference to a subprocessinstance, not-null if currently subprocess is started from this executionprotected CaseExecutionImpl
superCaseExecution
super case execution, not-null if this execution is part of a case executionprotected ExecutionImpl
superExecution
super execution, not-null if this execution is part of a subprocessprotected VariableStore<CoreVariableInstance>
variableStore
-
Fields inherited from class org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl
activity, activityInstanceEndListenersFailed, activityInstanceId, activityInstanceState, caseInstanceId, delayedEvents, deleteReason, deleteRoot, externallyTerminated, ignoreAsync, isActive, isConcurrent, isEnded, isEventScope, isRemoved, isScope, isStarting, nextActivity, preserveScope, processDefinition, replacedBy, scopeInstantiationContext, sequenceCounter, transition, transitionsToTake
-
Fields inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
businessKey, businessKeyWithoutCascade, eventName, eventSource, id, listenerIndex, skipCustomListeners, skipIoMapping, skipSubprocesses, tenantId
-
Fields inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
cachedElContext
-
-
Constructor Summary
Constructors Constructor Description ExecutionImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutionImpl
createExecution()
creates a new execution.CaseExecutionImpl
createSubCaseInstance(CmmnCaseDefinition caseDefinition)
Creates a new sub case instance.CaseExecutionImpl
createSubCaseInstance(CmmnCaseDefinition caseDefinition, java.lang.String businessKey)
Creates a new sub case instance.void
fireHistoricProcessStartEvent()
void
forceUpdate()
protected java.lang.String
generateActivityInstanceId(java.lang.String activityId)
generates an activity instance idFlowElement
getBpmnModelElementInstance()
Returns the currently executed Element in the BPMN Model.BpmnModelInstance
getBpmnModelInstance()
Returns theBpmnModelInstance
for the currently executed Bpmn Modeljava.lang.String
getBusinessKey()
The business key for the root execution (e.g.java.lang.String
getCurrentActivityName()
Gets the name of the current activity.java.util.List<ExecutionImpl>
getExecutions()
ensures initialization and returns the non-null executions listjava.util.List<ExecutionImpl>
getExecutionsAsCopy()
java.lang.String
getId()
Unique id of this path of execution that can be used as a handle to provide external signals back into the engine after wait states.ExecutionImpl
getParent()
ensures initialization and returns the parentjava.lang.String
getProcessBusinessKey()
The business key for the process instance this execution is associated with.java.lang.String
getProcessDefinitionId()
The process definition key for the process instance this execution is associated with.ProcessEngine
getProcessEngine()
Returns theProcessEngine
providing access to the public API of the process engine.ProcessEngineServices
getProcessEngineServices()
Returns theProcessEngineServices
providing access to the public API of the process engine.ExecutionImpl
getProcessInstance()
ensures initialization and returns the process instance.java.lang.String
getProcessInstanceId()
Reference to the overall process instanceExecutionImpl
getReplacedBy()
Returns an execution that has replaced this execution for executing activities in their shared scope.CaseExecutionImpl
getSubCaseInstance()
ExecutionImpl
getSubProcessInstance()
CaseExecutionImpl
getSuperCaseExecution()
ExecutionImpl
getSuperExecution()
In 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 java.lang.String
getToStringIdentity()
protected VariableInstanceFactory<CoreVariableInstance>
getVariableInstanceFactory()
protected java.util.List<VariableInstanceLifecycleListener<CoreVariableInstance>>
getVariableInstanceLifecycleListeners()
protected VariableStore<CoreVariableInstance>
getVariableStore()
void
initialize()
void
initializeTimerDeclarations()
protected ExecutionImpl
newExecution()
instantiates a new execution.protected void
removeVariablesLocalInternal()
void
setBusinessKey(java.lang.String businessKey)
void
setExecutions(java.util.List<ExecutionImpl> executions)
void
setParentExecution(PvmExecutionImpl parent)
Use #setParent to also update the child execution setsvoid
setProcessInstance(PvmExecutionImpl processInstance)
for setting the process instance, this setter must be used as subclasses can overridevoid
setSubCaseInstance(CmmnExecution subCaseInstance)
void
setSubProcessInstance(PvmExecutionImpl subProcessInstance)
void
setSuperCaseExecution(CmmnExecution superCaseExecution)
void
setSuperExecution(PvmExecutionImpl superExecution)
java.lang.String
toString()
-
Methods inherited from class org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl
activityInstanceDone, activityInstanceEndListenerFailure, activityInstanceStarted, activityInstanceStarting, clearDelayedEvents, clearScope, collectActiveActivityIds, collectExecutions, continueExecutionIfNotCanceled, continueIfExecutionDoesNotAffectNextOperation, createActivityExecutionMapping, createActivityExecutionMapping, createActivityExecutionMapping, createConcurrentExecution, createIncident, createIncident, createIncidentContext, createSubProcessInstance, createSubProcessInstance, createSubProcessInstance, delayEvent, delayEvent, deleteCascade, deleteCascade, deleteCascade, destroy, dispatchDelayedEventsAndPerformOperation, dispatchDelayedEventsAndPerformOperation, dispatchScopeEvents, disposeScopeInstantiationContext, end, endCompensation, enterActivityInstance, executeActivities, executeActivitiesConcurrent, executeActivity, executeEventHandlerActivity, executeIoMapping, findActiveActivityIds, findExecution, findExecutionForFlowScope, findExecutionForFlowScope, findExecutionForScope, findExecutions, findInactiveChildExecutions, findInactiveConcurrentExecutions, findIncidentHandler, getActivity, getActivityId, getActivityInstanceId, getActivityInstanceState, getAllChildExecutions, getCaseInstanceId, getCurrentActivityId, getCurrentTransitionId, getDelayedEvents, getDeleteReason, getEventScopeExecutions, getFlowScope, getFlowScopeExecution, getNextActivity, getNonEventScopeExecutions, getParentActivityInstanceId, getParentId, getParentScopeExecution, getParentVariableScope, getProcessDefinition, getScopeActivity, getScopeInstantiationContext, getSequenceCounter, getTransition, getTransitionsToTake, getVariableScopeKey, hasChildren, hasFailedOnEndListeners, hasReplacedParent, inactivate, incrementSequenceCounter, initActivityIds, instantiateScopes, interrupt, interrupt, isActive, isActive, isCanceled, isCompleteScope, isConcurrent, isDeleteRoot, isEnded, isEventScope, isExternallyTerminated, isIgnoreAsync, isInState, isPreserveScope, isProcessInstanceExecution, isProcessInstanceStarting, isRemoved, isReplacedByParent, isScope, isStarting, leaveActivityInstance, leaveActivityViaTransition, leaveActivityViaTransitions, onConcurrentExpand, propagateEnd, remove, removeAllTasks, removeEventScopes, replace, resolveIncident, resolveReplacedBy, setActive, setActivity, setActivityInstanceId, setCanceled, setCaseInstanceId, setCompleteScope, setConcurrent, setDeleteReason, setDeleteRoot, setEnded, setEventScope, setExternallyTerminated, setIgnoreAsync, setNextActivity, setParent, setPreserveScope, setProcessBusinessKey, setProcessDefinition, setProcessInstanceStarting, setScope, setSequenceCounter, setStartContext, setStarting, setTransition, setTransitionsToTake, setVariable, signal, start, start, start, startWithFormProperties, startWithoutExecuting, take, tryPruneLastConcurrentChild
-
Methods inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
getBusinessKeyWithoutCascade, getEventName, getEventSource, getListenerIndex, getTenantId, invokeListener, isSkipCustomListeners, isSkipIoMappings, isSkipSubprocesses, performOperation, performOperationSync, setEventName, setEventSource, setId, setListenerIndex, setSkipCustomListeners, setSkipIoMappings, setSkipSubprocesseses, setTenantId
-
Methods inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
collectVariableNames, collectVariables, dispatchEvent, getCachedElContext, getSourceActivityVariableScope, getValueFromVariableInstance, getVariable, getVariable, getVariableInstance, getVariableInstanceLocal, getVariableInstancesLocal, getVariableInstancesLocal, getVariableLocal, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, 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, setVariablesLocal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution
createActivityExecutionMapping, createSubProcessInstance, createSubProcessInstance, createSubProcessInstance, destroy, end, endCompensation, enterActivityInstance, executeActivity, findExecutionForFlowScope, findInactiveChildExecutions, findInactiveConcurrentExecutions, getActivity, getActivityInstanceId, getNextActivity, getNonEventScopeExecutions, getParentActivityInstanceId, getTransition, hasChildren, inactivate, interrupt, isActive, isCompleteScope, isConcurrent, isEnded, isProcessInstanceExecution, isScope, leaveActivityInstance, leaveActivityViaTransition, leaveActivityViaTransitions, remove, setActive, setActivity, setActivityInstanceId, setConcurrent, setEnded, setIgnoreAsync, setScope, signal, tryPruneLastConcurrentChild
-
Methods inherited from interface org.camunda.bpm.engine.delegate.BaseDelegateExecution
getEventName
-
Methods inherited from interface org.camunda.bpm.engine.delegate.DelegateExecution
createIncident, createIncident, getCurrentActivityId, getCurrentTransitionId, getParentId, getTenantId, isCanceled, resolveIncident, setProcessBusinessKey, setVariable
-
Methods inherited from interface org.camunda.bpm.engine.impl.pvm.PvmExecution
getActivity, getVariable, getVariables, hasVariable, setVariable, signal
-
Methods inherited from interface org.camunda.bpm.engine.impl.pvm.PvmProcessInstance
deleteCascade, findActiveActivityIds, findExecution, findExecutions, isEnded, start, start
-
Methods inherited from interface org.camunda.bpm.engine.delegate.VariableScope
getVariable, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariableScopeKey, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, removeVariable, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setVariable, setVariableLocal, setVariables, setVariablesLocal
-
-
-
-
Field Detail
-
processInstance
protected ExecutionImpl processInstance
the process instance. this is the root of the execution tree. the processInstance of a process instance is a self reference.
-
parent
protected ExecutionImpl parent
the parent execution
-
executions
protected java.util.List<ExecutionImpl> executions
nested executions representing scopes or concurrent paths
-
superExecution
protected ExecutionImpl superExecution
super execution, not-null if this execution is part of a subprocess
-
subProcessInstance
protected ExecutionImpl subProcessInstance
reference to a subprocessinstance, not-null if currently subprocess is started from this execution
-
superCaseExecution
protected CaseExecutionImpl superCaseExecution
super case execution, not-null if this execution is part of a case execution
-
subCaseInstance
protected CaseExecutionImpl subCaseInstance
reference to a subcaseinstance, not-null if currently subcase is started from this execution
-
variableStore
protected VariableStore<CoreVariableInstance> variableStore
-
-
Method Detail
-
createExecution
public ExecutionImpl createExecution()
creates a new execution. properties processDefinition, processInstance and activity will be initialized.- Specified by:
createExecution
in interfaceActivityExecution
- Specified by:
createExecution
in classPvmExecutionImpl
-
newExecution
protected ExecutionImpl newExecution()
instantiates a new execution. can be overridden by subclasses- Specified by:
newExecution
in classPvmExecutionImpl
-
initialize
public void initialize()
- Specified by:
initialize
in classPvmExecutionImpl
-
initializeTimerDeclarations
public void initializeTimerDeclarations()
- Specified by:
initializeTimerDeclarations
in classPvmExecutionImpl
-
getParent
public ExecutionImpl getParent()
ensures initialization and returns the parent- Specified by:
getParent
in interfaceActivityExecution
- Specified by:
getParent
in classPvmExecutionImpl
-
setParentExecution
public void setParentExecution(PvmExecutionImpl parent)
Description copied from class:PvmExecutionImpl
Use #setParent to also update the child execution sets- Specified by:
setParentExecution
in classPvmExecutionImpl
-
getExecutionsAsCopy
public java.util.List<ExecutionImpl> getExecutionsAsCopy()
- Specified by:
getExecutionsAsCopy
in classPvmExecutionImpl
-
getExecutions
public java.util.List<ExecutionImpl> getExecutions()
ensures initialization and returns the non-null executions list- Specified by:
getExecutions
in interfaceActivityExecution
- Specified by:
getExecutions
in classPvmExecutionImpl
-
getSuperExecution
public ExecutionImpl getSuperExecution()
Description copied from interface:DelegateExecution
In 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:
getSuperExecution
in interfaceDelegateExecution
- Specified by:
getSuperExecution
in classPvmExecutionImpl
- Returns:
- the super execution or null.
-
setSuperExecution
public void setSuperExecution(PvmExecutionImpl superExecution)
- Specified by:
setSuperExecution
in classPvmExecutionImpl
-
getSubProcessInstance
public ExecutionImpl getSubProcessInstance()
- Specified by:
getSubProcessInstance
in classPvmExecutionImpl
-
setSubProcessInstance
public void setSubProcessInstance(PvmExecutionImpl subProcessInstance)
- Specified by:
setSubProcessInstance
in classPvmExecutionImpl
-
getSuperCaseExecution
public CaseExecutionImpl getSuperCaseExecution()
- Specified by:
getSuperCaseExecution
in classPvmExecutionImpl
-
setSuperCaseExecution
public void setSuperCaseExecution(CmmnExecution superCaseExecution)
- Specified by:
setSuperCaseExecution
in classPvmExecutionImpl
-
getSubCaseInstance
public CaseExecutionImpl getSubCaseInstance()
- Specified by:
getSubCaseInstance
in classPvmExecutionImpl
-
setSubCaseInstance
public void setSubCaseInstance(CmmnExecution subCaseInstance)
- Specified by:
setSubCaseInstance
in classPvmExecutionImpl
-
createSubCaseInstance
public CaseExecutionImpl createSubCaseInstance(CmmnCaseDefinition caseDefinition)
Description copied from interface:ActivityExecution
Creates a new sub case instance.
This
execution will be the super execution of the created sub case instance.- Specified by:
createSubCaseInstance
in interfaceActivityExecution
- Specified by:
createSubCaseInstance
in classPvmExecutionImpl
- Parameters:
caseDefinition
- TheCmmnCaseDefinition
of the sub case instance.
-
createSubCaseInstance
public CaseExecutionImpl createSubCaseInstance(CmmnCaseDefinition caseDefinition, java.lang.String businessKey)
Description copied from interface:ActivityExecution
Creates a new sub case instance.
This
execution will be the super execution of the created sub case instance.- Specified by:
createSubCaseInstance
in interfaceActivityExecution
- Specified by:
createSubCaseInstance
in classPvmExecutionImpl
- Parameters:
caseDefinition
- TheCmmnCaseDefinition
of the sub case instance.businessKey
- The businessKey to be set on sub case instance.
-
getProcessDefinitionId
public java.lang.String getProcessDefinitionId()
Description copied from interface:DelegateExecution
The process definition key for the process instance this execution is associated with.- Specified by:
getProcessDefinitionId
in interfaceDelegateExecution
-
getProcessInstance
public ExecutionImpl getProcessInstance()
ensures initialization and returns the process instance.- Specified by:
getProcessInstance
in interfaceDelegateExecution
- Specified by:
getProcessInstance
in classPvmExecutionImpl
-
getProcessInstanceId
public java.lang.String getProcessInstanceId()
Description copied from interface:DelegateExecution
Reference to the overall process instance- Specified by:
getProcessInstanceId
in interfaceDelegateExecution
-
getBusinessKey
public java.lang.String getBusinessKey()
Description copied from interface:BaseDelegateExecution
The business key for the root execution (e.g. process instance).- Specified by:
getBusinessKey
in interfaceBaseDelegateExecution
- Overrides:
getBusinessKey
in classPvmExecutionImpl
-
setBusinessKey
public void setBusinessKey(java.lang.String businessKey)
- Overrides:
setBusinessKey
in classCoreExecution
-
getProcessBusinessKey
public java.lang.String getProcessBusinessKey()
Description copied from interface:DelegateExecution
The business key for the process instance this execution is associated with.- Specified by:
getProcessBusinessKey
in interfaceDelegateExecution
- Overrides:
getProcessBusinessKey
in classPvmExecutionImpl
-
setProcessInstance
public void setProcessInstance(PvmExecutionImpl processInstance)
for setting the process instance, this setter must be used as subclasses can override- Specified by:
setProcessInstance
in classPvmExecutionImpl
-
generateActivityInstanceId
protected java.lang.String generateActivityInstanceId(java.lang.String activityId)
generates an activity instance id- Specified by:
generateActivityInstanceId
in classPvmExecutionImpl
-
toString
public java.lang.String toString()
- Overrides:
toString
in classPvmExecutionImpl
-
getToStringIdentity
protected java.lang.String getToStringIdentity()
- Overrides:
getToStringIdentity
in classPvmExecutionImpl
-
getId
public java.lang.String getId()
Description copied from interface:BaseDelegateExecution
Unique id of this path of execution that can be used as a handle to provide external signals back into the engine after wait states.- Specified by:
getId
in interfaceBaseDelegateExecution
- Overrides:
getId
in classCoreExecution
-
getVariableStore
protected VariableStore<CoreVariableInstance> getVariableStore()
- Specified by:
getVariableStore
in classAbstractVariableScope
-
getVariableInstanceFactory
protected VariableInstanceFactory<CoreVariableInstance> getVariableInstanceFactory()
- Specified by:
getVariableInstanceFactory
in classAbstractVariableScope
-
getVariableInstanceLifecycleListeners
protected java.util.List<VariableInstanceLifecycleListener<CoreVariableInstance>> getVariableInstanceLifecycleListeners()
- Specified by:
getVariableInstanceLifecycleListeners
in classAbstractVariableScope
-
getReplacedBy
public ExecutionImpl getReplacedBy()
Description copied from class:PvmExecutionImpl
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.
- Specified by:
getReplacedBy
in classPvmExecutionImpl
-
setExecutions
public void setExecutions(java.util.List<ExecutionImpl> executions)
-
getCurrentActivityName
public java.lang.String getCurrentActivityName()
Description copied from interface:DelegateExecution
Gets the name of the current activity.- Specified by:
getCurrentActivityName
in interfaceDelegateExecution
- Overrides:
getCurrentActivityName
in classPvmExecutionImpl
-
getBpmnModelElementInstance
public FlowElement getBpmnModelElementInstance()
Description copied from interface:BpmnModelExecutionContext
Returns the currently executed Element in the BPMN Model. This method returns a
FlowElement
which may be casted to the concrete type of the Bpmn Model Element currently executed.If called from a Service
ExecutionListener
, the method will return the correspondingFlowNode
forExecutionListener.EVENTNAME_START
andExecutionListener.EVENTNAME_END
and the correspondingSequenceFlow
forExecutionListener.EVENTNAME_TAKE
.- Specified by:
getBpmnModelElementInstance
in interfaceBpmnModelExecutionContext
- Returns:
- the
FlowElement
corresponding to the current Bpmn Model Element
-
getBpmnModelInstance
public BpmnModelInstance getBpmnModelInstance()
Description copied from interface:BpmnModelExecutionContext
Returns theBpmnModelInstance
for the currently executed Bpmn Model- Specified by:
getBpmnModelInstance
in interfaceBpmnModelExecutionContext
- Returns:
- the current
BpmnModelInstance
-
getProcessEngineServices
public ProcessEngineServices getProcessEngineServices()
Description copied from interface:ProcessEngineServicesAware
Returns theProcessEngineServices
providing access to the public API of the process engine.- Specified by:
getProcessEngineServices
in interfaceProcessEngineServicesAware
- Returns:
- the
ProcessEngineServices
.
-
getProcessEngine
public ProcessEngine getProcessEngine()
Description copied from interface:ProcessEngineServicesAware
Returns theProcessEngine
providing access to the public API of the process engine.- Specified by:
getProcessEngine
in interfaceProcessEngineServicesAware
- Returns:
- the
ProcessEngine
.
-
forceUpdate
public void forceUpdate()
- Specified by:
forceUpdate
in interfaceActivityExecution
-
fireHistoricProcessStartEvent
public void fireHistoricProcessStartEvent()
- Specified by:
fireHistoricProcessStartEvent
in classPvmExecutionImpl
-
removeVariablesLocalInternal
protected void removeVariablesLocalInternal()
- Specified by:
removeVariablesLocalInternal
in classPvmExecutionImpl
-
-