org.camunda.bpm.engine.impl.persistence.entity
Class ExecutionEntity

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.persistence.entity.ExecutionEntity
All Implemented Interfaces:
Serializable, BaseDelegateExecution, BpmnModelExecutionContext, DelegateExecution, ProcessEngineServicesAware, VariableScope, VariableEventDispatcher, DbEntity, HasDbReferences, HasDbRevision, ActivityExecution, PvmExecution, PvmProcessInstance, Execution, ProcessInstance

public class ExecutionEntity
extends PvmExecutionImpl
implements Execution, ProcessInstance, DbEntity, HasDbRevision, HasDbReferences

Author:
Tom Baeyens, Daniel Meyer, Falko Menge
See Also:
Serialized Form

Field Summary
protected  String activityId
          persisted reference to the current position in the diagram within the PvmExecutionImpl.processDefinition.
protected  String activityName
          The name of the current activity position
protected  int cachedEntityState
           
static int EVENT_SUBSCRIPTIONS_STATE_BIT
           
protected  List<EventSubscriptionEntity> eventSubscriptions
           
protected  List<ExecutionEntity> executions
          nested executions representing scopes or concurrent paths
static int INCIDENT_STATE_BIT
           
protected  List<IncidentEntity> incidents
           
protected  List<JobEntity> jobs
           
static int JOBS_STATE_BIT
           
protected  ExecutionEntity parent
          the parent execution
protected  String parentId
          persisted reference to the parent of this execution.
protected  String processDefinitionId
          persisted reference to the processDefinition.
protected  ExecutionEntity processInstance
          the process instance.
protected  String processInstanceId
          persisted reference to the process instance.
protected  ExecutionEntity replacedBy
          when execution structure is pruned during a takeAll, then the original execution has to be resolved to the replaced execution.
protected  int revision
           
protected  boolean shouldQueryForSubCaseInstance
           
protected  boolean shouldQueryForSubprocessInstance
           
static int SUB_CASE_INSTANCE_STATE_BIT
           
static int SUB_PROCESS_INSTANCE_STATE_BIT
           
protected  CaseExecutionEntity subCaseInstance
          reference to a subcaseinstance, not-null if currently subcase is started from this execution
protected  ExecutionEntity subProcessInstance
          reference to a subprocessinstance, not-null if currently subprocess is started from this execution
protected  CaseExecutionEntity superCaseExecution
          super case execution, not-null if this execution is part of a case execution
protected  String superCaseExecutionId
          persisted reference to the super case execution of this execution
protected  ExecutionEntity superExecution
          super execution, not-null if this execution is part of a subprocess
protected  String superExecutionId
          persisted reference to the super execution of this execution
protected  int suspensionState
           
protected  List<TaskEntity> tasks
           
static int TASKS_STATE_BIT
           
static int VARIABLES_STATE_BIT
           
protected  ExecutionEntityVariableStore 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, 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
ExecutionEntity()
           
 
Method Summary
 void addEventSubscription(EventSubscriptionEntity eventSubscriptionEntity)
           
 void addIncident(IncidentEntity incident)
           
 void addJob(JobEntity jobEntity)
           
 void addTask(TaskEntity taskEntity)
           
protected  void clearExecution()
           
 ExecutionEntity createExecution()
          creates a new execution.
 ExecutionEntity createExecution(boolean initializeExecutionStartContext)
          creates a new execution.
protected static ExecutionEntity createNewExecution()
           
 CaseExecutionEntity createSubCaseInstance(CmmnCaseDefinition caseDefinition)
          Creates a new sub case instance.
 CaseExecutionEntity createSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey)
          Creates a new sub case instance.
 ExecutionEntity createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId)
           
 void deleteCascade2(String deleteReason)
           
 void destroy()
          Method used for destroying a scope in a way that the execution can be removed afterwards.
protected  void ensureActivityInitialized()
          must be called before the activity member field or getActivity() is called
protected  void ensureEventSubscriptionsInitialized()
           
protected  void ensureExecutionsInitialized()
           
protected  void ensureExecutionTreeInitialized()
          Fetch all the executions inside the same process instance as list and then reconstruct the complete execution tree.
protected  void ensureIncidentsInitialized()
           
protected  void ensureJobsInitialized()
           
protected  void ensureNotSuspended()
           
