CCXML 1.0-W3C Development Guide Home  |  Frameset Home


<assign>  element


The <assign> element updates a local variable, (originally instantiated using the <var> element), with a new ECMAScript value.



usage

<assign expr="(ECMAScript Expression)" name="(variable name)">


attributes

expr Data Type: (ECMAScript Expression) Default: none - attribute is required
The expr attribute specifies the value to assign to the variable in question. This may be any valid ECMAScript value.
name Data Type: (variable name) Default: none - attribute is required
is the name of the variable to assign a value / expression to.



parents

none


children

none


code samples

<1.0 assign-name-expr> sample
<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0">

<!-- VARIABLES NEED TO BE DECLARED BEFORE THEY CAN BE -->
<!-- GIVEN A NEW VALUE VIA THE <assign> ELEMENT -->


  <var name="myVar" expr="'Bruce Campbell'"/>

  <eventprocessor>


    <transition event="connection.alerting" name="event$">
      <log expr="'*** MYVAR = ' + myVar"/>
      <assign name="myVar" expr="'Bubba Ho Tep'"/>
      <accept/>
    </transition>

    <transition event="connection.connected">
      <log expr="'***** CALL WAS ANSWERED *****'"/>
      <log expr="'*** MYVAR NEW VALUE= ' + myVar"/> 
    </transition>


    <transition event="connection.disconnected">
      <log expr="'***** CALL EXITING *****'"/>
      <exit/>
    </transition>

  </eventprocessor>
</ccxml>



additional links

W3C Specification


  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login



© 2012 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site