commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger Hoover" <roger.hoo...@gmail.com>
Subject [SCXML] Possible bug passing _eventdatamap across parallel contexts when event has delay
Date Fri, 07 Nov 2008 03:38:00 GMT
Hi,

I'm new to Commons SCXML but I ran into what looks like a bug to me.  When
an event generated in one context gets sent to a sibling context with a
delay, the _eventdata object is null.  Oddly enough, when delay unset or set
to 0ms, it works fine.  I created a test file based on eventdata-03.xml to
expose it.   Set delay="0ms" and the counter state machine makes it to the
thirty state.  Set delay="1ms" and it doesn't.

Any help is appreciated.  Thanks,

Roger


<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->
<scxml xmlns="http://www.w3.org/2005/07/scxml"
      version="1.0"
      initialstate="start">

    <parallel id="start">

        <state id="simulatedUser">
            <datamodel>
                <data name="one" expr="1" />
                <data name="two" expr="2" />
            </datamodel>

            <onentry>
                <send event="event.bar" namelist="one two" delay="1ms"/>
            </onentry>
            <transition event="event.bar">
                <log label="'simulatedUser'"
expr="_eventdatamap['event.bar'].one + ', ' +
_eventdatamap['event.bar'].two"/>
            </transition>
        </state>

        <state id="counter">
            <initial>
                <transition target="twenty"/>
            </initial>

            <state id="twenty">
                <transition event="event.bar"
                    cond="_eventdatamap['event.bar'].one +
_eventdatamap['event.bar'].two eq 3"
                    target="thirty"/>
                <transition event="event.bar">
                    <log label="'event.bar in twenty state'"
expr="_eventdatamap['event.bar'].one + ', ' +
_eventdatamap['event.bar'].two"/>
                </transition>
            </state>

            <state id="thirty" final="true"/>
        </state>

    </parallel>

</scxml>

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