Title: Using VoiceXML, XHTML, and SCXML to Build Multimodal Applications
1Using VoiceXML, XHTML, and SCXML to Build
Multimodal Applications
James A. Larson
2Agenda
- SCXML controls the flow of an application
- SCXML controls modalities
- VoiceXML
- XHTML
- Others, e.g., InkML, SVG
- SCXML controls Web services
3State Chart XML
- Represents a state transition system
- States
- Transitions
A
B
4Possible Actions within a ltstategt
- Multimodal life cycle events
- ltstart /gt
- ltcancel /gt
- ltpause /gt
- ltresume /gt
- ltdata /gt
- Executable content
- ltassign/gt
- ltvargt
- ltscript/gt
- ltif/gt, ltelseif/gt, ltelse/gt
- ltlog/gt
A
ltif gt ltstart /gt ltelse/gt ltlog /gt lt/ifgt
5SCXML
- Sequentially perform the actions in two states
- ltstate id"A"gt
- ltprepare /gt
- lttransition event "done" target"B"/gt
- lt/stategt
- ltstate id"B"gt
- ltstart /gt
- lt/stategt
A
ltprepare /gt
done
ltstart /gt
B
6SCXML
- ltstate id"A"gt
- ltprepare /gt
- lttransition event "done"
- cond"result'OK?'"
target"B"/gt - lttransition event "done"
- cond"result'Opps'"
target"C"/gt - lt/stategt
A
ltprepare /gt
done OK
done Opps
B
C
7SCXML
- ltstate id"A"gt
- lttransition . target"B"/gt
- lt/stategt
- ltstate id"B"/gt
- ltparallelgt
- ltstate id"C"/gt
- ltstate id"D"/gt
- lt/parallelgt
- lt/stategt
A
B
C
D
8Agenda
- SCXML controls the flow of an application
- SCXML controls modalities
- VoiceXML
- XHTML
- Others, e.g., InkML, SVG
- SCXML controls Web services
9SCXML VoiceXML
ltstate id"A"gt ltstart name
"getAirport.vxml" /gt lttransition event
"done" target"B"/gt lt/stat
egt
A
lt?xml version"1.0"?gt ltvxml version"3.0"
xmlns "http//www.w3.org/2001/vxml"gt ltform id
"destination" gt ltfield name "Airport"gt
ltgrammar src "airport.grxml"/gt
ltpromptgtSay your destination airport lt/promptgt
ltgrammar src Airport.grxml
lt/fieldgt ltfilledgt ltsend event
"done" namelist "Airport" /gt lt/filledgt
lt/formgt lt/vxmlgt
getAirport.vxml
done
B
state id"B"gt ltstart /gt lt/stategt
10SCXML XHTML
ltstate id"A"gt ltstart name
"getAirport.xhtml" /gt lttransition event
"done" target"B"/gt lt/stat
egt
A
lthtml/gt ltheadgt ltevlistener
evevent"onchange"
evobserver"bodyId"
evhandler "sendDone()" /gt ltscriptgt function
sendDone lt/scriptgt lt/headgt lt!--xhtml code
--gt ltbody id"bodyId"/gtltpgtenter monthlt/pgt
ltinput type"text" id"month"/gt lt/bodygt lt/htmlgt
getAirport.xhtml
done
B
state id"B"gt ltstart /gt lt/stategt
11SCXML XHTML VoiceXML
A
B
ltstate id"A1"gt ltstart name
"getAirport.vxml" /gt lttransition event
"done" target"B"/gt lt/stat
egt
ltstate id"A2"gt ltstart name
"getAirport.xhtml" /gt lttransition event
"done" target"B"/gt lt/stat
egt
A1
A2
done
done
B
state id"B"gt ltstart /gt lt/stategt
12SCXML InkML VoiceXML
Another example of multiple modalities
A
B
ltstate id"A1"gt ltstart name
"getStuff.vxml" /gt lttransition event "done"
target"B"/gt lt/stategt
ltstate id"A2"gt ltstart name
"getStuff.Inkml" /gt lttransition event
"done" target"B"/gt lt/stat
egt
A1
A2
done
B
state id"B"gt ltstart /gt lt/stategt
13SCXML InkML VoiceXML
A
B
ltstate id"A1"gt ltstart name
"getStuff.vxml" /gt lttransition event "done"
target"B"/gt lt/stategt
ltstate id"A2"gt ltstart name
"getStuff.Inkml" /gt lttransition event
"done" target"B"/gt lt/stat
egt
A1
A2
ltinterpretation mode "speech"gt lttravelgt
ltto hook"ink"/gt ltfrom
hook"ink"/gt ltdaygt Tuesday lt/daygt
lt/travelgt lt/interpretationgt
done
B
state id"B"gt ltstart /gt lt/stategt
14SCXML InkML VoiceXML
A
B
ltstate id"A1"gt ltstart name
"getStuff.vxml" /gt lttransition event "done"
target"B"/gt lt/stategt
ltstate id"A2"gt ltstart name
"getStuff.inkml" /gt lttransition event
"done" target"B"/gt lt/stat
egt
A1
A2
ltinterpretation mode "ink"gt lttravelgt
lttogtLas Vegas lt/togt ltfromgtPortland
lt/fromgt lt/travelgt lt/interpretationgt
ltinterpretation mode "speech"gt lttravelgt
ltto hook"ink"/gt ltfrom
hook"ink"/gt ltdaygt Tuesday lt/daygt
lt/travelgt lt/interpretationgt
done
B
state id"B"gt ltstart /gt lt/stategt
15SCXML InkML VXML
ltinterpretation mode "interp1"gt lttravelgt
lttogt Las Vegas lt/togt ltfromgt
Portland lt/fromgt ltdaygt Tuesday lt/daygt
lt/travelgt lt/interpretationgt
A
B
ltstate id"A1"gt ltstart name
"getStuff.vxml" /gt lttransition event "done"
target"B"/gt lt/stategt
ltstate id"A2"gt ltstart name
getStuff.inkml" /gt lttransition event
"done" target"B"/gt lt/stat
egt
A1
A2
ltinterpretation mode "ink"gt lttravelgt
lttogtLas Vegas lt/togt ltfromgtPortland
lt/fromgt lt/travelgt lt/interpretationgt
ltinterpretation mode "speech"gt lttravelgt
ltto hook"ink"/gt ltfrom
hook"ink"/gt ltdaygt Tuesday lt/daygt
lt/travelgt lt/interpretationgt
done
B
state id"B"gt ltstart /gt lt/stategt
16Agenda
- SCXML controls the flow of an application
- SCXML controls modalities
- VoiceXML
- XHTML
- Others, e.g., InkML, SVG
- SCXML controls Web services
17SCXML Control More Than Just Modalities
vxml
ltstart /gt
- SQL
- Complex calculations
- Web services
ltstart /gt
sql
ltstart /gt
complexCalculation
xhtml
ltstart /gt
18References
- 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/
19Summary
- SCXML controls the flow of an application
- SCXML controls modalities
- XHTML
- VoiceXML
- Others, e.g., inkML, SVG
- SCXML controls Web services
20(No Transcript)