Record Class WorkflowStep

java.lang.Object
java.lang.Record
io.axoniq.framework.workflow.dsl.api.WorkflowStep
Record Components:
stepName - name of the step.
status - step status.
result - result of execution, may be null.
error - error of the execution, may be null.
timestamp - timestamp of step start.
context - processing context.

public record WorkflowStep(String stepName, StepStatus status, Object result, Throwable error, Instant timestamp, Context context) extends Record
Basic step of workflow execution.
Since:
5.4.0
Author:
Allard Buijze, Stefan Dragisic, Simon Zambrovski
  • Constructor Details

    • WorkflowStep

      public WorkflowStep(String stepName, StepStatus status, Object result, Throwable error, Instant timestamp, Context context)
      Creates an instance of a WorkflowStep record class.
      Parameters:
      stepName - the value for the stepName record component
      status - the value for the status record component
      result - the value for the result record component
      error - the value for the error record component
      timestamp - the value for the timestamp record component
      context - the value for the context record component
  • Method Details

    • started

      public static WorkflowStep started(String name, Object parameters, Instant timestamp, Context context)
    • completed

      public static WorkflowStep completed(String name, Object result, Instant timestamp, Context context)
    • failed

      public static WorkflowStep failed(String name, Throwable error, Instant timestamp, Context context)
    • timedOut

      public static WorkflowStep timedOut(String name, Object payload, Instant timestamp, Context context)
    • cancelled

      public static WorkflowStep cancelled(String name, Instant timestamp, Context context)
    • retrying

      public static WorkflowStep retrying(String name, StepRetryInfo retryInfo, Instant timestamp, Context context)
    • retryStarted

      public static WorkflowStep retryStarted(String name, StepRetryInfo retryInfo, Instant timestamp, Context context)
      A retry attempt that the store accepted and that is now running. retryInfo.attempt() is the attempt being started; the error is the one that triggered this retry.
      Parameters:
      name - name of the step
      retryInfo - retry state of the attempt being started
      timestamp - timestamp of the attempt start
      context - processing context
      Returns:
      the step in StepStatus.RETRY_STARTED status
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • stepName

      public String stepName()
      Returns the value of the stepName record component.
      Returns:
      the value of the stepName record component
    • status

      public StepStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • result

      public Object result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • error

      public Throwable error()
      Returns the value of the error record component.
      Returns:
      the value of the error record component
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • context

      public Context context()
      Returns the value of the context record component.
      Returns:
      the value of the context record component