org.camunda.bpm.engine.impl.cmmn.execution
Class CmmnExecution

java.lang.Object
  extended by org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
      extended by org.camunda.bpm.engine.impl.core.instance.CoreExecution
          extended by org.camunda.bpm.engine.impl.cmmn.execution.CmmnExecution
All Implemented Interfaces:
Serializable, BaseDelegateExecution, CmmnModelExecutionContext, DelegateCaseExecution, ProcessEngineServicesAware, VariableScope, CmmnActivityExecution, CmmnCaseInstance, VariableEventDispatcher
Direct Known Subclasses:
CaseExecutionEntity, CaseExecutionImpl

public abstract class CmmnExecution
extends CoreExecution
implements CmmnCaseInstance

Author:
Roman Smirnov
See Also:
Serialized Form

Field Summary
protected  CmmnActivity activity
          current activity
protected  CmmnCaseDefinition caseDefinition
           
protected  int currentState
           
protected  boolean entryCriterionSatisfied
          This property will be used if this CmmnExecution is in state CaseExecutionState.NEW to note that an entry criterion is satisfied.
protected  boolean exitCriterionSatisfied
          This property will be used if this CmmnExecution is in state CaseExecutionState.NEW to note that an entry criterion is satisfied.
protected static CmmnBehaviorLogger LOG
           
protected  int previousState
           
protected  boolean required
           
protected  TaskEntity task
           
protected  Queue<VariableEvent> variableEventsQueue
           
 
Fields inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
businessKey, eventName, eventSource, id, listenerIndex, skipCustomListeners, skipIoMapping
 
Fields inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
cachedElContext
 
Constructor Summary
CmmnExecution()
           
 
Method Summary
protected abstract  void addSentryPart(CmmnSentryPart sentryPart)
           
protected  void checkAndFireEntryCriteria(List<String> satisfiedSentries)
           
protected  void checkAndFireExitCriteria(List<String> satisfiedSentries)
           
 void close()
          Transition to CaseExecutionState.CLOSED state when no further work or modifications should be allowed for this case instance.
protected  List<String> collectAffectedSentries(CmmnExecution child, String transition)
           
 void complete()
          Transition to CaseExecutionState.COMPLETED state.
protected  boolean containsIfPart(String sentryId)
           
 void create()
          This case instance transitions to ACTIVE state.
 void create(Map<String,Object> variables)
          This case instance transitions to ACTIVE state.
protected abstract  CmmnExecution createCaseExecution(CmmnActivity activity)
           
 List<CmmnExecution> createChildExecutions(List<CmmnActivity> activities)
          Creates new child case executions for each given CmmnActivity.
protected  CmmnSentryPart createIfPart(CmmnSentryDeclaration sentryDeclaration, CmmnIfPartDeclaration ifPartDeclaration)
           
protected  CmmnSentryPart createOnPart(CmmnSentryDeclaration sentryDeclaration, CmmnOnPartDeclaration onPartDeclaration)
           
protected  CmmnSentryPart createSentryPart(CmmnSentryDeclaration sentryDeclaration, String type)
           
 void createSentryParts()
          Creates for each defined PlanItemOnPart and IfPart inside the specified Sentries a CmmnSentryPart.
abstract  CmmnExecution createSubCaseInstance(CmmnCaseDefinition caseDefinition)
          Creates a new sub case instance.
abstract  CmmnExecution createSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey)
          Creates a new sub case instance.
abstract  PvmExecutionImpl createSubProcessInstance(PvmProcessDefinition processDefinition)
          Creates a new sub process instance.
abstract  PvmExecutionImpl createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey)
          Creates a new sub process instance.
abstract  PvmExecutionImpl createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId)
          Creates a new sub process instance.
 TaskEntity createTask(TaskDecorator taskDecorator)
          Creates a new task.
 void deleteCascade()
           
 void disable()
          Transition to state.
 void dispatchEvent(VariableEvent variableEvent)
           
 void enable()
          Transition to CaseExecutionState.ENABLED state.
 void exit()
          Transition to CaseExecutionState.TERMINATING_ON_EXIT state.
 CmmnExecution findCaseExecution(String activityId)
          Find a case execution by the given activityId.
protected abstract  List<? extends CmmnSentryPart> findSentry(String sentryId)
           
 void fireEntryCriteria()
           
 void fireExitCriteria()
           
protected  void fireSentries(List<String> satisfiedSentries)
           
protected  void forceUpdateOnCaseSentryPart(List<String> sentryIds)
           
 CmmnActivity getActivity()
          ensures initialization and returns the activity
 String getCaseBusinessKey()
           
 CmmnCaseDefinition getCaseDefinition()
           
abstract  List<? extends CmmnExecution> getCaseExecutions()
          Returns a List of child case executions.
