Raxol.Workflow.Edge.ConditionalEdge (Raxol v2.6.0)

View Source

Edge whose chooser.(state) returns the next node id, or a list of node ids for parallel fan-out.

The chooser must return either an atom (single next node) or a non-empty list of atoms (parallel fan-out). The compiler verifies that every possible return value is a node in the graph; runtime re-checks if the chooser is opaque.

Summary

Types

chooser_result()

@type chooser_result() :: Raxol.Workflow.Node.id() | [Raxol.Workflow.Node.id()]

t()

@type t() :: %Raxol.Workflow.Edge.ConditionalEdge{
  candidates: [Raxol.Workflow.Node.id()],
  chooser: (any() -> chooser_result()),
  from: Raxol.Workflow.Node.id()
}