Re: [SCXML] Timers in SCXML
Hi, Which version of SCXML are you using? If you used a version older than 2.0-SNAPSHOT (sorry, 2.0 is still not released yet), could you try with 2.0-SNAPSHOT by building locally by yourself from [1]? Also, I wonder if you had a chance to follow Rahul's advice in the old thread? I think he already gave good pointers. Regards, Woonsan [1] https://github.com/apache/commons-scxml On Thu, Sep 3, 2015 at 7:47 PM, giangttpham wrote: > I know this topic has been solved a long time ago but if anyone out there is > listening, please help me. This is the scxml I have but the Timer delay > doesn't work. I have the same problem as the person who started this post, > after the send, the program just stops, it never goes to the next state. > > http://www.w3.org/2005/07/scxml"; > version="1.0" > initial="player"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > View this message in context: > http://apache-commons.680414.n4.nabble.com/SCXML-Timers-in-SCXML-tp746934p4678456.html > Sent from the Commons - User mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org > For additional commands, e-mail: user-h...@commons.apache.org > - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: [SCXML] Timers in SCXML
I know this topic has been solved a long time ago but if anyone out there is listening, please help me. This is the scxml I have but the Timer delay doesn't work. I have the same problem as the person who started this post, after the send, the program just stops, it never goes to the next state. http://www.w3.org/2005/07/scxml"; version="1.0" initial="player"> -- View this message in context: http://apache-commons.680414.n4.nabble.com/SCXML-Timers-in-SCXML-tp746934p4678456.html Sent from the Commons - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: [SCXML] Timers in SCXML
On Wed, Apr 15, 2009 at 11:02 AM, Linda Erlenhov wrote: > Hello > Sorry to mass-spam email you, but I solved the problem myself after a food > break and some more thinking. The problem was the way I was trying to solve > the data requests i asked about in another mail. So this is not a problem > anymore, thank you! > This isn't remotely close to spam, in fact its quite useful to know when issues are resolved so thanks for following up. -Rahul > //Linda > > On Wed, Apr 15, 2009 at 2:16 PM, Linda Erlenhov > wrote: > >> Hello again. >> I run the standalone test and it looks like the timers work fine there (An >> infinit loop between the two states, the logs, except for those that was >> nested as you pointed out, are printed one or two seconds apart as specified >> in the scxml ), so now I´m a bit clueless with how to proceed, any idéas? Is >> there anything I might have forgotten in my java files since it doesn´t work >> there? >> >> best regards >> //Linda >> >> On Tue, Apr 14, 2009 at 9:11 PM, Rahul Akolkar >> wrote: >> >>> On Tue, Apr 14, 2009 at 8:19 AM, Linda Erlenhov >>> wrote: >>> > Hello! >>> > >>> > This may be a stupid question but: >>> > I have read through the code for the simple scheduler and I´m not sure >>> i >>> > understand what happens. >>> > We have written a simple scxml for a small statechart containing two >>> states >>> > with timers and used the simple scheduler as described in your previous >>> > e-mail. As I understand the timers would make the machine just jump >>> between >>> > the two states. This doesn´t happen. Why? >>> >>> >>> The Commons SCXML version and the relevant driver (Java) code will >>> help towards answering -- we know this works, so we'll need to know >>> whats being done differently. Bear in mind that the timers execute as >>> daemons. >>> >>> I suggest trying your example standalone [1] first, and we'll go from >>> there. >>> >>> As an aside, in the markup below, is nested in which >>> isn't legal, so the nested will be ignored. >>> >>> -Rahul >>> >>> [1] http://commons.apache.org/scxml/guide/testing-standalone.html >>> >>> >>> >>> > --- >>> > http://commons.apache.org/scxml"; xmlns="http://www.w3.org/2005/07/scxml >>> "> >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > - >>> > >>> > The output when this is run is simply: >>> > 2009-apr-14 13:08:57 org.apache.commons.scxml.model.Log execute >>> > INFO: Renegade: Entering state: A >>> > 2009-apr-14 13:08:57 org.apache.commons.scxml.env.SimpleScheduler send >>> > INFO: send ( sendId: 1, target: null, targetType: scxml, event: ToB, >>> params: >>> > null, hints: null, delay: 1000) >>> > >>> > best regards >>> > //Linda >>> > >>> - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: [SCXML] Timers in SCXML
Hello Sorry to mass-spam email you, but I solved the problem myself after a food break and some more thinking. The problem was the way I was trying to solve the data requests i asked about in another mail. So this is not a problem anymore, thank you! //Linda On Wed, Apr 15, 2009 at 2:16 PM, Linda Erlenhov wrote: > Hello again. > I run the standalone test and it looks like the timers work fine there (An > infinit loop between the two states, the logs, except for those that was > nested as you pointed out, are printed one or two seconds apart as specified > in the scxml ), so now I´m a bit clueless with how to proceed, any idéas? Is > there anything I might have forgotten in my java files since it doesn´t work > there? > > best regards > //Linda > > On Tue, Apr 14, 2009 at 9:11 PM, Rahul Akolkar wrote: > >> On Tue, Apr 14, 2009 at 8:19 AM, Linda Erlenhov >> wrote: >> > Hello! >> > >> > This may be a stupid question but: >> > I have read through the code for the simple scheduler and I´m not sure >> i >> > understand what happens. >> > We have written a simple scxml for a small statechart containing two >> states >> > with timers and used the simple scheduler as described in your previous >> > e-mail. As I understand the timers would make the machine just jump >> between >> > the two states. This doesn´t happen. Why? >> >> >> The Commons SCXML version and the relevant driver (Java) code will >> help towards answering -- we know this works, so we'll need to know >> whats being done differently. Bear in mind that the timers execute as >> daemons. >> >> I suggest trying your example standalone [1] first, and we'll go from >> there. >> >> As an aside, in the markup below, is nested in which >> isn't legal, so the nested will be ignored. >> >> -Rahul >> >> [1] http://commons.apache.org/scxml/guide/testing-standalone.html >> >> >> >> > --- >> > http://commons.apache.org/scxml"; xmlns="http://www.w3.org/2005/07/scxml >> "> >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > - >> > >> > The output when this is run is simply: >> > 2009-apr-14 13:08:57 org.apache.commons.scxml.model.Log execute >> > INFO: Renegade: Entering state: A >> > 2009-apr-14 13:08:57 org.apache.commons.scxml.env.SimpleScheduler send >> > INFO: send ( sendId: 1, target: null, targetType: scxml, event: ToB, >> params: >> > null, hints: null, delay: 1000) >> > >> > best regards >> > //Linda >> > >> >> - >> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org >> For additional commands, e-mail: user-h...@commons.apache.org >> >> >
Re: [SCXML] Timers in SCXML
Hello again. I run the standalone test and it looks like the timers work fine there (An infinit loop between the two states, the logs, except for those that was nested as you pointed out, are printed one or two seconds apart as specified in the scxml ), so now I´m a bit clueless with how to proceed, any idéas? Is there anything I might have forgotten in my java files since it doesn´t work there? best regards //Linda On Tue, Apr 14, 2009 at 9:11 PM, Rahul Akolkar wrote: > On Tue, Apr 14, 2009 at 8:19 AM, Linda Erlenhov > wrote: > > Hello! > > > > This may be a stupid question but: > > I have read through the code for the simple scheduler and I´m not sure i > > understand what happens. > > We have written a simple scxml for a small statechart containing two > states > > with timers and used the simple scheduler as described in your previous > > e-mail. As I understand the timers would make the machine just jump > between > > the two states. This doesn´t happen. Why? > > > The Commons SCXML version and the relevant driver (Java) code will > help towards answering -- we know this works, so we'll need to know > whats being done differently. Bear in mind that the timers execute as > daemons. > > I suggest trying your example standalone [1] first, and we'll go from > there. > > As an aside, in the markup below, is nested in which > isn't legal, so the nested will be ignored. > > -Rahul > > [1] http://commons.apache.org/scxml/guide/testing-standalone.html > > > > > --- > > http://commons.apache.org/scxml"; xmlns="http://www.w3.org/2005/07/scxml > "> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > - > > > > The output when this is run is simply: > > 2009-apr-14 13:08:57 org.apache.commons.scxml.model.Log execute > > INFO: Renegade: Entering state: A > > 2009-apr-14 13:08:57 org.apache.commons.scxml.env.SimpleScheduler send > > INFO: send ( sendId: 1, target: null, targetType: scxml, event: ToB, > params: > > null, hints: null, delay: 1000) > > > > best regards > > //Linda > > > > - > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org > For additional commands, e-mail: user-h...@commons.apache.org > >
Re: [SCXML] Timers in SCXML
On Tue, Apr 14, 2009 at 8:19 AM, Linda Erlenhov wrote: > Hello! > > This may be a stupid question but: > I have read through the code for the simple scheduler and I´m not sure i > understand what happens. > We have written a simple scxml for a small statechart containing two states > with timers and used the simple scheduler as described in your previous > e-mail. As I understand the timers would make the machine just jump between > the two states. This doesn´t happen. Why? The Commons SCXML version and the relevant driver (Java) code will help towards answering -- we know this works, so we'll need to know whats being done differently. Bear in mind that the timers execute as daemons. I suggest trying your example standalone [1] first, and we'll go from there. As an aside, in the markup below, is nested in which isn't legal, so the nested will be ignored. -Rahul [1] http://commons.apache.org/scxml/guide/testing-standalone.html > --- > http://commons.apache.org/scxml"; xmlns="http://www.w3.org/2005/07/scxml";> > > > > > > > > > > > > > > > > > > > > > > > - > > The output when this is run is simply: > 2009-apr-14 13:08:57 org.apache.commons.scxml.model.Log execute > INFO: Renegade: Entering state: A > 2009-apr-14 13:08:57 org.apache.commons.scxml.env.SimpleScheduler send > INFO: send ( sendId: 1, target: null, targetType: scxml, event: ToB, params: > null, hints: null, delay: 1000) > > best regards > //Linda > - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: [SCXML] Timers in SCXML
Hello! This may be a stupid question but: I have read through the code for the simple scheduler and I´m not sure i understand what happens. We have written a simple scxml for a small statechart containing two states with timers and used the simple scheduler as described in your previous e-mail. As I understand the timers would make the machine just jump between the two states. This doesn´t happen. Why? --- http://commons.apache.org/scxml"; xmlns="http://www.w3.org/2005/07/scxml";> - The output when this is run is simply: 2009-apr-14 13:08:57 org.apache.commons.scxml.model.Log execute INFO: Renegade: Entering state: A 2009-apr-14 13:08:57 org.apache.commons.scxml.env.SimpleScheduler send INFO: send ( sendId: 1, target: null, targetType: scxml, event: ToB, params: null, hints: null, delay: 1000) best regards //Linda
Re: [SCXML] Timers in SCXML
On Wed, Apr 8, 2009 at 7:53 AM, Anna Södling wrote: > Hello, > > 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: > http://www.ling.gu.se/~lager/Labs/SCXML-Lab/ ): > > http://commons.apache.org/scxml"; xmlns=" > http://www.w3.org/2005/07/scxml";> > > > > > > > > > > > > > > > > > > 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: : target expression "StateA" evaluated to null or empty > String > (I tried to write target="'Self'" instead, too, but that didn't help > either) > Targets cannot be states, only entire state machines. "Self" has no associated semantics at all in SCXML. > I also tried to remove the target attribute, but then I get this line: Thats the right way to proceed. No target means current state machine. > 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! > Use an EventDispatcher that supports timers. Here is one that uses Java SE timers: http://commons.apache.org/scxml/apidocs/org/apache/commons/scxml/env/SimpleScheduler.html So, along these lines: SCXMLExecutor exec = new SCXMLExecutor(); ... exec.setEventDispatcher(new SimpleScheduler(exec)); ... -Rahul > Sincerely, > Anna > > - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
[SCXML] Timers in SCXML
Hello, 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: http://www.ling.gu.se/~lager/Labs/SCXML-Lab/ ): http://commons.apache.org/scxml"; xmlns=" http://www.w3.org/2005/07/scxml";> 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: : target expression "StateA" evaluated to null or empty String (I tried to write target="'Self'" instead, too, but that didn't help either) 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! Sincerely, Anna ___