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] Inject external event with XML payload () into SCXML engine
Date Mon, 09 Jul 2007 15:36:08 GMT
On 7/9/07, Ingmar Kliche <ingmar.kliche@googlemail.com> wrote:
> (Move this thread to the user list)
>
<snip/>

Thanks!


> Rahul,
>
> you wrote:
>
> > You can define expression language functions to do more specialized
> things.
>
> That sounds interesting. Do you have an advice where to find examples on how
> to define EL functions and how to use them in an SCXML document?
>
<snap/>

See bottom of the user guide page on Contexts and Evaluators [1] for a
short description.

-Rahul

[1] http://jakarta.apache.org/commons/scxml/guide/contexts-evaluators.html


> Thanks,
> Ingmar.
>
>
> 2007/7/6, Rahul Akolkar <rahul.akolkar@gmail.com>:
> >
> > 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-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message