| CCXML 1.0-W3C Development Guide | Home | Frameset Home |
<eventprocessor> element replaces the <eventhandler> that was used in previous incarnations of the CCXML specification. It is identical in all respects to the deprecated <eventhandler> element, in that it is used as a container for the <transition> elements that drive the CCXML execution. Of course, only a single instance of this element may exist within any CCXML document.
| statevariable | Data Type: (variable name) | Default: none - attribute is optional |
This attribute denotes the variable name which is the <eventhandler> state variable. be aware that this variable must be defined using the <var> or the <script> element in the ccxml scope. | ||
| <ccxml version="1.0">
<var name="initState" expr="'state_1'"/> <var name="MyCallID"/> <eventprocessor statevariable="initState"> <transition event="ccxml.loaded" state="state_1"> <log expr="'*** CCXML.LOADED, NOW EXITING ***'"/> <exit/> </transition> <transition event="error.*"> <log expr="'***** ERROR OCCURRED:' + event$.error"/> <exit/> </transition> </eventprocessor> </ccxml> |
| ANNOTATIONS: EXISTING POSTS |
kakeakeai
|
|
| what exactly is the statevariable useful for? | |
voxeoJeffK
|
|
| Hello,
The statevariable is the variable that a transition conditional checks in additional to the event. CCXML is an event driven state-machine. The state allows you to have different event handlers that are based on state. As an example lets say you have a script that starts a dialog, and when it is complete it starts another. For this you will want to have different actions occur upon a dialog.exit event. <eventprocessor statevariable="theState"> ... <transition event="connection.connected" state="state_1"> <log expr="'***** Starting first dialog *****'"/> <dialogstart src="'dialogOne.vxml'" type="'application/voicexml+xml'"/> <assign name="theState" expr="'firstDialog'"/> </transition> <transition event="dialog.exit" state="firstDialog"> <log expr="'***** First dialog done *****'"/> <dialogstart src="'dialogTwo.vxml'" type="'application/voicexml+xml'"/> <assign name="theState" expr="'secondDialog'"/> </transition> <transition event="dialog.exit" state="secondDialog"> <log expr="'***** Second dialog done. Exitting *****'"/> <exit/> </transition> The <transition> "state" attribute checks the value of the statevariable for a match. Both the event and the state must match for the transition to be selected. Regards, Jeff Kustermann Voxeo Support |
| login |