commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anna Södling <>
Subject [SCXML] Timers in SCXML
Date Wed, 08 Apr 2009 11:53:20 GMT
I'm having a little problem regarding timers in SCXML. I have built a
simple statemachine with two states and a transition going from each
state to the other. The transitions should not be taken when a user
"orders" an event, but when a timer has timed out. The code I have
written for this (which obviously is incorrect since it doesn't solve my
problem, but it might give an idea of how I'm thinking) looks like this
(I've tried to implement the timers like in the examples on this page,
if that might be any hint to what may be wrong: ):
<scxml version="1.0" initialstate="167" xmlns:cs="" xmlns="">
<state id = "167">
<transition target="StateA"/>
<state id ="StateA">
<send sendid="1" target="'StateA'" event="'ToB'" delay="'1000ms'" />
<transition event="ToB" target="StateB"/>
<state id="StateB">
<send sendid="2" target="'StateB'" event="'ToA'" delay="'2000ms'" />
<transition event="ToA" target="StateA"/>
I get complaints about my target and event parts. What I want is that
when you enter a state, a timer with the value of the delay attribute
should start ticking inside the current state and when the timer times
out, it should take the transition with the same event as the event in
the send tag. But when I do this, I get this warning:
VARNING: <send>: target expression "StateA" evaluated to null or empty
(I tried to write target="'Self'" instead, too, but that didn't help
I also tried to remove the target attribute, but then I get this line:
INFO: send ( sendId: 1, target: null, targetType: scxml, event: ToB,
params: null, hints: null, delay: 1000)
and nothing else happens. 
If anyone has any ideas of what I might have done wrong and how I can
solve this problem (preferably without implementing any custom actions),
I would be really happy!

<P><p><font face="Arial, Helvetica, sans-serif" size="2" style="font-size:13.5px">_______________________________________________________________<BR>
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message