StatifierBlocks.Describe.Edge (StatifierBlocks v0.36.1)

Copy Markdown View Source

One way control passes between blocks in a StatifierBlocks.Describe outline, in the vocabulary of the package's note on the block-level flow graph, docs/block-level-flow-graph.md (ADR-0016 decision 1).

container is the block whose structure produced the edge. An endpoint names a block and which part of it the edge touches: {:block, id} the block itself, {:entry, id} and {:exit, id} a container's entry and exit, and {:body, id} a group's body.

kindFromToCarries
:entry{:entry, container}the first child, or {:exit, container} for an empty bodynothing
:sequencea childthe next child in the same slotoutcomes
:exitthe last child of a slot{:exit, container}outcomes
:branch{:entry, branch}an arm's first child, or {:exit, branch} for an empty armcondition
:interrupta handler{:exit, group} to abandon, {:body, group} to resumeevent, history

outcomes is every outcome name the source block's type declares, on the one edge. condition is the arm's condition as its config holds it (nil when none is written), :otherwise, or :undecided. history is :shallow or :deep for a resume into a core.resumable_group, and nil otherwise: a resume into a core.group restarts its body from the first step.

Summary

Types

condition()

@type condition() :: String.t() | :otherwise | :undecided | nil

endpoint()

@type endpoint() ::
  {:block, StatifierBlocks.Block.id()}
  | {:entry, StatifierBlocks.Block.id()}
  | {:exit, StatifierBlocks.Block.id()}
  | {:body, StatifierBlocks.Block.id()}

kind()

@type kind() :: :entry | :sequence | :exit | :branch | :interrupt

t()

@type t() :: %StatifierBlocks.Describe.Edge{
  condition: condition(),
  container: StatifierBlocks.Block.id(),
  event: String.t() | nil,
  from: endpoint(),
  history: :shallow | :deep | nil,
  kind: kind(),
  outcomes: [String.t()],
  to: endpoint()
}