Skip to content

Submachine states: reuse a state machine class as a state #704

Open

Description

@fgmacedo

Why

Composing machines out of reusable machines has the strongest demand found: statelyai/xstate#221 and #428, dotnet-state-machine/stateless#232, spring-statemachine#801, and here #416, #614 and #616. Today invoke= runs a child machine with its own queue, which is not the same as embedding its states. Previously out of scope for #692 because PSSM has no submachine tests; reopened by demand, so semantics come from the UML specification text.

Scope

  • Embedding a StateChart subclass as a compound state of another machine, with id prefixing and callback resolution.
  • Connection points (entry/exit points) are a later step.

Acceptance

Tests on both engines: the embedded machine's states, transitions and callbacks behave as if declared inline; two embeddings of the same class do not share state.

Depends on #660 (per-class copies of the state graph). Refs #692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementumlUML state machine semantics, tracked in #692

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions