Record Class WorkflowResult

java.lang.Object
java.lang.Record
com.axelor.workflow.exec.WorkflowResult
Record Components:
node - where the walk stopped
park - what it is waiting on, when it stopped short of an end
declaredFailure - the name of a failure the definition raised on purpose; null for any other
cause - the defect behind a failure, kept so whoever finally fails the run can log it; null for any other

public record WorkflowResult(WorkflowResult.Status status, String node, String errorMessage, ParkInfo park, WorkflowResult.DeclaredFailure declaredFailure, Throwable cause) extends Record
How one walk of a workflow graph ended.
  • Constructor Details

    • WorkflowResult

      public WorkflowResult(WorkflowResult.Status status, String node, String errorMessage, ParkInfo park, WorkflowResult.DeclaredFailure declaredFailure, Throwable cause)
      Creates an instance of a WorkflowResult record class.
      Parameters:
      status - the value for the status record component
      node - the value for the node record component
      errorMessage - the value for the errorMessage record component
      park - the value for the park record component
      declaredFailure - the value for the declaredFailure record component
      cause - the value for the cause record component
  • Method Details

    • succeeded

      public boolean succeeded()
      Whether the walk reached an end, a terminate end included.
    • completed

      public static WorkflowResult completed(String node)
    • terminated

      public static WorkflowResult terminated(String node)
    • failed

      public static WorkflowResult failed(String node, String message)
    • skipped

      public static WorkflowResult skipped(String reason)
    • waiting

      public static WorkflowResult waiting(String node)
    • waiting

      public static WorkflowResult waiting(String node, ParkInfo park)
    • 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.
    • status

      public WorkflowResult.Status status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • node

      public String node()
      Returns the value of the node record component.
      Returns:
      the value of the node record component
    • errorMessage

      public String errorMessage()
      Returns the value of the errorMessage record component.
      Returns:
      the value of the errorMessage record component
    • park

      public ParkInfo park()
      Returns the value of the park record component.
      Returns:
      the value of the park record component
    • declaredFailure

      public WorkflowResult.DeclaredFailure declaredFailure()
      Returns the value of the declaredFailure record component.
      Returns:
      the value of the declaredFailure record component
    • cause

      public Throwable cause()
      Returns the value of the cause record component.
      Returns:
      the value of the cause record component