commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Dragert <>
Subject [scxml] condition checking
Date Fri, 20 Aug 2010 19:06:54 GMT
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=""

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

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

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

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

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

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

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

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



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message