Skip to content

Handling the any state correctly when using a nested state machine - #634

Merged
kris-jusiak merged 1 commit into
boost-ext:masterfrom
vasdal:any_state_and_nested_state_machine
Apr 1, 2025
Merged

kris-jusiak merged 1 commit into
boost-ext:masterfrom
vasdal:any_state_and_nested_state_machine

Conversation

@vasdal

@vasdal vasdal commented Apr 1, 2025

Copy link
Copy Markdown

Problem:

  • Any state does not work if there is a nested state machine within a state machine with any state, as demonstrated in the failing test any_state_nested.

Solution:

  • Modified the get_state_mapping specialization for nested state machines to consider both direct state transitions and any state transitions.
  • The implementation now tries direct transitions first, and if those don't handle the event, it falls back to any state transitions.
  • This ensures consistent behavior between regular states and nested state machines when using the any state.

Issue: #622

Reviewers:
@kris-jusiak

@kris-jusiak
kris-jusiak merged commit cd3ef80 into boost-ext:master Apr 1, 2025
@kris-jusiak

Copy link
Copy Markdown
Collaborator

Nice, thanks @vasdal 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants