public interface CmmnActivityExecution extends DelegateCaseExecution
Modifier and Type | Method and Description |
---|---|
void |
close()
Transition to
CaseExecutionState.CLOSED state when no further
work or modifications should be allowed for this case instance. |
void |
complete()
Transition to
CaseExecutionState.COMPLETED state. |
List<CmmnExecution> |
createChildExecutions(List<CmmnActivity> activities)
Creates new child case executions for each given
CmmnActivity . |
void |
createSentryParts()
|
CmmnCaseInstance |
createSubCaseInstance(CmmnCaseDefinition caseDefinition)
Creates a new sub case instance.
|
CmmnCaseInstance |
createSubCaseInstance(CmmnCaseDefinition caseDefinition,
String businessKey)
Creates a new sub case instance.
|
PvmProcessInstance |
createSubProcessInstance(PvmProcessDefinition processDefinition)
Creates a new sub process instance.
|
PvmProcessInstance |
createSubProcessInstance(PvmProcessDefinition processDefinition,
String businessKey)
Creates a new sub process instance.
|
PvmProcessInstance |
createSubProcessInstance(PvmProcessDefinition processDefinition,
String businessKey,
String caseInstanceId)
Creates a new sub process instance.
|
Task |
createTask(TaskDecorator taskDecorator)
Creates a new task.
|
void |
disable()
Transition to state.
|
void |
enable()
Transition to
CaseExecutionState.ENABLED state. |
void |
exit()
Transition to
CaseExecutionState.TERMINATING_ON_EXIT state. |
CmmnActivity |
getActivity()
Returns the
activity which is associated with
this case execution. |
List<? extends CmmnExecution> |
getCaseExecutions()
Returns a
List of child case executions. |
CaseExecutionState |
getCurrentState()
Returns the
current state of this
case execution. |
CmmnActivityExecution |
getParent()
Returns the parent of
this case execution, or null
if there is no parent. |
CaseExecutionState |
getPreviousState()
Returns the
previous state of this
case execution. |
boolean |
isCaseInstanceExecution()
Returns
true if this case execution
is a case instance. |
boolean |
isNew()
|
boolean |
isRequired()
Returns to true, if
this case execution is required. |
boolean |
isSentrySatisfied(String sentryId)
|
boolean |
isSuspending()
|
boolean |
isTerminating()
|
void |
manualComplete()
Transition to
CaseExecutionState.COMPLETED state. |
void |
manualStart()
Transition to
CaseExecutionState.ACTIVE state. |
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. |
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. |
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 |
setCurrentState(CaseExecutionState currentState)
Sets the given
state as the
current state of this case execution. |
void |
setRequired(boolean required)
Sets
this case execution as required or not required. |
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. |
void |
triggerChildExecutionsLifecycle(List<CmmnExecution> children)
This method triggers for each given case execution the lifecycle.
|
getActivityId, getActivityName, getCaseBusinessKey, getCaseDefinitionId, getCaseInstanceId, getEventName, getId, getParentId, isActive, isAvailable, isClosed, isCompleted, isDisabled, isEnabled, isFailed, isSuspended, isTerminated
getBusinessKey
getVariable, getVariableLocal, getVariableLocalTyped, getVariableLocalTyped, getVariableNames, getVariableNamesLocal, getVariables, getVariableScopeKey, getVariablesLocal, getVariablesLocalTyped, getVariablesLocalTyped, getVariablesTyped, getVariablesTyped, getVariableTyped, getVariableTyped, hasVariable, hasVariableLocal, hasVariables, hasVariablesLocal, removeVariable, removeVariableLocal, removeVariables, removeVariables, removeVariablesLocal, removeVariablesLocal, setVariable, setVariableLocal, setVariables, setVariablesLocal
getProcessEngineServices
getCmmnModelElementInstance, getCmmnModelInstance
CmmnActivityExecution getParent()
Returns the parent of this
case execution, or null
if there is no parent.
parent
or null.boolean isCaseInstanceExecution()
Returns true
if this
case execution
is a case instance. If this
case execution is not a
case instance then false
will be returned.
this
case execution is a case instance or not.CaseExecutionState getCurrentState()
Returns the current state
of this
case execution.
current state
void setCurrentState(CaseExecutionState currentState)
Sets the given state
as the
current state of this
case execution.
currentState
- the current state to setCaseExecutionState getPreviousState()
Returns the previous state
of this
case execution.
previous state
boolean isNew()
Returns true
iff:
getCurrentState()
== CaseExecutionState.NEW
this
case execution has as current state CaseExecutionState.NEW
boolean isTerminating()
Returns true
iff:
getCurrentState()
== CaseExecutionState.TERMINATING_ON_TERMINATION
|| getCurrentState()
== CaseExecutionState.TERMINATING_ON_PARENT_TERMINATION
|| getCurrentState()
== CaseExecutionState.TERMINATING_ON_EXIT
this
case execution has as current state CaseExecutionState.TERMINATING_ON_TERMINATION
,
CaseExecutionState.TERMINATING_ON_PARENT_TERMINATION
or CaseExecutionState.TERMINATING_ON_EXIT
boolean isSuspending()
Returns true
iff:
getCurrentState()
== CaseExecutionState.SUSPENDING_ON_SUSPENSION
|| getCurrentState()
== CaseExecutionState.SUSPENDING_ON_PARENT_SUSPENSION
this
case execution has as current state
CaseExecutionState.SUSPENDING_ON_SUSPENSION
or CaseExecutionState.SUSPENDING_ON_PARENT_SUSPENSION
CmmnActivity getActivity()
Returns the activity
which is associated with
this
case execution.
activity
List<CmmnExecution> createChildExecutions(List<CmmnActivity> activities)
Creates new child case executions for each given CmmnActivity
.
Afterwards the method 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
.
activities
- a collection of activities
of planned items
to execute inside this
case executionvoid triggerChildExecutionsLifecycle(List<CmmnExecution> children)
This method triggers for each given case execution the lifecycle.
This method must be called after createChildExecutions(List)
.
children
- a collection of case execution
to
trigger for each given case execution the lifecyclevoid enable()
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
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not CaseExecutionState.AVAILABLE
.ProcessEngineException
- when an internal exception happens during the execution
of the command.void disable()
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 complete()
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not CaseExecutionState.ENABLED
.ProcessEngineException
- when an internal exception happens during the execution
of the command.void reenable()
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
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not CaseExecutionState.DISABLED
.ProcessEngineException
- when an internal exception happens during the execution
of the command.void manualStart()
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
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not CaseExecutionState.ENABLED
.ProcessEngineException
- when an internal exception happens during the execution
of the command.void start()
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
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not CaseExecutionState.AVAILABLE
.ProcessEngineException
- when an internal exception happens during the execution
of the command.void complete()
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 complete()
.
In case of a Stage
the completion can only be performed when the following
criteria are fulfilled:
CaseExecutionState.ACTIVE
or CaseExecutionState.NEW
autoComplete
of the associated Stage
is set to true
:
requiredRule
evaluates to true
) children are in state
autoComplete
of the associated Stage
is set to false
:
For a Task
instance, this means its purpose has been accomplished:
HumanTask
have been completed by human.CaseTask
have launched a new CaseInstance
and if output parameters
are required and/or the property isBlocking
is set to true
,
then the launched CaseInstance
has completed and returned the
output parameters.ProcessTask
have launched a new ProcessInstance
and if output parameters
are required and/or the property isBlocking
is set to true
,
then the launched ProcessInstance
has completed and returned the
output parameters.CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not CaseExecutionState.ACTIVE
or when the case execution cannot be
completed.ProcessEngineException
- when an internal exception happens during the execution
of the command.void manualComplete()
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 complete()
.
In case of a Stage
the completion can only be performed when the following
criteria are fulfilled:
CaseExecutionState.ACTIVE
or CaseExecutionState.NEW
requiredRule
evaluates to true
) children are in state
For a Task
instance, this means its purpose has been accomplished:
HumanTask
have been completed by human.CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not CaseExecutionState.ACTIVE
or when the case execution cannot be
completed.ProcessEngineException
- when an internal exception happens during the execution
of the command.void occur()
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.
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 complete()
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not CaseExecutionState.AVAILABLE
.ProcessEngineException
- when an internal exception happens during the execution
of the command.void terminate()
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 performTerminate()
must be called to complete the transition into the state
CaseExecutionState.TERMINATED
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.void performTerminate()
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 complete()
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.void parentTerminate()
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 performParentTerminate()
must be called to complete
the transition into the state CaseExecutionState.TERMINATED
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.void performParentTerminate()
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
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.void exit()
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:
CaseExecutionState.AVAILABLE
,CaseExecutionState.ENABLED
,CaseExecutionState.DISABLED
,CaseExecutionState.ACTIVE
,CaseExecutionState.SUSPENDED
orCaseExecutionState.FAILED
It is only possible to execute an exit on a case execution which is
associated with a Stage
or Task
.
Afterwards the method 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 complete()
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.void performExit()
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 complete()
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.void suspend()
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 performSuspension()
must be called to complete
the transition into the state CaseExecutionState.SUSPENDED
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.void performSuspension()
Transition to CaseExecutionState.SUSPENDED
state.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.void parentSuspend()
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:
CaseExecutionState.AVAILABLE
,CaseExecutionState.ENABLED
,CaseExecutionState.DISABLED
orCaseExecutionState.ACTIVE
It is only possible to execute a parent suspension on a case execution which is
associated with a Stage
or Task
.
Afterwards the method performParentSuspension()
must be called to complete
the transition into the state CaseExecutionState.SUSPENDED
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.void performParentSuspension()
Transition to CaseExecutionState.SUSPENDED
state.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.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
.
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.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.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
.
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
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.void reactivate()
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:
CaseExecutionState.COMPLETED
,CaseExecutionState.SUSPENDED
,CaseExecutionState.TERMINATED
orCaseExecutionState.FAILED
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 resume()
and
parentResume()
.
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.void close()
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:
CaseIllegalStateTransitionException
- will be thrown, if this
case execution
is not in the expected state.ProcessEngineException
- when an internal exception happens during the execution
of the command.boolean isRequired()
Returns to true, if this
case execution is required.
this
case execution is required.void setRequired(boolean required)
Sets this
case execution as required or not required.
required
- a boolean value whether this
case execution
is required or not required.void remove()
Removes this
case execution from the parent case execution.
List<? extends CmmnExecution> getCaseExecutions()
Returns a List
of child case executions. If this
case
execution has no child case executions an empty List
will be returned.
List
of child case executions.Task createTask(TaskDecorator taskDecorator)
Creates a new task.
This
taskDecorator
- the task decorator used to create taskPvmProcessInstance createSubProcessInstance(PvmProcessDefinition processDefinition)
Creates a new sub process instance.
This
case execution will be the super case execution of the
created sub process instance.
processDefinition
- The PvmProcessDefinition
of the subprocess.PvmProcessInstance createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey)
Creates a new sub process instance.
This
case execution will be the super case execution of the
created sub process instance.
processDefinition
- The PvmProcessDefinition
of the subprocess.businessKey
- The businessKey to be set on sub process instance.PvmProcessInstance createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId)
Creates a new sub process instance.
This
case execution will be the super case execution of the
created sub process instance.
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.CmmnCaseInstance createSubCaseInstance(CmmnCaseDefinition caseDefinition)
Creates a new sub case instance.
This
case execution will be the super case execution of the
created sub case instance.
caseDefinition
- The CmmnCaseDefinition
of the sub case instance.CmmnCaseInstance createSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey)
Creates a new sub case instance.
This
case execution will be the super case execution of the
created sub case instance.
caseDefinition
- The CmmnCaseDefinition
of the sub case instance.businessKey
- The businessKey to be set on sub case instance.void createSentryParts()
Creates for each defined PlanItemOnPart
and IfPart
inside
the specified Sentries
a CmmnSentryPart
.
boolean isSentrySatisfied(String sentryId)
Returns true
, if each CmmnSentryPart
of the given
sentryId
is satisfied.
sentryId
- the id of the sentry to checktrue
if the sentry is satisfied.Copyright © 2018. All rights reserved.