Repository navigation
Track UML statechart semantics based on the OMG PSSM test suite #692
Description
Why
The engine follows W3C SCXML, and every semantic decision is checked against the W3C SCXML test suite (tests/scxml/). UML state machine features (event deferral, choice, junction, entry/exit points, and others) keep being requested, but UML and SCXML disagree on several behaviors, and there was no executable reference here to settle them.
The OMG publishes one: PSSM 1.0 (Precise Semantics of UML State Machines) ships a machine-readable test suite with 103 tests and their expected traces. This issue tracks building UML statechart support on top of it, the same way SCXML support was built on the W3C suite. No UML-derived feature is merged before this reference exists.
Plan
Additive features ship in 3.x minors; only breaking changes wait for 4.0. Order is by user demand (requests and real usage in this and neighbor libraries), not by PSSM tests unlocked; PSSM cases are the acceptance check. 3.3.0 ships the reference, the bug fixes and the high-demand features. The UML pseudostates and deferral are used mostly in Spring and embedded code, so they follow in later releases.
Reference and fixes (3.3.0)
- PSSM test suite: converter, committed generated cases, harness on both engines (feat: accept x- extension keys in native documents and run the OMG PSSM 1.0 test suite #697)
- History default entry (fix: enter history states by default without running the incoming effect twice #693)
- Explicit initial transition effect (fix: run the effect of an explicit initial transition and register it as the only initial #694, UML initial transitions: target a nested descendant directly and support on_init_<state> actions #587)
- Evaluator name resolution (fix: resolve bare names with the same precedence in the restricted and trusted evaluators #695)
- Internal transitions (fix: internal transitions enter and exit the right states #696)
- Errors while an invocation processes
done.invoke(fix: report errors raised while an invocation processes its done.invoke #698) - Fork reachability and docs (Fork: multi-target transitions fail the reachability check and are not documented as UML fork #705)
- Follow-ups: Sync engine: send(delay=) from a callback blocks the processing thread #706, Async invoke tasks inherit the running-engine context, so raise_ from them is treated as internal #707, Diagram: internal transitions of compound states are not rendered #708, Internal transition targeting its own empty history state #709, Expression evaluators: remaining name-resolution follow-ups #710, Explicit initial transition: reject a contradictory initial=True child and draw it in diagrams #711
- Docs: UML concepts and divergences (Docs: UML concepts and where this library differs #712)
Features (3.3.0)
- Transition kinds
external/local/internalacross Python, YAML and SCXML, withinternal=as a deprecated alias (Transition kinds: kind=external|local|internal across Python, YAML and SCXML #723) - Completion transitions, explicit spelling on any base (UML completion transitions: an explicit spelling usable on any base class #699)
- Time events (Time events: transitions that fire after a delay in a state #703)
- doActivity timing (doActivity timing: start on entry and let completion wait for it #700), then doActivity accepting events (doActivity that accepts events from its state machine #701)
- History after final (History after a region reached its final state #702)
- State redefinition on inheritance (Support structural refinement of inherited states while preserving transitions #660), then submachine states (Submachine states: reuse a state machine class as a state #704)
- Release notes (3.3.0 release notes for the UML work #713)
Later 3.x minors (UML constructs with low demand)
- Junction, carrying segmented compound-transition execution (UML junction pseudostate (and segmented compound-transition execution) #715)
- Entry and exit points (UML entry and exit points #717), choice (UML choice pseudostate #716), join (UML join pseudostate #718)
- Event deferral (UML event deferral #714, feat: add event deferral to states #664)
- Terminate (UML terminate pseudostate #719), call events (UML call events #720)
- Decision: compound state with an empty region (Decide: active compound state with an empty region #721)
4.0 (breaking only)
- Remove the deprecated
internal=alias andenable_self_transition_entries(4.0: remove the deprecated internal= alias and enable_self_transition_entries #724)
Out of scope for now: ChangeEvent (covered by eventless transitions with guards), ProtocolStateMachine, state invariants. Until the whole suite passes, the docs describe the work as "based on PSSM", not as conformance. Class-level flags for conflicting behaviors live on StateChart; a UMLStatechart preset is only added if enough of them accumulate.
Activity
fix: enter history states by default without running the incoming eff…
fix: enter history states by default without running the incoming eff…
fix: run the effect of an explicit initial transition and stop adding…
docs: explicit initial transition of a compound state
6 remaining items
fix: run the effect of an explicit initial transition and stop adding…
docs: explicit initial transition of a compound state
docs: 3.3.0 release notes for the merged fixes (#725)