Class ExecutionEntity
- All Implemented Interfaces:
Serializable,BaseDelegateExecution,BpmnModelExecutionContext,DelegateExecution,ProcessEngineServicesAware,VariableScope,VariableEventDispatcher,VariableStore.VariablesProvider<VariableInstanceEntity>,DbEntity,HasDbReferences,HasDbRevision,ActivityExecution,PvmExecution,PvmProcessInstance,Execution,ProcessInstance
- Author:
- Tom Baeyens, Daniel Meyer, Falko Menge
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringpersisted reference to the current position in the diagram within thePvmExecutionImpl.processDefinition.protected StringThe name of the current activity positionprotected intstatic final intprotected List<EventSubscriptionEntity>protected List<ExecutionObserver>Contains observers which are observe the execution.protected List<ExecutionEntity>nested executions representing scopes or concurrent pathsstatic final intprotected List<ExternalTaskEntity>static final intprotected List<IncidentEntity>static final intprotected static final EnginePersistenceLoggerprotected ExecutionEntitythe parent executionprotected Stringpersisted reference to the parent of this execution.protected Stringpersisted reference to the processDefinition.protected ExecutionEntitythe process instance.protected Stringpersisted reference to the process instance.protected StringCompleted HPI that is being restarted through this ExecutionEntityprotected intprotected Stringpersisted reference to the root process instance.protected booleanprotected booleanstatic final intstatic final intprotected CaseExecutionEntityreference to a subcaseinstance, not-null if currently subcase is started from this executionprotected ExecutionEntityreference to a subprocessinstance, not-null if currently subprocess is started from this executionprotected CaseExecutionEntitysuper case execution, not-null if this execution is part of a case executionprotected Stringpersisted reference to the super case execution of this executionprotected ExecutionEntitysuper execution, not-null if this execution is part of a subprocessprotected Stringpersisted reference to the super execution of this executionprotected intprotected List<TaskEntity>static final intstatic final intprotected VariableStore<VariableInstanceEntity>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, payloadForTriggeredScope, preserveScope, processDefinition, replacedBy, scopeInstantiationContext, sequenceCounter, transition, transitionsToTakeFields inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
businessKey, businessKeyWithoutCascade, eventName, eventSource, id, listenerIndex, skipCustomListeners, skipIoMapping, skipSubprocesses, tenantIdFields inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
cachedElContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventSubscription(EventSubscriptionEntity eventSubscriptionEntity) voidaddExecutionObserver(ExecutionObserver observer) voidaddExternalTask(ExternalTaskEntity externalTask) voidaddIncident(IncidentEntity incident) voidvoidaddTask(TaskEntity taskEntity) voidaddVariableInternal(VariableInstanceEntity variable) voidprotected voidcreates a new execution.protected static ExecutionEntitycreateSubCaseInstance(CmmnCaseDefinition caseDefinition) Creates a new sub case instance.createSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey) Creates a new sub case instance.createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId) protected voidcreateTimerInstances(Collection<TimerDeclarationImpl> timerDeclarations) voiddestroy(boolean alwaysSkipIoMappings) Method used for destroying a scope in a way that the execution can be removed afterwards.voiddispatchEvent(VariableEvent variableEvent) protected voidmust be called before the activity member field or getActivity() is calledprotected voidprotected voidprotected voidFetch all the executions inside the same process instance as list and then reconstruct the complete execution tree.protected voidprotected voidprotected voidprotected voidprotected voidprotected voidfor setting the process definition, this setter must be used as subclasses can overrideprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidvoidvoidvoidprotected StringgenerateActivityInstanceId(String activityId) generates an activity instance idensures initialization and returns the activityReturns the currently executed Element in the BPMN Model.Returns theBpmnModelInstancefor the currently executed Bpmn ModelintintgetCompensateEventSubscriptions(String activityId) Gets the id of the current activity.Gets the name of the current activity.returns the list of execution of which this execution the parent of.protected List<ExternalTaskEntity>getIncidentByCauseIncidentId(String causeIncidentId) protected List<IncidentEntity>getJobs()ensures initialization and returns the parentGets the id of the parent of this execution.Returns a representation of the object, as would be stored in the database.The business key for the process instance this execution is associated with.ensures initialization and returns the process definition.The id of the process definition of the process instance.Returns theProcessEngineproviding access to the public API of the process engine.Returns theProcessEngineServicesproviding access to the public API of the process engine.ensures initialization and returns the process instance.Id of the root of the execution tree representing the process instance.Scope: IN-MEMORY referencesScope: IN-MEMORY referencesReturns an execution that has replaced this execution for executing activities in their shared scope.intintThe id of the root process instance associated with this process instance.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.intgetTasks()protected List<TaskEntity>protected Stringprotected VariableInstanceFactory<CoreVariableInstance>protected VariableStore<CoreVariableInstance>voidhandleConditionalEventOnVariableChange(VariableEvent variableEvent) voidInactivates this execution.voidprotected static voidinitializeAssociations(ExecutionEntity execution) voidvoidinsert()voidinterrupt(String reason, boolean skipCustomListeners, boolean skipIoMappings, boolean externallyTerminated) booleanprotected booleanbooleanreturns whether this execution is a process instance or not.booleanbooleanIndicates if the execution is suspended.protected voidprotected voidprotected voidprotected voidmoveTasksTo(ExecutionEntity other) protected voidmoveVariablesTo(ExecutionEntity other) protected voidmoveVariableTo(VariableInstanceEntity variable, ExecutionEntity other) protected PvmExecutionImplvoidonConcurrentExpand(PvmExecutionImpl scopeExecution) Callback on tree expansion when this execution is used as the concurrent execution where the argument's children become a subordinate to.<T extends CoreExecution>
voidperformOperation(CoreAtomicOperation<T> operation) voidperformOperation(AtomicOperation executionOperation) <T extends CoreExecution>
voidperformOperationSync(CoreAtomicOperation<T> operation) voidperformOperationSync(AtomicOperation executionOperation) protected voidprovideTenantId(Map<String, Object> variables, VariableMap properties) provideVariables(Collection<String> variableNames) voidremove()protected voidremoveActivityJobs(String reason) voidvoidremoveEventSubscription(EventSubscriptionEntity eventSubscriptionEntity) voidprotected voidvoidremoveExecutionObserver(ExecutionObserver observer) voidremoveExternalTask(ExternalTaskEntity externalTask) protected voidvoidremoveIncident(IncidentEntity incident) voidvoidremoveTask(TaskEntity task) protected voidprotected voidremoveTasks(String reason, boolean skipCustomListeners) voidremoveVariableInternal(VariableInstanceEntity variable) voidvoidvoidreplace(PvmExecutionImpl execution) Replace an execution by this execution.protected booleanrequiresUnsuspendedExecution(AtomicOperation executionOperation) Instead ofPvmExecutionImpl.getReplacedBy(), which returns the execution that this execution was directly replaced with, this resolves the chain of replacements (i.e.voidrestoreProcessInstance(Collection<ExecutionEntity> executions, Collection<EventSubscriptionEntity> eventSubscriptions, Collection<VariableInstanceEntity> variables, Collection<TaskEntity> tasks, Collection<JobEntity> jobs, Collection<IncidentEntity> incidents, Collection<ExternalTaskEntity> externalTasks) Restores a complete process instance tree including referenced entities.voidscheduleAtomicOperationAsync(AtomicOperationInvocation executionOperationInvocation) voidsetActivity(PvmActivity activity) voidsetActivityId(String activityId) voidsetCachedEntityState(int cachedEntityState) voidsetExecutions(List<ExecutionEntity> executions) voidsetParentExecution(PvmExecutionImpl parent) Use #setParent to also update the child execution setsvoidsetParentId(String parentId) voidsetProcessDefinition(ProcessDefinitionImpl processDefinition) voidsetProcessDefinitionId(String processDefinitionId) voidsetProcessInstance(PvmExecutionImpl processInstance) voidsetProcessInstanceId(String processInstanceId) voidsetRestartedProcessInstanceId(String restartedProcessInstanceId) voidsetRevision(int revision) voidsetRootProcessInstanceId(String rootProcessInstanceId) voidsetSubCaseInstance(CmmnExecution subCaseInstance) voidsetSubProcessInstance(PvmExecutionImpl subProcessInstance) voidsetSuperCaseExecution(CmmnExecution superCaseExecution) voidsetSuperCaseExecutionId(String superCaseExecutionId) voidsetSuperExecution(PvmExecutionImpl superExecution) voidsetSuperExecutionId(String superExecutionId) voidsetSuspensionState(int suspensionState) voidstart(Map<String, Object> variables, VariableMap formProperties) voidstartWithoutExecuting(Map<String, Object> variables) perform starting behavior but don't execute the initial activitytoString()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, 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, getActivityInstanceId, getActivityInstanceState, getAllChildExecutions, getBusinessKey, getCaseInstanceId, getCurrentTransitionId, getDelayedEvents, getDeleteReason, getEventScopeExecutions, getFlowScope, getFlowScopeExecution, getNextActivity, getNonEventScopeExecutions, getParentActivityInstanceId, getParentScopeExecution, getParentVariableScope, getPayloadForTriggeredScope, getScopeActivity, getScopeInstantiationContext, getSequenceCounter, getTransition, getTransitionsToTake, getVariableScopeKey, hasChildren, hasFailedOnEndListeners, hasReplacedParent, incrementSequenceCounter, initActivityIds, instantiateScopes, interrupt, isActive, isAsyncAfterScopeWithoutTransition, isCanceled, isCompleteScope, isConcurrent, isDeleteRoot, isEnded, isEventScope, isExecutingScopeLeafActivity, isExternallyTerminated, isIgnoreAsync, isInState, isPreserveScope, isRemoved, isReplacedByParent, isScope, isStarting, leaveActivityInstance, leaveActivityViaTransition, leaveActivityViaTransitions, propagateEnd, removeEventScopes, resolveIncident, setActive, setActivityInstanceId, setCanceled, setCaseInstanceId, setCompleteScope, setConcurrent, setDelayedPayloadToNewScope, setDeleteReason, setDeleteRoot, setEnded, setEventScope, setExternallyTerminated, setIgnoreAsync, setNextActivity, setParent, setPayloadForTriggeredScope, setPreserveScope, setProcessBusinessKey, setProcessInstanceStarting, setScope, setSequenceCounter, setStartContext, setStarting, setTransition, setTransitionsToTake, setVariable, signal, start, start, startWithFormProperties, take, tryPruneLastConcurrentChildMethods inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
getBusinessKeyWithoutCascade, getEventName, getEventSource, getId, getListenerIndex, getTenantId, invokeListener, isSkipCustomListeners, isSkipIoMappings, isSkipSubprocesses, setBusinessKey, setEventName, setEventSource, setId, setListenerIndex, setSkipCustomListeners, setSkipIoMappings, setSkipSubprocesseses, setTenantIdMethods inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
collectVariableNames, collectVariables, 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, setVariablesLocalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.camunda.bpm.engine.delegate.BaseDelegateExecution
getEventName, getIdMethods inherited from interface org.camunda.bpm.engine.delegate.DelegateExecution
getTenantIdMethods inherited from interface org.camunda.bpm.engine.runtime.Execution
getId, getTenantId, isEndedMethods inherited from interface org.camunda.bpm.engine.impl.db.HasDbReferences
getDependentEntitiesMethods inherited from interface org.camunda.bpm.engine.runtime.ProcessInstance
getBusinessKey, getCaseInstanceIdMethods inherited from interface org.camunda.bpm.engine.impl.pvm.PvmExecution
getVariable, getVariables, hasVariable, setVariableMethods 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
-
Field Details
-
LOG
-
EVENT_SUBSCRIPTIONS_STATE_BIT
public static final int EVENT_SUBSCRIPTIONS_STATE_BIT- See Also:
-
TASKS_STATE_BIT
public static final int TASKS_STATE_BIT- See Also:
-
JOBS_STATE_BIT
public static final int JOBS_STATE_BIT- See Also:
-
INCIDENT_STATE_BIT
public static final int INCIDENT_STATE_BIT- See Also:
-
VARIABLES_STATE_BIT
public static final int VARIABLES_STATE_BIT- See Also:
-
SUB_PROCESS_INSTANCE_STATE_BIT
public static final int SUB_PROCESS_INSTANCE_STATE_BIT- See Also:
-
SUB_CASE_INSTANCE_STATE_BIT
public static final int SUB_CASE_INSTANCE_STATE_BIT- See Also:
-
EXTERNAL_TASKS_BIT
public static final int EXTERNAL_TASKS_BIT- See Also:
-
processInstance
the process instance. this is the root of the execution tree. the processInstance of a process instance is a self reference. -
parent
the parent execution -
executions
nested executions representing scopes or concurrent paths -
superExecution
super execution, not-null if this execution is part of a subprocess -
superCaseExecution
super case execution, not-null if this execution is part of a case execution -
subProcessInstance
reference to a subprocessinstance, not-null if currently subprocess is started from this execution -
subCaseInstance
reference to a subcaseinstance, not-null if currently subcase is started from this execution -
shouldQueryForSubprocessInstance
protected boolean shouldQueryForSubprocessInstance -
shouldQueryForSubCaseInstance
protected boolean shouldQueryForSubCaseInstance -
eventSubscriptions
-
jobs
-
tasks
-
externalTasks
-
incidents
-
cachedEntityState
protected int cachedEntityState -
variableStore
-
suspensionState
protected int suspensionState -
revision
protected int revision -
processDefinitionId
persisted reference to the processDefinition. -
activityId
persisted reference to the current position in the diagram within thePvmExecutionImpl.processDefinition.- See Also:
-
activityName
The name of the current activity position -
processInstanceId
persisted reference to the process instance.- See Also:
-
parentId
persisted reference to the parent of this execution.- See Also:
-
superExecutionId
persisted reference to the super execution of this execution- See Also:
-
setSuperExecution(ExecutionEntity)
-
rootProcessInstanceId
persisted reference to the root process instance.- See Also:
-
superCaseExecutionId
persisted reference to the super case execution of this execution- See Also:
-
setSuperCaseExecution(ExecutionEntity)
-
restartedProcessInstanceId
Completed HPI that is being restarted through this ExecutionEntity -
executionObservers
Contains observers which are observe the execution.- Since:
- 7.6
-
registeredVariableListeners
protected transient List<VariableInstanceLifecycleListener<VariableInstanceEntity>> registeredVariableListeners
-
-
Constructor Details
-
ExecutionEntity
public ExecutionEntity()
-
-
Method Details
-
createExecution
creates a new execution. properties processDefinition, processInstance and activity will be initialized.- Specified by:
createExecutionin interfaceActivityExecution- Specified by:
createExecutionin classPvmExecutionImpl
-
createSubProcessInstance
public ExecutionEntity createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId) - Specified by:
createSubProcessInstancein interfaceActivityExecution- Overrides:
createSubProcessInstancein classPvmExecutionImpl- Parameters:
processDefinition- ThePvmProcessDefinitionof the subprocess.businessKey- the business key of the process instancecaseInstanceId- the case instance id of the process instance- See Also:
-
createNewExecution
-
newExecution
- Specified by:
newExecutionin classPvmExecutionImpl
-
createSubCaseInstance
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 CaseExecutionEntity createSubCaseInstance(CmmnCaseDefinition caseDefinition, 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.
-
fireHistoricActivityInstanceUpdate
public void fireHistoricActivityInstanceUpdate() -
initialize
public void initialize()- Specified by:
initializein classPvmExecutionImpl
-
initializeTimerDeclarations
public void initializeTimerDeclarations()- Specified by:
initializeTimerDeclarationsin classPvmExecutionImpl
-
createTimerInstances
-
initializeAssociations
-
start
- Overrides:
startin classPvmExecutionImpl
-
startWithoutExecuting
Description copied from class:PvmExecutionImplperform starting behavior but don't execute the initial activity- Overrides:
startWithoutExecutingin classPvmExecutionImpl- Parameters:
variables- the variables which are used for the start
-
provideTenantId
-
fireHistoricProcessStartEvent
public void fireHistoricProcessStartEvent()- Specified by:
fireHistoricProcessStartEventin classPvmExecutionImpl
-
destroy
public void destroy(boolean alwaysSkipIoMappings) Method used for destroying a scope in a way that the execution can be removed afterwards.- Overrides:
destroyin classPvmExecutionImpl- Parameters:
alwaysSkipIoMappings- set to true to always skip IO mappings, regardless of internal state of execution (=>CoreExecution.isSkipIoMappings())
-
removeAllTasks
public void removeAllTasks()- Overrides:
removeAllTasksin classPvmExecutionImpl
-
clearExecution
protected void clearExecution() -
removeVariablesLocalInternal
public void removeVariablesLocalInternal()- Specified by:
removeVariablesLocalInternalin classPvmExecutionImpl
-
interrupt
public void interrupt(String reason, boolean skipCustomListeners, boolean skipIoMappings, boolean externallyTerminated) - Overrides:
interruptin classPvmExecutionImpl
-
removeActivityJobs
-
performOperation
- Overrides:
performOperationin classCoreExecution
-
performOperationSync
- Overrides:
performOperationSyncin classCoreExecution
-
performOperation
-
performOperationSync
-
ensureNotSuspended
protected void ensureNotSuspended() -
requiresUnsuspendedExecution
-
scheduleAtomicOperationAsync
-
isActive
- Overrides:
isActivein classPvmExecutionImpl
-
inactivate
public void inactivate()Description copied from interface:ActivityExecutionInactivates this execution. This is useful for example in a join: the execution still exists, but it is not longer active.- Specified by:
inactivatein interfaceActivityExecution- Overrides:
inactivatein classPvmExecutionImpl
-
addExecutionObserver
-
removeExecutionObserver
-
getExecutions
Description copied from interface:ActivityExecutionreturns the list of execution of which this execution the parent of. This is a copy of the actual list, so a modification has no direct effect.- Specified by:
getExecutionsin interfaceActivityExecution- Specified by:
getExecutionsin classPvmExecutionImpl
-
getExecutionsAsCopy
- Specified by:
getExecutionsAsCopyin classPvmExecutionImpl
-
ensureExecutionsInitialized
protected void ensureExecutionsInitialized() -
isExecutionTreePrefetchEnabled
protected boolean isExecutionTreePrefetchEnabled()- Returns:
- true if execution tree prefetching is enabled
-
setExecutions
-
getProcessBusinessKey
Description copied from interface:DelegateExecutionThe business key for the process instance this execution is associated with.- Specified by:
getProcessBusinessKeyin interfaceDelegateExecution- Overrides:
getProcessBusinessKeyin classPvmExecutionImpl
-
getProcessDefinition
ensures initialization and returns the process definition.- Overrides:
getProcessDefinitionin classPvmExecutionImpl
-
setProcessDefinitionId
-
getProcessDefinitionId
Description copied from interface:ProcessInstanceThe id of the process definition of the process instance.- Specified by:
getProcessDefinitionIdin interfaceDelegateExecution- Specified by:
getProcessDefinitionIdin interfaceProcessInstance
-
ensureProcessDefinitionInitialized
protected void ensureProcessDefinitionInitialized()for setting the process definition, this setter must be used as subclasses can override -
setProcessDefinition
- Overrides:
setProcessDefinitionin classPvmExecutionImpl
-
getProcessInstance
ensures initialization and returns the process instance.- Specified by:
getProcessInstancein interfaceDelegateExecution- Specified by:
getProcessInstancein classPvmExecutionImpl
-
ensureProcessInstanceInitialized
protected void ensureProcessInstanceInitialized() -
setProcessInstance
- Specified by:
setProcessInstancein classPvmExecutionImpl
-
isProcessInstanceExecution
public boolean isProcessInstanceExecution()Description copied from interface:ActivityExecutionreturns whether this execution is a process instance or not.- Specified by:
isProcessInstanceExecutionin interfaceActivityExecution- Overrides:
isProcessInstanceExecutionin classPvmExecutionImpl
-
isProcessInstanceStarting
public boolean isProcessInstanceStarting()- Overrides:
isProcessInstanceStartingin classPvmExecutionImpl
-
getActivity
ensures initialization and returns the activity- Specified by:
getActivityin interfaceActivityExecution- Specified by:
getActivityin interfacePvmExecution- Overrides:
getActivityin classPvmExecutionImpl
-
getActivityId
- Overrides:
getActivityIdin classPvmExecutionImpl
-
ensureActivityInitialized
protected void ensureActivityInitialized()must be called before the activity member field or getActivity() is called -
setActivity
- Specified by:
setActivityin interfaceActivityExecution- Overrides:
setActivityin classPvmExecutionImpl
-
generateActivityInstanceId
generates an activity instance id- Specified by:
generateActivityInstanceIdin classPvmExecutionImpl
-
getParent
ensures initialization and returns the parent- Specified by:
getParentin interfaceActivityExecution- Specified by:
getParentin classPvmExecutionImpl
-
ensureParentInitialized
protected void ensureParentInitialized() -
setParentExecution
Description copied from class:PvmExecutionImplUse #setParent to also update the child execution sets- Specified by:
setParentExecutionin classPvmExecutionImpl
-
getSuperExecutionId
-
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
- Specified by:
setSuperExecutionin classPvmExecutionImpl
-
ensureSuperExecutionInitialized
protected void ensureSuperExecutionInitialized() -
getSubProcessInstance
- Specified by:
getSubProcessInstancein classPvmExecutionImpl
-
setSubProcessInstance
- Specified by:
setSubProcessInstancein classPvmExecutionImpl
-
ensureSubProcessInstanceInitialized
protected void ensureSubProcessInstanceInitialized() -
getSuperCaseExecutionId
-
setSuperCaseExecutionId
-
getRestartedProcessInstanceId
-
setRestartedProcessInstanceId
-
getSuperCaseExecution
- Specified by:
getSuperCaseExecutionin classPvmExecutionImpl
-
setSuperCaseExecution
- Specified by:
setSuperCaseExecutionin classPvmExecutionImpl
-
ensureSuperCaseExecutionInitialized
protected void ensureSuperCaseExecutionInitialized() -
getSubCaseInstance
- Specified by:
getSubCaseInstancein classPvmExecutionImpl
-
setSubCaseInstance
- Specified by:
setSubCaseInstancein classPvmExecutionImpl
-
ensureSubCaseInstanceInitialized
protected void ensureSubCaseInstanceInitialized() -
remove
public void remove()- Specified by:
removein interfaceActivityExecution- Overrides:
removein classPvmExecutionImpl
-
removeEventSubscriptionsExceptCompensation
protected void removeEventSubscriptionsExceptCompensation() -
removeEventSubscriptions
public void removeEventSubscriptions() -
removeTasks
-
removeTasks
protected void removeTasks() -
removeExternalTasks
protected void removeExternalTasks() -
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
-
resolveReplacedBy
Description copied from class:PvmExecutionImplInstead ofPvmExecutionImpl.getReplacedBy(), which returns the execution that this execution was directly replaced with, this resolves the chain of replacements (i.e. in the case the replacedBy execution itself was replaced again)- Overrides:
resolveReplacedByin classPvmExecutionImpl
-
replace
Description copied from class:PvmExecutionImplReplace an execution by this execution. The replaced execution has a pointer (
PvmExecutionImpl.getReplacedBy()) to this execution. This pointer is maintained until the replaced execution is removed or this execution is removed/ended.This is used for two cases: Execution tree expansion and execution tree compaction
- expansion: Before:
------- | e1 | scope -------After:------- | e1 | scope ------- | ------- | e2 | cc (no scope) -------e2 replaces e1: it should receive all entities associated with the activity currently executed by e1; these are tasks, (local) variables, jobs (specific for the activity, not the scope) - compaction: Before:
------- | e1 | scope ------- | ------- | e2 | cc (no scope) -------After:------- | e1 | scope -------e1 replaces e2: it should receive all entities associated with the activity currently executed by e2; these are tasks, (all) variables, all jobs
- Overrides:
replacein classPvmExecutionImpl- See Also:
- expansion: Before:
-
onConcurrentExpand
Description copied from class:PvmExecutionImplCallback on tree expansion when this execution is used as the concurrent execution where the argument's children become a subordinate to. Note that this case is not the inverse of replace because replace has the semantics that the replacing execution can be used to continue execution of this execution's activity instance.- Overrides:
onConcurrentExpandin classPvmExecutionImpl
-
moveTasksTo
-
moveExternalTasksTo
-
moveActivityLocalJobsTo
-
moveVariablesTo
-
moveVariableTo
-
moveConcurrentLocalVariablesTo
-
addVariableListener
-
removeVariableListener
public void removeVariableListener(VariableInstanceLifecycleListener<VariableInstanceEntity> listener) -
provideVariables
- Specified by:
provideVariablesin interfaceVariableStore.VariablesProvider<VariableInstanceEntity>
-
provideVariables
- Specified by:
provideVariablesin interfaceVariableStore.VariablesProvider<VariableInstanceEntity>
-
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. -
restoreProcessInstance
public void restoreProcessInstance(Collection<ExecutionEntity> executions, Collection<EventSubscriptionEntity> eventSubscriptions, Collection<VariableInstanceEntity> variables, Collection<TaskEntity> tasks, Collection<JobEntity> jobs, Collection<IncidentEntity> incidents, Collection<ExternalTaskEntity> externalTasks) Restores a complete process instance tree including referenced entities.- Parameters:
executions- the list of all executions that are part of this process instance. Cannot be null, must include the process instance execution itself.eventSubscriptions- the list of all event subscriptions that are linked to executions which is part of this process instance If null, event subscriptions are not initialized and lazy loaded on demandvariables- the list of all variables that are linked to executions which are part of this process instance If null, variables are not initialized and are lazy loaded on demandjobs-tasks-incidents-
-
getPersistentState
Description copied from interface:DbEntityReturns 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:
getPersistentStatein interfaceDbEntity
-
insert
public void insert() -
getRevisionNext
public int getRevisionNext()- Specified by:
getRevisionNextin interfaceHasDbRevision
-
forceUpdate
public void forceUpdate()- Specified by:
forceUpdatein interfaceActivityExecution
-
toString
- Overrides:
toStringin classPvmExecutionImpl
-
getToStringIdentity
- Overrides:
getToStringIdentityin classPvmExecutionImpl
-
getEventSubscriptionsInternal
-
getEventSubscriptions
-
getCompensateEventSubscriptions
-
getCompensateEventSubscriptions
-
ensureEventSubscriptionsInitialized
protected void ensureEventSubscriptionsInitialized() -
addEventSubscription
-
removeEventSubscription
-
ensureJobsInitialized
protected void ensureJobsInitialized() -
getJobsInternal
-
getJobs
-
addJob
-
removeJob
-
ensureIncidentsInitialized
protected void ensureIncidentsInitialized() -
getIncidentsInternal
-
getIncidents
-
addIncident
-
removeIncident
-
getIncidentByCauseIncidentId
-
ensureTasksInitialized
protected void ensureTasksInitialized() -
getTasksInternal
-
getTasks
-
addTask
-
removeTask
-
ensureExternalTasksInitialized
protected void ensureExternalTasksInitialized() -
getExternalTasksInternal
-
addExternalTask
-
removeExternalTask
-
getExternalTasks
-
getVariableStore
- Specified by:
getVariableStorein classAbstractVariableScope
-
getVariableInstanceFactory
- Specified by:
getVariableInstanceFactoryin classAbstractVariableScope
-
getVariableInstanceLifecycleListeners
protected List<VariableInstanceLifecycleListener<CoreVariableInstance>> getVariableInstanceLifecycleListeners()- Specified by:
getVariableInstanceLifecycleListenersin classAbstractVariableScope
-
getVariablePersistenceListener
-
getVariablesInternal
-
removeVariableInternal
-
addVariableInternal
-
handleConditionalEventOnVariableChange
-
dispatchEvent
- Specified by:
dispatchEventin interfaceVariableEventDispatcher- Overrides:
dispatchEventin classAbstractVariableScope
-
setCachedEntityState
public void setCachedEntityState(int cachedEntityState) -
getCachedEntityState
public int getCachedEntityState() -
getCachedEntityStateRaw
public int getCachedEntityStateRaw() -
getRootProcessInstanceId
Description copied from interface:ProcessInstanceThe id of the root process instance associated with this process instance.- Specified by:
getRootProcessInstanceIdin interfaceProcessInstance
-
getRootProcessInstanceIdRaw
-
setRootProcessInstanceId
-
getProcessInstanceId
Description copied from interface:ExecutionId of the root of the execution tree representing the process instance. It is the same asExecution.getId()if this execution is the process instance.- Specified by:
getProcessInstanceIdin interfaceDelegateExecution- Specified by:
getProcessInstanceIdin interfaceExecution
-
setProcessInstanceId
-
getParentId
Description copied from interface:DelegateExecutionGets the id of the parent of this execution. If null, the execution represents a process-instance.- Specified by:
getParentIdin interfaceDelegateExecution- Overrides:
getParentIdin classPvmExecutionImpl
-
setParentId
-
getRevision
public int getRevision()- Specified by:
getRevisionin interfaceHasDbRevision
-
setRevision
public void setRevision(int revision) - Specified by:
setRevisionin interfaceHasDbRevision
-
setActivityId
-
setSuperExecutionId
-
getReferencedEntityIds
Description copied from interface:HasDbReferencesScope: IN-MEMORY references
- Specified by:
getReferencedEntityIdsin interfaceHasDbReferences- Returns:
- the ids of the entities that this entity references. Should only return ids for entities of the same type
-
getReferencedEntitiesIdAndClass
Description copied from interface:HasDbReferencesScope: IN-MEMORY references
- Specified by:
getReferencedEntitiesIdAndClassin interfaceHasDbReferences- Returns:
- a map of the ids and the entities' classes that this entity references. It's used when trying to determine if there was an Optimistic Locking occurrence on an INSERT or UPDATE of an object of this type.
-
getSuspensionState
public int getSuspensionState() -
setSuspensionState
public void setSuspensionState(int suspensionState) -
isSuspended
public boolean isSuspended()Description copied from interface:ExecutionIndicates if the execution is suspended.- Specified by:
isSuspendedin interfaceExecution- Specified by:
isSuspendedin interfaceProcessInstance
-
getCurrentActivityId
Description copied from interface:DelegateExecutionGets the id of the current activity.- Specified by:
getCurrentActivityIdin interfaceDelegateExecution- Overrides:
getCurrentActivityIdin classPvmExecutionImpl
-
getCurrentActivityName
Description copied from interface:DelegateExecutionGets the name of the current activity.- Specified by:
getCurrentActivityNamein interfaceDelegateExecution- Overrides:
getCurrentActivityNamein classPvmExecutionImpl
-
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
Description copied from interface:BpmnModelExecutionContextReturns theBpmnModelInstancefor the currently executed Bpmn Model- Specified by:
getBpmnModelInstancein interfaceBpmnModelExecutionContext- Returns:
- the current
BpmnModelInstance
-
getProcessEngineServices
Description copied from interface:ProcessEngineServicesAwareReturns theProcessEngineServicesproviding access to the public API of the process engine.- Specified by:
getProcessEngineServicesin interfaceProcessEngineServicesAware- Returns:
- the
ProcessEngineServices.
-
getProcessEngine
Description copied from interface:ProcessEngineServicesAwareReturns theProcessEngineproviding access to the public API of the process engine.- Specified by:
getProcessEnginein interfaceProcessEngineServicesAware- Returns:
- the
ProcessEngine.
-
getProcessDefinitionTenantId
-