commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <rahul.akol...@gmail.com>
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 20:51:39 GMT
On 5/7/06, Nestor Urquiza <nestoru@yahoo.com> 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.
>
<snip/>

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>
  <state id="child2">
    <transition event="menu.main" target="mainmenu"/>
    ...
  </state>
</state>

can become:

<state id="parent">
  <transition event="menu.main" target="mainmenu"/>
  <state id="child1">...</state>
  <state id="child2">...</state>
</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.

-Rahul


> 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 <fasihullah.askiri@baypackets.com> 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
<snap/>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message