On Tue, Dec 30, 2008 at 6:53 AM, Jaroslav Pullmann <[email protected]> wrote: > > Thank you Raul, using _eventdatamap did help. I'd like to summarize the > proposed solutions > (with JEXL as expression language), please correct them when necessary: > > 1) access the simple string content of thze event payload ? > > <transition event="view" cond="_eventdatamap['view'].text != null"> > > 2) access XML event payload via XPath ? > > <transition event="event.bar" > cond="Data(_eventdatamap['event.bar'].rootdata,'root/one') == 1"/> > <snip/>
Correct, and as I noted, the syntax is subject to change in future releases (will be more like the original example you posted when we're done). > 3) send a subtree of an XML data model along with an event ? > > - first define a local variable holding the required data excerpt via the > custom action "cs:var" > where xmlns:cs="http://commons.apache.org/scxml", since <datamodel> is > valid only in context > of <state>, not within an executable content: > <snap/> Also correct, though the reason has to do with the nature of 'namelist' -- we need a space-separated list of names so we create monikers for the XML subtree(s) that will become part of the event payload. -Rahul > <cs:var name="text" expr="Data(xmltext,'text')"/> > > - reference the variable via @namelist like an ordinary datamodel part: > > <send event="'view'" namelist="text" /> > > > Best regards ... and a happy New Year ;o) > Jaro > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