protected  void ensureParentInitialized()
           
protected  void ensureProcessDefinitionInitialized()
          for setting the process definition, this setter must be used as subclasses can override
protected  void ensureProcessInstanceInitialized()
           
protected  void ensureSubCaseInstanceInitialized()
           
protected  void ensureSubProcessInstanceInitialized()
           
protected  void ensureSuperCaseExecutionInitialized()
           
protected  void ensureSuperExecutionInitialized()
           
protected  void ensureTasksInitialized()
           
 void fireHistoricActivityInstanceUpdate()
           
 void fireHistoricProcessStartEvent()
           
 void fireHistoricVariableInstanceCreateEvents()
           
 void forceUpdate()
           
protected  String generateActivityInstanceId(String activityId)
          generates an activity instance id
 ActivityImpl getActivity()
          ensures initialization and returns the activity
 String getActivityId()
           
 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
 int getCachedEntityState()
           
 int getCachedEntityStateRaw()
           
 List<CompensateEventSubscriptionEntity> getCompensateEventSubscriptions()
           
 List<CompensateEventSubscriptionEntity> getCompensateEventSubscriptions(String activityId)
           
 String getCurrentActivityId()
          Gets the id of the current activity.
 String getCurrentActivityName()
          Gets the name of the current activity.
 List<EventSubscriptionEntity> getEventSubscriptions()
           
 List<EventSubscriptionEntity> getEventSubscriptionsInternal()
           
 List<ExecutionEntity> getExecutions()
          ensures initialization and returns the non-null executions list
 IncidentEntity getIncidentByCauseIncidentId(String causeIncidentId)
           
 List<IncidentEntity> getIncidents()
           
protected  List<IncidentEntity> getIncidentsInternal()
           
 List<JobEntity> getJobs()
           
protected  List<JobEntity> getJobsInternal()
           
 ExecutionEntity getParent()
          ensures initialization and returns the parent
 String getParentId()
          Gets the id of the parent of this execution.
 Object getPersistentState()
          Returns a representation of the object, as would be stored in the database.
 String getProcessBusinessKey()
          The business key for the process instance this execution is associated with.
 ProcessDefinitionImpl getProcessDefinition()
          ensures initialization and returns the process definition.
 String getProcessDefinitionId()
          The id of the process definition of the process instance.
 ProcessEngineServices getProcessEngineServices()
          Returns the ProcessEngineServices providing access to the public API of the process engine.
 ExecutionEntity getProcessInstance()
          ensures initialization and returns the process instance.
 String getProcessInstanceId()
          Id of the root of the execution tree representing the process instance.
 ProcessInstanceStartContext getProcessInstanceStartContext()
           
 ExecutionEntity getReplacedBy()
           
 int getRevision()
           
 int getRevisionNext()
           
 CaseExecutionEntity getSubCaseInstance()
           
 ExecutionEntity getSubProcessInstance()
           
 CaseExecutionEntity getSuperCaseExecution()
           
 String getSuperCaseExecutionId()
           
 ExecutionEntity 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.
 String getSuperExecutionId()
           
 int getSuspensionState()
           
 List<TaskEntity> getTasks()
           
protected  List<TaskEntity> getTasksInternal()
           
protected  String getToStringIdentity()
           
protected  CoreVariableStore getVariableStore()
           
 boolean hasReferenceTo(DbEntity entity)
           
 void inactivate()
          Inactivates this execution.
 void initialize()
           
protected static void initializeAssociations(ExecutionEntity execution)
           
 void initializeTimerDeclarations()
           
protected  void initializeVariableInstanceBackPointer(VariableInstanceEntity variableInstance)
           
 void insert()
           
 void interrupt(String reason, boolean skipCustomListeners, boolean skipIoMappings)
           
 boolean isActive(String activityId)
           
protected  boolean isAutoFireHistoryEvents()
           
protected  boolean isExecutingScopeLeafActivity()
           
protected  boolean isExecutionTreePrefetchEnabled()
           
 boolean isProcessInstanceExecution()
          returns whether this execution is a process instance or not.
 boolean isSuspended()
          Indicates if the execution is suspended.
protected  List<VariableInstanceEntity> loadVariableInstances()
           
protected  PvmExecutionImpl newExecution()
           
 void performOperation(AtomicOperation executionOperation)
           
