CCXML 1.0-W3C Development GuideHome  |  Frameset Home


<createccxml>  element

The <createccxml> element is used to spawn another thread of control, which begins execution with the document identified by this element. This thread of control provides independent execution and an entirely separate variable space for the CCXML documents that it executes. Such independent threads are associated with one or more event endpoints; such endpoints are the only things capable of sending events to these independent threads of execution.Note that the new thread of execution has an entirely separate address space and lifetime.


usage
<createccxml enctype="(ECMAScript Expression)" maxage="(ECMAScript Expression)" maxstale="(ECMAScript Expression)" method="(GET|POST)" namelist="STRING" next="(ECMAScript Expression)" sessionid="(ECMAScript Expression)" timeout="(ECMAScript Expression)">


attributes
enctypeData Type: (ECMAScript Expression)Default: application/x-www-form-urlencoded
enctype specifies an ECMAScript string expression that denotes the media encoding type of the submitted document, (when the POST method is used). The only allowable value of this attribute is 'application/x-www-form-urlencoded', which specifies that the indicates that the variables in the namelist attribute must be url-encoded.
maxageData Type: (ECMAScript Expression)Default: Optional
The maxage and maxstale attributes specify the maximum acceptable staleness, in seconds, of the resource in question. However, it is strongly advised not to rely on this attribute for cache-control; caching is always best controlled by the hosting server's response headers. If no headers are specified, then no cache control will be present, regardless of the value set for the maxage and maxstale attributes.
maxstaleData Type: (ECMAScript Expression)Default: Optional
The maxage and maxstale attributes specify the maximum acceptable staleness, in seconds, of the resource in question. However, it is strongly advised not to rely on this attribute for cache-control; caching is always best controlled by the hosting server's response headers. If no headers are specified, then no cache control will be present, regardless of the value set for the maxage and maxstale attributes.
methodData Type: (GET|POST)Default: Optional (GET)
The method attribute specifies the HTTP method to use when sending the request. If unspecified, then the value of ‘GET’, (default) is assumed, unless the submission of multipart/form-data is encountered, in which case the implied method will be ‘POST’.
namelistData Type: STRINGDefault: none - attribute is optional
The namelist attribute denotes the space-separated list of variable names to be sent along with the fetch. The variables will then be available as a variable/value pair in the resultant URI querystring that is sent to the server.
nextData Type: (ECMAScript Expression)Default: none - attribute is required
This attribute simply indicates the URI of the XML document to be fetched.
sessionidData Type: (ECMAScript Expression)Default: none - attribute is optional
The sessionid attribute is an expression resolving to a platform-defined unique identifier that denotes the newly-instantiated thread of control.
timeoutData Type: (ECMAScript Expression)Default: Optional
The timeout attribute specifies the amount of time to allow the fetch attempt to be made, specified by the next attribute value. If the new CCXML session is unable to fetch the initial document within the timeout interval denoted, then an error.fetch event will be thrown.




parents
none


children
none


code samples
<1.0 createccxml -next> sample
<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml">

<eventprocessor>
  <transition event="ccxml.loaded">
  <log expr="'***** CCXML.LOADED *****'"/>
  <createccxml next="'CCXML_child.xml'"/>
  </transition>

  <transition event="error.createccxml">
  <log expr="'***** ERROR.CREATECCXML *****'"/>
  </transition>

  <transition event="ccxml.created">
  <log expr="'***** CHILD SESSION STARTED: ' + event$.sessionid"/>
  <log expr="'***** CCXML.CREATED *****'"/>
  <exit/>
  </transition>

  <transition event="ccxml.exit">
  <log expr="'***** CHILD SESSION HAS EXITED *****'"/>
  <exit/>
  </transition>
</eventprocessor>
</ccxml>

<CCXML_child.xml>
<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml">

    <eventprocessor>
        <transition event="ccxml.loaded">
            <log expr="'*** CCXML.LOADED:CHILD SESSION ***'"/>
        </transition>

        <transition event="ccxml.kill">
            <log expr="'*** CCXML.KILL:CHILD SESSION ***'"/>
        </transition>

        <transition event="connection.failed">
          <log expr="'*** CONNECTION.FAILED:CHILD SESSION ***'"/>
            <exit/>
        </transition>

        <transition event="connection.disconnected">
            <log expr="'*** CONNECTION.DISCONNECTED:CHILD SESSION ***'"/>
            <exit/>
        </transition>

        <transition event="connection.connected">
        <log expr="'*** CONNECTION.CONNECTED:CHILD SESSION ***'"/>
        </transition>

        <transition event="connection.alerting">
            <accept/>
        <log expr="'*** CONNECTION.ALERTING:CHILD SESSION ***'"/>
        </transition>
    </eventprocessor>
</ccxml>



additional links
W3C Specification


  ANNOTATIONS: EXISTING POSTS
chaubkit
2/19/2008 10:01 PM (EST)
Could you please help: when the caller calls to the platform, which does the connectionid belong to? parent or child session? what is the workflow?
voxeojeff
2/20/2008 11:31 AM (EST)
Hello,

Per the W3C specification, the connectionid will stay with the parent session:

"The new CCXML session has no relation to its creator once spawned, and has a wholly separate lifetime and address space.  Execution returns from the <createccxml> element immediately, and the CCXML interpreter can continue on while the new CCXML session is established and loads its initial document. If the new session is successfully established or a failure occurs an event is generated and is delivered to the session that executed the <createccxml> element."

Hope this helps clarify,

Jeff
chaubkit
2/21/2008 3:49 AM (EST)
Hi jeff,
Thanks for your soon response, but I wonder that in the code samples above, how can the CCXML_child.xml excute while the connection belongs to the parent session. Do we need to send an event from parent session to child session to kick the child session excute?
Thanks a lot.
Chau - dhchau@tma.com.vn
voxeojeff
2/21/2008 5:09 PM (EST)
Hello Chau,

The connection should not go to the child session, per the specification.  It looks like you might be wanting to use something such as <fetch> or <goto>, or possibly even <move>.  The <move> element will move the connection to the new child session, but this element only works in Prophecy 8.  Can you clarify the intended behavior you are looking for here?

Standing by,

Jeff
chaubkit
2/29/2008 6:22 AM (EST)
Hi Jeff,

I have some confusion about the method "post" of createccxml tag. I do not know how to use it although I tried to skim through its definition.

Could you please give me an example of the method "post" for createccxml tag? And please let me know which attributes of createccxml tag are needed when using the method "post".

Thanks,
Chau
mikethompson
2/29/2008 5:08 PM (EST)
Chau,

Using the POST method is simply a way to pass variables to the new script *without* using a querystring.  The HTML specifications technically define the difference between "GET" and "POST" so that the former means form data is to be encoded (by a browser) into a URL, while the latter means the form data is to appear within a message body.

Whether you fetch the document via POST or GET, your content should be the same.  It is just a difference in the way the data is passed if you're using namelist.  If you submit some variables in your namelist via POST, then the server-side script on the receiving end needs to be expecting POST so it can properly pull the variables from the message body.  If the script is expecting GET, then it will not be able to find the variables, as it will be checking the querystring.

I hope this helps clarify, and please let me know if you require further explanation.

Best,
Mike Thompson
Voxeo Corporation

login



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