Class WorkflowFailure

All Implemented Interfaces:
Serializable

public final class WorkflowFailure extends RuntimeException
A node failed. A declared failure was raised on purpose with fail(), and a boundary may catch it by its code; an undeclared one is whatever escaped, and only a boundary without a code catches it. code is the author's name for a declared failure, or null.
See Also:
  • Constructor Details

    • WorkflowFailure

      public WorkflowFailure(String nodeId, String message)
      An undeclared failure: something escaped this node.
    • WorkflowFailure

      public WorkflowFailure(String nodeId, String message, Throwable cause)
      An undeclared failure preserving the defect that escaped the node.
  • Method Details

    • declared

      public static WorkflowFailure declared(String nodeId, String message, String code)
      A failure the definition raised on purpose, optionally under a name of its own.
    • activity

      public static WorkflowFailure activity(String nodeId, String message, ActivityEffect effect, boolean declared, Throwable cause)
      A failure of a node that reaches outside the database, with what it knows of its side effect; that is also written into the message for whoever decides whether to retry.
    • canContinue

      public static boolean canContinue()
      Whether the walk's transaction can still commit, so a boundary may take over from a failure. A failed flush leaves it rollback-only, and whatever the boundary's path wrote would be lost.
    • effect

      public ActivityEffect effect()
      What the node knew about its side effect, or null when it is not that kind of failure.
    • nodeId

      public String nodeId()
      The node that failed.