Runic.UnresolvedReferenceError exception (Runic v0.1.0-alpha.7)

Copy Markdown View Source

Raised when a component references another component that does not exist in the workflow.

This typically occurs when adding a rule with meta expressions like state_of(:counter) before the :counter component has been added to the workflow.

Example

workflow = Workflow.new()

# This will raise because :counter doesn't exist yet
|> Workflow.add(rule_using_state_of_counter)

# The accumulator should be added first
|> Workflow.add(counter_accumulator)

Solutions

  1. Add target components before adding rules that reference them
  2. Ensure component names match exactly (atoms are case-sensitive)
  3. For subcomponent references like {:parent, :child}, ensure both parent and child exist