Cancels a specified Process Activity , handling employee check-outs automatically if configured. The service validates that the Process Activity is in a state that allows cancellation, performs any necessary employee check-outs, terminates the active checklist instance if applicable, and sets the Process Activity state to Canceled.
Validates the input is not null and loads the full ProcessActivity entity.
Checks that the ProcessActivity is in a cancellable state (Open, In Progress, or Paused). If not, it throws an exception.
Checks if there are any employees currently checked in to the Process Activity .
If employees are checked in and the Process Activity definition allows:
Auto check-out on close is enabled: performs automatic check-out for all checked-in employees.
Otherwise, cancellation proceeds only if no employees remain checked in; if employees remain checked in, the Process Activity cannot be terminated.
If the Process Activity cannot be terminated due to checked-in employees, it terminates the active checklist instance (if any) to keep dependencies consistent.
Sets the system state of the Process Activity to Canceled.
If allowed, terminates the Process Activity only when there is no checklist associated to the Process Activity to finalize cancellation.
Returns the updated Process Activity in the output.