<T extends CoreExecution>
void
performOperation(CoreAtomicOperation<T> operation)
           
 void performOperationSync(AtomicOperation executionOperation)
           
<T extends CoreExecution>
void
performOperationSync(CoreAtomicOperation<T> operation)
           
 void remove()
           
protected  void removeActivityJobs(String reason)
           
 void removeEventSubscription(EventSubscriptionEntity eventSubscriptionEntity)
           
 void removeEventSubscriptions()
           
protected  void removeEventSubscriptionsExceptCompensation()
           
 void removeIncident(IncidentEntity incident)
           
 void removeJob(JobEntity job)
           
 void removeTask(TaskEntity task)
           
 void replace(PvmExecutionImpl execution)
           
protected  boolean requiresUnsuspendedExecution(AtomicOperation executionOperation)
           
protected  void scheduleAtomicOperationAsync(AtomicOperation executionOperation)
           
 void setActivity(PvmActivity activity)
           
 void setActivityId(String activityId)
           
 void setCachedEntityState(int cachedEntityState)
           
 void setExecutions(List<ExecutionEntity> executions)
           
 void setParent(PvmExecutionImpl parent)
           
 void setParentId(String parentId)
           
 void setProcessDefinition(ProcessDefinitionImpl processDefinition)
           
 void setProcessDefinitionId(String processDefinitionId)
           
 void setProcessInstance(PvmExecutionImpl processInstance)
           
 void setProcessInstanceId(String processInstanceId)
           
 void setReplacedBy(PvmExecutionImpl replacedBy)
           
 void setRevision(int revision)
           
 void setSubCaseInstance(CmmnExecution subCaseInstance)
           
 void setSubProcessInstance(PvmExecutionImpl subProcessInstance)
           
 void setSuperCaseExecution(CmmnExecution superCaseExecution)
           
 void setSuperCaseExecutionId(String superCaseExecutionId)
           
 void setSuperExecution(PvmExecutionImpl superExecution)
           
 void setSuperExecutionId(String superExecutionId)
           
 void setSuspensionState(int suspensionState)
           
 void startWithFormProperties(VariableMap properties)
           
 String toString()
           
 
Methods inherited from class org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl
allExecutionsInSameActivity, clearScope, collectActiveActivityIds, collectExecutions, createActivityExecutionMapping, createActivityExecutionMapping, createConcurrentExecution, createSubProcessInstance, createSubProcessInstance, deleteCascade, deleteCascade, deleteCascade, disposeExecutionStartContext, disposeProcessInstanceStartContext, end, endCompensation, enterActivityInstance, executeActivities, executeActivitiesConcurrent, executeActivity, executeEventHandlerActivity, executeIoMapping, findActiveActivityIds, findExecution, findExecutionForFlowScope, findExecutionForScope, findExecutions, findInactiveConcurrentExecutions, forceUpdateActivityInstance, getActivityInstanceId, getActivityInstanceState, getAllChildExecutions, getCaseInstanceId, getCurrentTransitionId, getDeleteReason, getEventScopeExecutions, getExecutionStartContext, getFlowScopeExecution, getNextActivity, getNonEventScopeExecutions, getParentActivityInstanceId, getParentScopeExecution, getParentVariableScope, getScopeActivity, getSequenceCounter, getTransition, getTransitionsToTake, getVariableScopeKey, hasConcurrentSiblings, hasProcessInstanceStartContext, incrementSequenceCounter, interrupt, isActive, isCanceled, isCompensationHandler, isCompensationThrowing, isCompleteScope, isConcurrent, isDeleteRoot, isEnded, isEventScope, isPreserveScope, isScope, leaveActivityInstance, leaveActivityViaTransition, leaveActivityViaTransitions, propagateEnd, removeEventScopes, setActive, setActivityInstanceId, setCanceled, setCaseInstanceId, setCompleteScope, setConcurrent, setDeleteReason, setEventScope, setNextActivity, setPreserveScope, setScope, setSequenceCounter, setStartContext, setTransition, setTransitionsToTake, signal, start, start, startWithoutExecuting, take, tryPruneLastConcurrentChild
 
Methods inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
getBusinessKey, getEventName, getEventSource, getId, getListenerIndex, invokeListener, isSkipCustomListeners, isSkipIoMappings, setBusinessKey, 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, 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.runtime.ProcessInstance
getBusinessKey, getCaseInstanceId
 
