Runic.Workflow.Rule (Runic v0.1.0-alpha.7)

Copy Markdown View Source

Summary

Types

t()

A rule.

Functions

Checks a rule's left hand side.

Evaluates a rule, checking its left hand side, then evaluating the right.

Types

t()

@type t() :: %Runic.Workflow.Rule{
  arity: arity(),
  closure: Runic.Closure.t() | nil,
  condition_hash: integer(),
  condition_refs: [{atom(), integer()}],
  hash: integer(),
  inputs: term(),
  name: String.t(),
  outputs: term(),
  reaction_hash: integer(),
  workflow: Runic.Workflow.t()
}

A rule.

The condition_refs field carries compile-time condition reference markers that need to be resolved at connect-time. Each entry is a {ref_name, target_hash} tuple where target_hash is the hash of the node (Conjunction or reaction Step) that the resolved condition should wire to.

Functions

check(rule, input)

@spec check(t(), any()) :: boolean()

Checks a rule's left hand side.

new(opts \\ [])

run(rule, input)

@spec run(t(), any()) :: any()

Evaluates a rule, checking its left hand side, then evaluating the right.