diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-02-25 12:28:05 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-02-25 12:28:05 (GMT) |
commit | 49c3c43d18c9cce6de305aae77cc8bd839506129 (patch) | |
tree | cfc4ea84416c76e8bbe3e27d2918321115b61e24 /test/samples | |
parent | 47956a35d11495f2ebf6988c7f9d9dffe0bd3a4b (diff) | |
download | uscxml-49c3c43d18c9cce6de305aae77cc8bd839506129.zip uscxml-49c3c43d18c9cce6de305aae77cc8bd839506129.tar.gz uscxml-49c3c43d18c9cce6de305aae77cc8bd839506129.tar.bz2 |
Introduced postpone element and reorganized http request representation as events
Diffstat (limited to 'test/samples')
-rw-r--r-- | test/samples/uscxml/test-osgconvert.scxml | 40 | ||||
-rw-r--r-- | test/samples/uscxml/test-postpone-element.scxml | 41 | ||||
-rw-r--r-- | test/samples/uscxml/test-response-element.scxml | 4 |
3 files changed, 83 insertions, 2 deletions
diff --git a/test/samples/uscxml/test-osgconvert.scxml b/test/samples/uscxml/test-osgconvert.scxml new file mode 100644 index 0000000..90591eb --- /dev/null +++ b/test/samples/uscxml/test-osgconvert.scxml @@ -0,0 +1,40 @@ +<scxml datamodel="ecmascript" name="vrml"> + <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" /> + <script> + var files = {}; + </script> + <state id="main"> + <!-- Stop processing if no vrml-path was given on command line --> + <transition target="final" cond="_x['args']['vrml-path'] == undefined || _x['args']['vrml-path'].length == 0"> + <log expr="'No --vrml-path given'" /> + </transition> + + <!-- Stop processing if an error occurred --> + <transition target="final" event="error"> + <log expr="'An error occured:'" /> + <script>dump(_event);</script> + </transition> + + <!-- Start the directory monitor --> + <invoke type="dirmon" id="dirmon.vrml"> + <param name="dir" expr="_x['args']['vrml-path']" /> + <param name="recurse" expr="true" /> + <param name="suffix" expr="'.wrl'" /> + <param name="reportExisting" expr="true" /> + <finalize> + <send target="#_osgvonvert.osgb"> + <param name="source" expr="_event.data.file.path" /> + <param name="dest" expr="_event.data.file.path + '.png'" /> + </send> + </finalize> + </invoke> + + <!-- Start the osgconvert invoker to transform 3D files --> + <invoke type="osgconvert" id="osgvonvert.osgb"> + <param name="threads" expr="1" /> + </invoke> + + <state id="idle" /> + </state> + <state id="final" final="true" /> +</scxml>
\ No newline at end of file diff --git a/test/samples/uscxml/test-postpone-element.scxml b/test/samples/uscxml/test-postpone-element.scxml new file mode 100644 index 0000000..185f367 --- /dev/null +++ b/test/samples/uscxml/test-postpone-element.scxml @@ -0,0 +1,41 @@ +<scxml datamodel="ecmascript" name="postpone"> + <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" /> + <script> + var blocked = true; + </script> + <state id="idle"> + + <!-- request will be postponed until someone unblocks --> + <transition event="http" target="idle" cond="_event.data.pathComponent[1] == 'block'"> + <if cond="blocked"> + <log expr="'Postponing'" /> + <postpone until="blocked == false;" /> + <else> + <response status="200" requestexpr="_event.origin"> + <content expr="blocked" /> + </response> + </else> + </if> + </transition> + + <!-- unblock - this triggers all postponed events --> + <transition event="http" target="idle" cond="_event.data.pathComponent[1] == 'unblock'"> + <log expr="'Unblocking'" /> + <script>blocked = false;</script> + <response status="200" requestexpr="_event.origin"> + <content expr="blocked" /> + </response> + </transition> + + <!-- default --> + <transition event="http" target="idle" cond=" + _event.data.pathComponent[1] != 'unblock' && + _event.data.pathComponent[1] != 'block' + "> + <script>dump(_event);</script> + <response status="200" requestexpr="_event.origin" /> + </transition> + + </state> + <state id="final" final="true" /> +</scxml>
\ No newline at end of file diff --git a/test/samples/uscxml/test-response-element.scxml b/test/samples/uscxml/test-response-element.scxml index d3d3c53..eb02320 100644 --- a/test/samples/uscxml/test-response-element.scxml +++ b/test/samples/uscxml/test-response-element.scxml @@ -3,9 +3,9 @@ <state id="start"> <state id="loop"> <transition event="http" target="loop"> - <!-- script> + <script> dump(_event); - </script --> + </script> <response status="200" requestexpr="_event.origin" /> </transition> </state> |