[msm] Stuck in pseudo exit
Hi all,
I have got a sub state machine (called Calibrate) which is exited via a
pseudo exit on an event called Ev_Exit. The event is triggered on the
return of a synchronous D-Bus call. So far everything works fine.
Now I wanted to use an async D-Bus call and trigger the event in the
finished-handler of the asynchronous D-Bus call. I can see that the
event is released and that the transition into the pseudo exit takes
place but the control is not given back to the outer state machine, i.e.
the following transition in the outer state machine is not executed:
Row < Calibrate::exit_pt<PseudoExit> , Ev_Exit , CheckNFC , none
, none >,
Instead I get the log output that there is no transition for event
Ev_Exit in the sub machine:
user.notice tm-calibration: void
hale::tmop::Calibration_::Calibrate_::CheckKconst::on_exit(const Event&,
FSM&) [with Event = hale::tmop::Ev_Exit; FSM =
boost::msm::back::state_machinehale::tmop::Calibration_::Calibrate_]
user.notice tm-calibration: void hale::tmop::PseudoExit::on_entry(const
Event&, FSM&) [with Event = hale::tmop::Ev_Exit; FSM =
boost::msm::back::state_machinehale::tmop::Calibration_::Calibrate_]
user.notice tm-calibration: void
hale::tmop::Calibration_::Calibrate_::no_transition(const Event&, FSM&,
int) [with FSM =
boost::msm::back::state_machinehale::tmop::Calibration_::Calibrate_;
Event = hale::tmop::Ev_Exit], No transition from state
I get the same behaviour when I try to use Glib's signal_timeout() to
generate timeout events in a sub machine. Then the sub machine gets also
stuck in the pseudo exit.
I'm using boost 1.53. The program is not multi-threaded and I'm using
Glib's main loop.
Part of transition table in sub machine called Calibrate:
...
Row < CheckKconst , Ev_Exit , PseudoExit , none
, is_exit_ok >,
Row < CheckKconst , Ev_Exit , ShowDesc , showImpError ,
is_exit_error >,
...
with
enum ExitReason
{
EXIT_REASON_NONE,
EXIT_REASON_OK,
EXIT_REASON_TIMEOUT,
EXIT_REASON_ERROR
};
struct Ev_Exit
{
ExitReason exitReason_;
std::string message_;
int code_;
Ev_Exit()
: exitReason_( EXIT_REASON_NONE ), code_( 0 )
{}
Ev_Exit( ExitReason exitReason, std::string message = "", int code
= 0 )
: exitReason_( exitReason ), message_( message ), code_( code )
{}
template <class Event>
Ev_Exit( Event const& )
: exitReason_( EXIT_REASON_NONE ), code_( 0 )
{}
};
struct is_exit_ok
{
template
I have got a sub state machine (called Calibrate) which is exited via a pseudo exit on an event called Ev_Exit. The event is triggered on the return of a synchronous D-Bus call. So far everything works fine.
Now I wanted to use an async D-Bus call and trigger the event in the finished-handler of the asynchronous D-Bus call. I can see that the event is released and that the transition into the pseudo exit takes place but the control is not given back to the outer state machine, i.e. the following transition in the outer state machine is not executed:
Row < Calibrate::exit_pt<PseudoExit> , Ev_Exit , CheckNFC , none , none >,
Instead I get the log output that there is no transition for event Ev_Exit in the sub machine:
I'm using boost 1.53. The program is not multi-threaded and I'm using Glib's main loop.
Hi, it's hard to answer without a minimal code example. Could you provide one? I see two possible reasons: - process_event is not called on the outer fsm but the inner - some older version of msm had a bug with pseudo entry. I don't remember exactly which one but 1.53 could be. Could you try with a newer version? If you provide me a minimal example (on the list or privately if you prefer) I will have a look at this. Cheers, Christophe
participants (2)
-
Chrisopher Vogl
-
christophe.j.henry@gmail.com