| CCXML Voxeo 1.0 Development Guide | Home | Frameset Home |
|
<catch> element:
<catch event="EVENT">
<!-- do something here -->
</catch>
<transition>:
<transition event="EVENT">
<!-- do something here -->
</transition>
<transition>'s we can assign a "reference name" to this ECMAScript object allowing us to access the contained fields as such:
<transition event="connection.CONNECTION_CONNECTED" name="evt">
<log expr="'The callid is: [' + evt.callid + ']'"/>
<var name="call_0" expr="evt.callid"/>
</transition>
<transition>.
<transition event="connection.CONNECTION_DISCONNECTED" name="evt">
<log expr="'The callid is: [' + evt.callid + ']'"/>
<if cond="evt.callid == call_0">
<!-- do this -->
<elseif cond="evt.callid == call_1"/>
<!-- do that -->
<else/>
<!-- twiddle your thumbs -->
</if>
</transition>
<exit> event, allowing you to catch any unexpected error events that have not be explicitly <transition>'ed. Example:
<transition event="error.*" name="evt">
<log expr="'an error has occurred (' + evt.error + ')'"/>
<exit/>
</transition>
<var name="unexpectedErrorCount" expr="0"/>
<transition event="error.*" name="evt">
<log expr="'an error has occurred (' + evt.error + ')'"/>
<if cond="unexpectedErrorCount == '0'">
<assign name="unexpectedErrorCount" expr="Number(unexpectedErrorCount) + 1"/>
<!-- RUN MY NORMAL CLEANUP CODE -->
<else/>
<assign name="unexpectedErrorType" expr="evt.error"/>
<send event="'http.get'" target="'myCoolErrorLog.asp'" namelist="unexpectedErrorType"/>
<!-- WE COULD ALWAYS TRANSITION THE EVENTS RELATED -->
<!-- TO THIS SEND AND EXIT WHEN CONFIRMED SUCCESS/FAILURE -->
<exit/>
</if>
</transition>
<transition state="'init'" event="ccxml.loaded" name="evt">
<!-- THIS WILL KILL THE APP IN 15 MIN -->
<send event="'DIE_ZOMBIE_DIE'" target="session.id" delay="'900000'"/>
</transition>
<transition event="user.DIE_ZOMBIE_DIE">
<exit/>
</transition>
| ANNOTATIONS: EXISTING POSTS |
jeross1
|
|
| It took me a minute before I realized why I was getting an error asking for the </transition> tag on this code snippet. The </exit> tag needs to be <exit/>.
<transition event="user.DIE_ZOMBIE_DIE"> </exit> </transition> -Judy |
|
voxeojeff
|
|
| Hi jeross1,
Nice catch! We will make sure this is fixed asap. :-) Best, Jeff Menkel Voxeo Corporation |
| login |
|