protected abstract  List<? extends CmmnExecution> getCaseExecutionsInternal()
           
abstract  CmmnExecution getCaseInstance()
          ensures initialization and returns the process instance.
 String getCaseInstanceId()
          ensures initialization and returns the process instance.
abstract  List<? extends CmmnSentryPart> getCaseSentryParts()
           
 CaseExecutionState getCurrentState()
          Returns the current state of this case execution.
abstract  CmmnExecution getParent()
          ensures initialization and returns the parent
 AbstractVariableScope getParentVariableScope()
           
 int getPrevious()
           
 CaseExecutionState getPreviousState()
          Returns the previous state of this case execution.
protected  List<String> getSatisfiedSentries(List<String> sentryIds)
          Checks for each given sentry id whether the corresponding sentry is satisfied.
protected abstract  Map<String,List<CmmnSentryPart>> getSentries()
           
 int getState()
           
abstract  CmmnExecution getSubCaseInstance()
           
abstract  PvmExecutionImpl getSubProcessInstance()
           
abstract  CmmnExecution getSuperCaseExecution()
           
abstract  PvmExecutionImpl getSuperExecution()
           
 TaskEntity getTask()
           
protected  String getToStringIdentity()
           
protected  Queue<VariableEvent> getVariableEventQueue()
           
 String getVariableScopeKey()
           
 void handleChildTransition(CmmnExecution child, String transition)
           
protected  void invokeVariableListeners(boolean includeCustomerListeners)
           
 boolean isActive()
           
 boolean isAvailable()
           
 boolean isCaseInstanceExecution()
          Returns true if this case execution is a case instance.
 boolean isClosed()
           
 boolean isCompleted()
           
 boolean isDisabled()
           
 boolean isEnabled()
           
 boolean isEntryCriterionSatisfied()
          The flag entryCriterionSatisfied will only be set to true, when this CmmnActivityExecution stays in state CaseExecutionState.NEW.
 boolean isExitCriterionSatisfied()
          The flag exitCriterionSatisfied will only be set to true, when this CmmnActivityExecution stays in state CaseExecutionState.NEW.
 boolean isFailed()
           
 boolean isNew()
          Returns true iff:
CmmnActivityExecution.getCurrentState() == CaseExecutionState.NEW
 boolean isRequired()
          Returns true, if this case execution is required.
 boolean isSentrySatisfied(String sentryId)
          Returns true, if each CmmnSentryPart of the given sentryId is satisfied.
 boolean isSuspended()
           
 boolean isSuspending()
          Returns true iff:
CmmnActivityExecution.getCurrentState() == CaseExecutionState.SUSPENDING_ON_SUSPENSION || CmmnActivityExecution.getCurrentState() == CaseExecutionState.SUSPENDING_ON_PARENT_SUSPENSION
 boolean isTerminated()
           
 boolean isTerminating()
          Returns true iff:
CmmnActivityExecution.getCurrentState() == CaseExecutionState.TERMINATING_ON_TERMINATION || CmmnActivityExecution.getCurrentState() == CaseExecutionState.TERMINATING_ON_PARENT_TERMINATION || CmmnActivityExecution.getCurrentState() == CaseExecutionState.TERMINATING_ON_EXIT
 void manualComplete()
          Transition to CaseExecutionState.COMPLETED state.
 void manualStart()
          Transition to CaseExecutionState.ACTIVE state.
protected abstract  CmmnExecution newCaseExecution()
           
protected abstract  CmmnSentryPart newSentryPart()
           
 void occur()
          Transition to CaseExecutionState.COMPLETED state.
 void parentResume()
          Transition to the previous state (CaseExecutionState.AVAILABLE, CaseExecutionState.ENABLED, CaseExecutionState.DISABLED or CaseExecutionState.ACTIVE) when the parent Stage transitions out of CaseExecutionState.SUSPENDED.
 void parentSuspend()
          Transition to CaseExecutionState.SUSPENDING_ON_PARENT_SUSPENSION state.
 void parentTerminate()
          Transition to CaseExecutionState.TERMINATING_ON_PARENT_TERMINATION state.
 void performExit()
          Transition to CaseExecutionState.TERMINATED state.
 void performParentSuspension()
          Transition to CaseExecutionState.SUSPENDED state.
 void performParentTerminate()
          Transition to CaseExecutionState.TERMINATED state.
 void performSuspension()
          Transition to CaseExecutionState.SUSPENDED state.
 void performTerminate()
          Transition to CaseExecutionState.TERMINATED state.
protected  void queueVariableEvent(VariableEvent variableEvent, boolean includeCustomerListeners)
           
 void reactivate()
          Transition to CaseExecutionState.ACTIVE state.
 void reenable()
          Transition to CaseExecutionState.ENABLED state.
 void remove()
          Removes this case execution from the parent case execution.