Methods inherited from interface org.camunda.bpm.engine.runtime.Execution
getId, isEnded
 
Methods inherited from interface org.camunda.bpm.engine.impl.db.DbEntity
getId, setId
 
Methods inherited from interface org.camunda.bpm.engine.delegate.BaseDelegateExecution
getBusinessKey, getEventName, getId
 
Methods inherited from interface org.camunda.bpm.engine.delegate.VariableScope
getVariable, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, 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.PvmExecution
getVariable, getVariables, hasVariable, setVariable
 

Field Detail

EVENT_SUBSCRIPTIONS_STATE_BIT

public static final int EVENT_SUBSCRIPTIONS_STATE_BIT
See Also:
Constant Field Values

TASKS_STATE_BIT

public static final int TASKS_STATE_BIT
See Also:
Constant Field Values

JOBS_STATE_BIT

public static final int JOBS_STATE_BIT
See Also:
Constant Field Values

INCIDENT_STATE_BIT

public static final int INCIDENT_STATE_BIT
See Also:
Constant Field Values

VARIABLES_STATE_BIT

public static final int VARIABLES_STATE_BIT
See Also:
Constant Field Values

SUB_PROCESS_INSTANCE_STATE_BIT

public static final int SUB_PROCESS_INSTANCE_STATE_BIT
See Also:
Constant Field Values

SUB_CASE_INSTANCE_STATE_BIT

public static final int SUB_CASE_INSTANCE_STATE_BIT
See Also:
Constant Field Values

processInstance

protected transient ExecutionEntity processInstance
the process instance. this is the root of the execution tree. the processInstance of a process instance is a self reference.


parent

protected transient ExecutionEntity parent
the parent execution


executions

protected transient List<ExecutionEntity> executions
nested executions representing scopes or concurrent paths


superExecution

protected transient ExecutionEntity superExecution
super execution, not-null if this execution is part of a subprocess


superCaseExecution

protected transient CaseExecutionEntity superCaseExecution
super case execution, not-null if this execution is part of a case execution


subProcessInstance

protected transient ExecutionEntity subProcessInstance
reference to a subprocessinstance, not-null if currently subprocess is started from this execution


subCaseInstance

protected transient CaseExecutionEntity subCaseInstance
reference to a subcaseinstance, not-null if currently subcase is started from this execution


shouldQueryForSubprocessInstance

protected boolean shouldQueryForSubprocessInstance

shouldQueryForSubCaseInstance

protected boolean shouldQueryForSubCaseInstance

eventSubscriptions

protected transient List<EventSubscriptionEntity> eventSubscriptions

jobs

protected transient List<JobEntity> jobs

tasks

protected transient List<TaskEntity> tasks

incidents

protected transient List<IncidentEntity> incidents

cachedEntityState

protected int cachedEntityState

variableStore

protected transient ExecutionEntityVariableStore variableStore

replacedBy

protected transient ExecutionEntity replacedBy
when execution structure is pruned during a takeAll, then the original execution has to be resolved to the replaced execution.

See Also:
#leaveActivityViaTransitions(List, List)} {@link OutgoingExecution}

suspensionState

protected int suspensionState

revision

protected int revision

processDefinitionId

protected String processDefinitionId
persisted reference to the processDefinition.

See Also:
PvmExecutionImpl.processDefinition, setProcessDefinition(ProcessDefinitionImpl), getProcessDefinition()

activityId

protected String activityId
persisted reference to the current position in the diagram within the PvmExecutionImpl.processDefinition.

See Also:
PvmExecutionImpl.activity, getActivity()

activityName

protected String activityName
The name of the current activity position


processInstanceId

protected String processInstanceId
persisted reference to the process instance.

See Also:
getProcessInstance()

parentId

protected String parentId
persisted reference to the parent of this execution.

See Also:
getParent()

superExecutionId

protected String superExecutionId
persisted reference to the super execution of this execution

See Also:
#setSuperExecution(ExecutionEntity)

superCaseExecutionId

protected String superCaseExecutionId
persisted reference to the super case execution of this execution

See Also:
#setSuperCaseExecution(ExecutionEntity)
Constructor Detail

ExecutionEntity

public ExecutionEntity()
Method Detail

