summaryrefslogtreecommitdiffstats
path: root/test/uscxml/test-jvoicexml.scxml
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-15 10:08:41 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-15 10:08:41 (GMT)
commit9149b28c87c7a037dfd244aa5d4c1409b6593dca (patch)
tree939c00d28864910a0ca8a67e70fadae9b6f05cc7 /test/uscxml/test-jvoicexml.scxml
parent322e868668a1e5b9595a21737aabe8d0d8b8d275 (diff)
downloaduscxml-9149b28c87c7a037dfd244aa5d4c1409b6593dca.zip
uscxml-9149b28c87c7a037dfd244aa5d4c1409b6593dca.tar.gz
uscxml-9149b28c87c7a037dfd244aa5d4c1409b6593dca.tar.bz2
More JVoiceXML integration
Diffstat (limited to 'test/uscxml/test-jvoicexml.scxml')
-rw-r--r--test/uscxml/test-jvoicexml.scxml128
1 files changed, 95 insertions, 33 deletions
diff --git a/test/uscxml/test-jvoicexml.scxml b/test/uscxml/test-jvoicexml.scxml
index ca423ad..2e60cf3 100644
--- a/test/uscxml/test-jvoicexml.scxml
+++ b/test/uscxml/test-jvoicexml.scxml
@@ -1,54 +1,116 @@
-<scxml xmlns="http://www.w3.org/2005/07/scxml"
- xmlns:vxml="http://www.w3.org/2001/vxml"
- datamodel="ecmascript">
- <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" />
+<?xml version="1.0"?>
+<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:vxml="http://www.w3.org/2001/vxml" datamodel="ecmascript">
+ <!-- get dump() function into datamodel -->
+ <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js"/>
+ <script>
+ vxmlTargetURL = "http://localhost:9090/mmi";
+ </script>
- <state id="start">
- <invoke type="heartbeat">
- <param name="interval" expr="'5s'" />
- </invoke>
-
- <state id="vxmlHello">
- <invoke src="https://raw.githubusercontent.com/Roland-Taizun-Azhar/TaskAssistance-Project/master/WebContent/hello.vxml" type="vxml" id="vxml">
- <param name="target" expr="'http://localhost:9090/mmi'" />
- </invoke>
- <!--invoke type="vxml" id="vxml">
- <param name="target" expr="'http://localhost:9090/mmi'" />
+ <state id="prompts">
+ <transition event="error" target="done">
+ <log expr="'An error occured:' + _event" />
+ </transition>
+
+ <state id="vxmlPrompt1">
+ <!-- Test that rendering a prompt sends start and done events -->
+ <invoke type="vxml" id="vxml">
+ <param name="target" expr="vxmlTargetURL"/>
+ <content>
+ <vxml:prompt>Testing start and done events</vxml:prompt>
+ </content>
<finalize>
<script>dump(_event);</script>
</finalize>
-
+ </invoke>
+
+ <state id="waitForPrompt1Start">
+ <transition event="vxml.output.start" target="waitForPrompt1Done"/>
+ </state>
+ <state id="waitForPrompt1Done">
+ <transition event="vxml.output.done" target="vxmlPrompt2"/>
+ </state>
+ </state>
+
+
+ <state id="vxmlPrompt2">
+ <!-- Test prompts in form with goto -->
+ <invoke type="vxml" id="vxml">
+ <param name="target" expr="vxmlTargetURL"/>
<content>
- <vxml:vxml version="2.1" xml:lang="en"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schematicLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd">
+ <vxml:vxml version="2.1">
<vxml:form id="say_hello">
<vxml:block>
- Hello World!
- <vxml:goto next="#say_goodbye" />
+ Testing prompts in form
+ <vxml:goto next="#say_goodbye"/>
</vxml:block>
</vxml:form>
<vxml:form id="say_goodbye">
<vxml:block>
- <vxml:prompt>Goodbye!</vxml:prompt>
+ <vxml:prompt>with goto</vxml:prompt>
</vxml:block>
</vxml:form>
</vxml:vxml>
</content>
- </invoke-->
+ <finalize>
+ <script>dump(_event);</script>
+ </finalize>
+ </invoke>
- <!-- <transition event="heartbeat" target="idle" /> -->
+ <state id="waitForPrompt2HelloStart">
+ <transition event="vxml.output.start" target="waitForPrompt2HelloDone"/>
+ </state>
+ <state id="waitForPrompt2HelloDone">
+ <transition event="vxml.output.done" target="waitForPrompt2ByeStart"/>
+ </state>
+ <state id="waitForPrompt2ByeStart">
+ <transition event="vxml.output.start" target="waitForPrompt2ByeDone"/>
+ </state>
+ <state id="waitForPrompt2ByeDone">
+ <transition event="vxml.output.done" target="waitForPrompt2HelloDone"/>
+ </state>
</state>
+ </state>
+
+
+
+ <state id="forms">
+ <transition event="error" target="done">
+ <log expr="'An error occured:' + _event" />
+ </transition>
+
+ <invoke type="vxml" id="vxml">
+ <param name="target" expr="vxmlTargetURL"/>
+ <content>
+ <vxml:vxml version="2.1">
+ <vxml:form id="launch_missiles">
+ <vxml:field name="user_id" type="digits">
+ <vxml:prompt>What is your username</vxml:prompt>
+ </vxml:field>
+ <vxml:field name="password">
+ <vxml:prompt>What is the code word?</vxml:prompt>
+ <vxml:grammar version="1.0" root="root">
+ <vxml:rule id="root" scope="public">rutabaga</vxml:rule>
+ </vxml:grammar>
+ <vxml:help>It is the name of an obscure vegetable.</vxml:help>
+ <vxml:catch event="nomatch noinput" count="3">
+ <vxml:prompt>Security violation!</vxml:prompt>
+ </vxml:catch>
+ </vxml:field>
+ </vxml:form>
+ </vxml:vxml>
+ </content>
+ <finalize>
+ <script>dump(_event);</script>
+ </finalize>
+ </invoke>
- <state id="idle">
- <onentry>
- <log expr="'Idling!'" />
- </onentry>
-
- <transition event="heartbeat" target="vxmlHello">
- <log expr="'Foo!'" />
+ <state id="waitForMissileEvents">
+ <transition event="vxml.input.field.user_id" target="done">
+ <log expr="'Welcome ' + _event.data.value + ' please provide credentials!'" />
</transition>
+ <transition event="vxml.input.field.password" />
</state>
-
</state>
-</scxml> \ No newline at end of file
+
+ <final id="done" />
+</scxml>