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  ExecutionImpl replacedBy
           
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, processDefinition, processInstanceStartContext, startContext, transition, transitionBeingTaken
 
Fields inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
businessKey, eventName, eventSource, id, listenerIndex, skipCustomListeners
 
Fields inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
cachedElContext
 
Constructor Summary
ExecutionImpl()
           
ExecutionImpl(ActivityImpl startActivity)
           
 
Method Summary
 ExecutionImpl createExecution(boolean initializeExecutionStartContext)
          creates a new execution.
 PvmExecutionImpl createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey)
           
 PvmExecutionImpl createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId)
           
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
 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
 PvmExecutionImpl getReplacedBy()
           
 ExecutionImpl getSubProcessInstance()
           
 CaseExecutionImpl getSuperCaseExecution()
           
 ExecutionImpl getSuperExecution()
           
protected  String getToStringIdentity()
           
protected  CoreVariableStore getVariableStore()
           
 void initialize()
           
 void interruptScope(String reason)
          Called when an execution is interrupted.
protected  ExecutionImpl newExecution()
          instantiates a new execution.
 void setBusinessKey(String businessKey)
           
 void setExecutions(List<ExecutionImpl> executions)
           
 void setParent(PvmExecutionImpl parent)
          all updates need to go through this setter as subclasses can override this method
 void setProcessInstance(PvmExecutionImpl processInstance)
          for setting the process instance, this setter must be used as subclasses can override
 void setReplacedBy(PvmExecutionImpl replacedBy)
           
 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
allExecutionsInSameActivity, cancelScope, collectActiveActivityIds, createExecution, createSubProcessInstance, deleteCascade, deleteCascade, deleteCascade2, destroy, disposeExecutionStartContext, disposeProcessInstanceStartContext, end, endCompensation, enterActivityInstance, executeActivity, findActiveActivityIds, findExecution, findInactiveConcurrentExecutions, forceUpdateActivityInstance, getActivity, getActivityId, getActivityInstanceId, getActivityInstanceState, getAllChildExecutions, getCaseInstanceId, getCurrentActivityId, getCurrentTransitionId, getDeleteReason, getExecutionStartContext, getNextActivity, getParentActivityInstanceId, getParentId, getParentVariableScope, getProcessDefinition, getProcessInstanceStartContext, getScopeActivity, getTransition, getTransitionBeingTaken, getVariableScopeKey, hasConcurrentSiblings, inactivate, isActive, isActive, isCanceled, isCompleteScope, isConcurrent, isDeleteRoot, isEnded, isEventScope, isProcessInstanceExecution, isScope, leaveActivityInstance, remove, removeEventScopes, replace, setActive, setActivity, setActivityInstanceId, setCanceled, setCaseInstanceId, setCompleteScope, setConcurrent, setDeleteReason, setEventScope, setProcessDefinition, setScope, setStartContext, setTransition, setTransitionBeingTaken, signal, start, take, takeAll
 
Methods inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
getEventName, getEventSource, getListenerIndex, invokeListener, isSkipCustomListeners, performOperation, performOperationSync, setEventName, setEventSource, setId, setListenerIndex, setSkipCustomListeners
 
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, 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
cancelScope, createExecution, createSubProcessInstance, end, endCompensation, enterActivityInstance, executeActivity, findInactiveConcurrentExecutions, getActivity, getActivityInstanceId, getNextActivity, getParentActivityInstanceId, inactivate, isActive, isCanceled, isCompleteScope, isConcurrent, isEnded, isProcessInstanceExecution, isScope, leaveActivityInstance, remove, setActive, setActivity, setActivityInstanceId, setConcurrent, setScope, signal, take, takeAll
 
Methods inherited from interface org.camunda.bpm.engine.delegate.DelegateExecution
getCurrentActivityId, getCurrentTransitionId, getParentId
 
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, 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


replacedBy

protected ExecutionImpl replacedBy

variableStore

protected SimpleVariableStore variableStore
Constructor Detail

ExecutionImpl

public ExecutionImpl()

ExecutionImpl

public ExecutionImpl(ActivityImpl startActivity)
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


createSubProcessInstance

public PvmExecutionImpl createSubProcessInstance(PvmProcessDefinition processDefinition,
                                                 String businessKey)
Specified by:
createSubProcessInstance in interface ActivityExecution
Specified by:
createSubProcessInstance in class PvmExecutionImpl
Parameters:
processDefinition - The PvmProcessDefinition of the subprocess.
businessKey - the business key of the process instance
See Also:
ActivityExecution.createSubProcessInstance(PvmProcessDefinition)

createSubProcessInstance

public PvmExecutionImpl createSubProcessInstance(PvmProcessDefinition processDefinition,
                                                 String businessKey,
                                                 String caseInstanceId)
Specified by:
createSubProcessInstance in interface ActivityExecution
Specified by:
createSubProcessInstance in class PvmExecutionImpl
Parameters:
processDefinition - The PvmProcessDefinition of the subprocess.
businessKey - the business key of the process instance
caseInstanceId - the case instance id of the process instance
See Also:
ActivityExecution.createSubProcessInstance(PvmProcessDefinition)

initialize

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

interruptScope

public void interruptScope(String reason)
Description copied from interface: ActivityExecution
Called when an execution is interrupted. This will remove all associated entities such as event subscriptions, jobs, ...

Specified by:
interruptScope in interface ActivityExecution

getParent

public ExecutionImpl getParent()
ensures initialization and returns the parent

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

setParent

public void setParent(PvmExecutionImpl parent)
all updates need to go through this setter as subclasses can override this method

Specified by:
setParent 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()
Specified by:
getSuperExecution in class PvmExecutionImpl

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

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 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 PvmExecutionImpl getReplacedBy()
Specified by:
getReplacedBy in class PvmExecutionImpl

setReplacedBy

public void setReplacedBy(PvmExecutionImpl replacedBy)
Overrides:
setReplacedBy 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.


Copyright © 2014 camunda services GmbH. All rights reserved.