[SCXML] Internal transition not producing expected results

2 messages Options
Embed this post
Permalink
Lee, Cheryl - ES/RDR -Gil

[SCXML] Internal transition not producing expected results

Reply Threaded More More options
Print post
Permalink
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?


<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>



________________________________
This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail.
Rahul Akolkar

Re: [SCXML] Internal transition not producing expected results

Reply Threaded More More options
Print post
Permalink
On Wed, Oct 14, 2009 at 4:16 PM, Lee, Cheryl - ES/RDR -Gil
<[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]