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

java.lang.Object
  extended by org.camunda.bpm.engine.impl.core.variable.CoreVariableScope
      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, ProcessEngineServicesAware, VariableScope, CmmnActivityExecution, CmmnCaseInstance, HasRevision, PersistentObject, CaseExecution, CaseInstance

public class CaseExecutionEntity
extends CmmnExecution
implements CaseExecution, CaseInstance, PersistentObject, HasRevision

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  CaseExecutionEntity parent
          the parent execution
protected  String parentId
           
protected  int revision
           
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
 
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  CaseExecutionEntity createCaseExecution(CmmnActivity activity)
           
 CaseExecutionEntity createSubCaseInstance(CmmnCaseDefinition caseDefinition)
          Creates a new sub case instance.
 ExecutionEntity createSubProcessInstance(PvmProcessDefinition processDefinition)
          Creates a new sub process instance.
protected  void ensureActivityInitialized()
           
protected  void ensureCaseDefinitionInitialized()
           
protected  void ensureCaseExecutionsInitialized()
           
protected  void ensureCaseInstanceInitialized()
           
protected  void ensureParentInitialized()
           
protected  void ensureSubCaseInstanceInitialized()
           
protected  void ensureSubProcessInstanceInitialized()
           
protected  void ensureSuperCaseExecutionInitialized()
           
 CmmnActivity getActivity()
          ensures initialization and returns the activity
 String getActivityId()
           
 String getActivityName()
           
 CmmnCaseDefinition getCaseDefinition()
          ensures initialization and returns the case definition.
 String getCaseDefinitionId()
          The id of the case definition of the case instance.
 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.
 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()
           
 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  CoreVariableStore getVariableStore()
           
protected  void initializeVariableInstanceBackPointer(VariableInstanceEntity variableInstance)
           
 boolean isCaseInstanceExecution()
          Returns true if this case execution is a case instance.
protected  List<VariableInstanceEntity> loadVariableInstances()
           
protected  CaseExecutionEntity newCaseExecution()
           
<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, create, create, createChildExecutions, deleteCascade, disable, enable, exit, findCaseExecution, getCaseBusinessKey, getCurrentState, getNextActivity, getParentVariableScope, getPrevious, getPreviousState, getState, isActive, isAvailable, isClosed, isCompleted, isDisabled, isEnabled, isFailed, isNew, isRequired, isSuspended, isTerminated, manualComplete, manualStart, occur, parentResume, parentSuspend, parentTerminate, reactivate, reenable, resume, setCurrentState, setNextActivity, setPrevious, setRequired, setState, start, suspend, terminate
 
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.CoreVariableScope
collectVariableInstances, collectVariableNames, collectVariables, createVariableInstance, createVariableLocal, createVariableLocal, createVariablesLocal, getCachedElContext, getSourceActivityVariableScope, getVariable, 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, updateVariableInstance
 
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, isDisabled, isEnabled
 
Methods inherited from interface org.camunda.bpm.engine.impl.db.PersistentObject
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.VariableScope
getVariable, 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


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
Constructor Detail

CaseExecutionEntity

public CaseExecutionEntity()
Method Detail

getCaseDefinitionId

public String getCaseDefinitionId()
Description copied from interface: CaseInstance
The id of the case definition of the case instance.

Specified by:
getCaseDefinitionId in interface DelegateCaseExecution
Specified by:
getCaseDefinitionId in interface CaseInstance

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()
Specified by:
getParentId in interface DelegateCaseExecution

getActivityId

public String getActivityId()
Specified by:
getActivityId in interface DelegateCaseExecution

getActivityName

public String getActivityName()
Specified by:
getActivityName in interface DelegateCaseExecution

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.

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.

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()

getVariableStore

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

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 HasRevision

setRevision

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

getRevisionNext

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

getPersistentState

public Object getPersistentState()
Description copied from interface: PersistentObject
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 PersistentObject

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.