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:
Serializable
,BaseDelegateExecution
,BpmnModelExecutionContext
,DelegateExecution
,ProcessEngineServicesAware
,VariableScope
,VariableEventDispatcher
,ActivityExecution
,PvmExecution
,PvmProcessInstance
public class ExecutionImpl extends PvmExecutionImpl implements 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 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, isActive, isConcurrent, isEnded, isEventScope, isRemoved, isScope, nextActivity, preserveScope, processDefinition, replacedBy, sequenceCounter, startContext, 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(boolean initializeExecutionStartContext)
creates a new execution.CaseExecutionImpl
createSubCaseInstance(CmmnCaseDefinition caseDefinition)
Creates a new sub case instance.CaseExecutionImpl
createSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey)
Creates a new sub case instance.void
fireHistoricProcessStartEvent()
void
forceUpdate()
protected String
generateActivityInstanceId(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 ModelString
getBusinessKey()
The business key for the root execution (e.g.String
getCurrentActivityName()
Gets the name of the current activity.List<ExecutionImpl>
getExecutions()
ensures initialization and returns the non-null executions listList<ExecutionImpl>
getExecutionsAsCopy()
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 parentString
getProcessBusinessKey()
The business key for the process instance this execution is associated with.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.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 String
getToStringIdentity()
protected VariableInstanceFactory<CoreVariableInstance>
getVariableInstanceFactory()
protected List<VariableInstanceLifecycleListener<CoreVariableInstance>>
getVariableInstanceLifecycleListeners()
protected VariableStore<CoreVariableInstance>
getVariableStore()
void
initialize()
void
initializeTimerDeclarations()
protected ExecutionImpl
newExecution()
instantiates a new execution.protected void
removeVariablesLocalInternal()
void
setBusinessKey(String businessKey)
void
setExecutions(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)
void
start(Map<String,Object> variables)
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, createExecution, createIncident, createIncident, createIncidentContext, createSubProcessInstance, createSubProcessInstance, createSubProcessInstance, delayEvent, delayEvent, deleteCascade, deleteCascade, deleteCascade, destroy, dispatchDelayedEventsAndPerformOperation, dispatchDelayedEventsAndPerformOperation, dispatchScopeEvents, disposeExecutionStartContext, disposeProcessInstanceStartContext, 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, getExecutionStartContext, getFlowScope, getFlowScopeExecution, getNextActivity, getNonEventScopeExecutions, getParentActivityInstanceId, getParentId, getParentScopeExecution, getParentVariableScope, getProcessDefinition, getProcessInstanceStartContext, getScopeActivity, getSequenceCounter, getTransition, getTransitionsToTake, getVariableScopeKey, hasChildren, hasFailedOnEndListeners, hasProcessInstanceStartContext, hasReplacedParent, inactivate, incrementSequenceCounter, initActivityIds, instantiateScopes, interrupt, interrupt, isActive, isActive, isCanceled, isCompleteScope, isConcurrent, isDeleteRoot, isEnded, isEventScope, isExternallyTerminated, isInState, isPreserveScope, isProcessInstanceExecution, isRemoved, isReplacedByParent, isScope, leaveActivityInstance, leaveActivityViaTransition, leaveActivityViaTransitions, onConcurrentExpand, propagateEnd, remove, removeAllTasks, removeEventScopes, replace, resolveIncident, resolveReplacedBy, setActive, setActivity, setActivityInstanceId, setCanceled, setCaseInstanceId, setCompleteScope, setConcurrent, setDeleteReason, setDeleteRoot, setEnded, setEventScope, setExternallyTerminated, setNextActivity, setParent, setPreserveScope, setProcessBusinessKey, setProcessDefinition, setScope, setSequenceCounter, setStartContext, setTransition, setTransitionsToTake, setVariable, signal, 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, createExecution, 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, 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
-
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 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(boolean initializeExecutionStartContext)
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 List<ExecutionImpl> getExecutionsAsCopy()
- Specified by:
getExecutionsAsCopy
in classPvmExecutionImpl
-
getExecutions
public 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, 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 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
-
start
public void start(Map<String,Object> variables)
- Specified by:
start
in interfacePvmProcessInstance
- Overrides:
start
in classPvmExecutionImpl
-
getProcessInstance
public ExecutionImpl getProcessInstance()
ensures initialization and returns the process instance.- Specified by:
getProcessInstance
in interfaceDelegateExecution
- Specified by:
getProcessInstance
in classPvmExecutionImpl
-
getProcessInstanceId
public String getProcessInstanceId()
Description copied from interface:DelegateExecution
Reference to the overall process instance- Specified by:
getProcessInstanceId
in interfaceDelegateExecution
-
getBusinessKey
public 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(String businessKey)
- Overrides:
setBusinessKey
in classCoreExecution
-
getProcessBusinessKey
public 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 String generateActivityInstanceId(String activityId)
generates an activity instance id- Specified by:
generateActivityInstanceId
in classPvmExecutionImpl
-
toString
public String toString()
- Overrides:
toString
in classPvmExecutionImpl
-
getToStringIdentity
protected String getToStringIdentity()
- Overrides:
getToStringIdentity
in classPvmExecutionImpl
-
getId
public 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 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(List<ExecutionImpl> executions)
-
getCurrentActivityName
public 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
-
-