| CCXML 1.0-W3C 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.connected">
<log expr="'The connectionid is: [' + event$.connectionid + ']'"/>
<assign name="call_0" expr="event$.connectionid"/>
</transition>
<transition>.
<transition event="connection.disconnected">
<log expr="'The connectionid is: [' + event$.connectionid + ']'"/>
<if cond="event$.connectionid == call_0">
<!-- do this -->
<elseif cond="event$.connectionid == 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.*">
<log expr="'an error has occurred (' + event$.reason + ')'"/>
<exit/>
</transition>
<var name="unexpectedErrorCount" expr="0"/>
<transition event="error.*">
<log expr="'an error has occurred (' + event$.reason + ')'"/>
<if cond="unexpectedErrorCount == '0'">
<assign name="unexpectedErrorCount" expr="Number(unexpectedErrorCount) + 1"/>
<!-- RUN MY NORMAL CLEANUP CODE -->
<else/>
<assign name="unexpectedErrorType" expr="event$.reason"/>
<send data="'http.get'" target="'myCoolErrorLog.asp'" namelist="unexpectedErrorType"/>
<!-- WE COULD ALWAYS TRANSITION THE EVENTS RELATED -->
<!-- TO THIS SEND AND EXIT WHEN CONFIRMED SUCCESS/FAILURE -->
</if>
</transition>
<transition state="init" event="ccxml.loaded">
<!-- THIS WILL KILL THE APP IN 15 MIN -->
<send data="'user.DIE_ZOMBIE_DIE'" target="session.id" delay="'90s'"/>
</transition>
<transition event="user.DIE_ZOMBIE_DIE">
</exit>
</transition>
| ANNOTATIONS: EXISTING POSTS |
| login |
|