Class CmmnExecution
- All Implemented Interfaces:
Serializable,BaseDelegateExecution,CmmnModelExecutionContext,DelegateCaseExecution,ProcessEngineServicesAware,VariableScope,CmmnActivityExecution,CmmnCaseInstance,VariableEventDispatcher
- Direct Known Subclasses:
CaseExecutionEntity,CaseExecutionImpl
- Author:
- Roman Smirnov
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CmmnActivitycurrent activityprotected CmmnCaseDefinitionprotected intprotected booleanThis property will be used ifthisCmmnExecutionis in stateCaseExecutionState.NEWto note that an entry criterion is satisfied.protected static final CmmnBehaviorLoggerprotected intprotected booleanprotected TaskEntityprotected Queue<VariableEvent>Fields inherited from class org.camunda.bpm.engine.impl.core.instance.CoreExecution
businessKey, businessKeyWithoutCascade, eventName, eventSource, id, listenerIndex, skipCustomListeners, skipIoMapping, skipSubprocesses, tenantIdFields inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
cachedElContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddIdIfNotSatisfied(List<String> affectedSentries, CmmnSentryPart sentryPart) protected abstract voidaddSentryPart(CmmnSentryPart sentryPart) protected voidcheckAndFireEntryCriteria(List<String> satisfiedSentries) protected voidcheckAndFireExitCriteria(List<String> satisfiedSentries) voidclose()Transition toCaseExecutionState.CLOSEDstate when no further work or modifications should be allowed for this case instance.collectAffectedSentries(CmmnExecution child, String transition) collectAffectedSentriesWithVariableOnParts(String variableName, String variableEvent, List<CmmnSentryPart> sentryParts) protected Map<String,List<CmmnSentryPart>> protected voidprotected List<CmmnSentryPart>collectSentryParts(Map<String, List<CmmnSentryPart>> sentries) voidcomplete()Transition toCaseExecutionState.COMPLETEDstate.protected booleancontainsIfPartAndExecutionActive(String sentryId, Map<String, List<CmmnSentryPart>> sentries) voidcreate()Thiscase instance transitions toACTIVEstate.voidThiscase instance transitions toACTIVEstate.protected abstract CmmnExecutioncreateCaseExecution(CmmnActivity activity) createChildExecutions(List<CmmnActivity> activities) Creates new child case executions for each givenCmmnActivity.protected CmmnSentryPartcreateIfPart(CmmnSentryDeclaration sentryDeclaration, CmmnIfPartDeclaration ifPartDeclaration) protected CmmnSentryPartcreateOnPart(CmmnSentryDeclaration sentryDeclaration, CmmnOnPartDeclaration onPartDeclaration) protected CmmnSentryPartcreateSentryPart(CmmnSentryDeclaration sentryDeclaration, String type) voidabstract CmmnExecutioncreateSubCaseInstance(CmmnCaseDefinition caseDefinition) Creates a new sub case instance.abstract CmmnExecutioncreateSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey) Creates a new sub case instance.abstract PvmExecutionImplcreateSubProcessInstance(PvmProcessDefinition processDefinition) Creates a new sub process instance.abstract PvmExecutionImplcreateSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey) Creates a new sub process instance.abstract PvmExecutionImplcreateSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId) Creates a new sub process instance.createTask(TaskDecorator taskDecorator) Creates a new task.protected CmmnSentryPartcreateVariableOnPart(CmmnSentryDeclaration sentryDeclaration, CmmnVariableOnPartDeclaration variableOnPartDeclaration) voidvoiddisable()Transition to state.voiddispatchEvent(VariableEvent variableEvent) voidenable()Transition toCaseExecutionState.ENABLEDstate.voidexit()Transition toCaseExecutionState.TERMINATING_ON_EXITstate.findCaseExecution(String activityId) Find a case execution by the givenactivityId.protected abstract List<? extends CmmnSentryPart>findSentry(String sentryId) voidvoidvoidFire sentries that consist only out of ifPart, are not satisfied yet, but do satisfy condition.protected voidfireSentries(List<String> satisfiedSentries) protected voidforceUpdateOnCaseSentryParts(List<CmmnSentryPart> sentryParts) protected voidforceUpdateOnSentries(List<String> sentryIds) ensures initialization and returns the activityprotected List<CmmnSentryPart>getAffectedSentryParts(Map<String, List<CmmnSentryPart>> allSentries, List<String> affectedSentries) The business key for the root execution (e.g.abstract List<? extends CmmnExecution>Returns aListof child case executions.protected abstract List<? extends CmmnExecution>abstract CmmnExecutionensures initialization and returns the process instance.ensures initialization and returns the process instance.abstract List<? extends CmmnSentryPart>Returns thecurrent stateofthiscase execution.abstract CmmnExecutionensures initialization and returns the parentintReturns theprevious stateofthiscase execution.getSatisfiedSentries(List<String> sentryIds) Checks for each given sentry id whether the corresponding sentry is satisfied.getSatisfiedSentriesInExecutionTree(List<String> sentryIds, Map<String, List<CmmnSentryPart>> allSentries) Checks for each given sentry id in the execution tree whether the corresponding sentry is satisfied.protected abstract Map<String,List<CmmnSentryPart>> intgetState()abstract CmmnExecutionabstract PvmExecutionImplabstract CmmnExecutionabstract PvmExecutionImplgetTask()protected Stringprotected Queue<VariableEvent>voidhandleChildTransition(CmmnExecution child, String transition) voidhandleVariableTransition(String variableName, String transition) protected booleanhasVariableWithSameNameInParent(CmmnExecution execution, String variableName) protected voidinvokeVariableListeners(boolean includeCustomerListeners) booleanisActive()booleanbooleanReturnstrueifthiscase execution is a case instance.booleanisClosed()booleanbooleanbooleanbooleanThe flagentryCriterionSatisfiedwill only be set totrue, whenthisCmmnActivityExecutionstays in stateCaseExecutionState.NEW.booleanisFailed()booleanisNew()protected booleanisNotSatisfiedIfPartOnly(CmmnSentryPart sentryPart) booleanReturns true, ifthiscase execution is required.protected booleanisSentryPartsSatisfied(String sentryId, List<? extends CmmnSentryPart> sentryParts) booleanisSentrySatisfied(String sentryId) booleanbooleanbooleanbooleanvoidTransition toCaseExecutionState.COMPLETEDstate.voidTransition toCaseExecutionState.ACTIVEstate.protected abstract CmmnExecutionprotected abstract CmmnSentryPartvoidoccur()Transition toCaseExecutionState.COMPLETEDstate.voidTransition toCaseExecutionState.TERMINATEDstate.voidTransition to the previous state (CaseExecutionState.AVAILABLE,CaseExecutionState.ENABLED,CaseExecutionState.DISABLEDorCaseExecutionState.ACTIVE) when the parentStagetransitions out ofCaseExecutionState.SUSPENDED.voidTransition toCaseExecutionState.SUSPENDING_ON_PARENT_SUSPENSIONstate.voidTransition toCaseExecutionState.TERMINATING_ON_PARENT_TERMINATIONstate.voidTransition toCaseExecutionState.TERMINATEDstate.voidTransition toCaseExecutionState.SUSPENDEDstate.voidTransition toCaseExecutionState.TERMINATEDstate.voidTransition toCaseExecutionState.SUSPENDEDstate.voidTransition toCaseExecutionState.TERMINATEDstate.protected voidqueueVariableEvent(VariableEvent variableEvent, boolean includeCustomerListeners) voidTransition toCaseExecutionState.ACTIVEstate.voidreenable()Transition toCaseExecutionState.ENABLEDstate.voidremove()Removesthiscase execution from the parent case execution.protected voidresetSentries(List<String> sentries) protected voidresetSentryParts(List<CmmnSentryPart> parts) voidresume()Transition to either toCaseExecutionState.ACTIVEstate, ifthiscase execution is associated with aStageorTask, or toCaseExecutionState#AVAILABE, ifthiscase execution is associated with aEventListenerorMilestone.voidsetActivity(CmmnActivity activity) voidsetCaseDefinition(CmmnCaseDefinition caseDefinition) abstract voidsetCaseInstance(CmmnExecution caseInstance) voidsetCurrentState(CaseExecutionState currentState) Sets the givenstateas the current state ofthiscase execution.abstract voidsetParent(CmmnExecution parent) voidsetPrevious(int previous) voidsetRequired(boolean required) Setsthiscase execution as required or not required.voidsetState(int state) abstract voidsetSubCaseInstance(CmmnExecution subCaseInstance) abstract voidsetSubProcessInstance(PvmExecutionImpl subProcessInstance) abstract voidsetSuperCaseExecution(CmmnExecution superCaseExecution) abstract voidsetSuperExecution(PvmExecutionImpl superExecution) voidvoidstart()Transition toCaseExecutionState.ACTIVEstate.voidsuspend()Transition toCaseExecutionState.SUSPENDING_ON_SUSPENSIONstate.voidTransition toCaseExecutionState.TERMINATING_ON_TERMINATIONstate.toString()voidtriggerChildExecutionsLifecycle(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
getBusinessKeyWithoutCascade, getEventName, getEventSource, getId, getListenerIndex, getTenantId, hasFailedOnEndListeners, invokeListener, isSkipCustomListeners, isSkipIoMappings, isSkipSubprocesses, performOperation, performOperationSync, setBusinessKey, setEventName, setEventSource, setId, setListenerIndex, setSkipCustomListeners, setSkipIoMappings, setSkipSubprocesseses, setTenantIdMethods inherited from class org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope
collectVariableNames, collectVariables, getCachedElContext, getSourceActivityVariableScope, getValueFromVariableInstance, getVariable, getVariable, getVariableInstance, getVariableInstanceFactory, getVariableInstanceLifecycleListeners, getVariableInstanceLocal, getVariableInstancesLocal, getVariableInstancesLocal, getVariableLocal, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariableStore, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, initializeVariableStore, invokeVariableLifecycleListenersCreate, invokeVariableLifecycleListenersCreate, invokeVariableLifecycleListenersDelete, invokeVariableLifecycleListenersDelete, invokeVariableLifecycleListenersUpdate, invokeVariableLifecycleListenersUpdate, removeVariable, removeVariable, removeVariableLocal, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setCachedElContext, setVariable, setVariable, setVariable, setVariable, setVariableLocal, setVariableLocal, setVariableLocal, setVariables, setVariables, setVariablesLocal, setVariablesLocalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.camunda.bpm.engine.delegate.CmmnModelExecutionContext
getCmmnModelElementInstance, getCmmnModelInstanceMethods inherited from interface org.camunda.bpm.engine.delegate.DelegateCaseExecution
getActivityId, getActivityName, getCaseDefinitionId, getEventName, getId, getParentId, getTenantIdMethods inherited from interface org.camunda.bpm.engine.delegate.ProcessEngineServicesAware
getProcessEngine, getProcessEngineServicesMethods inherited from interface org.camunda.bpm.engine.delegate.VariableScope
getVariable, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, removeVariable, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setVariable, setVariableLocal, setVariables, setVariablesLocal
-
Field Details
-
LOG
-
caseDefinition
-
activity
current activity -
required
protected boolean required -
previousState
protected int previousState -
currentState
protected int currentState -
variableEventsQueue
-
task
-
entryCriterionSatisfied
protected boolean entryCriterionSatisfiedThis property will be used ifthisCmmnExecutionis in stateCaseExecutionState.NEWto note that an entry criterion is satisfied.
-
-
Constructor Details
-
CmmnExecution
public CmmnExecution()
-
-
Method Details
-
getCaseExecutions
Description copied from interface:CmmnActivityExecutionReturns a
Listof child case executions. Ifthiscase execution has no child case executions an emptyListwill be returned.- Specified by:
getCaseExecutionsin interfaceCmmnActivityExecution- Returns:
- a
Listof child case executions.
-
getCaseExecutionsInternal
-
findCaseExecution
Description copied from interface:CmmnCaseInstanceFind a case execution by the given
activityId.- Specified by:
findCaseExecutionin interfaceCmmnCaseInstance- Parameters:
activityId- the id of theactivityto which a case execution is associated.- Returns:
- returns a case execution or null if a case execution could not be found.
-
getTask
-
setTask
-
createTask
Description copied from interface:CmmnActivityExecutionCreates a new task.
case execution will be the case execution of the created task.This- Specified by:
createTaskin interfaceCmmnActivityExecution- Parameters:
taskDecorator- the task decorator used to create task
-
getSuperExecution
-
setSuperExecution
-
getSubProcessInstance
-
setSubProcessInstance
-
createSubProcessInstance
Description copied from interface:CmmnActivityExecutionCreates a new sub process instance.
Thiscase execution will be the super case execution of the created sub process instance.- Specified by:
createSubProcessInstancein interfaceCmmnActivityExecution- Parameters:
processDefinition- ThePvmProcessDefinitionof the subprocess.
-
createSubProcessInstance
public abstract PvmExecutionImpl createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey) Description copied from interface:CmmnActivityExecutionCreates a new sub process instance.
Thiscase execution will be the super case execution of the created sub process instance.- Specified by:
createSubProcessInstancein interfaceCmmnActivityExecution- Parameters:
processDefinition- ThePvmProcessDefinitionof 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:CmmnActivityExecutionCreates a new sub process instance.
Thiscase execution will be the super case execution of the created sub process instance.- Specified by:
createSubProcessInstancein interfaceCmmnActivityExecution- Parameters:
processDefinition- ThePvmProcessDefinitionof the subprocess.businessKey- The businessKey to be set on sub process instance.caseInstanceId- The caseInstanceId to be set on sub process instance.
-
getSubCaseInstance
-
setSubCaseInstance
-
createSubCaseInstance
Description copied from interface:CmmnActivityExecutionCreates a new sub case instance.
Thiscase execution will be the super case execution of the created sub case instance.- Specified by:
createSubCaseInstancein interfaceCmmnActivityExecution- Parameters:
caseDefinition- TheCmmnCaseDefinitionof the sub case instance.
-
createSubCaseInstance
public abstract CmmnExecution createSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey) Description copied from interface:CmmnActivityExecutionCreates a new sub case instance.
Thiscase execution will be the super case execution of the created sub case instance.- Specified by:
createSubCaseInstancein interfaceCmmnActivityExecution- Parameters:
caseDefinition- TheCmmnCaseDefinitionof the sub case instance.businessKey- The businessKey to be set on sub case instance.
-
getSuperCaseExecution
-
setSuperCaseExecution
-
newSentryPart
-
addSentryPart
-
createSentryParts
public void createSentryParts()Description copied from interface:CmmnActivityExecutionCreates for each defined
PlanItemOnPartandIfPartinside the specifiedSentriesaCmmnSentryPart.- Specified by:
createSentryPartsin interfaceCmmnActivityExecution
-
createOnPart
protected CmmnSentryPart createOnPart(CmmnSentryDeclaration sentryDeclaration, CmmnOnPartDeclaration onPartDeclaration) -
createIfPart
protected CmmnSentryPart createIfPart(CmmnSentryDeclaration sentryDeclaration, CmmnIfPartDeclaration ifPartDeclaration) -
createVariableOnPart
protected CmmnSentryPart createVariableOnPart(CmmnSentryDeclaration sentryDeclaration, CmmnVariableOnPartDeclaration variableOnPartDeclaration) -
createSentryPart
-
handleChildTransition
-
fireIfOnlySentryParts
public void fireIfOnlySentryParts()Description copied from interface:CmmnActivityExecutionFire sentries that consist only out of ifPart, are not satisfied yet, but do satisfy condition.- Specified by:
fireIfOnlySentryPartsin interfaceCmmnActivityExecution
-
handleVariableTransition
-
collectAffectedSentries
-
isNotSatisfiedIfPartOnly
-
addIdIfNotSatisfied
-
collectAffectedSentriesWithVariableOnParts
-
hasVariableWithSameNameInParent
-
collectAllSentries
-
getAffectedSentryParts
protected List<CmmnSentryPart> getAffectedSentryParts(Map<String, List<CmmnSentryPart>> allSentries, List<String> affectedSentries) -
collectSentryParts
-
forceUpdateOnCaseSentryParts
-
getSatisfiedSentries
Checks for each given sentry id whether the corresponding sentry is satisfied. -
getSatisfiedSentriesInExecutionTree
protected List<String> getSatisfiedSentriesInExecutionTree(List<String> sentryIds, Map<String, List<CmmnSentryPart>> allSentries) Checks for each given sentry id in the execution tree whether the corresponding sentry is satisfied. -
forceUpdateOnSentries
-
resetSentries
-
resetSentryParts
-
fireSentries
-
collectCaseExecutionsInExecutionTree
-
checkAndFireExitCriteria
-
checkAndFireEntryCriteria
-
fireExitCriteria
public void fireExitCriteria() -
fireEntryCriteria
public void fireEntryCriteria() -
getCaseSentryParts
-
findSentry
-
getSentries
-
isSentrySatisfied
Description copied from interface:CmmnActivityExecutionReturns
true, if eachCmmnSentryPartof the givensentryIdis satisfied.- Specified by:
isSentrySatisfiedin interfaceCmmnActivityExecution- Parameters:
sentryId- the id of the sentry to check- Returns:
trueif the sentry is satisfied.
-
isSentryPartsSatisfied
protected boolean isSentryPartsSatisfied(String sentryId, List<? extends CmmnSentryPart> sentryParts) -
containsIfPartAndExecutionActive
protected boolean containsIfPartAndExecutionActive(String sentryId, Map<String, List<CmmnSentryPart>> sentries) -
isEntryCriterionSatisfied
public boolean isEntryCriterionSatisfied()Description copied from interface:CmmnActivityExecutionThe flag
entryCriterionSatisfiedwill only be set totrue, whenthisCmmnActivityExecutionstays in stateCaseExecutionState.NEW.For example:
There exists:
- a
Stage, - the
Stagecontains two tasks (A and B) and - task B has an entry criterion which is satisfied,
when task A performs the transition
create
When the
Stageinstance becomes active, two child case executions will be created for task A and task B. Both tasks are in the stateCaseExecutionState.NEW. Now task A performs thecreatetransition 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.NEWand will not be notified, that its' entry criterion has been satisfied. That's why the the flagentryCriterionSatisfiedwill be set totrueon the case execution of task B in such a situation. When task B performs the transition into the stateCaseExecutionState.AVAILABLEit can perform the next transition because the entry criterion has been already satisfied.- Specified by:
isEntryCriterionSatisfiedin interfaceCmmnActivityExecution
- a
-
getCaseBusinessKey
- Specified by:
getCaseBusinessKeyin interfaceDelegateCaseExecution
-
getBusinessKey
Description copied from interface:BaseDelegateExecutionThe business key for the root execution (e.g. process instance).- Specified by:
getBusinessKeyin interfaceBaseDelegateExecution
-
getCaseDefinition
-
setCaseDefinition
-
getCaseInstance
ensures initialization and returns the process instance. -
setCaseInstance
-
isCaseInstanceExecution
public boolean isCaseInstanceExecution()Description copied from interface:CmmnActivityExecutionReturns
trueifthiscase execution is a case instance. Ifthiscase execution is not a case instance thenfalsewill be returned.- Specified by:
isCaseInstanceExecutionin interfaceCmmnActivityExecution- Returns:
- whether
thiscase execution is a case instance or not.
-
getCaseInstanceId
ensures initialization and returns the process instance.- Specified by:
getCaseInstanceIdin interfaceDelegateCaseExecution
-
getParent
ensures initialization and returns the parent- Specified by:
getParentin interfaceCmmnActivityExecution- Returns:
- a
parentor null.
-
setParent
-
getActivity
ensures initialization and returns the activity- Specified by:
getActivityin interfaceCmmnActivityExecution- Returns:
- the associated
activity
-
setActivity
-
getVariableScopeKey
- Specified by:
getVariableScopeKeyin interfaceVariableScope- Overrides:
getVariableScopeKeyin classAbstractVariableScope
-
getParentVariableScope
- Specified by:
getParentVariableScopein classAbstractVariableScope
-
deleteCascade
public void deleteCascade() -
remove
public void remove()Description copied from interface:CmmnActivityExecutionRemoves
thiscase execution from the parent case execution.- Specified by:
removein interfaceCmmnActivityExecution
-
isRequired
public boolean isRequired()Description copied from interface:CmmnActivityExecutionReturns true, if
thiscase execution is required.- Specified by:
isRequiredin interfaceCmmnActivityExecution- Returns:
- true if
thiscase execution is required.
-
setRequired
public void setRequired(boolean required) Description copied from interface:CmmnActivityExecutionSets
thiscase execution as required or not required.- Specified by:
setRequiredin interfaceCmmnActivityExecution- Parameters:
required- a boolean value whetherthiscase execution is required or not required.
-
getCurrentState
Description copied from interface:CmmnActivityExecutionReturns the
current stateofthiscase execution.- Specified by:
getCurrentStatein interfaceCmmnActivityExecution- Returns:
- the
current state
-
setCurrentState
Description copied from interface:CmmnActivityExecutionSets the given
stateas the current state ofthiscase execution.- Specified by:
setCurrentStatein interfaceCmmnActivityExecution- 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:CmmnActivityExecutionReturns
trueiff:
CmmnActivityExecution.getCurrentState()==CaseExecutionState.NEW- Specified by:
isNewin interfaceCmmnActivityExecution- Returns:
- whether
thiscase execution has as current stateCaseExecutionState.NEW
-
isAvailable
public boolean isAvailable()- Specified by:
isAvailablein interfaceDelegateCaseExecution
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceDelegateCaseExecution
-
isDisabled
public boolean isDisabled()- Specified by:
isDisabledin interfaceDelegateCaseExecution
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceDelegateCaseExecution
-
isCompleted
public boolean isCompleted()- Specified by:
isCompletedin interfaceDelegateCaseExecution
-
isSuspended
public boolean isSuspended()- Specified by:
isSuspendedin interfaceDelegateCaseExecution
-
isSuspending
public boolean isSuspending()Description copied from interface:CmmnActivityExecutionReturns
trueiff:
CmmnActivityExecution.getCurrentState()==CaseExecutionState.SUSPENDING_ON_SUSPENSION||CmmnActivityExecution.getCurrentState()==CaseExecutionState.SUSPENDING_ON_PARENT_SUSPENSION- Specified by:
isSuspendingin interfaceCmmnActivityExecution- Returns:
- whether
thiscase execution has as current stateCaseExecutionState.SUSPENDING_ON_SUSPENSIONorCaseExecutionState.SUSPENDING_ON_PARENT_SUSPENSION
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceDelegateCaseExecution
-
isTerminating
public boolean isTerminating()Description copied from interface:CmmnActivityExecutionReturns
trueiff:
CmmnActivityExecution.getCurrentState()==CaseExecutionState.TERMINATING_ON_TERMINATION||CmmnActivityExecution.getCurrentState()==CaseExecutionState.TERMINATING_ON_PARENT_TERMINATION||CmmnActivityExecution.getCurrentState()==CaseExecutionState.TERMINATING_ON_EXIT- Specified by:
isTerminatingin interfaceCmmnActivityExecution- Returns:
- whether
thiscase execution has as current stateCaseExecutionState.TERMINATING_ON_TERMINATION,CaseExecutionState.TERMINATING_ON_PARENT_TERMINATIONorCaseExecutionState.TERMINATING_ON_EXIT
-
isFailed
public boolean isFailed()- Specified by:
isFailedin interfaceDelegateCaseExecution
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceDelegateCaseExecution
-
getPreviousState
Description copied from interface:CmmnActivityExecutionReturns the
previous stateofthiscase execution.- Specified by:
getPreviousStatein interfaceCmmnActivityExecution- Returns:
- the
previous state
-
getPrevious
public int getPrevious() -
setPrevious
public void setPrevious(int previous) -
create
public void create()Description copied from interface:CmmnCaseInstanceThiscase instance transitions toACTIVEstate.- Specified by:
createin interfaceCmmnCaseInstance
-
create
Description copied from interface:CmmnCaseInstanceThiscase instance transitions toACTIVEstate.The given
variableswill be set a case instance variables.- Specified by:
createin interfaceCmmnCaseInstance
-
createChildExecutions
Description copied from interface:CmmnActivityExecutionCreates 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 whenthiscase execution (which represents aStage) transitions toACTIVEstate. The passed collection ofactivitiesare the planned items that should be executed in thisStage. So that for each givenCmmnActivitya new case execution will be instantiated. Furthermore for each created child execution there happens a transition to the initial stateAVAILABLE.- Specified by:
createChildExecutionsin interfaceCmmnActivityExecution- Parameters:
activities- a collection ofactivitiesof planned items to execute insidethiscase execution
-
triggerChildExecutionsLifecycle
Description copied from interface:CmmnActivityExecutionThis method triggers for each given case execution the lifecycle.
This method must be called after
CmmnActivityExecution.createChildExecutions(List).- Specified by:
triggerChildExecutionsLifecyclein interfaceCmmnActivityExecution- Parameters:
children- a collection ofcase executionto trigger for each given case execution the lifecycle
-
createCaseExecution
-
newCaseExecution
-
enable
public void enable()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.ENABLEDstate.Thiscase execution must be inCaseExecutionState.AVAILABLEstate to be able to do this transition.It is only possible to enable a case execution which is associated with a
StageorTask.- Specified by:
enablein interfaceCmmnActivityExecution
-
disable
public void disable()Description copied from interface:CmmnActivityExecutionTransition to state.
Thiscase execution must be inCaseExecutionState.ENABLEDstate to be able to do this transition.It is only possible to disable a case execution which is associated with a
StageorTask.If
thiscase execution has a parent case execution, that parent case execution will be notified thatthiscase 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 seeCmmnActivityExecution.complete().- Specified by:
disablein interfaceCmmnActivityExecution
-
reenable
public void reenable()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.ENABLEDstate.Thiscase execution must be inCaseExecutionState.DISABLEDstate to be able to do this transition.It is only possible to re-enable a case execution which is associated with a
StageorTask.- Specified by:
reenablein interfaceCmmnActivityExecution
-
manualStart
public void manualStart()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.ACTIVEstate.Thiscase execution must be inCaseExecutionState.ENABLEDstate to be able to do this transition.It is only possible to start a case execution manually which is associated with a
StageorTask.- Specified by:
manualStartin interfaceCmmnActivityExecution
-
start
public void start()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.ACTIVEstate.Thiscase execution must be inCaseExecutionState.AVAILABLEstate to be able to do this transition.It is only possible to start a case execution which is associated with a
StageorTask.- Specified by:
startin interfaceCmmnActivityExecution
-
complete
public void complete()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.COMPLETEDstate.Thiscase execution must be inCaseExecutionState.ACTIVEstate to be able to do this transition.It is only possible to complete a case execution which is associated with a
StageorTask.If
thiscase execution has a parent case execution, that parent case execution will be notified thatthiscase 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 seeCmmnActivityExecution.complete().In case of a
Stagethe completion can only be performed when the following criteria are fulfilled:
- there are no children in the state
CaseExecutionState.ACTIVEorCaseExecutionState.NEW - if the property
autoCompleteof the associatedStageis set totrue:- all required (
requiredRuleevaluates totrue) children are in state
- all required (
- if the property
autoCompleteof the associatedStageis set tofalse:
For a
Taskinstance, this means its purpose has been accomplished:
HumanTaskhave been completed by human.CaseTaskhave launched a newCaseInstanceand if output parameters are required and/or the propertyisBlockingis set totrue, then the launchedCaseInstancehas completed and returned the output parameters.ProcessTaskhave launched a newProcessInstanceand if output parameters are required and/or the propertyisBlockingis set totrue, then the launchedProcessInstancehas completed and returned the output parameters.
- Specified by:
completein interfaceCmmnActivityExecution
- there are no children in the state
-
manualComplete
public void manualComplete()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.COMPLETEDstate.Thiscase execution must be inCaseExecutionState.ACTIVEstate to be able to do this transition.It is only possible to complete a case execution manually which is associated with a
StageorTask.If
thiscase execution has a parent case execution, that parent case execution will be notified thatthiscase 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 seeCmmnActivityExecution.complete().In case of a
Stagethe completion can only be performed when the following criteria are fulfilled:
- there are no children in the state
CaseExecutionState.ACTIVEorCaseExecutionState.NEW - all required (
requiredRuleevaluates totrue) children are in state
For a
Taskinstance, this means its purpose has been accomplished:
HumanTaskhave been completed by human.
- Specified by:
manualCompletein interfaceCmmnActivityExecution
- there are no children in the state
-
occur
public void occur()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.COMPLETEDstate.Thiscase execution must be inCaseExecutionState.AVAILABLEstate to be able to do this transition.For
Forevent listenertransitions when the event being listened by theevent listenerinstance does occur. For auser event listenerinstance this transition happens when a human decides to raise the event.Milestoneinstance transitions when one of the achievingsentries(entry criteria) is satisfied.If
thiscase execution has a parent case execution, that parent case execution will be notified thatthiscase 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 seeCmmnActivityExecution.complete().- Specified by:
occurin interfaceCmmnActivityExecution
-
terminate
public void terminate()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.TERMINATING_ON_TERMINATIONstate.If
thiscase execution is associated with aStageorTask, thenthiscase execution must be inCaseExecutionState.ACTIVEstate to be able to do this transition.
And ifthiscase execution is association withEventListeneror aMilestone, thenthiscase execution must be inCaseExecutionState.AVAILABLEstate to be able to do this transition.For a
Stageinstance the termination ofthiscase execution will be propagated down to all its containedEventListener,Milestone,Stage, andTaskinstances.In case of a
Stagethis corresponding case execution stays in this state until all children notified this case execution, that they terminated successfully. Afterwards the methodCmmnActivityExecution.performTerminate()must be called to complete the transition into the stateCaseExecutionState.TERMINATED.- Specified by:
terminatein interfaceCmmnActivityExecution
-
performTerminate
public void performTerminate()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.TERMINATEDstate.If
thiscase execution has a parent case execution, that parent case execution will be notified thatthiscase 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 seeCmmnActivityExecution.complete().- Specified by:
performTerminatein interfaceCmmnActivityExecution
-
parentTerminate
public void parentTerminate()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.TERMINATING_ON_PARENT_TERMINATIONstate.Thiscase execution must be inCaseExecutionState.AVAILABLEorCaseExecutionState.SUSPENDEDstate 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
EventListenerorMilestone.Afterwards the method
CmmnActivityExecution.performParentTerminate()must be called to complete the transition into the stateCaseExecutionState.TERMINATED.- Specified by:
parentTerminatein interfaceCmmnActivityExecution
-
performParentTerminate
public void performParentTerminate()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.TERMINATEDstate.Thiscase execution must be inCaseExecutionState.AVAILABLEorCaseExecutionState.SUSPENDEDstate 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
EventListenerorMilestone.- Specified by:
performParentTerminatein interfaceCmmnActivityExecution
-
exit
public void exit()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.TERMINATING_ON_EXITstate.Thiscase execution must be in one of the following state to be able to do this transition:CaseExecutionState.AVAILABLE,CaseExecutionState.ENABLED,CaseExecutionState.DISABLED,CaseExecutionState.ACTIVE,CaseExecutionState.SUSPENDEDorCaseExecutionState.FAILED
It is only possible to execute an exit on a case execution which is associated with a
StageorTask.Afterwards the method
CmmnActivityExecution.performExit()must be called to complete the transition into the stateCaseExecutionState.TERMINATED.If this transition is triggered by a fulfilled exit criteria and if
thiscase execution has a parent case execution, that parent case execution will be notified thatthiscase 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 seeCmmnActivityExecution.complete().- Specified by:
exitin interfaceCmmnActivityExecution
-
parentComplete
public void parentComplete()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.TERMINATEDstate.- Specified by:
parentCompletein interfaceCmmnActivityExecution
-
performExit
public void performExit()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.TERMINATEDstate.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:
performExitin interfaceCmmnActivityExecution
-
suspend
public void suspend()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.SUSPENDING_ON_SUSPENSIONstate.If
thiscase execution is associated with aStageorTask, thenthiscase execution must be inCaseExecutionState.ACTIVEstate to be able to do this transition.
And ifthiscase execution is association withEventListeneror aMilestone, thenthiscase execution must be inCaseExecutionState.AVAILABLEstate to be able to do this transition.For a
Stageinstance the suspension ofthiscase execution will be propagated down to all its containedEventListener,Milestone,Stage, andTaskinstances.Afterwards the method
CmmnActivityExecution.performSuspension()must be called to complete the transition into the stateCaseExecutionState.SUSPENDED.- Specified by:
suspendin interfaceCmmnActivityExecution
-
performSuspension
public void performSuspension()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.SUSPENDEDstate.- Specified by:
performSuspensionin interfaceCmmnActivityExecution
-
parentSuspend
public void parentSuspend()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.SUSPENDING_ON_PARENT_SUSPENSIONstate.Thiscase execution must be in one of the following state to be able to do this transition:CaseExecutionState.AVAILABLE,CaseExecutionState.ENABLED,CaseExecutionState.DISABLEDorCaseExecutionState.ACTIVE
It is only possible to execute a parent suspension on a case execution which is associated with a
StageorTask.Afterwards the method
CmmnActivityExecution.performParentSuspension()must be called to complete the transition into the stateCaseExecutionState.SUSPENDED.- Specified by:
parentSuspendin interfaceCmmnActivityExecution
-
performParentSuspension
public void performParentSuspension()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.SUSPENDEDstate.- Specified by:
performParentSuspensionin interfaceCmmnActivityExecution
-
resume
public void resume()Description copied from interface:CmmnActivityExecutionTransition to either to
CaseExecutionState.ACTIVEstate, ifthiscase execution is associated with aStageorTask, or toCaseExecutionState#AVAILABE, ifthiscase execution is associated with aEventListenerorMilestone.Thiscase execution must be inCaseExecutionState.SUSPENDEDstate to be able to do this transition.For a
Stageinstance the resume ofthiscase execution will be propagated down to all its containedEventListener,Milestone,Stage, andTaskinstances.- Specified by:
resumein interfaceCmmnActivityExecution
-
parentResume
public void parentResume()Description copied from interface:CmmnActivityExecutionTransition to the previous state (
CaseExecutionState.AVAILABLE,CaseExecutionState.ENABLED,CaseExecutionState.DISABLEDorCaseExecutionState.ACTIVE) when the parentStagetransitions out ofCaseExecutionState.SUSPENDED.Thiscase execution must be inCaseExecutionState.SUSPENDEDstate 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
StageorTask.- Specified by:
parentResumein interfaceCmmnActivityExecution
-
reactivate
public void reactivate()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.ACTIVEstate.If
thiscase execution is associated with aStageorTaskand is not a case instance, thenthiscase execution must be inCaseExecutionState.FAILEDstate to be able to do this transition.
And ifthiscase execution is a case instance, thenthiscase instance must be in one of the following state to perform this transition:CaseExecutionState.COMPLETED,CaseExecutionState.SUSPENDED,CaseExecutionState.TERMINATEDorCaseExecutionState.FAILED
In case of a case instance the transition out of
CaseExecutionState.SUSPENDEDstate the resume will be propagated down to all its containedEventListener,Milestone,Stage, andTaskinstances, seeCmmnActivityExecution.resume()andCmmnActivityExecution.parentResume().- Specified by:
reactivatein interfaceCmmnActivityExecution
-
close
public void close()Description copied from interface:CmmnActivityExecutionTransition to
CaseExecutionState.CLOSEDstate 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:
closein interfaceCmmnActivityExecution
-
dispatchEvent
- Specified by:
dispatchEventin interfaceVariableEventDispatcher- Overrides:
dispatchEventin classAbstractVariableScope
-
queueVariableEvent
-
invokeVariableListeners
protected void invokeVariableListeners(boolean includeCustomerListeners) -
getVariableEventQueue
-
toString
-
getToStringIdentity
-