Closed BrukerJWD closed 7 months ago
Sorry for the very long dealy :( The behavior in 1.72 is correct. According to the UML Standard, completion events (none) have the highest priority, so that the event queue can only be processed after yóur FSM transitions back to State1.
I wrote a state machine with Boost 1.64. As it seemed most convenient for me, I put all actions into the
on_entry()
functions. For error handling I created aErrorState
that all states have a transition to if anErrorEvent
is signalled. This event is mostly sent internally, e.g. if a calculation over the measured data produces invalid results.Now I changed to Boost 1.72 and my unit tests start to fail, because the ErrorEvent is now queued and only processed after the transition table. I do have some immediate transactions to separate the logic which now happen although the ErrorEvent is sent.
I wrote a small reproducer on wandbox. It has 3 states (State1, 2 and 3) + the ErrorState. According to the transition table,
State1
transitions toState2
on aStartEvent
,State2
immediately toState3
andState3
immediatly back toState1
.State2
also has an entry for anErrorEvent
to transition toErrorState", and in
on_entry()of
State2the
ErrorEventis emitted. Until Boost 1.71 this put the state machine into the
ErrorState`, but since 1.72 the transition table is processed first.If this program is executed with 1.71, the output is:
whereas with 1.72 it is:
I am not sure whether this is intended behavior.