Assembly: OptimaJet.Workflow.Core

Enum CancellationTokenHandling

OptimaJet.Workflow.Core.Runtime.CancellationTokenHandling

Specifies whether workflow execution checks a CancellationToken at the post-activity checkpoint before continuing the process.

public enum CancellationTokenHandling

Fields

Ignore = 0 #
Skips the post-activity cancellation check and allows the execution loop to continue.

Remarks

If cancellation has already been requested at the checkpoint, the runtime may still create fork subprocesses, follow automatic transitions, or complete idle or final processing. A later token-aware operation may still observe cancellation. This is the default value of WorkflowRuntimeSettings.CancellationTokenHandling.
Throw = 1 #
Checks the token at the post-activity checkpoint and stops continuation when cancellation has been requested.

Remarks

The runtime calls CancellationToken.ThrowIfCancellationRequested() before starting the continuation work. The check does not roll back persistence updates already performed for the completed activity.

In the standard execution loop, the resulting OperationCanceledException is handled as an execution failure: the runtime records the error, changes the process status to Error when the current activity has command transitions or the process has active timers and to Terminated otherwise, and then throws an ProcessExecutionException that wraps the cancellation exception.

Remarks

The checkpoint is reached after the activity executor returns successfully and the runtime performs the configured persistence updates for the completed activity. It precedes fork subprocess creation, automatic transition execution, break request processing, and completion of the process as idle or finalized.

This setting controls only that explicit checkpoint. The token is still passed to asynchronous actions, conditions, custom activities, event handlers, and other token-aware operations, which may observe cancellation independently.