Statifier.Validator.HistoryStateValidator (statifier v1.9.0)
View SourceValidates history state constraints in SCXML documents.
Ensures history states follow SCXML specification requirements:
- History states must have a parent state (not at root level)
- History states cannot have child states
- Only one history state per type (shallow/deep) per parent
- History type must be valid (shallow or deep)
- Default transition targets must exist
- Warns if history state is unreachable
Summary
Functions
Validate that history states have no child states. History states are pseudo-states and cannot contain child states.
Validate that history states are not at root level. History states must be children of compound or parallel states.
Validate all history state constraints in the document.
Validate that default transition targets in history states exist.
Validate that history type is valid (shallow or deep). This should already be enforced by parsing, but we validate as a safety check.
Validate that history states have unique IDs within their parent state. While general ID uniqueness is checked elsewhere, this ensures no ID conflicts within the same parent state.
Validate that there is only one history state per type per parent. A parent can have at most one shallow and one deep history state.
Warn if history states are unreachable (no transitions target them).
Functions
@spec validate_history_no_children( Statifier.Validator.validation_result(), [Statifier.State.t()] ) :: Statifier.Validator.validation_result()
Validate that history states have no child states. History states are pseudo-states and cannot contain child states.
@spec validate_history_not_at_root( Statifier.Validator.validation_result(), Statifier.Document.t(), [Statifier.State.t()] ) :: Statifier.Validator.validation_result()
Validate that history states are not at root level. History states must be children of compound or parallel states.
@spec validate_history_states( Statifier.Validator.validation_result(), Statifier.Document.t() ) :: Statifier.Validator.validation_result()
Validate all history state constraints in the document.
@spec validate_history_transition_targets( Statifier.Validator.validation_result(), [Statifier.State.t()], Statifier.Document.t() ) :: Statifier.Validator.validation_result()
Validate that default transition targets in history states exist.
@spec validate_history_type( Statifier.Validator.validation_result(), [Statifier.State.t()] ) :: Statifier.Validator.validation_result()
Validate that history type is valid (shallow or deep). This should already be enforced by parsing, but we validate as a safety check.
@spec validate_history_unique_in_parent( Statifier.Validator.validation_result(), [Statifier.State.t()], [Statifier.State.t()] ) :: Statifier.Validator.validation_result()
Validate that history states have unique IDs within their parent state. While general ID uniqueness is checked elsewhere, this ensures no ID conflicts within the same parent state.
@spec validate_one_history_per_type_per_parent( Statifier.Validator.validation_result(), [Statifier.State.t()], [Statifier.State.t()] ) :: Statifier.Validator.validation_result()
Validate that there is only one history state per type per parent. A parent can have at most one shallow and one deep history state.
@spec warn_unreachable_history_states( Statifier.Validator.validation_result(), [Statifier.State.t()], [ Statifier.State.t() ] ) :: Statifier.Validator.validation_result()
Warn if history states are unreachable (no transitions target them).