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

Reply via email to