Re: [scxml] trasition tag with type=internal in compound state issue

2011-06-07 Thread Vance huang
Hi, Rahul:

Thanks. I've opened a ticket SCXML-162 for this. 

Vance
On Mon, Jun 6, 2011 at 7:11 PM, Vance huang  wrote: > Hi, > > According to the 
SCXML spec, the following was stated: > "The behavior of transitions with 
'type' 
of "internal" is identical, except in > the case of a transition whose source 
state is a compound state and whose > target(s) is a descendant of the source. 
In such a case, an internal transition > will not exit and re-enter its source 
state, while an external one will, as > shown in the example below." > > I am 
trying to do something similar like the following: >
 
 >   expr="entering s11"/>  
 
   expr="'leaving s11'"/>> > >  
 >   >type="internal">  
  >  > > > Assuming I am in s11 when event e fired. But it always log "leaving 
s1" before > log "executing transition" which means going out of S1 even if the 
internal type > was set. Am I missing something in the spec?   No, though 
internal transitions are a recent addition and are not yet implemented in 
Commons SCXML.  You may open an enhancement request to track this in JIRA [1]. 
Patches with suggested fixes are welcome as well.   > Also, I am not sure how 
can I search in the archive to see if this question has > been asked before. 
Can 
you let me know? Thanks! >   You can use a number of archives for searching, 
markmail [2] is one example. More information on the project mailing lists page 
[3], see two columns on far right in table on page.  -Rahul  [1] 
http://commons.apache.org/scxml/issue-tracking.html [2] 
http://commons.markmail.org/ [3] 
http://commons.apache.org/scxml/mail-lists.html   
> Vance >  
> - 
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional 
commands, e-mail: user-h...@commons.apache.org 

[scxml] trasition tag with type=internal in compound state issue

2011-06-06 Thread Vance huang
Hi, 

According to the SCXML spec, the following was stated:
"The behavior of transitions with 'type' of "internal" is identical, except in 
the case of a transition whose source state is a compound state and whose 
target(s) is a descendant of the source. In such a case, an internal transition 
will not exit and re-enter its source state, while an external one will, as 
shown in the example below."

I am trying to do something similar like the following:
  
 
  


 
 
  
 
 



Assuming I am in s11 when event e fired. But it always log "leaving s1" before 
log "executing transition" which means going out of S1 even if the internal 
type 
was set. Am I missing something in the spec? 
Also, I am not sure how can I search in the archive to see if this question has 
been asked before. Can you let me know? Thanks!

Vance


Re: Re: [scxml]

2011-05-20 Thread Vance huang
Hi, Rahul:

Your suggestion does the trick and now it is transitioning correctly. Many 
thanks.

Vance

On Tue, May 17, 2011 at 3:44 PM, Vance huang  wrote: > 
Hi, 
Rahul: > Thanks for taking a look. In further testing, I found the probable 
cause of this > issue is that when the custom action in test2 is executing, 
sometimes it injects > the actionComplete event right back to the scxml engine 
(in the same thread). > When that occurs, the state transition is messed up and 
stayed in test2-init > state though in the log it went into active state. If 
the 
custom action is not > doing that, and later another thread sends the 
actionComplete to the engine, > then it transitions fine. Is this a bug or 
something should not be done based on > the spec? Thanks. >   You should 
inject events from within a custom action by adding to the set of derived 
events 
(param of execute method) which will be processed in a subsequent microstep, 
rather than triggering another event on the executor (if thats what you're 
doing).  -Rahul

Re: Re: [scxml]

2011-05-17 Thread Vance huang
Hi, Rahul:
Thanks for taking a look. In further testing, I found the probable cause of 
this 
issue is that when the custom action in test2 is executing, sometimes it 
injects 
the actionComplete event right back to the scxml engine (in the same thread). 
When that occurs, the state transition is messed up and stayed in test2-init 
state though in the log it went into active state. If the custom action is not 
doing that, and later another thread sends the actionComplete to the engine, 
then it transitions fine. Is this a bug or something should not be done based 
on 
the spec? Thanks.

Vance

On Mon, May 16, 2011 at 12:26 PM, Vance huang  wrote: > > 
Hi, Rahul: > > Here is the trimmed down snippet: >   I reduced it even 
further: 
  


 
   
 
   Is 
