commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <rahul.akol...@gmail.com>
Subject Re: [SCXML] Possible bug passing _eventdatamap across parallel contexts when event has delay
Date Fri, 07 Nov 2008 19:54:48 GMT
On Thu, Nov 6, 2008 at 10:38 PM, Roger Hoover <roger.hoover@gmail.com> wrote:
> 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.
>
<snip/>

A slight digression, but might be relevant background -- the
EventDispatcher [1] (which handles <send> and <cancel>) is anticipated
to be user-authored for any usages of the library of reasonable
complexity. We do provide simple examples (see implementing classes in
Javadoc) as a way to get folks started, but these do not handle any
targettypes beyond 'scxml' (which is also the default).

The behavior you mention above does seem like a bug. Obviously, events
with or without delay are handled differently (the former are
scheduled for execution). I suspect the SimpleScheduler implementation
may be overlooking event payloads, or not processing them correctly.
Please file a bug report in JIRA [2] and attach your test case, and
I'll take a look at this.

-Rahul

[1] http://commons.apache.org/scxml/0.8/apidocs/org/apache/commons/scxml/EventDispatcher.html
[2] http://commons.apache.org/scxml/issue-tracking.html


> 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>
>

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


Mime
View raw message