You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Ingmar Kliche <in...@googlemail.com> on 2007/05/25 16:40:25 UTC

[SCXML] Bug on decision of transition?

I noticed that commons-scxml executes multiple transitions on one event as
soon as multiple transitions (i.e. multiple transitions exist for one event)
match. The SCXML spec instead says that only one transition has to be taken
(the first in document order) as long as it is not a parallel construct. To
illustrate this behavior I modified the state chart of the stop watch
example to

<scxml xmlns="http://www.w3.org/2005/07/scxml"
       version="1.0"
       initialstate="init">
...
 </state>
    <state id="reset">
*        <transition event="watch.start" target="running"/>
        <transition event="watch.start" target="stopped"/>
*        <transition event="watch.split">
         <assign name="foo" expr="3"/>
        </transition>
    </state>
....

I.e. the reset state contains two transitions for the event "watch.start".
According to the SCXML spec I would assume that the first transition in
document order will be taken, but commons-scxml executes both transitions
and ends up in two states. See the following log:


25.05.2007 16:27:01 org.apache.commons.scxml.env.SimpleErrorReporter onError
WARNUNG: NON_DETERMINISTIC (Multiple conflicting transitions enabled.):
[transition (event = watch.start, cond = null, from = /reset, to =
/stopped), transition (event = watch.start, cond = null, from = /reset, to =
/running)]
25.05.2007 16:27:01 org.apache.commons.scxml.env.SimpleErrorReporter onError
WARNUNG: ILLEGAL_CONFIG (Multiple top-level OR states active!): <SCXML> :
[/running, /stopped]
25.05.2007 16:27:01 org.apache.commons.scxml.env.SimpleErrorReporter onError
WARNUNG: ILLEGAL_CONFIG (Multiple top-level OR states active!): <SCXML> :
[/running, /stopped]
25.05.2007 16:27:01 org.apache.commons.scxml.SCXMLExecutor logState
INFO: Current States: [running, stopped]

Is this behaviour inteted?

Thanks and regards,
Ingmar

Re: [SCXML] Bug on decision of transition?

Posted by Rahul Akolkar <ra...@gmail.com>.
On 5/25/07, Ingmar Kliche <in...@googlemail.com> wrote:
> I noticed that commons-scxml executes multiple transitions on one event as
> soon as multiple transitions (i.e. multiple transitions exist for one event)
> match. The SCXML spec instead says that only one transition has to be taken
> (the first in document order) as long as it is not a parallel construct.
<snip/>

I suspect you're using v0.6. Recent changes now take into account
document order. In fact, here is a similar test case:

http://svn.apache.org/repos/asf/jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/tie-breaker-01.xml

Please try building [1] from trunk [2].

-Rahul

[1] http://jakarta.apache.org/commons/scxml/building.html
[2] http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/


> To
> illustrate this behavior I modified the state chart of the stop watch
> example to
>
> <scxml xmlns="http://www.w3.org/2005/07/scxml"
>        version="1.0"
>        initialstate="init">
> ...
>  </state>
>     <state id="reset">
> *        <transition event="watch.start" target="running"/>
>         <transition event="watch.start" target="stopped"/>
> *        <transition event="watch.split">
>          <assign name="foo" expr="3"/>
>         </transition>
>     </state>
> ....
>
> I.e. the reset state contains two transitions for the event "watch.start".
> According to the SCXML spec I would assume that the first transition in
> document order will be taken, but commons-scxml executes both transitions
> and ends up in two states. See the following log:
>
>
> 25.05.2007 16:27:01 org.apache.commons.scxml.env.SimpleErrorReporter onError
> WARNUNG: NON_DETERMINISTIC (Multiple conflicting transitions enabled.):
> [transition (event = watch.start, cond = null, from = /reset, to =
> /stopped), transition (event = watch.start, cond = null, from = /reset, to =
> /running)]
> 25.05.2007 16:27:01 org.apache.commons.scxml.env.SimpleErrorReporter onError
> WARNUNG: ILLEGAL_CONFIG (Multiple top-level OR states active!): <SCXML> :
> [/running, /stopped]
> 25.05.2007 16:27:01 org.apache.commons.scxml.env.SimpleErrorReporter onError
> WARNUNG: ILLEGAL_CONFIG (Multiple top-level OR states active!): <SCXML> :
> [/running, /stopped]
> 25.05.2007 16:27:01 org.apache.commons.scxml.SCXMLExecutor logState
> INFO: Current States: [running, stopped]
>
> Is this behaviour inteted?
>
> Thanks and regards,
> Ingmar
>

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