summaryrefslogtreecommitdiffstats
path: root/test/samples/uscxml/test-http-servlet.scxml
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-02-20 21:13:02 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-02-20 21:13:02 (GMT)
commita56f28b0db56ff3e39f0b50e4c55c52b7aeec696 (patch)
tree41cf67ea5cee9593e86272ab55367653fbd1c2f3 /test/samples/uscxml/test-http-servlet.scxml
parent7c779099b3acd1fa969dde718299484ebe0d2775 (diff)
downloaduscxml-a56f28b0db56ff3e39f0b50e4c55c52b7aeec696.zip
uscxml-a56f28b0db56ff3e39f0b50e4c55c52b7aeec696.tar.gz
uscxml-a56f28b0db56ff3e39f0b50e4c55c52b7aeec696.tar.bz2
See detailled log
- Builds on windows again - All HTTP requests are no passed into interpreter - New response element to reply with data - Moved basichttp URL - New HTTP servlet invoker to register additional URLs - More bugfixes than I care to mention
Diffstat (limited to 'test/samples/uscxml/test-http-servlet.scxml')
-rw-r--r--test/samples/uscxml/test-http-servlet.scxml41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/samples/uscxml/test-http-servlet.scxml b/test/samples/uscxml/test-http-servlet.scxml
new file mode 100644
index 0000000..8836b76
--- /dev/null
+++ b/test/samples/uscxml/test-http-servlet.scxml
@@ -0,0 +1,41 @@
+<scxml datamodel="ecmascript">
+ <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" />
+ <state id="start">
+ <!--
+ I went for explicit invokers instead of a response element in executable content
+ as it provides better control on the path where to serve data.
+ -->
+ <invoke type="httpserver" id="servlet.data">
+ <!-- server path where to listen -->
+ <param name="path" expr="'data'" />
+ <!-- the name of events originating from requests at this url -->
+ <param name="callback" expr="'http.data'" />
+ </invoke>
+ <invoke type="httpserver" id="servlet.exit">
+ <param name="path" expr="'exit'" />
+ <param name="callback" expr="'http.exit'" />
+ </invoke>
+ <state id="loop">
+ <transition event="http.data" target="loop">
+ <script>
+ dump(_event);
+ </script>
+ <!-- Sending a http reply is to send the invoker id a "reply.<requestId>" event -->
+ <send target="#_servlet.data" eventexpr="'reply.' + _event.data.reqId">
+ <!-- This will end up as a header field -->
+ <param name="Foo" expr="_ioprocessors" />
+ <!-- JSON string in the content -->
+ <content expr="_ioprocessors" />
+ </send>
+ </transition>
+ <transition event="http.exit" target="final">
+ <script>
+ dump(_event);
+ </script>
+ <!-- This will never get delivered as we terminate before -->
+ <send target="#_servlet.exit" eventexpr="'reply.' + _event.data.reqId" />
+ </transition>
+ </state>
+ </state>
+ <final id="final" />
+</scxml> \ No newline at end of file