developer_guide:voicexml_references:elements:throw

< throw >

The <throw> element throws a pre-defined event or application-specific event.

<throw
event="event"
eventexpr="ECMAScript_Expression"
message="String"
messageexpr="ECMAScript_Expression"/>
eventThe event attribute defines the event name to throw. The attribute is required – specifically the event or eventexpr is required.
eventexprThe eventexpr is an expression that yields the event name. The attribute is required – specifically the event or eventexpr is required.
messageThe message attribute indicates a message string providing additional context about the event being thrown. For the pre-defined events thrown by the platform, the value of the message is platform dependent. The message will be available as a variable within the scope of the catch element. This attribute is optional.
messageexprThe expression attribute defines the expression that yields the message. This attribute is optional.
<block>, <catch>, <error>, <filled>, <help>, <if>, <noinput>, <nomatch>
None.
None.
None.
<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
 <catch event="goodbye">
  <prompt>goodbye.</prompt>
  <exit/>
 </catch>
 <form>
  <field name="hello">
   <grammar>hello | goodbye</grammar>
   <help>Just say hello</prompt>
   <prompt>Say hello</prompt>
   <noinput>Say something</noinput>
   <filled>
   <if cond="hello == 'goodbye'>
    <throw event="goodbye"/>
   </if>
   <prompt>Hello, world!</prompt>
   </filled>
  </field>
 </form>
</vxml>
  • developer_guide/voicexml_references/elements/throw.txt
  • Last modified: 2015/10/27 21:45
  • by borja