|
Boost : |
Subject: [boost] Fwd: [msm] guard behavior if guard guards the transition MSM threats event as handled is that correct ?
From: Richard Szabo (sz.richard_at_[hidden])
Date: 2011-11-23 14:17:43
Hi Christophe
the attached example I think shows 2 problems.
1st is that the deferral of event3 is not happening.
2nd is that the no_transition function is never called.
the output of the run is :
MS1 Entering State: Idle by: event1
MS1 Leaving State: Idle by: event1
MS1 Entering State: SubRunning by: event1
FwdGuard: returns:1, event: event2
Processing BaseEvent Instance(event2)
Setting guard false
FwdGuard: returns:0, event: event3
FwdGuard: returns:0, event: event4
FwdGuard: returns:0, event: event5
MS1 Leaving State: SubRunning by: event5
MS1 Entering State: AfterSub by: event5
I think it shall be :
MS1 Entering State: Idle by: event1
MS1 Leaving State: Idle by: event1
MS1 Entering State: SubRunning by: event1
FwdGuard: returns:1, event: event2
Processing BaseEvent Instance(event2)
Setting guard false
FwdGuard: returns:0, event: event3
FwdGuard: returns:0, event: event4
MS1 no_transition event (event4)
MS1 Leaving State: SubRunning by: event5
MS1 Entering State: AfterSub by: event5
MS1 no_transition event (event3)
So in this example event3 and event4 are never triggered a transition ...
the Row < SubRunning , baseEvent , none , ProcessBaseEvent , FwdGuard
> was guarded by the FwdGuard for these events.
Is my expected behavior wrong ?
If guard is executed but the transition actually is triggered because it
is guarded out why this event treated as handled event ?.
This 2 problems breaks my current nested state machine implementation
because I'm using no_transition to forward the event to the outer state
machine. I'm confused :(.
Cheers
Richie
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk