Enum Class NexusOperationCancellationType

java.lang.Object
java.lang.Enum<NexusOperationCancellationType>
io.temporal.workflow.NexusOperationCancellationType
All Implemented Interfaces:
Serializable, Comparable<NexusOperationCancellationType>, Constable

@Experimental public enum NexusOperationCancellationType extends Enum<NexusOperationCancellationType>
Defines behavior of the parent workflow when CancellationScope that wraps Nexus operation is canceled. The result of the cancellation independently of the type is a CanceledFailure thrown from the Nexus operation method. If the caller exits without waiting, the cancellation request may not be delivered to the handler, regardless of indicated cancellation type.

Note: Nexus operation cancellation can fail if the operation handler fails the cancellation request. In this case, the operation will throw the exception from the handler if cancellation has not already been reported to the caller.

  • Enum Constant Details

    • WAIT_COMPLETED

      public static final NexusOperationCancellationType WAIT_COMPLETED
      Wait for operation completion. Operation may or may not complete as cancelled. Default.
    • WAIT_REQUESTED

      public static final NexusOperationCancellationType WAIT_REQUESTED
      Request cancellation of the operation and wait for confirmation that the request was received. Doesn't wait for actual cancellation.
    • TRY_CANCEL

      public static final NexusOperationCancellationType TRY_CANCEL
      Initiate a cancellation request and immediately report cancellation to the caller. Note that it doesn't guarantee that cancellation is delivered to the operation handler if the caller exits before the delivery is done.
    • ABANDON

      public static final NexusOperationCancellationType ABANDON
      Do not request cancellation of the operation and immediately report cancellation to the caller.
  • Method Details

    • values

      public static NexusOperationCancellationType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NexusOperationCancellationType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null