createExecution

public ExecutionEntity createExecution()
Description copied from class: PvmExecutionImpl
creates a new execution. properties processDefinition, processInstance and activity will be initialized.

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

createExecution

public ExecutionEntity 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

createSubProcessInstance

public ExecutionEntity createSubProcessInstance(PvmProcessDefinition processDefinition,
                                                String businessKey,
                                                String caseInstanceId)
Specified by:
createSubProcessInstance in interface ActivityExecution
Overrides:
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)

createNewExecution

protected static ExecutionEntity createNewExecution()

newExecution

protected PvmExecutionImpl newExecution()
Specified by:
newExecution in class PvmExecutionImpl

createSubCaseInstance

public CaseExecutionEntity 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 CaseExecutionEntity 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.

fireHistoricActivityInstanceUpdate

public void fireHistoricActivityInstanceUpdate()

initialize

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

initializeTimerDeclarations

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

initializeAssociations

protected static void initializeAssociations(ExecutionEntity execution)

startWithFormProperties

public void startWithFormProperties(VariableMap properties)

fireHistoricProcessStartEvent

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

destroy

public void destroy()
Method used for destroying a scope in a way that the execution can be removed afterwards.

Specified by:
destroy in interface ActivityExecution
Overrides:
destroy in class PvmExecutionImpl

clearExecution

protected void clearExecution()

interrupt

public void interrupt(String reason,
                      boolean skipCustomListeners,
                      boolean skipIoMappings)
Overrides:
interrupt in class PvmExecutionImpl

removeActivityJobs

protected void removeActivityJobs(String reason)

performOperation

public <T extends CoreExecution> void performOperation(CoreAtomicOperation<T> operation)
Overrides:
performOperation in class CoreExecution

performOperationSync

public <T extends CoreExecution> void performOperationSync(CoreAtomicOperation<T> operation)
Overrides:
performOperationSync in class CoreExecution

performOperation

public void performOperation(AtomicOperation executionOperation)

performOperationSync

public void performOperationSync(AtomicOperation executionOperation)

ensureNotSuspended

protected void ensureNotSuspended()

requiresUnsuspendedExecution

protected boolean requiresUnsuspendedExecution(AtomicOperation executionOperation)

scheduleAtomicOperationAsync

protected void scheduleAtomicOperationAsync(AtomicOperation executionOperation)

isActive

public boolean isActive(String activityId)
Overrides:
isActive in class PvmExecutionImpl

inactivate

public void inactivate()
Description copied from interface: ActivityExecution
Inactivates this execution. This is useful for example in a join: the execution still exists, but it is not longer active.

Specified by:
inactivate in interface ActivityExecution
Overrides:
inactivate in class PvmExecutionImpl

getExecutions

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

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

ensureExecutionsInitialized

protected void ensureExecutionsInitialized()

isExecutionTreePrefetchEnabled

protected boolean isExecutionTreePrefetchEnabled()
Returns:
true if execution tree prefetching is enabled

setExecutions

public void setExecutions(List<ExecutionEntity> executions)

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

getProcessDefinition

public ProcessDefinitionImpl getProcessDefinition()
ensures initialization and returns the process definition.

Overrides:
getProcessDefinition in class PvmExecutionImpl

setProcessDefinitionId

public void setProcessDefinitionId(String processDefinitionId)

getProcessDefinitionId

public String getProcessDefinitionId()
Description copied from interface: ProcessInstance
The id of the process definition of the process instance.

Specified by:
getProcessDefinitionId in interface DelegateExecution
Specified by:
getProcessDefinitionId in interface ProcessInstance

ensureProcessDefinitionInitialized

protected void ensureProcessDefinitionInitialized()
for setting the process definition, this setter must be used as subclasses can override


setProcessDefinition

public void setProcessDefinition(ProcessDefinitionImpl processDefinition)
Overrides:
setProcessDefinition in class PvmExecutionImpl

getProcessInstance

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

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

ensureProcessInstanceInitialized

protected void ensureProcessInstanceInitialized()

setProcessInstance

public void setProcessInstance(PvmExecutionImpl processInstance)
Specified by:
setProcessInstance in class PvmExecutionImpl

isProcessInstanceExecution

public boolean isProcessInstanceExecution()
Description copied from interface: ActivityExecution
returns whether this execution is a process instance or not.

