You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Christopher Giblin <CG...@zurich.ibm.com> on 2007/09/26 14:59:32 UTC

[SCXML] _eventdata?

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

Thanks, chris


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


Re: [SCXML] _eventdata?

Posted by Rahul Akolkar <ra...@gmail.com>.
On 9/26/07, Christopher Giblin <CG...@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