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 manually 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}
- all required (
requiredRule
evaluates to true
) children are in state - {@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.
@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.