org.camunda.bpm.engine.impl.cmmn.entity.runtime
Class CaseExecutionEntity

java.lang.Object
  extended by org.camunda.bpm.engine.impl.core.variable.CoreVariableScope<PersistentVariableInstance>
      extended by org.camunda.bpm.engine.impl.core.variable.CorePersistentVariableScope
          extended by org.camunda.bpm.engine.impl.core.instance.CoreExecution
              extended by org.camunda.bpm.engine.impl.cmmn.execution.CmmnExecution
                  extended by org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity
All Implemented Interfaces:
Serializable, BaseDelegateExecution, CmmnModelExecutionContext, DelegateCaseExecution, PersistentVariableScope, ProcessEngineServicesAware, VariableScope<PersistentVariableInstance>, CmmnActivityExecution, CmmnCaseInstance, DbEntity, HasDbReferences, HasDbRevision, CaseExecution, CaseInstance

public class CaseExecutionEntity
extends CmmnExecution
implements CaseExecution, CaseInstance, DbEntity, HasDbRevision, HasDbReferences

Author:
Roman Smirnov
See Also:
Serialized Form

Field Summary
protected  String activityId
           
protected  String activityName
           
protected  String caseDefinitionId
           
protected  List<CaseExecutionEntity> caseExecutions
          nested executions
protected  CaseExecutionEntity caseInstance
          the case instance.
protected  String caseInstanceId
           
protected  List<CaseSentryPartEntity> caseSentryParts
          nested case sentry parts
protected  boolean forcedUpdate
           
protected  CaseExecutionEntity parent
          the parent execution
protected  String parentId
           
protected  int revision
           
protected  Map<String,List<CaseSentryPartEntity>> sentries
           
protected  CaseExecutionEntity subCaseInstance
           
protected  ExecutionEntity subProcessInstance
          reference to a sub process instance, not-null if currently subprocess is started from this execution
protected  CaseExecutionEntity superCaseExecution
           
protected  String superCaseExecutionId
           
protected  CaseExecutionEntityVariableStore variableStore
           
 
Fields inherited from class org.camunda.bpm.engine.impl.cmmn.execution.CmmnExecution
activity, caseDefinition, currentState, nextActivity, previousState, required, satisfiedSentries
 
Fields inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
businessKey, eventName, eventSource, id, listenerIndex, skipCustomListeners
 
Fields inherited from class org.camunda.bpm.engine.impl.core.variable.CoreVariableScope
cachedElContext
 
Constructor Summary
CaseExecutionEntity()
           
 
Method Summary
protected  void addSentryPart(CmmnSentryPart sentryPart)
           
protected  CaseExecutionEntity createCaseExecution(CmmnActivity activity)
           
 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)
          Creates a new sub process instance.
 ExecutionEntity createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey)
          Creates a new sub process instance.
 ExecutionEntity createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId)
          Creates a new sub process instance.
protected  void ensureActivityInitialized()
           
protected  void ensureCaseDefinitionInitialized()
           
protected  void ensureCaseExecutionsInitialized()
           
protected  void ensureCaseInstanceInitialized()
           
protected  void ensureCaseSentryPartsInitialized()
           
protected  void ensureParentInitialized()
           
protected  void ensureSubCaseInstanceInitialized()
           
protected  void ensureSubProcessInstanceInitialized()
           
protected  void ensureSuperCaseExecutionInitialized()
           
protected  List<CaseSentryPartEntity> findSentry(String sentryId)
           
 void forceUpdate()
           
 CmmnActivity getActivity()
          ensures initialization and returns the activity
 String getActivityId()
          The id of the activity associated with this case execution.
 String getActivityName()
          The name of the activity associated with this case execution.
 CmmnCaseDefinition getCaseDefinition()
          ensures initialization and returns the case definition.
 String getCaseDefinitionId()
          The id of the case definition of the case execution.
 List<CaseExecutionEntity> getCaseExecutions()
          Returns a List of child case executions.
