commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Garner <shawndgar...@hotmail.com>
Subject RE: SCXML
Date Wed, 12 Dec 2007 03:54:13 GMT

I like my way the best but between yours I like 1 better than 2.
Not sure if I like 1 or 2 though so I might try to find a better suited state machine.

Thanks,
Shawn


> Date: Mon, 10 Dec 2007 12:05:16 -0500
> From: rahul.akolkar@gmail.com
> To: user@commons.apache.org
> Subject: Re: SCXML
> 
> 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
> 

_________________________________________________________________
Share life as it happens with the new Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_122007
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message