Class CaseExecutionEntity
- java.lang.Object
-
- org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
-
- org.camunda.bpm.engine.impl.core.instance.CoreExecution
-
- org.camunda.bpm.engine.impl.cmmn.execution.CmmnExecution
-
- org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity
-
- All Implemented Interfaces:
Serializable
,BaseDelegateExecution
,CmmnModelExecutionContext
,DelegateCaseExecution
,ProcessEngineServicesAware
,VariableScope
,CmmnActivityExecution
,CmmnCaseInstance
,VariableEventDispatcher
,VariableStore.VariablesProvider<VariableInstanceEntity>
,DbEntity
,HasDbReferences
,HasDbRevision
,CaseExecution
,CaseInstance
public class CaseExecutionEntity extends CmmnExecution implements CaseExecution, CaseInstance, DbEntity, HasDbRevision, HasDbReferences, VariableStore.VariablesProvider<VariableInstanceEntity>
- Author:
- Roman Smirnov
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.camunda.bpm.engine.impl.cmmn.execution.CmmnExecution
activity, caseDefinition, currentState, entryCriterionSatisfied, LOG, previousState, required, task, variableEventsQueue
-
Fields inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
businessKey, businessKeyWithoutCascade, eventName, eventSource, id, listenerIndex, skipCustomListeners, skipIoMapping, skipSubprocesses, tenantId
-
Fields inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
cachedElContext
-
-
Constructor Summary
Constructors Constructor Description CaseExecutionEntity()
-
Method Summary
-
Methods inherited from class org.camunda.bpm.engine.impl.cmmn.execution.CmmnExecution
addIdIfNotSatisfied, checkAndFireEntryCriteria, checkAndFireExitCriteria, close, collectAffectedSentries, collectAffectedSentriesWithVariableOnParts, collectAllSentries, collectCaseExecutionsInExecutionTree, collectSentryParts, complete, containsIfPartAndExecutionActive, create, createChildExecutions, createIfPart, createOnPart, createSentryPart, createSentryParts, createVariableOnPart, deleteCascade, disable, dispatchEvent, enable, exit, findCaseExecution, fireEntryCriteria, fireExitCriteria, fireIfOnlySentryParts, fireSentries, forceUpdateOnCaseSentryParts, forceUpdateOnSentries, getAffectedSentryParts, getBusinessKey, getCaseBusinessKey, getCurrentState, getParentVariableScope, getPrevious, getPreviousState, getSatisfiedSentries, getSatisfiedSentriesInExecutionTree, getState, getVariableEventQueue, getVariableScopeKey, handleChildTransition, handleVariableTransition, hasVariableWithSameNameInParent, invokeVariableListeners, isActive, isAvailable, isClosed, isCompleted, isDisabled, isEnabled, isEntryCriterionSatisfied, isFailed, isNew, isNotSatisfiedIfPartOnly, isRequired, isSentryPartsSatisfied, isSentrySatisfied, isSuspended, isSuspending, isTerminated, isTerminating, manualComplete, manualStart, occur, parentComplete, parentResume, parentSuspend, parentTerminate, performExit, performParentSuspension, performParentTerminate, performSuspension, performTerminate, queueVariableEvent, reactivate, reenable, resetSentries, resetSentryParts, resume, setCurrentState, setPrevious, setRequired, setState, setTask, start, suspend, terminate, triggerChildExecutionsLifecycle
-
Methods inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
getBusinessKeyWithoutCascade, getEventName, getEventSource, getId, getListenerIndex, getTenantId, hasFailedOnEndListeners, invokeListener, isSkipCustomListeners, isSkipIoMappings, isSkipSubprocesses, setBusinessKey, setEventName, setEventSource, setId, setListenerIndex, setSkipCustomListeners, setSkipIoMappings, setSkipSubprocesseses, setTenantId
-
Methods 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, 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.CaseExecution
getId, getTenantId, isActive, isAvailable, isDisabled, isEnabled, isRequired, isTerminated
-
Methods inherited from interface org.camunda.bpm.engine.runtime.CaseInstance
getBusinessKey, isCompleted
-
Methods inherited from interface org.camunda.bpm.engine.delegate.DelegateCaseExecution
getEventName, getId, getTenantId
-
Methods inherited from interface org.camunda.bpm.engine.impl.db.HasDbReferences
getDependentEntities
-
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
-
-
-
-
Field Detail
-
caseInstance
protected transient CaseExecutionEntity caseInstance
the case instance. this is the root of the execution tree. the caseInstance of a case instance is a self reference.
-
parent
protected transient CaseExecutionEntity parent
the parent execution
-
caseExecutions
protected List<CaseExecutionEntity> caseExecutions
nested executions
-
caseSentryParts
protected List<CaseSentryPartEntity> caseSentryParts
nested case sentry parts
-
sentries
protected Map<String,List<CmmnSentryPart>> sentries
-
subProcessInstance
protected transient ExecutionEntity subProcessInstance
reference to a sub process instance, not-null if currently subprocess is started from this execution
-
superExecution
protected transient ExecutionEntity superExecution
-
subCaseInstance
protected transient CaseExecutionEntity subCaseInstance
-
superCaseExecution
protected transient CaseExecutionEntity superCaseExecution
-
variableStore
protected VariableStore<VariableInstanceEntity> variableStore
-
revision
protected int revision
-
caseDefinitionId
protected String caseDefinitionId
-
activityId
protected String activityId
-
caseInstanceId
protected String caseInstanceId
-
parentId
protected String parentId
-
superCaseExecutionId
protected String superCaseExecutionId
-
superExecutionId
protected String superExecutionId
-
activityName
protected String activityName
-
activityType
protected String activityType
-
activityDescription
protected String activityDescription
-
-
Method Detail
-
getCaseDefinitionId
public String getCaseDefinitionId()
Description copied from interface:CaseExecution
The id of the case definition of the case execution.
- Specified by:
getCaseDefinitionId
in interfaceCaseExecution
- Specified by:
getCaseDefinitionId
in interfaceDelegateCaseExecution
-
getCaseDefinition
public CmmnCaseDefinition getCaseDefinition()
ensures initialization and returns the case definition.- Overrides:
getCaseDefinition
in classCmmnExecution
-
setCaseDefinition
public void setCaseDefinition(CmmnCaseDefinition caseDefinition)
- Overrides:
setCaseDefinition
in classCmmnExecution
-
ensureCaseDefinitionInitialized
protected void ensureCaseDefinitionInitialized()
-
getParent
public CaseExecutionEntity getParent()
Description copied from class:CmmnExecution
ensures initialization and returns the parent- Specified by:
getParent
in interfaceCmmnActivityExecution
- Specified by:
getParent
in classCmmnExecution
- Returns:
- a
parent
or null.
-
setParent
public void setParent(CmmnExecution parent)
- Specified by:
setParent
in classCmmnExecution
-
ensureParentInitialized
protected void ensureParentInitialized()
-
ensureCaseExecutionTreeInitialized
protected void ensureCaseExecutionTreeInitialized()
-
isExecutionTreePrefetchEnabled
protected boolean isExecutionTreePrefetchEnabled()
- Returns:
- true if execution tree prefetching is enabled
-
getParentId
public String getParentId()
Description copied from interface:CaseExecution
The id of the parent of
this
case execution.- Specified by:
getParentId
in interfaceCaseExecution
- Specified by:
getParentId
in interfaceDelegateCaseExecution
-
getActivity
public CmmnActivity getActivity()
Description copied from class:CmmnExecution
ensures initialization and returns the activity- Specified by:
getActivity
in interfaceCmmnActivityExecution
- Overrides:
getActivity
in classCmmnExecution
- Returns:
- the associated
activity
-
setActivity
public void setActivity(CmmnActivity activity)
- Overrides:
setActivity
in classCmmnExecution
-
ensureActivityInitialized
protected void ensureActivityInitialized()
-
getActivityProperty
protected String getActivityProperty(CmmnActivity activity, String property)
-
getActivityId
public String getActivityId()
Description copied from interface:CaseExecution
The id of the activity associated with
this
case execution.- Specified by:
getActivityId
in interfaceCaseExecution
- Specified by:
getActivityId
in interfaceDelegateCaseExecution
-
getActivityName
public String getActivityName()
Description copied from interface:CaseExecution
The name of the activity associated with
this
case execution.- Specified by:
getActivityName
in interfaceCaseExecution
- Specified by:
getActivityName
in interfaceDelegateCaseExecution
-
getActivityType
public String getActivityType()
Description copied from interface:CaseExecution
The type of the activity associated with
this
case execution.- Specified by:
getActivityType
in interfaceCaseExecution
-
getActivityDescription
public String getActivityDescription()
Description copied from interface:CaseExecution
The description of the activity associated with
this
case execution.- Specified by:
getActivityDescription
in interfaceCaseExecution
-
getCaseExecutions
public List<CaseExecutionEntity> getCaseExecutions()
Description copied from interface:CmmnActivityExecution
Returns a
List
of child case executions. Ifthis
case execution has no child case executions an emptyList
will be returned.- Specified by:
getCaseExecutions
in interfaceCmmnActivityExecution
- Specified by:
getCaseExecutions
in classCmmnExecution
- Returns:
- a
List
of child case executions.
-
getCaseExecutionsInternal
protected List<CaseExecutionEntity> getCaseExecutionsInternal()
- Specified by:
getCaseExecutionsInternal
in classCmmnExecution
-
ensureCaseExecutionsInitialized
protected void ensureCaseExecutionsInitialized()
-
getTask
public TaskEntity getTask()
- Overrides:
getTask
in classCmmnExecution
-
ensureTaskInitialized
protected void ensureTaskInitialized()
-
createTask
public TaskEntity createTask(TaskDecorator taskDecorator)
Description copied from interface:CmmnActivityExecution
Creates a new task.
case execution will be the case execution of the created task.This
- Specified by:
createTask
in interfaceCmmnActivityExecution
- Overrides:
createTask
in classCmmnExecution
- Parameters:
taskDecorator
- the task decorator used to create task
-
getCaseInstanceId
public String getCaseInstanceId()
Description copied from class:CmmnExecution
ensures initialization and returns the process instance.- Specified by:
getCaseInstanceId
in interfaceCaseExecution
- Specified by:
getCaseInstanceId
in interfaceDelegateCaseExecution
- Overrides:
getCaseInstanceId
in classCmmnExecution
-
getCaseInstance
public CaseExecutionEntity getCaseInstance()
Description copied from class:CmmnExecution
ensures initialization and returns the process instance.- Specified by:
getCaseInstance
in classCmmnExecution
-
setCaseInstance
public void setCaseInstance(CmmnExecution caseInstance)
- Specified by:
setCaseInstance
in classCmmnExecution
-
ensureCaseInstanceInitialized
protected void ensureCaseInstanceInitialized()
-
isCaseInstanceExecution
public boolean isCaseInstanceExecution()
Description copied from interface:CmmnActivityExecution
Returns
true
ifthis
case execution is a case instance. Ifthis
case execution is not a case instance thenfalse
will be returned.- Specified by:
isCaseInstanceExecution
in interfaceCmmnActivityExecution
- Overrides:
isCaseInstanceExecution
in classCmmnExecution
- Returns:
- whether
this
case execution is a case instance or not.
-
create
public void create(Map<String,Object> variables)
Description copied from interface:CmmnCaseInstance
This
case instance transitions toACTIVE
state.The given
variables
will be set a case instance variables.- Specified by:
create
in interfaceCmmnCaseInstance
- Overrides:
create
in classCmmnExecution
-
createCaseExecution
protected CaseExecutionEntity createCaseExecution(CmmnActivity activity)
- Specified by:
createCaseExecution
in classCmmnExecution
-
newCaseExecution
protected CaseExecutionEntity newCaseExecution()
- Specified by:
newCaseExecution
in classCmmnExecution
-
getSuperExecutionId
public String getSuperExecutionId()
-
setSuperExecutionId
public void setSuperExecutionId(String superProcessExecutionId)
-
getSuperExecution
public ExecutionEntity getSuperExecution()
- Specified by:
getSuperExecution
in classCmmnExecution
-
setSuperExecution
public void setSuperExecution(PvmExecutionImpl superExecution)
- Specified by:
setSuperExecution
in classCmmnExecution
-
ensureSuperExecutionInstanceInitialized
protected void ensureSuperExecutionInstanceInitialized()
-
getSubProcessInstance
public ExecutionEntity getSubProcessInstance()
- Specified by:
getSubProcessInstance
in classCmmnExecution
-
setSubProcessInstance
public void setSubProcessInstance(PvmExecutionImpl subProcessInstance)
- Specified by:
setSubProcessInstance
in classCmmnExecution
-
createSubProcessInstance
public ExecutionEntity createSubProcessInstance(PvmProcessDefinition processDefinition)
Description copied from interface:CmmnActivityExecution
Creates a new sub process instance.
This
case execution will be the super case execution of the created sub process instance.- Specified by:
createSubProcessInstance
in interfaceCmmnActivityExecution
- Specified by:
createSubProcessInstance
in classCmmnExecution
- Parameters:
processDefinition
- ThePvmProcessDefinition
of the subprocess.
-
createSubProcessInstance
public ExecutionEntity createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey)
Description copied from interface:CmmnActivityExecution
Creates a new sub process instance.
This
case execution will be the super case execution of the created sub process instance.- Specified by:
createSubProcessInstance
in interfaceCmmnActivityExecution
- Specified by:
createSubProcessInstance
in classCmmnExecution
- Parameters:
processDefinition
- ThePvmProcessDefinition
of the subprocess.businessKey
- The businessKey to be set on sub process instance.
-
createSubProcessInstance
public ExecutionEntity createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId)
Description copied from interface:CmmnActivityExecution
Creates a new sub process instance.
This
case execution will be the super case execution of the created sub process instance.- Specified by:
createSubProcessInstance
in interfaceCmmnActivityExecution
- Specified by:
createSubProcessInstance
in classCmmnExecution
- Parameters:
processDefinition
- ThePvmProcessDefinition
of the subprocess.businessKey
- The businessKey to be set on sub process instance.caseInstanceId
- The caseInstanceId to be set on sub process instance.
-
ensureSubProcessInstanceInitialized
protected void ensureSubProcessInstanceInitialized()
-
getSubCaseInstance
public CaseExecutionEntity getSubCaseInstance()
- Specified by:
getSubCaseInstance
in classCmmnExecution
-
setSubCaseInstance
public void setSubCaseInstance(CmmnExecution subCaseInstance)
- Specified by:
setSubCaseInstance
in classCmmnExecution
-
createSubCaseInstance
public CaseExecutionEntity createSubCaseInstance(CmmnCaseDefinition caseDefinition)
Description copied from interface:CmmnActivityExecution
Creates a new sub case instance.
This
case execution will be the super case execution of the created sub case instance.- Specified by:
createSubCaseInstance
in interfaceCmmnActivityExecution
- Specified by:
createSubCaseInstance
in classCmmnExecution
- Parameters:
caseDefinition
- TheCmmnCaseDefinition
of the sub case instance.
-
createSubCaseInstance
public CaseExecutionEntity createSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey)
Description copied from interface:CmmnActivityExecution
Creates a new sub case instance.
This
case execution will be the super case execution of the created sub case instance.- Specified by:
createSubCaseInstance
in interfaceCmmnActivityExecution
- Specified by:
createSubCaseInstance
in classCmmnExecution
- Parameters:
caseDefinition
- TheCmmnCaseDefinition
of the sub case instance.businessKey
- The businessKey to be set on sub case instance.
-
fireHistoricCaseActivityInstanceUpdate
public void fireHistoricCaseActivityInstanceUpdate()
-
ensureSubCaseInstanceInitialized
protected void ensureSubCaseInstanceInitialized()
-
getSuperCaseExecutionId
public String getSuperCaseExecutionId()
-
setSuperCaseExecutionId
public void setSuperCaseExecutionId(String superCaseExecutionId)
-
getSuperCaseExecution
public CmmnExecution getSuperCaseExecution()
- Specified by:
getSuperCaseExecution
in classCmmnExecution
-
setSuperCaseExecution
public void setSuperCaseExecution(CmmnExecution superCaseExecution)
- Specified by:
setSuperCaseExecution
in classCmmnExecution
-
ensureSuperCaseExecutionInitialized
protected void ensureSuperCaseExecutionInitialized()
-
getCaseSentryParts
public List<CaseSentryPartEntity> getCaseSentryParts()
- Specified by:
getCaseSentryParts
in classCmmnExecution
-
ensureCaseSentryPartsInitialized
protected void ensureCaseSentryPartsInitialized()
-
addSentryPart
protected void addSentryPart(CmmnSentryPart sentryPart)
- Specified by:
addSentryPart
in classCmmnExecution
-
getSentries
protected Map<String,List<CmmnSentryPart>> getSentries()
- Specified by:
getSentries
in classCmmnExecution
-
findSentry
protected List<CmmnSentryPart> findSentry(String sentryId)
- Specified by:
findSentry
in classCmmnExecution
-
newSentryPart
protected CaseSentryPartEntity newSentryPart()
- Specified by:
newSentryPart
in classCmmnExecution
-
getVariableStore
protected VariableStore<CoreVariableInstance> getVariableStore()
- Specified by:
getVariableStore
in classAbstractVariableScope
-
getVariableInstanceFactory
protected VariableInstanceFactory<CoreVariableInstance> getVariableInstanceFactory()
- Specified by:
getVariableInstanceFactory
in classAbstractVariableScope
-
getVariableInstanceLifecycleListeners
protected List<VariableInstanceLifecycleListener<CoreVariableInstance>> getVariableInstanceLifecycleListeners()
- Specified by:
getVariableInstanceLifecycleListeners
in classAbstractVariableScope
-
provideVariables
public Collection<VariableInstanceEntity> provideVariables()
- Specified by:
provideVariables
in interfaceVariableStore.VariablesProvider<VariableInstanceEntity>
-
provideVariables
public Collection<VariableInstanceEntity> provideVariables(Collection<String> variableNames)
- Specified by:
provideVariables
in interfaceVariableStore.VariablesProvider<VariableInstanceEntity>
-
toString
public String toString()
- Overrides:
toString
in classCmmnExecution
-
getToStringIdentity
protected String getToStringIdentity()
- Overrides:
getToStringIdentity
in classCmmnExecution
-
remove
public void remove()
Description copied from interface:CmmnActivityExecution
Removes
this
case execution from the parent case execution.- Specified by:
remove
in interfaceCmmnActivityExecution
- Overrides:
remove
in classCmmnExecution
-
getRevision
public int getRevision()
- Specified by:
getRevision
in interfaceHasDbRevision
-
setRevision
public void setRevision(int revision)
- Specified by:
setRevision
in interfaceHasDbRevision
-
getRevisionNext
public int getRevisionNext()
- Specified by:
getRevisionNext
in interfaceHasDbRevision
-
forceUpdate
public void forceUpdate()
-
getReferencedEntityIds
public Set<String> getReferencedEntityIds()
Description copied from interface:HasDbReferences
Scope: IN-MEMORY references
- Specified by:
getReferencedEntityIds
in interfaceHasDbReferences
- Returns:
- the ids of the entities that this entity references. Should only return ids for entities of the same type
-
getReferencedEntitiesIdAndClass
public Map<String,Class> getReferencedEntitiesIdAndClass()
Description copied from interface:HasDbReferences
Scope: IN-MEMORY references
- Specified by:
getReferencedEntitiesIdAndClass
in 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.
-
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 interfaceDbEntity
-
getCmmnModelInstance
public CmmnModelInstance getCmmnModelInstance()
Description copied from interface:CmmnModelExecutionContext
Returns theCmmnModelInstance
for the currently executed Cmmn Model- Specified by:
getCmmnModelInstance
in interfaceCmmnModelExecutionContext
- Returns:
- the current
CmmnModelInstance
-
getCmmnModelElementInstance
public CmmnElement getCmmnModelElementInstance()
Description copied from interface:CmmnModelExecutionContext
Returns the currently executed Element in the Cmmn Model. This method returns a
CmmnElement
which may be casted to the concrete type of the Cmmn Model Element currently executed.- Specified by:
getCmmnModelElementInstance
in interfaceCmmnModelExecutionContext
- Returns:
- the
CmmnElement
corresponding to the current Cmmn Model Element
-
getProcessEngineServices
public ProcessEngineServices getProcessEngineServices()
Description copied from interface:ProcessEngineServicesAware
Returns theProcessEngineServices
providing access to the public API of the process engine.- Specified by:
getProcessEngineServices
in interfaceProcessEngineServicesAware
- Returns:
- the
ProcessEngineServices
.
-
getProcessEngine
public ProcessEngine getProcessEngine()
Description copied from interface:ProcessEngineServicesAware
Returns theProcessEngine
providing access to the public API of the process engine.- Specified by:
getProcessEngine
in interfaceProcessEngineServicesAware
- Returns:
- the
ProcessEngine
.
-
getCaseDefinitionTenantId
public String getCaseDefinitionTenantId()
-
performOperation
public <T extends CoreExecution> void performOperation(CoreAtomicOperation<T> operation)
- Overrides:
performOperation
in classCoreExecution
-
performOperationSync
public <T extends CoreExecution> void performOperationSync(CoreAtomicOperation<T> operation)
- Overrides:
performOperationSync
in classCoreExecution
-
-