protected  List<CaseExecutionEntity> getCaseExecutionsInternal()
           
 CaseExecutionEntity getCaseInstance()
          ensures initialization and returns the process instance.
 String getCaseInstanceId()
          ensures initialization and returns the process instance.
 List<CaseSentryPartEntity> getCaseSentryParts()
           
 org.camunda.bpm.model.cmmn.instance.CmmnElement getCmmnModelElementInstance()
          Returns the currently executed Element in the Cmmn Model.
 org.camunda.bpm.model.cmmn.CmmnModelInstance getCmmnModelInstance()
          Returns the CmmnModelInstance for the currently executed Cmmn Model
 CaseExecutionEntity getParent()
          ensures initialization and returns the parent
 String getParentId()
          The id of the parent of this case execution.
 Object getPersistentState()
          Returns a representation of the object, as would be stored in the database.
 ProcessEngineServices getProcessEngineServices()
          Returns the ProcessEngineServices providing access to the public API of the process engine.
 int getRevision()
           
 int getRevisionNext()
           
 CaseExecutionEntity getSubCaseInstance()
           
 ExecutionEntity getSubProcessInstance()
           
 CmmnExecution getSuperCaseExecution()
           
 String getSuperCaseExecutionId()
           
protected  String getToStringIdentity()
           
protected  CorePersistentVariableStore getVariableStore()
           
 boolean hasReferenceTo(DbEntity entity)
           
protected  void initializeVariableInstanceBackPointer(VariableInstanceEntity variableInstance)
           
 boolean isCaseInstanceExecution()
          Returns true if this case execution is a case instance.
protected  List<VariableInstanceEntity> loadVariableInstances()
           
protected  CaseExecutionEntity newCaseExecution()
           
protected  CaseSentryPartEntity newSentryPart()
           
<T extends CoreExecution>
void
performOperation(CoreAtomicOperation<T> operation)
           
<T extends CoreExecution>
void
performOperationSync(CoreAtomicOperation<T> operation)
           
 void remove()
          Removes this case execution from the parent case execution.
 void setActivity(CmmnActivity activity)
           
 void setCaseDefinition(CmmnCaseDefinition caseDefinition)
           
 void setCaseInstance(CmmnExecution caseInstance)
           
 void setParent(CmmnExecution parent)
           
 void setRevision(int revision)
           
 void setSubCaseInstance(CmmnExecution subCaseInstance)
           
 void setSubProcessInstance(PvmExecutionImpl subProcessInstance)
           
 void setSuperCaseExecution(CmmnExecution superCaseExecution)
           
 void setSuperCaseExecutionId(String superCaseExecutionId)
           
 String toString()
           
 
Methods inherited from class org.camunda.bpm.engine.impl.cmmn.execution.CmmnExecution
close, complete, create, create, createChildExecutions, createIfPart, createOnPart, createSentryPart, createSentryParts, deleteCascade, disable, enable, exit, findCaseExecution, getCaseBusinessKey, getCurrentState, getNextActivity, getParentVariableScope, getPrevious, getPreviousState, getState, handleChildTransition, isActive, isAvailable, isClosed, isCompleted, isDisabled, isEnabled, isFailed, isNew, isRequired, isSentrySatisfied, isSuspended, isTerminated, manualComplete, manualStart, occur, parentResume, parentSuspend, parentTerminate, reactivate, reenable, resume, setCurrentState, setNextActivity, setPrevious, setRequired, setState, start, suspend, terminate, triggerChildExecutions, triggerEntryCriteria, triggerExitCriteria
 
Methods inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
getBusinessKey, getEventName, getEventSource, getId, getListenerIndex, invokeListener, isSkipCustomListeners, setBusinessKey, setEventName, setEventSource, setId, setListenerIndex, setSkipCustomListeners
 
Methods inherited from class org.camunda.bpm.engine.impl.core.variable.CorePersistentVariableScope
createVariableLocalFromSerialized, setVariableFromSerialized, setVariableFromSerialized, setVariableLocalFromSerialized, setVariableLocalFromSerialized
 
Methods inherited from class org.camunda.bpm.engine.impl.core.variable.CoreVariableScope
collectVariableInstances, collectVariableNames, collectVariables, getCachedElContext, getSourceActivityVariableScope, getVariable, getVariableInstance, getVariableInstanceLocal, getVariableInstances, getVariableInstances, getVariableInstancesLocal, getVariableLocal, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, 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.CaseInstance
getBusinessKey, isCompleted
 
Methods inherited from interface org.camunda.bpm.engine.runtime.CaseExecution
getId, isActive, isAvailable, isDisabled, isEnabled
 
Methods inherited from interface org.camunda.bpm.engine.impl.db.DbEntity
getId, setId
 
Methods inherited from interface org.camunda.bpm.engine.delegate.DelegateCaseExecution
getEventName, getId
 
Methods inherited from interface org.camunda.bpm.engine.delegate.BaseDelegateExecution
getBusinessKey
 
