org.camunda.bpm.engine.impl.pvm.runtime
Class ExecutionImpl

java.lang.Object
  extended by org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
      extended by org.camunda.bpm.engine.impl.core.instance.CoreExecution
          extended by org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl
              extended by 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
protected  List<ExecutionImpl> executions
          nested executions representing scopes or concurrent paths
protected  ExecutionImpl parent
          the parent execution
protected  ExecutionImpl processInstance
          the process instance.
protected  CaseExecutionImpl subCaseInstance
          reference to a subcaseinstance, not-null if currently subcase is started from this execution
protected  ExecutionImpl subProcessInstance
          reference to a subprocessinstance, not-null if currently subprocess is started from this execution
protected  CaseExecutionImpl superCaseExecution
          super case execution, not-null if this execution is part of a case execution
protected  ExecutionImpl superExecution
          super execution, not-null if this execution is part of a subprocess
protected  SimpleVariableStore variableStore
           
 
Fields inherited from class org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl
activity, activityInstanceId, activityInstanceState, caseInstanceId, deleteReason, deleteRoot, isActive, isConcurrent, isEnded, isEventScope, isScope, nextActivity, preserveScope, processDefinition, replacedBy, sequenceCounter, startContext, transition, transitionsToTake
 
Fields inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
businessKey, eventName, eventSource, id, listenerIndex, skipCustomListeners, skipIoMapping
 
Fields inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
cachedElContext
 
Constructor Summary
ExecutionImpl()
           
 
Method Summary
 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 id
 org.camunda.bpm.model.bpmn.instance.FlowElement getBpmnModelElementInstance()
          Returns the currently executed Element in the BPMN Model.
 org.camunda.bpm.model.bpmn.BpmnModelInstance getBpmnModelInstance()
          Returns the BpmnModelInstance for the currently executed Bpmn Model
 String getBusinessKey()
          The business key for this execution.
 String getCurrentActivityName()
          Gets the name of the current activity.
 List<ExecutionImpl> getExecutions()
          ensures initialization and returns the non-null executions list
 List<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 parent
 String 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.
 ProcessEngineServices getProcessEngineServices()
          Returns the ProcessEngineServices 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 instance
 ExecutionImpl 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  CoreVariableStore getVariableStore()
           
 void initialize()
           
 void initializeTimerDeclarations()
           
protected  ExecutionImpl newExecution()
          instantiates a new execution.
 void setBusinessKey(String businessKey)
           
 void setExecutions(List<ExecutionImpl> executions)
           
 void setParentExecution(PvmExecutionImpl parent)
          Use #setParent to also update the child execution sets
 void setProcessInstance(PvmExecutionImpl processInstance)
          for setting the process instance, this setter must be used as subclasses can override
 void 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
clearScope, collectActiveActivityIds, collectExecutions, createActivityExecutionMapping, createActivityExecutionMapping, createActivityExecutionMapping, createConcurrentExecution, createExecution, createSubProcessInstance, createSubProcessInstance, createSubProcessInstance, deleteCascade, deleteCascade, deleteCascade, deleteCascade2, destroy, disposeExecutionStartContext, disposeProcessInstanceStartContext, end, endCompensation, enterActivityInstance, executeActivities, executeActivitiesConcurrent, executeActivity, executeEventHandlerActivity, executeIoMapping, findActiveActivityIds, findExecution, findExecutionForFlowScope, findExecutionForScope, findExecutions, findInactiveConcurrentExecutions, forceUpdateActivityInstance, getActivity, getActivityId, getActivityInstanceId, getActivityInstanceState, getAllChildExecutions, getCaseInstanceId, getCurrentActivityId, getCurrentTransitionId, getDeleteReason, getEventScopeExecutions, getExecutionStartContext, getFlowScope, getFlowScopeExecution, getNextActivity, getNonEventScopeExecutions, getParentActivityInstanceId, getParentId, getParentScopeExecution, getParentVariableScope, getProcessDefinition, getProcessInstanceStartContext, getScopeActivity, getSequenceCounter, getTransition, getTransitionsToTake, getVariableScopeKey, hasChildren, hasProcessInstanceStartContext, hasReplacedParent, inactivate, incrementSequenceCounter, interrupt, interrupt, isActive, isActive, isCanceled, isCompleteScope, isConcurrent, isDeleteRoot, isEnded, isEventScope, isPreserveScope, isProcessInstanceExecution, isReplacedByParent, isScope, leaveActivityInstance, leaveActivityViaTransition, leaveActivityViaTransitions, propagateEnd, remove, removeEventScopes, replace, setActive, setActivity, setActivityInstanceId, setCanceled, setCaseInstanceId, setCompleteScope, setConcurrent, setDeleteReason, setEnded, setEventScope, setNextActivity, setParent, setPreserveScope, setProcessDefinition, setScope, setSequenceCounter, setStartContext, setTransition, setTransitionsToTake, signal, start, startWithoutExecuting, take, tryPruneLastConcurrentChild
 
