On 12/10/07, Shawn Garner <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]