High Performance
O(1) state and transition lookups with optimized Maps for fast state chart execution
Complete W3C compliant implementation with high-performance state chart execution
Statifier is an Elixir implementation of SCXML (State Chart XML) state machines with a focus on W3C compliance. It provides a complete runtime engine for executing complex state charts with hierarchical states, parallel execution, and advanced features like history states and conditional transitions.
In()
function<assign>
, <if>
, <log>
, and <raise>
element support# Parse SCXML document
xml = """
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initial="idle">
<state id="idle">
<transition event="start" target="running"/>
</state>
<state id="running">
<transition event="stop" target="idle"/>
</state>
</scxml>
"""
# Initialize state chart
{:ok, document, _warnings} = Statifier.parse(xml)
{:ok, state_chart} = Statifier.initialize(document)
# Process events
{:ok, new_state_chart} = Statifier.send_sync(state_chart, "start")
Add statifier
to your list of dependencies in mix.exs
:
{:statifier, "~> 1.7"}
Active Development Notice
This project is under active development. While stable for production use, APIs may evolve as we continue improving SCXML compliance and functionality.