Record Class Workflow.RecoverStrategy<T>

Object
Record
akka.javasdk.workflow.Workflow.RecoverStrategy<T>
Enclosing class:
Workflow<S>

public static record Workflow.RecoverStrategy<T>(int maxRetries, String failoverStepName, Optional<T> failoverStepInput) extends Record
  • Constructor Details

    • RecoverStrategy

      public RecoverStrategy(int maxRetries, String failoverStepName, Optional<T> failoverStepInput)
      Creates an instance of a RecoverStrategy record class.
      Parameters:
      maxRetries - the value for the maxRetries record component
      failoverStepName - the value for the failoverStepName record component
      failoverStepInput - the value for the failoverStepInput record component
  • Method Details

    • maxRetries

      public static Workflow.RecoverStrategy.MaxRetries maxRetries(int maxRetries)
      Set the number of retries for a failed step, maxRetries equals 0 means that the step won't retry in case of failure.
    • failoverTo

      @Deprecated public static Workflow.RecoverStrategy<?> failoverTo(String stepName)
      Deprecated.
    • failoverTo

      public static <W> Workflow.RecoverStrategy<Void> failoverTo(akka.japi.function.Function<W,Workflow.StepEffect> lambda)
      In case of a step fails, don't retry but transition to a given step method.
      Type Parameters:
      W - The workflow type containing the step method
      Parameters:
      lambda - Reference to the step method to transition to
      Returns:
      A recovery strategy transitioning to the specified step
    • failoverTo

      @Deprecated public static <T> Workflow.RecoverStrategy<T> failoverTo(String stepName, T input)
    • failoverTo

      public static <W, I> Workflow.RecoverStrategy.RecoveryInput<I> failoverTo(akka.japi.function.Function2<W,I,Workflow.StepEffect> lambda)
      In case of a step fails, don't retry but transition to a given step method with input parameter.
      Type Parameters:
      W - The workflow type containing the step method
      I - The input parameter type for the step
      Parameters:
      lambda - Reference to the step method to transition to
      Returns:
      A builder to provide the input parameter for the recovery strategy
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • maxRetries

      public int maxRetries()
      Returns the value of the maxRetries record component.
      Returns:
      the value of the maxRetries record component
    • failoverStepName

      public String failoverStepName()
      Returns the value of the failoverStepName record component.
      Returns:
      the value of the failoverStepName record component
    • failoverStepInput

      public Optional<T> failoverStepInput()
      Returns the value of the failoverStepInput record component.
      Returns:
      the value of the failoverStepInput record component