Open dclementson opened 3 years ago
Hello DC
Let me check, but I think it is invalid to invoke transition from on_entry in a state.
Hello DC,
Event less transitions are not allowed on PyEDS. That means that on_entry
and on_exit
does not support taking a transition. This brings up two things:
Transitions are allowed on on_init
and on user event handlers (as you already use this). The on_init
is executed when the state machine reaches its destination state. This is meaningful only on HSM while on FSM every transition goes through only one state, so it is always executed after on_entry
.
In the next few days I'll take care of these issues.
HI Nenad:
Thanks for the update. Take care,
DC
On Tue, Dec 22, 2020 at 5:27 AM Nenad Radulović notifications@github.com wrote:
Hello DC,
Event less transitions are not allowed on PyEDS. That means that on_entry and on_exit does not support taking a transition. This brings up two things:
- This behavior should be documented
- PyEDS should raise an exception when this occurs
- PyEDS should have unit-tests for this use-case
Transitions are allowed on on_init and on user event handlers (as you already use this). The on_init is executed when the state machine reaches its destination state. This is meaningful only on HSM while on FSM every transition goes through only one state, so it is always executed after on_entry.
In the next few days I'll take care of these issues.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nradulovic/pyeds/issues/17#issuecomment-749539645, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGL6X6IJHERLU2VSCVHKJ2TSWCNFRANCNFSM4VAPXNAA .
Hi Nenad:
I'm finding that pyeds hangs if I ask a FSM to transition directly from one state to another without having an Event trigger the transition. Here is an example of a FSM that I thought would go directly from the "Run" state to the "Idle" state after first printing a message. It hangs at the "return Idle" statement:
`@fsm.DeclareState(myFSM) class Run(fsm.State):
this example does essentially the same transition logic, but does not hang:
`@fsm.DeclareState(myFSM) class Run(fsm.State):
Is this the expected behavior or am I missing something? Thanks! DC