protected  void resetSentries(List<String> sentries)
           
 void resume()
          Transition to either to CaseExecutionState.ACTIVE state, if this case execution is associated with a Stage or Task, or to CaseExecutionState#AVAILABE, if this case execution is associated with a EventListener or Milestone.
 void setActivity(CmmnActivity activity)
           
 void setCaseDefinition(CmmnCaseDefinition caseDefinition)
           
abstract  void setCaseInstance(CmmnExecution caseInstance)
           
 void setCurrentState(CaseExecutionState currentState)
          Sets the given state as the current state of this case execution.
abstract  void setParent(CmmnExecution parent)
           
 void setPrevious(int previous)
           
 void setRequired(boolean required)
          Sets this case execution as required or not required.
 void setState(int state)
           
abstract  void setSubCaseInstance(CmmnExecution subCaseInstance)
           
abstract  void setSubProcessInstance(PvmExecutionImpl subProcessInstance)
           
abstract  void setSuperCaseExecution(CmmnExecution superCaseExecution)
           
abstract  void setSuperExecution(PvmExecutionImpl superExecution)
           
 void setTask(Task task)
           
 void start()
          Transition to CaseExecutionState.ACTIVE state.
 void suspend()
          Transition to CaseExecutionState.SUSPENDING_ON_SUSPENSION state.
 void terminate()
          Transition to CaseExecutionState.TERMINATING_ON_TERMINATION state.
 String toString()
           
 void triggerChildExecutionsLifecycle(List<CmmnExecution> children)
          This method triggers for each given case execution the lifecycle.
 
Methods inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
getBusinessKey, getEventName, getEventSource, getId, getListenerIndex, invokeListener, isSkipCustomListeners, isSkipIoMappings, performOperation, performOperationSync, setBusinessKey, setEventName, setEventSource, setId, setListenerIndex, setSkipCustomListeners, setSkipIoMappings
 
Methods inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
collectVariableNames, collectVariables, getCachedElContext, getSourceActivityVariableScope, getValueFromVariableInstance, getVariable, getVariable, getVariableInstance, getVariableInstanceLocal, getVariableInstancesLocal, getVariableLocal, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariableStore, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, removeVariable, removeVariable, removeVariableLocal, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setCachedElContext, setVariable, setVariable, setVariableLocal, setVariableLocal, setVariableLocalTransient, 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.delegate.DelegateCaseExecution
getActivityId, getActivityName, getCaseDefinitionId, getEventName, getId, getParentId
 
Methods inherited from interface org.camunda.bpm.engine.delegate.BaseDelegateExecution
getBusinessKey
 
Methods inherited from interface org.camunda.bpm.engine.delegate.VariableScope
getVariable, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, removeVariable, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setVariable, setVariableLocal, setVariables, setVariablesLocal
 
Methods inherited from interface org.camunda.bpm.engine.delegate.ProcessEngineServicesAware
getProcessEngineServices
 
Methods inherited from interface org.camunda.bpm.engine.delegate.CmmnModelExecutionContext
getCmmnModelElementInstance, getCmmnModelInstance
 

Field Detail

LOG

protected static final CmmnBehaviorLogger LOG

caseDefinition

protected transient CmmnCaseDefinition caseDefinition

activity

protected transient CmmnActivity activity
current activity


required

protected boolean required

previousState

protected int previousState

currentState

protected int currentState

variableEventsQueue

protected Queue<VariableEvent> variableEventsQueue

task

protected transient TaskEntity task

entryCriterionSatisfied

protected boolean entryCriterionSatisfied
This property will be used if this CmmnExecution is in state CaseExecutionState.NEW to note that an entry criterion is satisfied.


exitCriterionSatisfied

protected boolean exitCriterionSatisfied
This property will be used if this CmmnExecution is in state CaseExecutionState.NEW to note that an entry criterion is satisfied.

Constructor Detail

CmmnExecution

public CmmnExecution()
Method Detail

getCaseExecutions

public abstract List<? extends CmmnExecution> 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
Returns:
a List of child case executions.

getCaseExecutionsInternal

protected abstract List<? extends CmmnExecution> getCaseExecutionsInternal()

findCaseExecution

public CmmnExecution findCaseExecution(String activityId)
Description copied from interface: CmmnCaseInstance

Find a case execution by the given activityId.

Specified by:
findCaseExecution in interface CmmnCaseInstance
Parameters:
activityId - the id of the activity to which a case execution is associated.
Returns:
returns a case execution or null if a case execution could not be found.

getTask

public TaskEntity getTask()

setTask

public void setTask(Task task)

createTask

