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] <send> _eventdata?
Date Wed, 26 Sep 2007 16:20:56 GMT
On 9/26/07, Christopher Giblin <CGI@zurich.ibm.com> wrote:
>
> Hi,
> I am using <send> and would like to send the current event, or a copy
> thereof, to the target. I don't see a way to do this other than defining
> each event field in a <datamodel> and <assign>'ing each event field to its
> respective <data> element and then finally specifying each <data> element
> in <send>'s "namelist" attribute.
>
> Is it possible - or has it been considered - for <send> semantics to
> support forwarding the current event (ie, _eventdata) without going over
> <datamodel> ?
>
<snip/>

This could be related to SCXML-54 [1], though its hard to say without
further details.

Note that depending on how long you want the _eventdata to persist
(beyond the processing cycle for the current event) you may need to
persist it via the <datamodel>. However, it is not necessary to do a
"field-by-field" copy since a <data> is not enforced to be an XML
tree. Ofcourse, if it isn't, its no longer possible to use XPath to
identify pieces of the <data>.

The following snippet illustrates how the entire payload of the event
"foo.done" is used in a subsequent <send>'s namelist.

    <!-- Root or composite state datamodel -->
    <datamodel>
        <data name="payload"/>
    </datamodel>

    <state id="foo">
        <transition event="foo.done" target="bar">
            <assign name="payload" expr="_eventdata" />
        </transition>
    </state>

    <state id="bar">
        <transition event="bar.done" target="baz">
            <send ... namelist="payload etc"/>
        </transition>
    </state>
    ...

-Rahul

[1] http://issues.apache.org/jira/browse/SCXML-54


> Thanks, chris
>
>

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


Mime
View raw message