the above still a representative test case where you're seeing the behavior 
(using the same custom action you have below)? If so, the issue is still 
unclear. If you're repeatedly firing test2 events, you may want to throttle 
them 
(with short delays) to ensure the executor is done processing the previous 
event. If after that something still seems amiss, next step would then be to 
provide a simplest JUnit test case that can reproduce the problem (see src/test 
directory in SVN or source distro for numerous examples of test cases).  -Rahul 
  
>  >  > > 
 >  > 
>  >  > > >  
>  >  >> 
 > >  > > <"calling a 
custom action here/> >  >  > > 
 >  >  >  >  >> > 
 >  > >  
 
  >  > >  > > >  >  
>  > > > > What happen was that sometimes going from 
> active 
to test2 and back to active > works fine. But other times though it seems to 
coming back from test2 to active > state is fine (based on the onentry logging) 
but when test2 event fired, it was > caught in test2 state not active state. I 
am not sure what else can I do to > provide more information on this. Thanks. > 
> > Vance > > > > >  > From: Vance huang 
 > To: user@commons.apache.org > Sent: Fri, May 13, 2011 
5:54:44 PM > Subject: [scxml] > > > Hi, > > I am using scxml 0.9 release and 
encountered a weird issue. When I am > transitioning between 2 states, it 
worked 
fine sometimes but in other times, it > failed to transition to the next state. 
I put logging in  and  > and here is what happened: > State 1 
transition to State 2. > State 2 processes some events and transition back to 
State 1 > I put logging in  of State 1 and  of State 2. I saw 
both logs. > Then after few seconds an event fired but caught in State 2!! > Is 
it a known issue in 0.9 release? Any workaround? > Thanks. > > Vance  
- To 
unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional 
commands, e-mail: user-h...@commons.apache.org 

Re: Re: [scxml]

2011-05-16 Thread Vance huang
On Fri, May 13, 2011 at 6:54 PM, Vance huang  wrote: > 
Hi, 
> > I am using scxml 0.9 release and encountered a weird issue. When I am > 
transitioning between 2 states, it worked fine sometimes but in other times, it 
> failed to transition to the next state. I put logging in  and 
 > and here is what happened: > State 1 transition to State 2. > State 
2 processes some events and transition back to State 1 > I put logging in 
 of State 1 and  of State 2. I saw both logs. > Then after few 
seconds an event fired but caught in State 2!! > Is it a known issue in 0.9 
release? Any workaround?   Doesn't ring a bell. We'll need a concrete 
test case. Post the smallest possible SCXML snippet exhibiting the behavior you 
think is unexpected with a reason why you think its unexpected (if not 
obvious).  
-Rahul   > Thanks. > > Vance 


Hi, Rahul:

Here is the trimmed down snippet:














   




<"calling a custom action here/>








   
















What happen was that sometimes going from active to test2 and back to active 
works fine. But other times though it seems to coming back from test2 to active 
state is fine (based on the onentry logging) but when test2 event fired, it was 
caught in test2 state not active state. I am not sure what else can I do to 
provide more information on this. Thanks.


Vance





From: Vance huang 
To: user@commons.apache.org
Sent: Fri, May 13, 2011 5:54:44 PM
Subject: [scxml]


Hi, 

I am using scxml 0.9 release and encountered a weird issue. When I am 
transitioning between 2 states, it worked fine sometimes but in other times, it 
failed to transition to the next state. I put logging in  and  
and here is what happened:
State 1 transition to State 2.
State 2 processes some events and transition back to State 1
I put logging in  of State 1 and  of State 2. I saw both logs.
Then after few seconds an event fired but caught in State 2!!
Is it a known issue in 0.9 release? Any workaround? 
Thanks.

Vance

[scxml]

2011-05-13 Thread Vance huang
Hi, 

I am using scxml 0.9 release and encountered a weird issue. When I am 
transitioning between 2 states, it worked fine sometimes but in other times, it 
failed to transition to the next state. I put logging in  and  
and here is what happened:
State 1 transition to State 2.
State 2 processes some events and transition back to State 1
I put logging in  of State 1 and  of State 2. I saw both logs.
Then after few seconds an event fired but caught in State 2!!
Is it a known issue in 0.9 release? Any workaround? 
Thanks.

Vance