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

Entry event on initialization #12

Open
dralex opened this issue Apr 30, 2023 · 1 comment
Open

Entry event on initialization #12

dralex opened this issue Apr 30, 2023 · 1 comment

Comments

@dralex
Copy link

dralex commented Apr 30, 2023

I've started using the pysm implementation of HSM and found interesting issue: the 'entry' handler is not called on initialization (for the initial states). According to this doc https://www.state-machine.com/doc/AN_Crash_Course_in_UML_State_Machines.pdf and the Quantum Leaps initialization the entry should be called while state is initial.

Imagine that the "Complex hierarchical state machine" example has entry program for the states s0, s1, and s11 like "print(state)". During the SM initialization we should get the prints "s0", "s1", "s11".

Is it possible to implement this feature? As I understand the initialize method could be slightly modified.

Right now I have to add an additional state like "initial state" and the explicit transition between this state and the proper initial state (e.g. s11) to make the entries work as it should.

@doug-harriman
Copy link

@dralex - I've added this feature to a fork of this repo. See: https://github.com/Simplexity-Product-Development/pysm

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

No branches or pull requests

2 participants