Specified by:
isProcessInstanceExecution in interface ActivityExecution
Overrides:
isProcessInstanceExecution in class PvmExecutionImpl

getActivity

public ActivityImpl getActivity()
ensures initialization and returns the activity

Specified by:
getActivity in interface ActivityExecution
Specified by:
getActivity in interface PvmExecution
Overrides:
getActivity in class PvmExecutionImpl

getActivityId

public String getActivityId()
Overrides:
getActivityId in class PvmExecutionImpl

ensureActivityInitialized

protected void ensureActivityInitialized()
must be called before the activity member field or getActivity() is called


setActivity

public void setActivity(PvmActivity activity)
Specified by:
setActivity in interface ActivityExecution
Overrides:
setActivity in class PvmExecutionImpl

generateActivityInstanceId

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

Specified by:
generateActivityInstanceId in class PvmExecutionImpl

getParent

public ExecutionEntity getParent()
ensures initialization and returns the parent

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

ensureParentInitialized

protected void ensureParentInitialized()

setParent

public void setParent(PvmExecutionImpl parent)
Specified by:
setParent in class PvmExecutionImpl

getSuperExecutionId

public String getSuperExecutionId()

getSuperExecution

public ExecutionEntity 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

ensureSuperExecutionInitialized

protected void ensureSuperExecutionInitialized()

getSubProcessInstance

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

setSubProcessInstance

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

ensureSubProcessInstanceInitialized

protected void ensureSubProcessInstanceInitialized()

getSuperCaseExecutionId

public String getSuperCaseExecutionId()

setSuperCaseExecutionId

public void setSuperCaseExecutionId(String superCaseExecutionId)

getSuperCaseExecution

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

setSuperCaseExecution

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

ensureSuperCaseExecutionInitialized

protected void ensureSuperCaseExecutionInitialized()

getSubCaseInstance

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

setSubCaseInstance

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

ensureSubCaseInstanceInitialized

protected void ensureSubCaseInstanceInitialized()

remove

public void remove()
Specified by:
remove in interface ActivityExecution
Overrides:
remove in class PvmExecutionImpl

removeEventSubscriptionsExceptCompensation

protected void removeEventSubscriptionsExceptCompensation()

removeEventSubscriptions

public void removeEventSubscriptions()

getReplacedBy

public ExecutionEntity getReplacedBy()
Specified by:
getReplacedBy in class PvmExecutionImpl

setReplacedBy

public void setReplacedBy(PvmExecutionImpl replacedBy)
Overrides:
setReplacedBy in class PvmExecutionImpl

replace

public void replace(PvmExecutionImpl execution)
Overrides:
replace in class PvmExecutionImpl

initializeVariableInstanceBackPointer

protected void initializeVariableInstanceBackPointer(VariableInstanceEntity variableInstance)

isExecutingScopeLeafActivity

protected boolean isExecutingScopeLeafActivity()

loadVariableInstances

protected List<VariableInstanceEntity> loadVariableInstances()

isAutoFireHistoryEvents

protected boolean isAutoFireHistoryEvents()

fireHistoricVariableInstanceCreateEvents

public void fireHistoricVariableInstanceCreateEvents()

ensureExecutionTreeInitialized

protected void ensureExecutionTreeInitialized()
Fetch all the executions inside the same process instance as list and then reconstruct the complete execution tree. In many cases this is an optimization over fetching the execution tree lazily. Usually we need all executions anyway and it is preferable to fetch more data in a single query (maybe even too much data) then to run multiple queries, each returning a fraction of the data. The most important consideration here is network roundtrip: If the process engine and database run on separate hosts, network roundtrip has to be added to each query. Economizing on the number of queries economizes on network roundtrip. The tradeoff here is network roundtrip vs. throughput: multiple roundtrips carrying small chucks of data vs. a single roundtrip carrying more data.


getPersistentState

public Object getPersistentState()
Description copied from interface: DbEntity
Returns a representation of the object, as would be stored in the database. Used when deciding if updates have occurred to the object or not since it was last loaded.

Specified by:
getPersistentState in interface DbEntity

insert

public void insert()

deleteCascade2

public void deleteCascade2(String deleteReason)
Overrides:
deleteCascade2 in class PvmExecutionImpl

getRevisionNext

