summaryrefslogtreecommitdiffstats
path: root/test/samples/uscxml/test-umundo-s11n.scxml
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-11-07 22:20:09 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-11-07 22:20:09 (GMT)
commitda08a1d3c3bca8070c9b029cfc1f8faf9e34dd25 (patch)
treeb285148ab6ca415814d9370148f91736f83c852c /test/samples/uscxml/test-umundo-s11n.scxml
parent0ae6c27d9322208053033d9b19c0ffffed3d99eb (diff)
downloaduscxml-da08a1d3c3bca8070c9b029cfc1f8faf9e34dd25.zip
uscxml-da08a1d3c3bca8070c9b029cfc1f8faf9e34dd25.tar.gz
uscxml-da08a1d3c3bca8070c9b029cfc1f8faf9e34dd25.tar.bz2
Committing local version again
Diffstat (limited to 'test/samples/uscxml/test-umundo-s11n.scxml')
-rw-r--r--test/samples/uscxml/test-umundo-s11n.scxml115
1 files changed, 115 insertions, 0 deletions
diff --git a/test/samples/uscxml/test-umundo-s11n.scxml b/test/samples/uscxml/test-umundo-s11n.scxml
new file mode 100644
index 0000000..001d72e
--- /dev/null
+++ b/test/samples/uscxml/test-umundo-s11n.scxml
@@ -0,0 +1,115 @@
+<scxml datamodel="ecmascript">
+ <script>
+ <![CDATA[
+ function dump(arr,level) {
+ if(!level) level = 0;
+
+ var level_padding = "";
+ for(var j=0;j < level+1;j++) level_padding += " ";
+
+ if(typeof(arr) == 'object') {
+ for(var item in arr) {
+ var value = arr[item];
+
+ if(typeof(value) == 'object') {
+ print(level_padding + "'" + item + "' ...\n");
+ print(dump(value,level+1));
+ } else {
+ print(level_padding + "'" + item + "' => \"" + value + "\"\n");
+ }
+ }
+ } else {
+ print("===> "+arr+" <===("+typeof(arr)+")");
+ }
+ }
+ ]]>
+ </script>
+ <state id="start">
+ <invoke type="umundo" id="scxml.umundo">
+ <param name="types" expr="'proto/Test.proto'" />
+ <param name="channel" expr="'types'" />
+ <finalize>
+ <script>
+ dump(_event);
+ </script>
+ <send target="#_scxml.umundo" delay="0s" event="dump.event">
+ <param name="type" expr="_event.data.type" />
+ <content>_event.data</content>
+ </send>
+ </finalize>
+ </invoke>
+ <onentry-off>
+ <!-- The round brackets are needed to evaluate the JSON object as an expression! -->
+ <send target="#_scxml.umundo" delay="3s" event="dump.event">
+ <param name="type" expr="'AllTypes'" />
+ <content>
+ ({
+ "doubleType": 1.0,
+ "floatType": 2.0,
+ "int32Type": -3,
+ "int64Type": -4,
+ "uint32Type": 5,
+ "uint64Type": 6,
+ "sint32Type": -7,
+ "sint64Type": -8,
+ "fixed32Type": 9,
+ "fixed64Type": 10,
+ "sfixed32Type": -11,
+ "sfixed64Type": -12,
+ "boolType": false,
+ "stringType": 'string',
+ "bytesType": 'bytes',
+ })
+ </content>
+ </send>
+ <send target="#_scxml.umundo" delay="3s" event="dump.event">
+ <param name="type" expr="'RepeatedTypes'" />
+ <content>
+ ({
+ "doubleType": [ 1.0, 2.0 ],
+ "floatType": [ 2.0, 3.0 ],
+ "int32Type": [ -3, -4 ],
+ "int64Type": [ -4, -5 ],
+ "uint32Type": [ 5, 6 ],
+ "uint64Type": [ 6, 7 ],
+ "sint32Type": [ -7, -8 ],
+ "sint64Type": [ -8, -9 ],
+ "fixed32Type": [ 9, 10 ],
+ "fixed64Type": [ 10, 11 ],
+ "sfixed32Type": [ -11, -12 ],
+ "sfixed64Type": [ -12, -13 ],
+ "boolType": [ false, true ],
+ "stringType": [ '1st string', '2nd string' ],
+ "bytesType": [ '1st bytes', '2nd bytes' ],
+ "repeatedMessage": [{
+ "doubleType": [ 1.0, 2.0 ],
+ "floatType": [ 2.0, 3.0 ],
+ "int32Type": [ -3, -4 ],
+ "int64Type": [ -4, -5 ],
+ "uint32Type": [ 5, 6 ],
+ "uint64Type": [ 6, 7 ],
+ "sint32Type": [ -7, -8 ],
+ "sint64Type": [ -8, -9 ],
+ "fixed32Type": [ 9, 10 ],
+ "fixed64Type": [ 10, 11 ],
+ "sfixed32Type": [ -11, -12 ],
+ "sfixed64Type": [ -12, -13 ],
+ "boolType": [ false, true ],
+ "stringType": [ '1st string', '2nd string' ],
+ "bytesType": [ '1st bytes', '2nd bytes' ],
+ }],
+ })
+ </content>
+ </send>
+ </onentry-off>
+ <transition target="dump" event="dump.event" />
+ </state>
+ <state id="dump">
+ <onentry>
+ <script>
+ dump(_event);
+ </script>
+ </onentry>
+ <transition target="dump" event="dump.event" />
+ </state>
+</scxml> \ No newline at end of file