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] Internal transition not producing expected results
Date Wed, 14 Oct 2009 20:48:54 GMT
On Wed, Oct 14, 2009 at 4:16 PM, Lee, Cheryl - ES/RDR -Gil
<Cheryl.Lee@itt.com> wrote:
> I am having problems with an internal transition in a composite state.  The transitions
"ONLINELOCAL", "ONLINEREMOTE", AND "OFFLINE" lead to the appropriate states within ControlIsEnabled
however, the entry and exit actions of ControlIsEnabled are triggered.  This behavior is
opposite of general state machine theory behavior.  Is my syntax wrong for an internal transition
or is executing the entry/exit actions the intended behavior in apache commons scxml?
>
<snip/>

A transition always leaves the originating state and enters the target
state (unless its targetless) i.e. this is an invariant. In the
example below, "ControllsEnabled" being the originating state it will
be left (and subsequently re-entered given the states topology below).
Its not clear why you think this is opposite of general state machine
theory.

All else left as-is, you may add a wrapper state (parent of
"ControllsEnabled" which will contain the onentry/exit executable
content) to ensure only one invocation as you are expecting here.

-Rahul


>
> <state id="ControlEnabled">
>          <onexit><my:SendMsg/></onexit>
>          <initial id="ControlInitial">
>            <transition target="ControlIsEnabled"/>
>          </initial>
>          <state id="ControlIsEnabled">
>            <onentry><my:ControlInit/></onentry>
>            <onexit><my:ControlExit/></onexit>
>            <state id="OnlineRemote">
>              <onentry><my:ChangeMode/></onentry>
>              <transition event="" target="ControlDisabled"/>
>              <transition event="CAR_LOCAL" target="CarLocalCtrl"/>
>              <transition event="CAR_REMOTE" target="CarRemoteCtrl"/>
>            </state>
>            <state id="OnlineLocal">
>              <onentry><my:ChangeMode/></onentry>
>              <transition event="CAR_LOCAL" target="CarLocalCtrl"/>
>              <transition event="CAR_REMOTE" target="CarRemoteCtrl"/>
>            </state>
>            <state id="Offline">
>              <onentry><my:ChangeMode/></onentry>
>              <transition event="CAR_LOCAL" target="CarLocalCtrl"/>
>              <transition event="CAR_REMOTE" target="CarRemoteCtrl"/>
>            </state>
>            <initial id="ControlEnabledInitial">
>              <transition target="OnlineLocal"/>
>            </initial>
>            <state id="CarLocalCtrl">
>              <onentry><my:ChangeCarMode/></onentry>
>            </state>
>            <state id="CarRemoteCtrl">
>              <onentry><my:ChangeCarMode/></onentry>
>            </state>
>            <transition event="ONLINEREMOTE" target="OnlineRemote"/>
>            <transition event="OFFLINE" target="Offline"/>
>            <transition event="ONLINELOCAL" target="OnlineLocal"/>
>          </state>
>          <transition event="CONTROLMODEACTIONSTATUSBUTTON" target="ControlDisabled"/>
>          <transition event="EXITSTATUSONLYBUTTON" target="Status"/>
>        </state>
>
>
>

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


Mime
View raw message