VoiceXML 2.1 Development GuideHome  |  Frameset Home


<return>  element

The return element is used to terminate a subdialog and return control to the main dialog. This element will throw a fatal error.semantic if encountered outside the context of a subdialog call. Exactly one namelistevent, or eventexpr must be specified, else a fatal error.badfetch will be thrown in the logger.


usage
<return event="NMTOKEN" eventexpr="CDATA" message="CDATA" messageexpr="CDATA" namelist="NMTOKEN">


attributes
eventData Type: NMTOKENDefault: Optional
The event attribute specifies the event to be thrown immediately after returning to the invoking application. Either an event or a namelist may be used in the return element, but not both.
eventexprData Type: CDATADefault: Optional
The eventexpr attribute specifies an ECMAScript expression that evaluates to the event being thrown to the application. As mentioned, either platform defined events, or user-defined events may be indicated in this attribute. Please note that either event or eventexpr may be used within the parent element, but not both.
messageData Type: CDATADefault: Optional
The message attribute allows the developer to include a descriptive message along with the event that is being thrown. The message being thrown is accessible in the catch elements shadow variable _message.
messageexprData Type: CDATADefault: Optional
The messageexpr attribute allows the developer to include an ECMAScript expression resolving to the message being thrown to the application. The messageexpr being thrown is accessible in the catch elements shadow variable _message.
namelistData Type: NMTOKENDefault: Optional
The namelist attribute specifies a space-separated list of variables to send to the subdialog back to the invoking application. Either a namelist or an event may be specified for the return element, but not both.



shadow variables
none


parents
<block> <catch> <error> <filled> <help> <if> <noinput> <nomatch>


children
none


code samples
<Return namelist> sample
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>

<form id="F1">
  <subdialog name="SubD_1" src="MySubD.vxml">
    <param name="confirm_prompt"
        expr="'is there a chance in hell that nick cage will ever
              be taken seriously as a dramatic actor? '"/>
 
    <filled>
      <prompt> yeah, you are probably right. </prompt>
    </filled>

  </subdialog>

</form>
</vxml>

<MySubD.vxml>
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>

<form id="F1">

  <var name="confirm_prompt"/>
  <var name="response"/>

  <field name="field_confirm" type="boolean">
    <prompt>
      <value expr="confirm_prompt"/>
    </prompt>

    <filled>
      <if cond="field_confirm == true">
        <assign name="response" expr="'yes'"/>
      <else/>
        <assign name="response" expr="'no'"/>
      </if>
        <return namelist="response"/>
    </filled>

  </field>
</form>

</vxml>

<Return event> sample
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>

  <catch event="MyEvent">
    <prompt> Of course. Just look at Vanilla Ice, little buddy. </prompt>
  </catch>



<form id="F1">
  <subdialog name="SubD_1" src="MySubD_2.vxml">
    <param name="confirm_prompt"
      expr="'admit it.  suburban white kids trying to be gangster rappers
                have no credibility whatsoever, yes?'"/>
 
    <filled>
      <prompt> I thought so. </prompt>
    </filled>

  </subdialog>

</form>
</vxml>

<MySubD_2.vxml>
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">

<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>

<form id="F1">

  <var name="confirm_prompt"/>
  <var name="response"/>

  <field name="field_confirm" type="boolean">
    <prompt>
      <value expr="confirm_prompt"/>
    </prompt>

    <filled>
      <if cond="field_confirm == true">
        <assign name="response" expr="'yes'"/>
      <else/>
        <assign name="response" expr="'no'"/>
      </if>
        <return event="MyEvent"/>
    </filled>

  </field>

</form>

</vxml>



additional links
W3C 2.0 Specification


  ANNOTATIONS: EXISTING POSTS
safarishane
3/16/2006 11:34 AM (EST)
In the valid children section of <return> is it implied that because <catch> can be a parent, that <nomatch> and <noinput> are automatically included as catch handlers?

Thanks,
Shane
steve.sax
3/16/2006 11:59 AM (EST)


Hello Shane,

You are correct in this understanding; I'll see that our documentation folks correct this oversight.

Steve Sax
sudhareddy
10/24/2008 12:57 AM (EDT)
Hi I am new to vxml.
          how we can store the response of the user.
for ex:
computer: say ur name:
user:    "abc"
  computer :say ur phone no:
  user:    999999999

          my requirement is i want to store these two user inputs and i want use these variables further...how we can achive this....can any one help me.....
voxeoJeffK
10/24/2008 1:46 AM (EDT)
Hi sudhareddy,

I wonder if I could get some clarification. I noticed in your account you've tried out some of the tutorials, so you may be familiar with how input elements such as <field> have their variable filled. Is your question along those lines? Or since you've posted your question in the section under the <return> element does your question concern transferring variables from a subdialog?

standing by,
Jeff Kustermann
Voxeo Support

login



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