diff options
Diffstat (limited to 'apps/samples')
-rw-r--r-- | apps/samples/put-that-there/put-that-there.scxml | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/apps/samples/put-that-there/put-that-there.scxml b/apps/samples/put-that-there/put-that-there.scxml index 43a6b37..301e34b 100644 --- a/apps/samples/put-that-there/put-that-there.scxml +++ b/apps/samples/put-that-there/put-that-there.scxml @@ -2,6 +2,11 @@ xmlns="http://www.w3.org/2005/07/scxml" xmlns:scenegraph="http://uscxml.tk.informatik.tu-darmstadt.de/scenegraph.xsd"> <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" /> + + <datamodel> + <data id="foo">This is foo!</data> + </datamodel> + <state id="start"> <invoke type="scenegraph"> <content> @@ -27,8 +32,10 @@ </content> </invoke> <state id="main"> + <transition event="http" target="main" type="internal" - cond="_event.data.pathComponent[1] === 'basichttp' && _event.data.pathComponent[2] === 'query'" > + cond="_event.data.path Component[1] === 'basichttp' && + _event.data.pathComponent[2] === 'query'" > <!-- a request for /ptt/basichttp/query --> <script>dump(_event);</script> <if cond="_event.data.header['X-XPath']"> @@ -41,6 +48,11 @@ _event.reply = "No nodes!"; } </script> + <elseif cond="_event.data.header['X-ECMAPath']" /> + <script> + // an ecmascript expression evaluate and set reply on event + _event.reply = eval(_event.data.header['X-ECMAPath']); + </script> </if> <send type="basichttp" targetexpr="_event.data.header['X-Reply-To']"> <content expr="_event.reply" /> @@ -61,6 +73,11 @@ _event.reply = "No nodes!"; } </script> + <elseif cond="_event.data.header['X-ECMAPath']" /> + <script> + // an ecmascript expression evaluate and set reply on event + _event.reply = eval(_event.data.header['X-ECMAPath']); + </script> </if> <respond to="_event.origin"> <content expr="_event.reply" /> |