public TaskEntity createTask(TaskDecorator taskDecorator)
Description copied from interface: CmmnActivityExecution

Creates a new task.

This

case execution will be the case execution of the created task.

Specified by:
createTask in interface CmmnActivityExecution
Parameters:
taskDecorator - the task decorator used to create task

getSuperExecution

public abstract PvmExecutionImpl getSuperExecution()

setSuperExecution

public abstract void setSuperExecution(PvmExecutionImpl superExecution)

getSubProcessInstance

public abstract PvmExecutionImpl getSubProcessInstance()

setSubProcessInstance

public abstract void setSubProcessInstance(PvmExecutionImpl subProcessInstance)

createSubProcessInstance

public abstract PvmExecutionImpl 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
Parameters:
processDefinition - The PvmProcessDefinition of the subprocess.

createSubProcessInstance

public abstract PvmExecutionImpl 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
Parameters:
processDefinition - The PvmProcessDefinition of the subprocess.
businessKey - The businessKey to be set on sub process instance.

createSubProcessInstance

public abstract PvmExecutionImpl 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
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.

getSubCaseInstance

public abstract CmmnExecution getSubCaseInstance()

setSubCaseInstance

public abstract void setSubCaseInstance(CmmnExecution subCaseInstance)

createSubCaseInstance

public abstract CmmnExecution 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
Parameters:
caseDefinition - The CmmnCaseDefinition of the sub case instance.

createSubCaseInstance

public abstract CmmnExecution 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
Parameters:
caseDefinition - The CmmnCaseDefinition of the sub case instance.
businessKey - The businessKey to be set on sub case instance.

getSuperCaseExecution

public abstract CmmnExecution getSuperCaseExecution()

setSuperCaseExecution

public abstract void setSuperCaseExecution(CmmnExecution superCaseExecution)

newSentryPart

protected abstract CmmnSentryPart newSentryPart()

addSentryPart

protected abstract void addSentryPart(CmmnSentryPart sentryPart)

createSentryParts

public void createSentryParts()
Description copied from interface: CmmnActivityExecution

Creates for each defined PlanItemOnPart and IfPart inside the specified Sentries a CmmnSentryPart.

Specified by:
createSentryParts in interface CmmnActivityExecution

createOnPart

protected CmmnSentryPart createOnPart(CmmnSentryDeclaration sentryDeclaration,
                                      CmmnOnPartDeclaration onPartDeclaration)

createIfPart

protected CmmnSentryPart createIfPart(CmmnSentryDeclaration sentryDeclaration,
                                      CmmnIfPartDeclaration ifPartDeclaration)

createSentryPart

protected CmmnSentryPart createSentryPart(CmmnSentryDeclaration sentryDeclaration,
                                          String type)

handleChildTransition

public void handleChildTransition(CmmnExecution child,
                                  String transition)

collectAffectedSentries

protected List<String> collectAffectedSentries(CmmnExecution child,
                                               String transition)

forceUpdateOnCaseSentryPart

protected void forceUpdateOnCaseSentryPart(List<String> sentryIds)

getSatisfiedSentries

protected List<String> getSatisfiedSentries(List<String> sentryIds)
Checks for each given sentry id whether the corresponding sentry is satisfied.


resetSentries

protected void resetSentries(List<String> sentries)

fireSentries

protected void fireSentries(List<String> satisfiedSentries)

checkAndFireExitCriteria

protected void checkAndFireExitCriteria(List<String> satisfiedSentries)

checkAndFireEntryCriteria

protected void checkAndFireEntryCriteria(List<String> satisfiedSentries)

fireExitCriteria

public void fireExitCriteria()

fireEntryCriteria

public void fireEntryCriteria()

getCaseSentryParts

public abstract List<? extends CmmnSentryPart> getCaseSentryParts()

findSentry

protected abstract List<? extends CmmnSentryPart> findSentry(String sentryId)

getSentries

protected abstract Map<String,List<CmmnSentryPart>> getSentries()

isSentrySatisfied

public boolean isSentrySatisfied(String sentryId)
Description copied from interface: CmmnActivityExecution

Returns true, if each CmmnSentryPart of the given sentryId is satisfied.

Specified by:
isSentrySatisfied in interface CmmnActivityExecution
Parameters:
sentryId - the id of the sentry to check
Returns:
true if the sentry is satisfied.

containsIfPart

protected boolean containsIfPart(String sentryId)

isEntryCriterionSatisfied

public boolean isEntryCriterionSatisfied()
Description copied from interface: CmmnActivityExecution

The flag entryCriterionSatisfied will only be set to true, when this CmmnActivityExecution stays in state CaseExecutionState.NEW.

For example:

There exists:

