commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <rahul.akol...@gmail.com>
Subject Re: [SCXML] Inject external event with XML payload () into SCXML engine
Date Thu, 05 Jul 2007 22:09:41 GMT
Please post to the user list if the question is purely about usage
(though I understand determining that can be tricky sometimes). If
this thread continues, we should probably move it to the user list.

On 7/5/07, Ingmar Kliche <ingmar.kliche@googlemail.com> wrote:
> Rahul,
>
> I would like to inject events with XML payload into the SCXML engine.
> Currently we have to convert XML represented messages received from external
> components into a hashmap object to fire the event into the engine. But this
> does not allow to include XML attributes easily. Suppose we have an event
> which is represented as an EMMA string, e.g. (borrowed from [1])
>
> <emma:emma version="1.0">
>   <emma:one-of id="r1" emma:start="1087995961542" emma:end="1087995963542">
>     <emma:interpretation id="int1" emma:confidence="0.75"
>     emma:tokens="flights from boston to denver">
>       <origin>Boston</origin>
>       <destination>Denver</destination>
>     </emma:interpretation>
>
>     <emma:interpretation id="int2" emma:confidence="0.68"
>     emma:tokens="flights from austin to denver">
>       <origin>Austin</origin>
>       <destination>Denver</destination>
>     </emma:interpretation>
>   </emma:one-of>
> </emma:emma>
>
> How do we pass this into the SCXML engine? My goal is to pass this XML data
> into the SCXML data model and operate on the event data using XPath.
>
> Do you have any suggestion?
>
<snip/>

Might be best to parse the EMMA into its DOM before attaching it to
the payload (say under property 'emma').

Then you can get to it like so:

Data( _eventdata.emma , '/some/xpath' )

You can define expression language functions to do more specialized things.

You can use <assign> to store the payload in the SCXML data model.

-Rahul


> - Ingmar.
>
> [1] http://www.w3.org/TR/emma
>

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


Mime
View raw message