Boost logo

Boost Users :

Subject: [Boost-users] [MSM] a timer/timeout for the whole state machine (including submachines)
From: Albert Gil Moreno (albert.gil_at_[hidden])
Date: 2012-04-04 06:20:46


Hi,

I've been working for a while with the MSM and I'm very impressed about
it... congratulations for your work!!

I've to say that I'm not an expert on UML nor state machines and I think
that my needs are a very common user-case... so I'm probably missing
something!

Basically what I need is a (reusable) Timer that, after a number of Clocks,
it sends a TimeOut to the state machine, and when the Timer receives a
Reset it restarts the counting of clocks.
(I want to also add a Pause or similar but this doesn't matter right now...)

So, the goal is that any (or all) of my states could be controlled by the
Timer and if no events are received for a while a TimeOut will be (always)
received/processed.

AFAIK there is no concept of timer/timeout in the MSM, but I found very
straightforward to implement my idea with an Orthogonal Region with a
single state Timer that receives Clock and Reset events and sends a TimeOut.
And it worked like a charm!!

But I found a problem with one of my states become a submachine...
The Timer::Reset action executes a fsm.process_event(Timer::Reset()), but
this event is not processed.
I realized that "fsm" is the submachine and AFAIK there is no way to access
to the parent(est) fsm...

So, is there a better or more standard way to implement a Timer/Timeout in
UML/MSM?
And, although "fsm" is the submachine, why the no_transition function is
not executed (this last seems a bug to me...).

Albert

PD: Do you think that has meaning that the MSM could have an "on_timeout"
function for the states (like on_entry/exit?), or to have a timeout event
like "none"... ok may be this sounds huge to implement and not so generic...



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net