Methods inherited from interface org.camunda.bpm.engine.delegate.PersistentVariableScope
setVariableFromSerialized, setVariableLocalFromSerialized
 
Methods inherited from interface org.camunda.bpm.engine.delegate.VariableScope
getVariable, getVariableInstance, getVariableInstanceLocal, getVariableInstances, getVariableInstancesLocal, getVariableLocal, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, 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<CaseSentryPartEntity>> sentries

subProcessInstance

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


subCaseInstance

protected transient CaseExecutionEntity subCaseInstance

superCaseExecution

protected transient CaseExecutionEntity superCaseExecution

variableStore

protected CaseExecutionEntityVariableStore variableStore

revision

protected int revision

caseDefinitionId

protected String caseDefinitionId

activityId

protected String activityId

activityName

protected String activityName

caseInstanceId

protected String caseInstanceId

parentId

protected String parentId

superCaseExecutionId

protected String superCaseExecutionId

forcedUpdate

protected boolean forcedUpdate
Constructor Detail

CaseExecutionEntity

public CaseExecutionEntity()
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 interface DelegateCaseExecution
Specified by:
getCaseDefinitionId in interface CaseExecution

getCaseDefinition

public CmmnCaseDefinition getCaseDefinition()
ensures initialization and returns the case definition.

Overrides:
getCaseDefinition in class CmmnExecution

setCaseDefinition

public void setCaseDefinition(CmmnCaseDefinition caseDefinition)
Overrides:
setCaseDefinition in class CmmnExecution

ensureCaseDefinitionInitialized

protected void ensureCaseDefinitionInitialized()

getParent

public CaseExecutionEntity getParent()
Description copied from class: CmmnExecution
ensures initialization and returns the parent

Specified by:
getParent in interface CmmnActivityExecution
Specified by:
getParent in class CmmnExecution
Returns:
a parent or null.

setParent

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

ensureParentInitialized

protected void ensureParentInitialized()

getParentId

public String getParentId()
Description copied from interface: CaseExecution

The id of the parent of this case execution.

Specified by:
getParentId in interface DelegateCaseExecution
Specified by:
getParentId in interface CaseExecution

getActivityId

public String getActivityId()
Description copied from interface: CaseExecution

The id of the activity associated with this case execution.

Specified by:
getActivityId in interface DelegateCaseExecution
Specified by:
getActivityId in interface CaseExecution

getActivityName

public String getActivityName()
Description copied from interface: CaseExecution

The name of the activity associated with this case execution.

Specified by:
getActivityName in interface DelegateCaseExecution
Specified by:
getActivityName in interface CaseExecution

getActivity

public CmmnActivity getActivity()
Description copied from class: CmmnExecution
ensures initialization and returns the activity

Specified by:
getActivity in interface CmmnActivityExecution
Overrides:
getActivity in class CmmnExecution
Returns:
the associated activity

setActivity

public void setActivity(CmmnActivity activity)
Overrides:
setActivity in class CmmnExecution

ensureActivityInitialized

protected void ensureActivityInitialized()

getCaseExecutions

public List<CaseExecutionEntity> getCaseExecutions()
Description copied from interface: CmmnActivityExecution

Returns a List of child case executions. If this case execution has no child case executions an empty List will be returned.

Specified by:
getCaseExecutions in interface CmmnActivityExecution
Specified by:
getCaseExecutions in class CmmnExecution
Returns:
a List of child case executions.

getCaseExecutionsInternal

protected List<CaseExecutionEntity> getCaseExecutionsInternal()
Specified by:
getCaseExecutionsInternal in class CmmnExecution

ensureCaseExecutionsInitialized

protected void ensureCaseExecutionsInitialized()

getCaseInstanceId

public String getCaseInstanceId()
Description copied from class: CmmnExecution
ensures initialization and returns the process instance.

Specified by:
getCaseInstanceId in interface DelegateCaseExecution
Specified by:
getCaseInstanceId in interface CaseExecution
Overrides:
getCaseInstanceId in class CmmnExecution

getCaseInstance

public CaseExecutionEntity getCaseInstance()
Description copied from class: CmmnExecution
ensures initialization and returns the process instance.

Specified by:
getCaseInstance in class CmmnExecution

setCaseInstance

public void setCaseInstance(CmmnExecution caseInstance)
Specified by:
setCaseInstance in class CmmnExecution

ensureCaseInstanceInitialized

protected void ensureCaseInstanceInitialized()

