Statifier.Validator (statifier v1.9.0)
View SourceValidates SCXML documents for structural correctness and semantic consistency.
Catches issues like invalid initial state references, unreachable states, malformed hierarchies, and other problems that could cause runtime errors.
Optimizes valid documents with hierarchy caching for improved runtime performance.
Summary
Functions
Finalize validation with whole-document validations and optimization.
Validate an SCXML document and optimize it for runtime use.
Types
@type validation_result_with_document() :: {validation_result(), Statifier.Document.t()}
Functions
@spec finalize(validation_result(), Statifier.Document.t()) :: validation_result_with_document()
Finalize validation with whole-document validations and optimization.
This callback is called after all individual validations have completed, allowing for validations that require the entire document context. If the document is valid, it will be optimized for runtime performance with hierarchy caching and lookup maps.
@spec validate(Statifier.Document.t()) :: {:ok, Statifier.Document.t(), [String.t()]} | {:error, [String.t()], [String.t()]}
Validate an SCXML document and optimize it for runtime use.
Returns {:ok, optimized_document, warnings} if document is valid. Returns {:error, errors, warnings} if document has validation errors. The optimized document includes performance optimizations like lookup maps.