commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hynek Cihlar <hynek.cih...@gmail.com>
Subject [scxml] A local transition to a parallel sub-state affects all its parent's siblings
Date Mon, 25 Jul 2011 10:31:57 GMT
I have come across the following case, where I believe the Commons SCXML
behaves incorrectly.

Assuming the following state machine configuration:

<scxml xmlns="http://www.w3.org/2005/07/scxml"
       xmlns:cs="http://commons.apache.org/scxml"
       version="1.0"
       initialstate="parallel">

  <parallel id="parallel">

    <state id="A">
        <initial>
            <transition target="A.1"/>
        </initial>

        <transition event="anEvent" target="A.2"/>
        <transition event="anAEvent" target="A.3"/>

        <state id="A.1"/>
        <state id="A.2"/>
        <state id="A.3"/>
    </state>

    <state id="B">

        <initial>
            <transition target="B.1"/>
        </initial>

        <transition event="anEvent" target="B.2"/>

        <state id="B.1"/>
        <state id="B.2"/>
    </state>

  </parallel>
</scxml>


First the event "anEvent" is triggered to bring the parallel states "A" and
"B" from their initial states. Now, after triggering the event "anAEvent" I
would expect only the state of "A" to be changed. Surprisingly the event has
also effect on the "B" state, when it is brought to its initial state.

Tested on the svn revision 1143657, last changed date 2011-06-07 01:13:06
+0200 (Tue, 07 Jun 2011).

I am attaching the output log from the engine execution.

2011-07-25 12:26:56,419 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel
2011-07-25 12:26:56,420 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/A
2011-07-25 12:26:56,421 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/B
2011-07-25 12:26:56,421 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/A/A.1
2011-07-25 12:26:56,421 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/B/B.1
2011-07-25 12:26:56,425 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdata = null
2011-07-25 12:26:56,426 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdatamap =
{B.entry=null, parallel.entry=null, A.1.entry=null, B.1.entry=null,
A.entry=null}
2011-07-25 12:26:56,451 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdata = null
2011-07-25 12:26:56,451 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdatamap =
{B.entry=null, parallel.entry=null, A.1.entry=null, B.1.entry=null,
A.entry=null}
2011-07-25 12:26:56,452 DEBUG [org.apache.commons.scxml.SCXMLExecutor:538] :
Current States: [A.1, B.1]
2011-07-25 12:26:56,452 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdata = null
2011-07-25 12:26:56,452 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdatamap =
{anEvent=null}
2011-07-25 12:26:56,459 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:53] : /parallel/B/B.1
2011-07-25 12:26:56,459 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:53] : /parallel/A/A.1
2011-07-25 12:26:56,459 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:53] : /parallel/B
2011-07-25 12:26:56,459 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:53] : /parallel/A
2011-07-25 12:26:56,459 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:63] : transition (event =
anEvent, cond = null, from = /parallel/A, to = /parallel/A/A.2)
2011-07-25 12:26:56,459 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:63] : transition (event =
anEvent, cond = null, from = /parallel/B, to = /parallel/B/B.2)
2011-07-25 12:26:56,460 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/A
2011-07-25 12:26:56,460 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/B
2011-07-25 12:26:56,460 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/A/A.2
2011-07-25 12:26:56,460 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/B/B.2
2011-07-25 12:26:56,460 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdata = null
2011-07-25 12:26:56,460 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdatamap =
{B.entry=null, B.exit=null, B.2.entry=null, A.2.entry=null, B.1.exit=null,
A.exit=null, A.1.exit=null, A.entry=null}
2011-07-25 12:26:56,465 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdata = null
2011-07-25 12:26:56,465 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdatamap =
{B.entry=null, parallel.entry=null, A.1.entry=null, B.1.entry=null,
A.entry=null}
2011-07-25 12:26:56,465 DEBUG [org.apache.commons.scxml.SCXMLExecutor:538] :
Current States: [B.2, A.2]
2011-07-25 12:26:56,465 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdata = null
2011-07-25 12:26:56,465 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdatamap =
{anAEvent=null}
2011-07-25 12:26:56,469 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:53] : /parallel/B/B.2
2011-07-25 12:26:56,469 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:53] : /parallel/A/A.2
2011-07-25 12:26:56,469 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:53] : /parallel/B
2011-07-25 12:26:56,470 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:53] : /parallel/A
2011-07-25 12:26:56,470 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:63] : transition (event =
anAEvent, cond = null, from = /parallel/A, to = /parallel/A/A.3)
2011-07-25 12:26:56,470 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/A
2011-07-25 12:26:56,470 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/B
2011-07-25 12:26:56,470 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/A/A.3
2011-07-25 12:26:56,470 INFO
[org.apache.commons.scxml.env.SimpleSCXMLListener:44] : /parallel/B/B.1
2011-07-25 12:26:56,470 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdata = null
2011-07-25 12:26:56,471 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdatamap =
{B.entry=null, B.exit=null, B.2.exit=null, A.3.entry=null, A.exit=null,
B.1.entry=null, A.entry=null, A.2.exit=null}
2011-07-25 12:26:56,473 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdata = null
2011-07-25 12:26:56,474 DEBUG
[org.apache.commons.scxml.env.SimpleContext:165] : _eventdatamap =
{B.entry=null, parallel.entry=null, A.1.entry=null, B.1.entry=null,
A.entry=null}
2011-07-25 12:26:56,474 DEBUG [org.apache.commons.scxml.SCXMLExecutor:538] :
Current States: [A.3, B.1]



Hynek

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message