Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify EventLess Transitions documentation #16

Open
devurandom opened this issue Jan 4, 2023 · 2 comments
Open

Clarify EventLess Transitions documentation #16

devurandom opened this issue Jan 4, 2023 · 2 comments
Labels
standard-compliance Comply with the statecharts standard/specification

Comments

@devurandom
Copy link

The documentation on EventLess Transitions describes very well what happens when in state :s1, event :e12 happens and either guard23 or guard24 return true. If they are not true, it just says "Otherwise it would stay in :s2."

What exactly happens in this case? Will :always be evaluated again when the next event arrives while the machine is still in :s2? Specifically:

  • What happens if we are in state :s2 and event :e23 happens?
  • What happens if we are in state :s2 and another event (that is not :e23) happens?
@lucywang000
Copy link
Owner

lucywang000 commented Jan 5, 2023

Right now the :always part is only evaluated when entering the state it's defined in. i.e. :s2 in the example used in the documentation.

@lucywang000
Copy link
Owner

Looks like in the statecharts specification, the :always part shall be evaluated for any event, as long as the machine is in that state.

https://statecharts.dev/glossary/automatic-transition.html

Automatic transitions are usually guarded. Such a guarded automatic transition is checked immediately after the state is entered. If the condition doesn’t hold then the machine remains in the state, with this automatic transition in play for as long as the state is active. Every time the statechart handles an event, the guard condition for these automatic transitions are checked. If the guard condition ever succeeds, then the transition happens.

I'll fix this part to comply with the standard.

@lucywang000 lucywang000 added the standard-compliance Comply with the statecharts standard/specification label Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
standard-compliance Comply with the statecharts standard/specification
Projects
None yet
Development

No branches or pull requests

2 participants