200 likes | 363 Views
Using VoiceXML, XHTML, and SCXML to Build Multimodal Applications. James A. Larson. Agenda. SCXML controls the flow of an application SCXML controls modalities VoiceXML XHTML Others, e.g., InkML, SVG SCXML controls Web services. State Chart XML. Represents a state transition system
E N D
Using VoiceXML, XHTML, and SCXML to Build Multimodal Applications James A. Larson
Agenda • SCXML controls the flow of an application • SCXML controls modalities • VoiceXML • XHTML • Others, e.g., InkML, SVG • SCXML controls Web services
State Chart XML • Represents a state transition system • States • Transitions A B
Possible Actions within a <state> • Multimodal life cycle events <start … /> <cancel … /> <pause … /> <resume … /> <data … /> • Executable content <assign/> <var> <script/> <if/>, <elseif/>, <else/> <log/> A <if …> <start … /> <else/> <log …/> </if>
SCXML • Sequentially perform the actions in two states <state id="A"> <prepare … /> <transition event= "done" target="B"/> </state> <state id="B"> <start … /> </state> A <prepare … /> done <start … /> B
SCXML • Conditional branch <state id="A"> <prepare … /> <transition event= "done" cond="result='OK̍'" target="B"/> <transition event= "done" cond="result='Opps'" target="C"/> </state> A <prepare … /> done OK done Opps B C
SCXML • Parallel States <state id="A"> <transition …. target="B"/> </state> <state id="B"/> <parallel> <state id="C"/> <state id="D"/> </parallel> </state> A B C D
Agenda • SCXML controls the flow of an application • SCXML controls modalities • VoiceXML • XHTML • Others, e.g., InkML, SVG • SCXML controls Web services
SCXML + VoiceXML <state id="A"> <start name= "getAirport.vxml" /> <transition event= "done" target="B"/> </state> A <?xml version="1.0"?> <vxml version="3.0" xmlns = "http://www.w3.org/2001/vxml"> <form id = "destination" > <field name = "Airport"> <grammar src= "airport.grxml"/> <prompt>Say your destination airport </prompt> <grammar src= “Airport.grxml” </field> <filled> <send event= "done" namelist = "Airport" /> </filled> </form> </vxml> getAirport.vxml done B state id="B"> <start … /> </state>
SCXML + XHTML <state id="A"> <start name= "getAirport.xhtml" /> <transition event= "done" target="B"/> </state> A <html/> <head> <ev:listener ev:event="onchange" ev:observer="bodyId" ev:handler= "sendDone()" /> <script> {function sendDone…} </script> </head> <!--xhtml code --> <body id="bodyId"/><p>enter month</p> <input type="text" id="month"/> </body> </html> getAirport.xhtml done B state id="B"> <start … /> </state>
SCXML + XHTML + VoiceXML A B <state id="A1"> <start name= "getAirport.vxml" /> <transition event= "done" target="B"/> </state> A1 <state id="A2"> <start name= "getAirport.xhtml" /> <transition event= "done" target="B"/> </state> A2 done done B state id="B"> <start … /> </state>
Another example of multiple modalities SCXML + InkML + VoiceXML A B <state id="A1"> <start name= "getStuff.vxml" /> <transition event= "done" target="B"/> </state> A1 <state id="A2"> <start name= "getStuff.Inkml" /> <transition event= "done" target="B"/> </state> A2 done B state id="B"> <start … /> </state>
SCXML + InkML + VoiceXML A B <state id="A1"> <start name= "getStuff.vxml" /> <transition event= "done" target="B"/> </state> A1 <state id="A2"> <start name= "getStuff.Inkml" /> <transition event= "done" target="B"/> </state> A2 <interpretation mode = "speech"> <travel> <to hook="ink"/> <from hook="ink"/> <day> Tuesday </day> </travel> </interpretation> done B state id="B"> <start … /> </state>
SCXML + InkML + VoiceXML A B <state id="A1"> <start name= "getStuff.vxml" /> <transition event= "done" target="B"/> </state> A1 <state id="A2"> <start name= "getStuff.inkml" /> <transition event= "done" target="B"/> </state> A2 <interpretation mode = "ink"> <travel> <to>Las Vegas </to> <from>Portland </from> </travel> </interpretation> <interpretation mode = "speech"> <travel> <to hook="ink"/> <from hook="ink"/> <day> Tuesday </day> </travel> </interpretation> done B state id="B"> <start … /> </state>
<interpretation mode = "interp1"> <travel> <to> Las Vegas </to> <from> Portland </from> <day> Tuesday </day> </travel> </interpretation> SCXML + InkML + VXML A B <state id="A1"> <start name= "getStuff.vxml" /> <transition event= "done" target="B"/> </state> A1 <state id="A2"> <start name= “getStuff.inkml" /> <transition event= "done" target="B"/> </state> A2 <interpretation mode = "ink"> <travel> <to>Las Vegas </to> <from>Portland </from> </travel> </interpretation> <interpretation mode = "speech"> <travel> <to hook="ink"/> <from hook="ink"/> <day> Tuesday </day> </travel> </interpretation> done B state id="B"> <start … /> </state>
Agenda • SCXML controls the flow of an application • SCXML controls modalities • VoiceXML • XHTML • Others, e.g., InkML, SVG • SCXML controls Web services
SCXML Control More Than Just Modalities vxml <start … /> • SQL • Complex calculations • Web services <start … /> sql <start … /> complexCalculation xhtml <start …/>
References • State Chart XML (SCXML): State Machine Notation for Control Abstraction • http://www.w3.org/TR/scxml/ • Multimodal Architecture and Interfaces • http://www.w3.org/TR/mmi-arch/ • Commons SCXML (Open Source) • http://jakarta.apache.org/commons/scxml/
Summary • SCXML controls the flow of an application • SCXML controls modalities • XHTML • VoiceXML • Others, e.g., inkML, SVG • SCXML controls Web services