public int getRevisionNext()
Specified by:
getRevisionNext in interface HasDbRevision

forceUpdate

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

toString

public String toString()
Overrides:
toString in class PvmExecutionImpl

getToStringIdentity

protected String getToStringIdentity()
Overrides:
getToStringIdentity in class PvmExecutionImpl

getEventSubscriptionsInternal

public List<EventSubscriptionEntity> getEventSubscriptionsInternal()

getEventSubscriptions

public List<EventSubscriptionEntity> getEventSubscriptions()

getCompensateEventSubscriptions

public List<CompensateEventSubscriptionEntity> getCompensateEventSubscriptions()

getCompensateEventSubscriptions

public List<CompensateEventSubscriptionEntity> getCompensateEventSubscriptions(String activityId)

ensureEventSubscriptionsInitialized

protected void ensureEventSubscriptionsInitialized()

addEventSubscription

public void addEventSubscription(EventSubscriptionEntity eventSubscriptionEntity)

removeEventSubscription

public void removeEventSubscription(EventSubscriptionEntity eventSubscriptionEntity)

ensureJobsInitialized

protected void ensureJobsInitialized()

getJobsInternal

protected List<JobEntity> getJobsInternal()

getJobs

public List<JobEntity> getJobs()

addJob

public void addJob(JobEntity jobEntity)

removeJob

public void removeJob(JobEntity job)

ensureIncidentsInitialized

protected void ensureIncidentsInitialized()

getIncidentsInternal

protected List<IncidentEntity> getIncidentsInternal()

getIncidents

public List<IncidentEntity> getIncidents()

addIncident

public void addIncident(IncidentEntity incident)

removeIncident

public void removeIncident(IncidentEntity incident)

getIncidentByCauseIncidentId

public IncidentEntity getIncidentByCauseIncidentId(String causeIncidentId)

ensureTasksInitialized

protected void ensureTasksInitialized()

getTasksInternal

protected List<TaskEntity> getTasksInternal()

getTasks

public List<TaskEntity> getTasks()

addTask

public void addTask(TaskEntity taskEntity)

removeTask

public void removeTask(TaskEntity task)

getVariableStore

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

setCachedEntityState

public void setCachedEntityState(int cachedEntityState)

getCachedEntityState

public int getCachedEntityState()

getCachedEntityStateRaw

public int getCachedEntityStateRaw()

getProcessInstanceId

public String getProcessInstanceId()
Description copied from interface: Execution
Id of the root of the execution tree representing the process instance. It is the same as Execution.getId() if this execution is the process instance.

Specified by:
getProcessInstanceId in interface DelegateExecution
Specified by:
getProcessInstanceId in interface Execution

setProcessInstanceId

public void setProcessInstanceId(String processInstanceId)

getParentId

public String getParentId()
Description copied from interface: DelegateExecution
Gets the id of the parent of this execution. If null, the execution represents a process-instance.

Specified by:
getParentId in interface DelegateExecution
Overrides:
getParentId in class PvmExecutionImpl

setParentId

public void setParentId(String parentId)

getRevision

public int getRevision()
Specified by:
getRevision in interface HasDbRevision

setRevision

public void setRevision(int revision)
Specified by:
setRevision in interface HasDbRevision

setActivityId

public void setActivityId(String activityId)

setSuperExecutionId

public void setSuperExecutionId(String superExecutionId)

hasReferenceTo

public boolean hasReferenceTo(DbEntity entity)
Specified by:
hasReferenceTo in interface HasDbReferences

getSuspensionState

public int getSuspensionState()

setSuspensionState

public void setSuspensionState(int suspensionState)

isSuspended

public boolean isSuspended()
Description copied from interface: Execution
Indicates if the execution is suspended.

Specified by:
isSuspended in interface Execution
Specified by:
isSuspended in interface ProcessInstance

getProcessInstanceStartContext

public ProcessInstanceStartContext getProcessInstanceStartContext()
Overrides:
getProcessInstanceStartContext in class PvmExecutionImpl

getCurrentActivityId

public String getCurrentActivityId()
Description copied from interface: DelegateExecution
Gets the id of the current activity.

Specified by:
getCurrentActivityId in interface DelegateExecution
Overrides:
getCurrentActivityId in class PvmExecutionImpl

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 © 2015 camunda services GmbH. All rights reserved.