When the Stage instance becomes active, two child case executions will be created for task A and task B. Both tasks are in the state CaseExecutionState.NEW. Now task A performs the create transition and so that the given sentry is triggered, that this is satisfied. Afterwards the sentry will be reseted, that the sentry is not satisfied anymore.

But task B is still in the state CaseExecutionState.NEW and will not be notified, that its' entry criterion has been satisfied. That's why the the flag entryCriterionSatisfied will be set to true on the case execution of task B in such a situation. When task B performs the transition into the state CaseExecutionState.AVAILABLE it can perform the next transition because the entry criterion has been already satisfied.

Specified by:
isEntryCriterionSatisfied in interface CmmnActivityExecution

isExitCriterionSatisfied

public boolean isExitCriterionSatisfied()
Description copied from interface: CmmnActivityExecution

The flag exitCriterionSatisfied will only be set to true, when this CmmnActivityExecution stays in state CaseExecutionState.NEW.

For example:

There exists:

When the Stage instance becomes active, two child case executions will be created for task A and task B. Both tasks are in the state CaseExecutionState.NEW. Now task A performs the create transition and so that the given sentry is triggered, that this is satisfied. Afterwards the sentry will be reseted, that the sentry is not satisfied anymore.

But task B is still in the state CaseExecutionState.NEW and will not be notified, that its' exit criterion has been satisfied. That's why the the flag exitCriterionSatisfied will be set to true on the case execution of task B in such a situation. When task B performs the transition into the state CaseExecutionState.AVAILABLE it can perform the exit transition because the exit criterion has been already satisfied.

Specified by:
isExitCriterionSatisfied in interface CmmnActivityExecution

getCaseBusinessKey

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

getCaseDefinition

public CmmnCaseDefinition getCaseDefinition()

setCaseDefinition

public void setCaseDefinition(CmmnCaseDefinition caseDefinition)

getCaseInstance

public abstract CmmnExecution getCaseInstance()
ensures initialization and returns the process instance.


setCaseInstance

public abstract void setCaseInstance(CmmnExecution caseInstance)

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
Returns:
whether this case execution is a case instance or not.

getCaseInstanceId

public String getCaseInstanceId()
ensures initialization and returns the process instance.

Specified by:
getCaseInstanceId in interface DelegateCaseExecution

getParent

public abstract CmmnExecution getParent()
ensures initialization and returns the parent

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

setParent

public abstract void setParent(CmmnExecution parent)

getActivity

public CmmnActivity getActivity()
ensures initialization and returns the activity

Specified by:
getActivity in interface CmmnActivityExecution
Returns:
the associated activity

setActivity

public void setActivity(CmmnActivity activity)

getVariableScopeKey

public String getVariableScopeKey()
Specified by:
getVariableScopeKey in interface VariableScope
Overrides:
getVariableScopeKey in class AbstractVariableScope

getParentVariableScope

public AbstractVariableScope getParentVariableScope()
Specified by:
getParentVariableScope in class AbstractVariableScope

deleteCascade

public void deleteCascade()

remove

public void remove()
Description copied from interface: CmmnActivityExecution

Removes this case execution from the parent case execution.

Specified by:
remove in interface CmmnActivityExecution

isRequired

public boolean isRequired()
Description copied from interface: CmmnActivityExecution

Returns true, if this case execution is required.

Specified by:
isRequired in interface CmmnActivityExecution
Returns:
true if this case execution is required.

setRequired

public void setRequired(boolean required)
Description copied from interface: CmmnActivityExecution

Sets this case execution as required or not required.

Specified by:
setRequired in interface CmmnActivityExecution
Parameters:
required - a boolean value whether this case execution is required or not required.

getCurrentState

public CaseExecutionState getCurrentState()
Description copied from interface: CmmnActivityExecution

Returns the current state of this case execution.

Specified by:
getCurrentState in interface CmmnActivityExecution
Returns:
the current state

setCurrentState

public void setCurrentState(CaseExecutionState currentState)
Description copied from interface: CmmnActivityExecution

Sets the given state as the current state of this case execution.

Specified by:
setCurrentState in interface CmmnActivityExecution
Parameters:
currentState - the current state to set

getState

public int getState()

setState

public void setState(int state)

isNew

public boolean isNew()
Description copied from interface: CmmnActivityExecution

Returns true iff:
CmmnActivityExecution.getCurrentState() == CaseExecutionState.NEW

Specified by:
isNew in interface CmmnActivityExecution
Returns:
whether this case execution has as current state CaseExecutionState.NEW

isAvailable

public boolean isAvailable()
Specified by:
isAvailable in interface DelegateCaseExecution

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface DelegateCaseExecution

isDisabled

public boolean isDisabled()
Specified by:
isDisabled in interface DelegateCaseExecution

isActive

