My SCXML is crashing when I try to run it and my debugging efforts have gone 
for naught.  The observable behaviour is as follows -- from the state 
stationary, the state machine checks the guard on a transitions several times, 
and then stops functioning.  The cond is a method call using JEXL that returns 
a boolean (I've tested this and found that the method does return on a call 
leading to the crash, so the problem is not here).

If the move transition is followed, then on eventual return to the stationary 
state, the state machine will become unresponsive after a few checks of the 
guard.

With a listener I've determined that there is no state change, so if the 
machine is running, the cond should be evaluated.  My hunch is that the state 
machine is silently failing -- how can i determine if this is the case?  Are 
there any obvious mistakes that I'm making in my SCXML file?

Any help would be appreciated,

Chris Dragert

------
SCXML file:

<?xml version="1.0" encoding="ASCII"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml";
       version="1.0"
       initialstate="stationary">

 <datamodel>
     <data id="threatener" />
  <data id="move" expr="move" />
    </datamodel>
    <state id="tracking" final="true">
        <initial>
   <transition target="safe" />
  </initial>

  <transition event="i_see_player">
      <log expr="this.addPlayer(_eventdata)" />
        </transition>

  <transition event="i_dont_see_player">
      <log expr="this.removePlayer(_eventdata)" />
        </transition>

  <state id="safe" final="true">
   <initial>
    <transition target="history" />
   </initial>

   <history type="deep" id="history">
     <transition target="stationary"/>
   </history>
   <state id="stationary" final="true">
    <transition cond="this.tooClose(this.getTheyApproachBuffer())" 
target="threatened" />
    <transition event="move" target="moving" />
   </state>

   <state id="moving" final="true">
    <transition cond="this.tooClose(this.getWeApproachBuffer())" 
target="threatened">
     <raise event="destination_unreachable" />
    </transition>
    <transition event="destination_reached" target="stationary" />
    <transition event="destination_unreachable" target="stationary" />
   </state>
  </state>

  <state id="threatened">
   <onentry>
    <log expr="this.fleeTarget(threatener)" />
    <log expr="this.createEvent('move', destination)" />
   </onentry>

   <transition event="destination_reached" target="history" />
   <transition event="destination_unreachable" target="history" />
  </state>

 </state>

</scxml>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to