commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Barnett <Jim.Barn...@genesyslab.com>
Subject RE: [scxml] update data model
Date Wed, 12 Dec 2012 20:37:34 GMT
Riccardo,
  I don't know what the problem is.  I've been unable to get even the simple command line
example to work.  One thing that you might try is removing the 'delay' from the <send>.
 You should still be in state paused when the watch.stopped event is processed. I know that
this is not the behavior you want, but it would tell you whether the problem was in basic
<send> or in the 'delay' functionality. 

- Jim

-----Original Message-----
From: Riccardo Manoni [mailto:arduinowifishield@gmail.com] 
Sent: Wednesday, December 12, 2012 2:02 PM
To: user@commons.apache.org
Subject: RE: [scxml] update data model

Thanks for the reply, Jim.
I edited stopwatch.xml like below, but the send tag seems don't work.
Once entered in "paused" state, it don't move to "stop" state as it should.

<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

Should i implement an EventDispatcher interface maybe? If yes, could you please give me a
hint or a link where i can take a look? Thanks in advance.

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



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


Mime
View raw message