public boolean isActive()
Specified by:
isActive in interface DelegateCaseExecution

isCompleted

public boolean isCompleted()
Specified by:
isCompleted in interface DelegateCaseExecution

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface DelegateCaseExecution

isSuspending

public boolean isSuspending()
Description copied from interface: CmmnActivityExecution

Returns true iff:
CmmnActivityExecution.getCurrentState() == CaseExecutionState.SUSPENDING_ON_SUSPENSION || CmmnActivityExecution.getCurrentState() == CaseExecutionState.SUSPENDING_ON_PARENT_SUSPENSION

Specified by:
isSuspending in interface CmmnActivityExecution
Returns:
whether this case execution has as current state CaseExecutionState.SUSPENDING_ON_SUSPENSION or CaseExecutionState.SUSPENDING_ON_PARENT_SUSPENSION

isTerminated

public boolean isTerminated()
Specified by:
isTerminated in interface DelegateCaseExecution

isTerminating

public boolean isTerminating()
Description copied from interface: CmmnActivityExecution

Returns true iff:
CmmnActivityExecution.getCurrentState() == CaseExecutionState.TERMINATING_ON_TERMINATION || CmmnActivityExecution.getCurrentState() == CaseExecutionState.TERMINATING_ON_PARENT_TERMINATION || CmmnActivityExecution.getCurrentState() == CaseExecutionState.TERMINATING_ON_EXIT

Specified by:
isTerminating in interface CmmnActivityExecution
Returns:
whether this case execution has as current state CaseExecutionState.TERMINATING_ON_TERMINATION, CaseExecutionState.TERMINATING_ON_PARENT_TERMINATION or CaseExecutionState.TERMINATING_ON_EXIT

isFailed

public boolean isFailed()
Specified by:
isFailed in interface DelegateCaseExecution

isClosed

public boolean isClosed()
Specified by:
isClosed in interface DelegateCaseExecution

getPreviousState

public CaseExecutionState getPreviousState()
Description copied from interface: CmmnActivityExecution

Returns the previous state of this case execution.

Specified by:
getPreviousState in interface CmmnActivityExecution
Returns:
the previous state

getPrevious

public int getPrevious()

setPrevious

public void setPrevious(int previous)

create

public void create()
Description copied from interface: CmmnCaseInstance

This case instance transitions to ACTIVE state.

Specified by:
create in interface CmmnCaseInstance

create

public void create(Map<String,Object> variables)
Description copied from interface: CmmnCaseInstance

This case instance transitions to ACTIVE state.

The given variables will be set a case instance variables.

Specified by:
create in interface CmmnCaseInstance

createChildExecutions

public List<CmmnExecution> createChildExecutions(List<CmmnActivity> activities)
Description copied from interface: CmmnActivityExecution

Creates new child case executions for each given CmmnActivity.

Afterwards the method CmmnActivityExecution.triggerChildExecutionsLifecycle(List) must be called to execute each created case executions (ie. the create listener will be notified etc.).

According to the CMMN 1.0 specification:
This method can be called when this case execution (which represents a Stage) transitions to ACTIVE state. The passed collection of activities are the planned items that should be executed in this Stage. So that for each given CmmnActivity a new case execution will be instantiated. Furthermore for each created child execution there happens a transition to the initial state AVAILABLE.

Specified by:
createChildExecutions in interface CmmnActivityExecution
Parameters:
activities - a collection of activities of planned items to execute inside this case execution

triggerChildExecutionsLifecycle

public void triggerChildExecutionsLifecycle(List<CmmnExecution> children)
Description copied from interface: CmmnActivityExecution

This method triggers for each given case execution the lifecycle.

This method must be called after CmmnActivityExecution.createChildExecutions(List).

Specified by:
triggerChildExecutionsLifecycle in interface CmmnActivityExecution
Parameters:
children - a collection of case execution to trigger for each given case execution the lifecycle

createCaseExecution

protected abstract CmmnExecution createCaseExecution(CmmnActivity activity)

newCaseExecution

protected abstract CmmnExecution newCaseExecution()

enable

public void enable()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.ENABLED state.

This case execution must be in CaseExecutionState.AVAILABLE state to be able to do this transition.

It is only possible to enable a case execution which is associated with a Stage or Task.

Specified by:
enable in interface CmmnActivityExecution

disable

public void disable()
Description copied from interface: CmmnActivityExecution

Transition to state.

This case execution must be in CaseExecutionState.ENABLED state to be able to do this transition.

It is only possible to disable a case execution which is associated with a Stage or Task.

If this case execution has a parent case execution, that parent case execution will be notified that this case execution has been disabled. This can lead to a completion of the parent case execution, for more details when the parent case execution can be completed see CmmnActivityExecution.complete().

