Transition to {@link CaseExecutionState#COMPLETED} state.
This
case execution must be in {@link CaseExecutionState#ACTIVE}state to be able to do this transition.
It is only possible to complete a case execution which is associated with a {@link Stage} or {@link 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 {@link #complete()}.
In case of a {@link Stage} the completion can only be performed when the followingcriteria are fulfilled:
- there are no children in the state {@link CaseExecutionState#ACTIVE} or {@link CaseExecutionState#NEW}
- if the property
autoComplete
of the associated {@link Stage} is set to true
: - all required (
requiredRule
evaluates to true
) children are in state - {@link CaseExecutionState#DISABLED}
- {@link CaseExecutionState#COMPLETED}
- {@link CaseExecutionState#TERMINATED}
- {@link CaseExecutionState#FAILED}
- if the property
autoComplete
of the associated {@link Stage} is set to false
: - all children are in
- {@link CaseExecutionState#DISABLED}
- {@link CaseExecutionState#COMPLETED}
- {@link CaseExecutionState#TERMINATED}
- {@link CaseExecutionState#FAILED}
For a {@link Task} instance, this means its purpose has been accomplished:
- {@link HumanTask} have been completed by human.
- {@link CaseTask} have launched a new {@link CaseInstance} and if output parametersare required and/or the property
isBlocking
is set to true
, then the launched {@link CaseInstance} has completed and returned theoutput parameters. - {@link ProcessTask} have launched a new {@link ProcessInstance} and if output parametersare required and/or the property
isBlocking
is set to true
, then the launched {@link ProcessInstance} has completed and returned theoutput parameters.
@throws CaseIllegalStateTransitionException will be thrown, if
this
case executionis not {@link CaseExecutionState#ACTIVE} or when the case execution cannot becompleted.
@throws ProcessEngineException when an internal exception happens during the executionof the command.