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>executionsnested executions representing scopes or concurrent pathsprotected ExecutionImplparentthe parent executionprotected ExecutionImplprocessInstancethe process instance.protected CaseExecutionImplsubCaseInstancereference to a subcaseinstance, not-null if currently subcase is started from this executionprotected ExecutionImplsubProcessInstancereference to a subprocessinstance, not-null if currently subprocess is started from this executionprotected CaseExecutionImplsuperCaseExecutionsuper case execution, not-null if this execution is part of a case executionprotected ExecutionImplsuperExecutionsuper 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 ExecutionImplcreateExecution()creates a new execution.CaseExecutionImplcreateSubCaseInstance(CmmnCaseDefinition caseDefinition)Creates a new sub case instance.CaseExecutionImplcreateSubCaseInstance(CmmnCaseDefinition caseDefinition, java.lang.String businessKey)Creates a new sub case instance.voidfireHistoricProcessStartEvent()voidforceUpdate()protected java.lang.StringgenerateActivityInstanceId(java.lang.String activityId)generates an activity instance idFlowElementgetBpmnModelElementInstance()Returns the currently executed Element in the BPMN Model.BpmnModelInstancegetBpmnModelInstance()Returns theBpmnModelInstancefor the currently executed Bpmn Modeljava.lang.StringgetBusinessKey()The business key for the root execution (e.g.java.lang.StringgetCurrentActivityName()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.StringgetId()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.ExecutionImplgetParent()ensures initialization and returns the parentjava.lang.StringgetProcessBusinessKey()The business key for the process instance this execution is associated with.java.lang.StringgetProcessDefinitionId()The process definition key for the process instance this execution is associated with.ProcessEnginegetProcessEngine()Returns theProcessEngineproviding access to the public API of the process engine.ProcessEngineServicesgetProcessEngineServices()Returns theProcessEngineServicesproviding access to the public API of the process engine.ExecutionImplgetProcessInstance()ensures initialization and returns the process instance.java.lang.StringgetProcessInstanceId()Reference to the overall process instanceExecutionImplgetReplacedBy()Returns an execution that has replaced this execution for executing activities in their shared scope.CaseExecutionImplgetSubCaseInstance()ExecutionImplgetSubProcessInstance()CaseExecutionImplgetSuperCaseExecution()ExecutionImplgetSuperExecution()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.StringgetToStringIdentity()protected VariableInstanceFactory<CoreVariableInstance>getVariableInstanceFactory()protected java.util.List<VariableInstanceLifecycleListener<CoreVariableInstance>>getVariableInstanceLifecycleListeners()protected VariableStore<CoreVariableInstance>getVariableStore()voidinitialize()voidinitializeTimerDeclarations()protected ExecutionImplnewExecution()instantiates a new execution.protected voidremoveVariablesLocalInternal()voidsetBusinessKey(java.lang.String businessKey)voidsetExecutions(java.util.List<ExecutionImpl> executions)voidsetParentExecution(PvmExecutionImpl parent)Use #setParent to also update the child execution setsvoidsetProcessInstance(PvmExecutionImpl processInstance)for setting the process instance, this setter must be used as subclasses can overridevoidsetSubCaseInstance(CmmnExecution subCaseInstance)voidsetSubProcessInstance(PvmExecutionImpl subProcessInstance)voidsetSuperCaseExecution(CmmnExecution superCaseExecution)voidsetSuperExecution(PvmExecutionImpl superExecution)java.lang.StringtoString()-
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:
createExecutionin interfaceActivityExecution- Specified by:
createExecutionin classPvmExecutionImpl
-
newExecution
protected ExecutionImpl newExecution()
instantiates a new execution. can be overridden by subclasses- Specified by:
newExecutionin classPvmExecutionImpl
-
initialize
public void initialize()
- Specified by:
initializein classPvmExecutionImpl
-
initializeTimerDeclarations
public void initializeTimerDeclarations()
- Specified by:
initializeTimerDeclarationsin classPvmExecutionImpl
-
getParent
public ExecutionImpl getParent()
ensures initialization and returns the parent- Specified by:
getParentin interfaceActivityExecution- Specified by:
getParentin classPvmExecutionImpl
-
setParentExecution
public void setParentExecution(PvmExecutionImpl parent)
Description copied from class:PvmExecutionImplUse #setParent to also update the child execution sets- Specified by:
setParentExecutionin classPvmExecutionImpl
-
getExecutionsAsCopy
public java.util.List<ExecutionImpl> getExecutionsAsCopy()
- Specified by:
getExecutionsAsCopyin classPvmExecutionImpl
-
getExecutions
public java.util.List<ExecutionImpl> getExecutions()
ensures initialization and returns the non-null executions list- Specified by:
getExecutionsin interfaceActivityExecution- Specified by:
getExecutionsin classPvmExecutionImpl
-
getSuperExecution
public ExecutionImpl 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- Specified by:
getSuperExecutionin classPvmExecutionImpl- Returns:
- the super execution or null.
-
setSuperExecution
public void setSuperExecution(PvmExecutionImpl superExecution)
- Specified by:
setSuperExecutionin classPvmExecutionImpl
-
getSubProcessInstance
public ExecutionImpl getSubProcessInstance()
- Specified by:
getSubProcessInstancein classPvmExecutionImpl
-
setSubProcessInstance
public void setSubProcessInstance(PvmExecutionImpl subProcessInstance)
- Specified by:
setSubProcessInstancein classPvmExecutionImpl
-
getSuperCaseExecution
public CaseExecutionImpl getSuperCaseExecution()
- Specified by:
getSuperCaseExecutionin classPvmExecutionImpl
-
setSuperCaseExecution
public void setSuperCaseExecution(CmmnExecution superCaseExecution)
- Specified by:
setSuperCaseExecutionin classPvmExecutionImpl
-
getSubCaseInstance
public CaseExecutionImpl getSubCaseInstance()
- Specified by:
getSubCaseInstancein classPvmExecutionImpl
-
setSubCaseInstance
public void setSubCaseInstance(CmmnExecution subCaseInstance)
- Specified by:
setSubCaseInstancein classPvmExecutionImpl
-
createSubCaseInstance
public CaseExecutionImpl createSubCaseInstance(CmmnCaseDefinition caseDefinition)
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- Specified by:
createSubCaseInstancein classPvmExecutionImpl- Parameters:
caseDefinition- TheCmmnCaseDefinitionof the sub case instance.
-
createSubCaseInstance
public CaseExecutionImpl createSubCaseInstance(CmmnCaseDefinition caseDefinition, java.lang.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- Specified by:
createSubCaseInstancein classPvmExecutionImpl- Parameters:
caseDefinition- TheCmmnCaseDefinitionof the sub case instance.businessKey- The businessKey to be set on sub case instance.
-
getProcessDefinitionId
public java.lang.String getProcessDefinitionId()
Description copied from interface:DelegateExecutionThe process definition key for the process instance this execution is associated with.- Specified by:
getProcessDefinitionIdin interfaceDelegateExecution
-
getProcessInstance
public ExecutionImpl getProcessInstance()
ensures initialization and returns the process instance.- Specified by:
getProcessInstancein interfaceDelegateExecution- Specified by:
getProcessInstancein classPvmExecutionImpl
-
getProcessInstanceId
public java.lang.String getProcessInstanceId()
Description copied from interface:DelegateExecutionReference to the overall process instance- Specified by:
getProcessInstanceIdin interfaceDelegateExecution
-
getBusinessKey
public java.lang.String getBusinessKey()
Description copied from interface:BaseDelegateExecutionThe business key for the root execution (e.g. process instance).- Specified by:
getBusinessKeyin interfaceBaseDelegateExecution- Overrides:
getBusinessKeyin classPvmExecutionImpl
-
setBusinessKey
public void setBusinessKey(java.lang.String businessKey)
- Overrides:
setBusinessKeyin classCoreExecution
-
getProcessBusinessKey
public java.lang.String getProcessBusinessKey()
Description copied from interface:DelegateExecutionThe business key for the process instance this execution is associated with.- Specified by:
getProcessBusinessKeyin interfaceDelegateExecution- Overrides:
getProcessBusinessKeyin classPvmExecutionImpl
-
setProcessInstance
public void setProcessInstance(PvmExecutionImpl processInstance)
for setting the process instance, this setter must be used as subclasses can override- Specified by:
setProcessInstancein classPvmExecutionImpl
-
generateActivityInstanceId
protected java.lang.String generateActivityInstanceId(java.lang.String activityId)
generates an activity instance id- Specified by:
generateActivityInstanceIdin classPvmExecutionImpl
-
toString
public java.lang.String toString()
- Overrides:
toStringin classPvmExecutionImpl
-
getToStringIdentity
protected java.lang.String getToStringIdentity()
- Overrides:
getToStringIdentityin classPvmExecutionImpl
-
getId
public java.lang.String getId()
Description copied from interface:BaseDelegateExecutionUnique 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:
getIdin interfaceBaseDelegateExecution- Overrides:
getIdin classCoreExecution
-
getVariableStore
protected VariableStore<CoreVariableInstance> getVariableStore()
- Specified by:
getVariableStorein classAbstractVariableScope
-
getVariableInstanceFactory
protected VariableInstanceFactory<CoreVariableInstance> getVariableInstanceFactory()
- Specified by:
getVariableInstanceFactoryin classAbstractVariableScope
-
getVariableInstanceLifecycleListeners
protected java.util.List<VariableInstanceLifecycleListener<CoreVariableInstance>> getVariableInstanceLifecycleListeners()
- Specified by:
getVariableInstanceLifecycleListenersin classAbstractVariableScope
-
getReplacedBy
public ExecutionImpl getReplacedBy()
Description copied from class:PvmExecutionImplReturns 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:
getReplacedByin classPvmExecutionImpl
-
setExecutions
public void setExecutions(java.util.List<ExecutionImpl> executions)
-
getCurrentActivityName
public java.lang.String getCurrentActivityName()
Description copied from interface:DelegateExecutionGets the name of the current activity.- Specified by:
getCurrentActivityNamein interfaceDelegateExecution- Overrides:
getCurrentActivityNamein classPvmExecutionImpl
-
getBpmnModelElementInstance
public FlowElement getBpmnModelElementInstance()
Description copied from interface:BpmnModelExecutionContextReturns the currently executed Element in the BPMN Model. This method returns a
FlowElementwhich 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 correspondingFlowNodeforExecutionListener.EVENTNAME_STARTandExecutionListener.EVENTNAME_ENDand the correspondingSequenceFlowforExecutionListener.EVENTNAME_TAKE.- Specified by:
getBpmnModelElementInstancein interfaceBpmnModelExecutionContext- Returns:
- the
FlowElementcorresponding to the current Bpmn Model Element
-
getBpmnModelInstance
public BpmnModelInstance getBpmnModelInstance()
Description copied from interface:BpmnModelExecutionContextReturns theBpmnModelInstancefor the currently executed Bpmn Model- Specified by:
getBpmnModelInstancein interfaceBpmnModelExecutionContext- Returns:
- the current
BpmnModelInstance
-
getProcessEngineServices
public ProcessEngineServices getProcessEngineServices()
Description copied from interface:ProcessEngineServicesAwareReturns theProcessEngineServicesproviding access to the public API of the process engine.- Specified by:
getProcessEngineServicesin interfaceProcessEngineServicesAware- Returns:
- the
ProcessEngineServices.
-
getProcessEngine
public ProcessEngine getProcessEngine()
Description copied from interface:ProcessEngineServicesAwareReturns theProcessEngineproviding access to the public API of the process engine.- Specified by:
getProcessEnginein interfaceProcessEngineServicesAware- Returns:
- the
ProcessEngine.
-
forceUpdate
public void forceUpdate()
- Specified by:
forceUpdatein interfaceActivityExecution
-
fireHistoricProcessStartEvent
public void fireHistoricProcessStartEvent()
- Specified by:
fireHistoricProcessStartEventin classPvmExecutionImpl
-
removeVariablesLocalInternal
protected void removeVariablesLocalInternal()
- Specified by:
removeVariablesLocalInternalin classPvmExecutionImpl
-
-