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
Date Mon, 10 Dec 2007 17:05:16 GMT
On 12/10/07, Shawn Garner <shawndgarner@hotmail.com> wrote:
>
> Is there a way to declare a global state transition?
> <state id="*">
>   <transition event="userLeave" target="GetPlayers"/>
> </state>

Not in the way you have above (I understand that was only for
clarifying intent). But, there are atleast two ways to achieve this.
Say, you have foo.xml as follows:

<scxml initialstate="s1" ...>

   <state id="s1">
      <!-- Body of s1 ... -->
   </state>

   <!-- More ... -->

</scxml>

You could:

1) Add a composite parent state to hold the global transition, so
modify foo.xml like so:

<scxml initialstate="global" ...>

   <state id="global">
      <transition event="userLeave" target="GetPlayers"/>

      <initial>
         <transition target="s1"/>
      </intial>

      <state id="s1">
         <!-- Body of s1 ... -->
      </state>

      <!-- More ... -->

   </state>

</scxml>

2) If foo.xml can't be changed etc. create a bar.xml SCXML document
that decorates foo.xml like so:

<scxml initialstate="global" ...>

   <state id="global" src="foo.xml">
      <transition event="userLeave" target="GetPlayers"/>
   </state>

</scxml>

-Rahul

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


Mime
View raw message