commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Riccardo Manoni <arduinowifishi...@gmail.com>
Subject [scxml] send tag doesn't work with delay
Date Fri, 14 Dec 2012 14:13:03 GMT
I edited stopwatch.xml like below, but the send tag seems doesn't work.
Once entered in "paused" state, it doesn't move to "stop" state as it
should (2 seconds after). Only if i remove the tag "delay" or if i put delay="'0'"
than the state "paused" move to "stop" (but immediatly).

<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
initialstate="reset">

    <datamodel>
        <data id="time" expr="1"/>
    </datamodel>

    <state id="reset">
        <onentry>
            <log label="entered on reset" expr="'xXx'"/>
            <assign name="time" expr="0"/>
        </onentry>
        <transition event="watch.start"   target="running"/>
        <onexit>
            <log label="time vale" expr="time"/>
            <log label="exited from reset" expr="'xXx'"/>
        </onexit>
    </state>

    <state id="running">
        <onentry>
            <log label="entered on running" expr="'xXx'"></log>
        </onentry>
        <transition event="watch.split"   target="paused">
            <send event="'watch.stop'" delay="'2s'"/>

        </transition>
        <transition event="watch.stop"    target="stopped"/>
        <onexit>
            <log label="exited from running" expr="'xXx'"></log>
        </onexit>
    </state>

    <state id="paused">
        <onentry>
            <log label="entered on paused" expr="'xXx'"></log>
        </onentry>
        <transition event="watch.unsplit" target="running"/>
        <transition event="watch.stop"    target="stopped"/>
        <onexit>
            <log label="exited from paused" expr="'xXx'"></log>
        </onexit>
    </state>

    <state id="stopped">
        <onentry>
            <log label="entered on stopped" expr="'xXx'"></log>
        </onentry>
        <transition event="watch.reset"   target="reset"/>
        <onexit>
            <log label="exited from stopped" expr="'xXx'"></log>
        </onexit>
    </state>

</scxml>

and the output i get is this:

12-dic-2012 19.55.54 org.apache.commons.scxml.model.Log execute
INFO: entered on reset: xXx
12-dic-2012 19.55.59 org.apache.commons.scxml.model.Log execute
INFO: time vale: 0
12-dic-2012 19.55.59 org.apache.commons.scxml.model.Log execute
INFO: exited from reset: xXx
12-dic-2012 19.55.59 org.apache.commons.scxml.model.Log execute
INFO: entered on running: xXx
12-dic-2012 19.56.05 org.apache.commons.scxml.model.Log execute
INFO: exited from running: xXx
12-dic-2012 19.56.05 org.apache.commons.scxml.env.SimpleDispatcher send
INFO: send ( sendId: null, target: null, targetType: scxml, event:
watch.stop, params: null, hints: null, delay: 2000)
12-dic-2012 19.56.05 org.apache.commons.scxml.model.Log execute
INFO: entered on paused: xXx

am i doing wrong ?
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message