isCaseInstanceExecution

public boolean isCaseInstanceExecution()
Description copied from interface: CmmnActivityExecution

Returns true if this case execution is a case instance. If this case execution is not a case instance then false will be returned.

Specified by:
isCaseInstanceExecution in interface CmmnActivityExecution
Overrides:
isCaseInstanceExecution in class CmmnExecution
Returns:
whether this case execution is a case instance or not.

createCaseExecution

protected CaseExecutionEntity createCaseExecution(CmmnActivity activity)
Specified by:
createCaseExecution in class CmmnExecution

newCaseExecution

protected CaseExecutionEntity newCaseExecution()
Specified by:
newCaseExecution in class CmmnExecution

getSubProcessInstance

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

setSubProcessInstance

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

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 interface CmmnActivityExecution
Specified by:
createSubProcessInstance in class CmmnExecution
Parameters:
processDefinition - The PvmProcessDefinition 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 interface CmmnActivityExecution
Specified by:
createSubProcessInstance in class CmmnExecution
Parameters:
processDefinition - The PvmProcessDefinition 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 interface CmmnActivityExecution
Specified by:
createSubProcessInstance in class CmmnExecution
Parameters:
processDefinition - The PvmProcessDefinition 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 class CmmnExecution

setSubCaseInstance

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

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 interface CmmnActivityExecution
Specified by:
createSubCaseInstance in class CmmnExecution
Parameters:
caseDefinition - The CmmnCaseDefinition of the subprocess.

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 interface CmmnActivityExecution
Specified by:
createSubCaseInstance in class CmmnExecution
Parameters:
caseDefinition - The CmmnCaseDefinition of the subprocess.
businessKey - The businessKey to be set on sub case instance.

ensureSubCaseInstanceInitialized

protected void ensureSubCaseInstanceInitialized()

getSuperCaseExecutionId

public String getSuperCaseExecutionId()

setSuperCaseExecutionId

public void setSuperCaseExecutionId(String superCaseExecutionId)

getSuperCaseExecution

public CmmnExecution getSuperCaseExecution()
Specified by:
getSuperCaseExecution in class CmmnExecution

setSuperCaseExecution

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

ensureSuperCaseExecutionInitialized

protected void ensureSuperCaseExecutionInitialized()

getCaseSentryParts

public List<CaseSentryPartEntity> getCaseSentryParts()
Specified by:
getCaseSentryParts in class CmmnExecution

ensureCaseSentryPartsInitialized

protected void ensureCaseSentryPartsInitialized()

addSentryPart

protected void addSentryPart(CmmnSentryPart sentryPart)
Specified by:
addSentryPart in class CmmnExecution

findSentry

protected List<CaseSentryPartEntity> findSentry(String sentryId)
Specified by:
findSentry in class CmmnExecution

newSentryPart

protected CaseSentryPartEntity newSentryPart()
Specified by:
newSentryPart in class CmmnExecution

getVariableStore

protected CorePersistentVariableStore getVariableStore()
Specified by:
getVariableStore in class CorePersistentVariableScope

initializeVariableInstanceBackPointer

protected void initializeVariableInstanceBackPointer(VariableInstanceEntity variableInstance)

loadVariableInstances

protected List<VariableInstanceEntity> loadVariableInstances()

toString

public String toString()
Overrides:
toString in class CmmnExecution

getToStringIdentity

protected String getToStringIdentity()
Overrides:
getToStringIdentity in class CmmnExecution

remove

public void remove()
Description copied from interface: CmmnActivityExecution

Removes this case execution from the parent case execution.

Specified by:
remove in interface CmmnActivityExecution
Overrides:
remove in class CmmnExecution

getRevision

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

setRevision

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

getRevisionNext

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

forceUpdate

public void forceUpdate()

hasReferenceTo

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

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

getCmmnModelInstance

public org.camunda.bpm.model.cmmn.CmmnModelInstance getCmmnModelInstance()
Description copied from interface: CmmnModelExecutionContext
Returns the CmmnModelInstance for the currently executed Cmmn Model

Specified by:
getCmmnModelInstance in interface CmmnModelExecutionContext
Returns:
the current CmmnModelInstance

getCmmnModelElementInstance

public org.camunda.bpm.model.cmmn.instance.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 interface CmmnModelExecutionContext
Returns:
the CmmnElement corresponding to the current Cmmn Model Element

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.

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


Copyright © 2014 camunda services GmbH. All Rights Reserved.