Definitively.Domain.Program (definitively v0.2.1)

Copy Markdown

Immutable workflow definition loaded from YAML.

Summary

Functions

Resolves the active node definition for a state name, if the state is active.

Returns all state names declared with type :final.

Types

t()

@type t() :: %Definitively.Domain.Program{
  id: String.t(),
  initial: atom(),
  nodes: %{required(atom()) => Definitively.Domain.NodeDefinition.t()},
  states: %{required(atom()) => Definitively.Domain.StateDefinition.t()},
  version: pos_integer()
}

Functions

active_node(program, state_name)

@spec active_node(t(), atom()) ::
  {:ok, Definitively.Domain.NodeDefinition.t()} | {:error, :not_active}

Resolves the active node definition for a state name, if the state is active.

final_states(program)

@spec final_states(t()) :: [atom()]

Returns all state names declared with type :final.