summaryrefslogtreecommitdiffstats
path: root/test/samples/uscxml
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-01-21 14:33:32 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-01-21 14:33:32 (GMT)
commit948fbc12c1b4e48a24b18a84878bd560cbaf91a7 (patch)
tree23976fb5eedfedaeadd8fed8da60aa1159f3d286 /test/samples/uscxml
parent08eff21dfbdbf7d20e1b96ff2f00882ec0a87b08 (diff)
downloaduscxml-948fbc12c1b4e48a24b18a84878bd560cbaf91a7.zip
uscxml-948fbc12c1b4e48a24b18a84878bd560cbaf91a7.tar.gz
uscxml-948fbc12c1b4e48a24b18a84878bd560cbaf91a7.tar.bz2
SMTP Invoker and "invoke.success.<INV_ID>" events when an invoker was started
Diffstat (limited to 'test/samples/uscxml')
-rw-r--r--test/samples/uscxml/test-smtp.scxml50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/samples/uscxml/test-smtp.scxml b/test/samples/uscxml/test-smtp.scxml
new file mode 100644
index 0000000..7c3ad22
--- /dev/null
+++ b/test/samples/uscxml/test-smtp.scxml
@@ -0,0 +1,50 @@
+<scxml datamodel="ecmascript">
+ <script>
+//<![CDATA[
+ someBinaryData1 = new ArrayBuffer(256);
+ var view = new Uint8Array(someBinaryData1);
+ for (var i = 0; i < view.length; i++) {
+ view[i] = i;
+ }
+//]]>
+ </script>
+
+ <state id="main">
+
+ <invoke type="smtp" id="smtp">
+ <param name="username" expr="'username'" />
+ <param name="password" expr="'password'" />
+ <param name="server" expr="'smtp://example.com:587'" />
+ </invoke>
+
+ <transition event="invoke.success.smtp">
+ <file operation="read"
+ sandbox="off"
+ url="file:///Users/sradomski/Documents/TK/Presentations/umundo/umundo-techtalk.pdf"
+ callback="file.load.success"
+ type="binary"
+ mimetype="application/pdf"
+ />
+ </transition>
+
+ <transition event="file.load.success">
+ <send target="#_smtp" event="mail.send" delay="500ms">
+ <param name="header" expr="'X-User-Agent: uscxml'" />
+ <param name="verbose" expr="'on'" />
+ <param name="subject" expr="'This is a test'" />
+ <param name="Content-Type" expr="'text/plain'" />
+ <param name="attachment" expr="({ filename: 'attachment.txt', mimetype: 'text/plain', data: 'Attachment'})" />
+ <param name="attachment" expr="({ filename: 'attachment3.txt', data: someBinaryData1 })" />
+ <param name="attachment" expr="someBinaryData2" />
+ <param name="attachment" expr="({ filename: _event.data.file.name, data: _event.data.content })" />
+ <param name="from" expr="'sradomski@example.com'" />
+ <param name="to" expr="'sradomski@example.com'" />
+ <param name="cc" expr="'sradomski2@example.com'" />
+ <param name="cc" expr="'sradomski3@example.com'" />
+ <param name="bcc" expr="'sradomski4@example.com'" />
+ <content>I just tried your SMTP invoker</content>
+ </send>
+ </transition>
+
+ </state>
+</scxml> \ No newline at end of file