Statifier.HistoryTracker (statifier v1.9.0)
View SourceTracks history state configurations for SCXML state machines.
Implements W3C SCXML specification for shallow and deep history states. Records active state configurations before exiting parent states and provides retrieval for history state restoration.
Shallow vs Deep History
- Shallow History: Records only immediate children of the parent state
- Deep History: Records all atomic descendant states within the parent
W3C SCXML Compliance
History is recorded "before taking any transition that exits the parent" and restored when a transition targets a history state.
Summary
Functions
Clear all recorded history.
Clear history for a specific parent state.
Get the deep history for a parent state.
Get the shallow history for a parent state.
Check if a parent state has recorded history.
Create a new empty history tracker.
Record history for a parent state before it exits.
Types
Functions
Clear all recorded history.
Resets the tracker to empty state, useful for testing or state machine restart.
Clear history for a specific parent state.
Useful for testing or when explicitly resetting history state.
Get the deep history for a parent state.
Returns all atomic descendant states that were active when the parent was last exited. Returns empty set if no history has been recorded for this parent.
Get the shallow history for a parent state.
Returns the immediate children that were active when the parent was last exited. Returns empty set if no history has been recorded for this parent.
Check if a parent state has recorded history.
Returns true if the parent state has been visited and exited before, false if this would be the first time entering the parent.
@spec new() :: t()
Create a new empty history tracker.
Record history for a parent state before it exits.
Records both shallow (immediate children) and deep (atomic descendants) history based on the current active state configuration.
Parameters
tracker- The history trackerparent_state_id- ID of the parent state exitingactive_states- Current active state configurationdocument- Document for state hierarchy analysis
Returns
Updated history tracker with recorded configuration.