Enum Class ActivityCancellationType

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

public enum ActivityCancellationType extends Enum<ActivityCancellationType>
In case of an activity's call scope cancellation the corresponding activity stub call fails with a CanceledFailure. The different modes of this behavior are available and specified by this enum.
  • Enum Constant Details

    • WAIT_CANCELLATION_COMPLETED

      public static final ActivityCancellationType WAIT_CANCELLATION_COMPLETED
      Wait for the Activity Execution to confirm any requested cancellation. An Activity Execution must Heartbeat to receive a cancellation notification through ActivityCompletionException. This can block the cancellation of a Workflow Execution for a long time if the Activity Execution doesn't Heartbeat or chooses to ignore the cancellation request. The activity stub call will fail with CanceledFailure only after cancellation confirmation from the Activity Execution has been received.
    • TRY_CANCEL

      public static final ActivityCancellationType TRY_CANCEL
      In case of activity's scope cancellation send an Activity cancellation request to the server, and report cancellation to the Workflow Execution by causing the activity stub call to fail with CanceledFailure
    • ABANDON

      public static final ActivityCancellationType ABANDON
      Do not request cancellation of the Activity Execution at all (no request is sent to the server) and immediately report cancellation to the Workflow Execution by causing the activity stub call to fail with CanceledFailure immediately.
  • Method Details

    • values

      public static ActivityCancellationType[] 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 ActivityCancellationType 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