SC.ConditionEvaluator (sc v1.0.2)
View SourceHandles compilation and evaluation of SCXML conditional expressions using Predicator.
Supports SCXML-specific built-in functions:
- In(state_id) - Check if state machine is in a given state
- _event.name - Access current event name
- _event.data - Access event data
Summary
Functions
Build SCXML evaluation context from interpreter state.
Build SCXML-specific functions for Predicator v2.0.
Compile a conditional expression string into predicator instructions.
Evaluate a compiled condition with SCXML context.
Check if the current configuration contains a specific state (In function). This is used for SCXML In() predicate support.
Functions
Build SCXML evaluation context from interpreter state.
Build SCXML-specific functions for Predicator v2.0.
Returns a map of function names to {arity, function} tuples for use with the functions option in Predicator.evaluate/3.
Compile a conditional expression string into predicator instructions.
Returns {:ok, compiled} on success, {:error, reason} on failure.
Evaluate a compiled condition with SCXML context.
Context includes:
- Current state configuration
- Current event
- Data model variables
Returns boolean result. On error, returns false per SCXML spec.
Check if the current configuration contains a specific state (In function). This is used for SCXML In() predicate support.