Methods inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
getEventName, getEventSource, getListenerIndex, invokeListener, isSkipCustomListeners, isSkipIoMappings, performOperation, performOperationSync, setEventName, setEventSource, setId, setListenerIndex, setSkipCustomListeners, setSkipIoMappings
 
Methods inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
collectVariableNames, collectVariables, dispatchEvent, getCachedElContext, getSourceActivityVariableScope, getValueFromVariableInstance, getVariable, getVariable, getVariableInstance, getVariableInstanceLocal, getVariableInstancesLocal, getVariableLocal, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, removeVariable, removeVariable, removeVariableLocal, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setCachedElContext, setVariable, setVariable, setVariableLocal, setVariableLocal, setVariableLocalTransient, setVariables, 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, findInactiveConcurrentExecutions, getActivity, getActivityInstanceId, getNextActivity, 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.DelegateExecution
getCurrentActivityId, getCurrentTransitionId, getParentId, isCanceled
 
Methods inherited from interface org.camunda.bpm.engine.delegate.BaseDelegateExecution
getEventName
 
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
 
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.impl.pvm.PvmExecution
getActivity, getVariable, getVariables, hasVariable, setVariable, signal
 

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 SimpleVariableStore variableStore
Constructor Detail

ExecutionImpl

public ExecutionImpl()
Method Detail

createExecution

public ExecutionImpl createExecution(boolean initializeExecutionStartContext)
creates a new execution. properties processDefinition, processInstance and activity will be initialized.

Specified by:
createExecution in interface ActivityExecution
Specified by:
createExecution in class PvmExecutionImpl

newExecution

protected ExecutionImpl newExecution()
instantiates a new execution. can be overridden by subclasses

Specified by:
newExecution in class PvmExecutionImpl

initialize

public void initialize()
Specified by:
initialize in class PvmExecutionImpl

initializeTimerDeclarations

public void initializeTimerDeclarations()
Specified by:
initializeTimerDeclarations in class PvmExecutionImpl

getParent

public ExecutionImpl getParent()
ensures initialization and returns the parent

Specified by:
getParent in interface ActivityExecution
Specified by:
getParent in class PvmExecutionImpl

setParentExecution

public void setParentExecution(PvmExecutionImpl parent)
Description copied from class: PvmExecutionImpl
Use #setParent to also update the child execution sets

Specified by:
setParentExecution in class PvmExecutionImpl

getExecutionsAsCopy

public List<ExecutionImpl> getExecutionsAsCopy()
Specified by:
getExecutionsAsCopy in class PvmExecutionImpl

getExecutions

public List<ExecutionImpl> getExecutions()
ensures initialization and returns the non-null executions list

Specified by:
getExecutions in interface ActivityExecution
Specified by:
getExecutions in class PvmExecutionImpl

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 interface DelegateExecution
Specified by:
getSuperExecution in class PvmExecutionImpl
Returns:
the super execution or null.

setSuperExecution

public void setSuperExecution(PvmExecutionImpl superExecution)
Specified by:
setSuperExecution in class PvmExecutionImpl

getSubProcessInstance

public ExecutionImpl getSubProcessInstance()
Specified by:
getSubProcessInstance in class PvmExecutionImpl

setSubProcessInstance

public void setSubProcessInstance(PvmExecutionImpl subProcessInstance)
Specified by:
setSubProcessInstance in class PvmExecutionImpl

getSuperCaseExecution

public CaseExecutionImpl getSuperCaseExecution()
Specified by:
getSuperCaseExecution in class PvmExecutionImpl

setSuperCaseExecution

