[statechart] using events for passing information

Hello, I wonder if it is possible to use events for passing in data to states. I even cannot find some hints in the statechart documentation how to determine in some state which event caused a transistion to the this state! regards, chris -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

Hi Christian
I wonder if it is possible to use events for passing in data to states.
Yes, it is. You can define a transition action, which receives the triggering event as a parameter. Problem is, the UML standard mandates that the transition action is executed when all states of the origin state configuration have been left and before any of the states of the destination configuration are entered. Only the innermost common context or any of its contexts can therefore store the event data.
I even cannot find some hints in the statechart documentation how to determine in some state which event caused a transistion to the this state!
There is a to-do item (no. 2) for this: http://www.boost.org/libs/statechart/doc/future_and_history.html#ToDoList Please let me know whether that would cover what you need. Thanks, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.

There is a to-do item (no. 2) for this:
http://www.boost.org/libs/statechart/doc/future_and_history.html#ToDoList
Please let me know whether that would cover what you need.
This is exactly what I want! I would make heavy use of this feature but know after reading your comment on this point I'm not sure if this is a good idea and if I should do a redesign. On Thursday 16 August 2007 19:30:42 Andreas Huber wrote:
Hi Christian
I wonder if it is possible to use events for passing in data to states.
Yes, it is. You can define a transition action, which receives the triggering event as a parameter. Problem is, the UML standard mandates that the transition action is executed when all states of the origin state configuration have been left and before any of the states of the destination configuration are entered. Only the innermost common context or any of its contexts can therefore store the event data.
I even cannot find some hints in the statechart documentation how to determine in some state which event caused a transistion to the this state!
There is a to-do item (no. 2) for this:
http://www.boost.org/libs/statechart/doc/future_and_history.html#ToDoList
Please let me know whether that would cover what you need.
Thanks,

Christian Bähnisch
There is a to-do item (no. 2) for this:
http://www.boost.org/libs/statechart/doc/future_and_history.html#ToDoList
Please let me know whether that would cover what you need.
This is exactly what I want! I would make heavy use of this feature but know after reading your comment on this point I'm not sure if this is a good idea and if I should do a redesign.
My comment is based on personal experience and on the fact that any use of that feature wrecks type safety. Now, FSMs are employed in such varied fields that I've become rather cautious in providing general design advice. I'd therefore be grateful if you could provide me with examples of situations where you would need the feature. Thanks, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.
participants (3)
-
"Christian Bähnisch"
-
Andreas Huber
-
Christian Bähnisch