commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fasih" <>
Subject Re: [scxml] is there a way to allow an event in all states and just keep in the state?
Date Mon, 08 May 2006 21:03:51 GMT
I think that Nestor wanted to be in the same state, there is a difference in 
going // and included states way.
If you "bubble up" wouldnt you loose the state you were in? Or is there some 
way to remain in the orig state? By the way, I was wondering if <history> is 
implemented, any example to show a use? Just curious!


----- Original Message ----- 
From: "Rahul Akolkar" <>
To: "Jakarta Commons Users List" <>
Sent: Monday, May 08, 2006 3:51 PM
Subject: Re: [scxml] is there a way to allow an event in all states and just 
keep in the state?

On 5/7/06, Nestor Urquiza <> wrote:
> thanks first of all for the reply, then my concrete
> example is a system that is accepting services request
> from remote clients. Must of the requests would be
> accepted if the client is in the proper state to
> accept them which translates to having in the scxml
> file the "event" attribute available for the current
> state.
> There are events however that are available for every
> state in the system ... in other words no special
> state is needed to authorize the event to be
> triggered. For those events you can add a node inside
> every state in your scxml file and I am wondering if
> there is a better way of doing this.

Generally speaking, if events get processed by identical transitions
for all substates of a particular state, the transition can be
replaced by a single one that bubbles up to the parent.

For example:

<state id="parent">
  <state id="child1">
    <transition event="menu.main" target="mainmenu"/>
  <state id="child2">
    <transition event="menu.main" target="mainmenu"/>

can become:

<state id="parent">
  <transition event="menu.main" target="mainmenu"/>
  <state id="child1">...</state>
  <state id="child2">...</state>

Parallelism could be used as well, as already pointed out. If I've
missed the point, the smallest possible SCXML snippet illustrating
what you want to do would be helpful.


> Parallel states maybe are a solution given a parallel
> state that can be defined as the same level as the
> IDDLE one meaning that the system could be in an
> IDDLE2 parallel state from which all the requests or
> events are accepted.
> I will give this configuration a try and I will be
> back to you. I guess I got what you mean.
> Nestor
> --- Fasih <> wrote:
> > Not sure I understood your requirement right. But
> > have you seen how parallel
> > states work?
> > You might have seen this, but just in case you
> > haven't, look at the
> > microwave e.g
> > There are two parallel states:
> > Door
> > Cooking [??]
> > Door can be in Open/Close state. Cooking has its own
> > states, cooking may or
> > maynot change state on a door state change, this
> > might be what you are
> > looking for.
> >
> > Maybe you can give a few examples to elaborate on
> > your requirements
> >
> > +Fasih

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message