public void setSuperCaseExecution(CmmnExecution superCaseExecution)
Specified by:
setSuperCaseExecution in class PvmExecutionImpl

getSubCaseInstance

public CaseExecutionImpl getSubCaseInstance()
Specified by:
getSubCaseInstance in class PvmExecutionImpl

setSubCaseInstance

public void setSubCaseInstance(CmmnExecution subCaseInstance)
Specified by:
setSubCaseInstance in class PvmExecutionImpl

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 interface ActivityExecution
Specified by:
createSubCaseInstance in class PvmExecutionImpl
Parameters:
caseDefinition - The CmmnCaseDefinition 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 interface ActivityExecution
Specified by:
createSubCaseInstance in class PvmExecutionImpl
Parameters:
caseDefinition - The CmmnCaseDefinition 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 interface DelegateExecution

start

public void start(Map<String,Object> variables)
Specified by:
start in interface PvmProcessInstance
Overrides:
start in class PvmExecutionImpl

getProcessInstance

public ExecutionImpl getProcessInstance()
ensures initialization and returns the process instance.

Specified by:
getProcessInstance in interface DelegateExecution
Specified by:
getProcessInstance in class PvmExecutionImpl

getProcessInstanceId

public String getProcessInstanceId()
Description copied from interface: DelegateExecution
Reference to the overall process instance

Specified by:
getProcessInstanceId in interface DelegateExecution

getBusinessKey

public String getBusinessKey()
Description copied from interface: BaseDelegateExecution
The business key for this execution. Only returns a value if the delegate execution is a a root execution (such as a process instance).

Specified by:
getBusinessKey in interface BaseDelegateExecution
Overrides:
getBusinessKey in class CoreExecution

setBusinessKey

public void setBusinessKey(String businessKey)
Overrides:
setBusinessKey in class CoreExecution

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 interface DelegateExecution
Overrides:
getProcessBusinessKey in class PvmExecutionImpl

setProcessInstance

public void setProcessInstance(PvmExecutionImpl processInstance)
for setting the process instance, this setter must be used as subclasses can override

Specified by:
setProcessInstance in class PvmExecutionImpl

generateActivityInstanceId

protected String generateActivityInstanceId(String activityId)
generates an activity instance id

Specified by:
generateActivityInstanceId in class PvmExecutionImpl

toString

public String toString()
Overrides:
toString in class PvmExecutionImpl

getToStringIdentity

protected String getToStringIdentity()
Overrides:
getToStringIdentity in class PvmExecutionImpl

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 interface BaseDelegateExecution
Overrides:
getId in class CoreExecution

getVariableStore

protected CoreVariableStore getVariableStore()
Specified by:
getVariableStore in class AbstractVariableScope

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 class PvmExecutionImpl

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 interface DelegateExecution
Overrides:
getCurrentActivityName in class PvmExecutionImpl

getBpmnModelElementInstance

public org.camunda.bpm.model.bpmn.instance.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 corresponding FlowNode for ExecutionListener.EVENTNAME_START and ExecutionListener.EVENTNAME_END and the corresponding SequenceFlow for ExecutionListener.EVENTNAME_TAKE.

Specified by:
getBpmnModelElementInstance in interface BpmnModelExecutionContext
Returns:
the FlowElement corresponding to the current Bpmn Model Element

getBpmnModelInstance

public org.camunda.bpm.model.bpmn.BpmnModelInstance getBpmnModelInstance()
Description copied from interface: BpmnModelExecutionContext
Returns the BpmnModelInstance for the currently executed Bpmn Model

Specified by:
getBpmnModelInstance in interface BpmnModelExecutionContext
Returns:
the current BpmnModelInstance

getProcessEngineServices

public ProcessEngineServices getProcessEngineServices()
Description copied from interface: ProcessEngineServicesAware
Returns the ProcessEngineServices providing access to the public API of the process engine.

Specified by:
getProcessEngineServices in interface ProcessEngineServicesAware
Returns:
the ProcessEngineServices.

forceUpdate

public void forceUpdate()
Specified by:
forceUpdate in interface ActivityExecution

fireHistoricProcessStartEvent

public void fireHistoricProcessStartEvent()
Specified by:
fireHistoricProcessStartEvent in class PvmExecutionImpl


Copyright © 2015 camunda services GmbH. All rights reserved.