Specified by:
disable in interface CmmnActivityExecution

reenable

public void reenable()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.ENABLED state.

This case execution must be in CaseExecutionState.DISABLED state to be able to do this transition.

It is only possible to re-enable a case execution which is associated with a Stage or Task.

Specified by:
reenable in interface CmmnActivityExecution

manualStart

public void manualStart()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.ACTIVE state.

This case execution must be in CaseExecutionState.ENABLED state to be able to do this transition.

It is only possible to start a case execution manually which is associated with a Stage or Task.

Specified by:
manualStart in interface CmmnActivityExecution

start

public void start()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.ACTIVE state.

This case execution must be in CaseExecutionState.AVAILABLE state to be able to do this transition.

It is only possible to start a case execution which is associated with a Stage or Task.

Specified by:
start in interface CmmnActivityExecution

complete

public void complete()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.COMPLETED state.

This case execution must be in CaseExecutionState.ACTIVE state to be able to do this transition.

It is only possible to complete a case execution which is associated with a Stage or Task.

If this case execution has a parent case execution, that parent case execution will be notified that this case execution has been completed. This can lead to a completion of the parent case execution, for more details when the parent case execution can be completed see CmmnActivityExecution.complete().

In case of a Stage the completion can only be performed when the following criteria are fulfilled:

For a Task instance, this means its purpose has been accomplished:

Specified by:
complete in interface CmmnActivityExecution

manualComplete

public void manualComplete()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.COMPLETED state.

This case execution must be in CaseExecutionState.ACTIVE state to be able to do this transition.

It is only possible to complete a case execution manually which is associated with a Stage or Task.

If this case execution has a parent case execution, that parent case execution will be notified that this case execution has been completed. This can lead to a completion of the parent case execution, for more details when the parent case execution can be completed see CmmnActivityExecution.complete().

In case of a Stage the completion can only be performed when the following criteria are fulfilled:

For a Task instance, this means its purpose has been accomplished:

Specified by:
manualComplete in interface CmmnActivityExecution

occur

public void occur()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.COMPLETED state.

This case execution must be in CaseExecutionState.AVAILABLE state to be able to do this transition.

For event listener transitions when the event being listened by the event listener instance does occur. For a user event listener instance this transition happens when a human decides to raise the event.

For Milestone instance transitions when one of the achieving sentries (entry criteria) is satisfied.

If this case execution has a parent case execution, that parent case execution will be notified that this case execution has been completed (ie.the event or milestone occured). This can lead to a completion of the parent case execution, for more details when the parent case execution can be completed see CmmnActivityExecution.complete().

Specified by:
occur in interface CmmnActivityExecution

terminate

public void terminate()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.TERMINATING_ON_TERMINATION state.

If this case execution is associated with a Stage or Task, then this case execution must be in CaseExecutionState.ACTIVE state to be able to do this transition.
And if this case execution is association with EventListener or a Milestone, then this case execution must be in CaseExecutionState.AVAILABLE state to be able to do this transition.

For a Stage instance the termination of this case execution will be propagated down to all its contained EventListener, Milestone, Stage, and Task instances.

In case of a Stage this corresponding case execution stays in this state until all children notified this case execution, that they terminated successfully. Afterwards the method CmmnActivityExecution.performTerminate() must be called to complete the transition into the state CaseExecutionState.TERMINATED.

Specified by:
terminate in interface CmmnActivityExecution

performTerminate

public void performTerminate()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.TERMINATED state.

If this case execution has a parent case execution, that parent case execution will be notified that this case execution has been terminated. This can lead to a completion of the parent case execution, for more details when the parent case execution can be completed see CmmnActivityExecution.complete().

Specified by:
performTerminate in interface CmmnActivityExecution

parentTerminate

public void parentTerminate()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.TERMINATING_ON_PARENT_TERMINATION state.

This case execution must be in CaseExecutionState.AVAILABLE or CaseExecutionState.SUSPENDED state to be able to do this transition.

It is only possible to execute a parent termination on a case execution which is associated with a EventListener or Milestone.

Afterwards the method CmmnActivityExecution.performParentTerminate() must be called to complete the transition into the state CaseExecutionState.TERMINATED.

Specified by:
parentTerminate in interface CmmnActivityExecution

performParentTerminate

public void performParentTerminate()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.TERMINATED state.

This case execution must be in CaseExecutionState.AVAILABLE or CaseExecutionState.SUSPENDED state to be able to do this transition.

It is only possible to execute a parent termination on a case execution which is associated with a EventListener or Milestone.

Specified by:
performParentTerminate in interface CmmnActivityExecution

exit

public void exit()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.TERMINATING_ON_EXIT state.

This case execution must be in one of the following state to be able to do this transition:

It is only possible to execute an exit on a case execution which is associated with a Stage or Task.

Afterwards the method CmmnActivityExecution.performExit() must be called to complete the transition into the state CaseExecutionState.TERMINATED.

If this transition is triggered by a fulfilled exit criteria and if this case execution has a parent case execution, that parent case execution will be notified that this case execution has been terminated. This can lead to a completion of the parent case execution, for more details when the parent case execution can be completed see CmmnActivityExecution.complete().

Specified by:
exit in interface CmmnActivityExecution

performExit

public void performExit()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.TERMINATED state.

This can lead to a completion of the parent case execution, for more details when the parent case execution can be completed see CmmnActivityExecution.complete().

Specified by:
performExit in interface CmmnActivityExecution

suspend

public void suspend()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.SUSPENDING_ON_SUSPENSION state.

If this case execution is associated with a Stage or Task, then this case execution must be in CaseExecutionState.ACTIVE state to be able to do this transition.
And if this case execution is association with EventListener or a Milestone, then this case execution must be in CaseExecutionState.AVAILABLE state to be able to do this transition.

For a Stage instance the suspension of this case execution will be propagated down to all its contained EventListener, Milestone, Stage, and Task instances.

Afterwards the method CmmnActivityExecution.performSuspension() must be called to complete the transition into the state CaseExecutionState.SUSPENDED.

Specified by:
suspend in interface CmmnActivityExecution

performSuspension

public void performSuspension()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.SUSPENDED state.

Specified by:
performSuspension in interface CmmnActivityExecution

parentSuspend

public void parentSuspend()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.SUSPENDING_ON_PARENT_SUSPENSION state.

This case execution must be in one of the following state to be able to do this transition:

It is only possible to execute a parent suspension on a case execution which is associated with a Stage or Task.

Afterwards the method CmmnActivityExecution.performParentSuspension() must be called to complete the transition into the state CaseExecutionState.SUSPENDED.

Specified by:
parentSuspend in interface CmmnActivityExecution

performParentSuspension

public void performParentSuspension()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.SUSPENDED state.

Specified by:
performParentSuspension in interface CmmnActivityExecution

resume

public void resume()
Description copied from interface: CmmnActivityExecution

Transition to either to CaseExecutionState.ACTIVE state, if this case execution is associated with a Stage or Task, or to CaseExecutionState#AVAILABE, if this case execution is associated with a EventListener or Milestone.

This case execution must be in CaseExecutionState.SUSPENDED state to be able to do this transition.

For a Stage instance the resume of this case execution will be propagated down to all its contained EventListener, Milestone, Stage, and Task instances.

Specified by:
resume in interface CmmnActivityExecution

parentResume

public void parentResume()
Description copied from interface: CmmnActivityExecution

Transition to the previous state (CaseExecutionState.AVAILABLE, CaseExecutionState.ENABLED, CaseExecutionState.DISABLED or CaseExecutionState.ACTIVE) when the parent Stage transitions out of CaseExecutionState.SUSPENDED.

This case execution must be in CaseExecutionState.SUSPENDED state to be able to do this transition.

It is only possible to execute a parent resume on a case execution which is associated with a Stage or Task.

Specified by:
parentResume in interface CmmnActivityExecution

reactivate

public void reactivate()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.ACTIVE state.

If this case execution is associated with a Stage or Task and is not a case instance, then this case execution must be in CaseExecutionState.FAILED state to be able to do this transition.
And if this case execution is a case instance, then this case instance must be in one of the following state to perform this transition:

In case of a case instance the transition out of CaseExecutionState.SUSPENDED state the resume will be propagated down to all its contained EventListener, Milestone, Stage, and Task instances, see CmmnActivityExecution.resume() and CmmnActivityExecution.parentResume().

Specified by:
reactivate in interface CmmnActivityExecution

close

public void close()
Description copied from interface: CmmnActivityExecution

Transition to CaseExecutionState.CLOSED state when no further work or modifications should be allowed for this case instance.

It is only possible to close a case instance which is in one of the following states:

Specified by:
close in interface CmmnActivityExecution

dispatchEvent

public void dispatchEvent(VariableEvent variableEvent)
Specified by:
dispatchEvent in interface VariableEventDispatcher
Overrides:
dispatchEvent in class AbstractVariableScope

queueVariableEvent

protected void queueVariableEvent(VariableEvent variableEvent,
                                  boolean includeCustomerListeners)

invokeVariableListeners

protected void invokeVariableListeners(boolean includeCustomerListeners)

getVariableEventQueue

protected Queue<VariableEvent> getVariableEventQueue()

toString

public String toString()
Overrides:
toString in class Object

getToStringIdentity

protected String getToStringIdentity()


Copyright © 2016 camunda services GmbH. All rights reserved.