<?xml version="1.0"?>
<!-- @ Copyright 1998-2003 W3C (MIT, ERCIM, Keio), All Rights Reserved. See http://www.w3.org/Consortium/Legal/. @ -->
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml"
      xmlns:conf="http://www.w3.org/2002/vxml-conformance">

<!--
    For every type of form item except <initial>, that item will
    be selected by the FIA if it is the first eligible form item
    in document order and the previous loop of the FIA did not
    end in a goto nextitem
-->

  <catch>
    <conf:comment>
      Toplevel caught event <value expr="_event"/>
    </conf:comment>
    <conf:fail expr="_event"/>
  </catch>

  <var name="form_item_next" expr="1"/>

  <form id="first">

    <field name="f1">
      <conf:grammar utterance="alpha">
        <conf:key name="f1" value="1234"/>
      </conf:grammar>
      <conf:speech value="alpha"/>
      <filled>
        <if cond="form_item_next != 1">
          <conf:fail reason="field F one not executed in right order."/>
        </if>
        <assign name="form_item_next" expr="form_item_next + 1"/>
      </filled>
    </field>

    <record name="r">
      <conf:speech value="bravo"/>
      <filled>
        <if cond="form_item_next != 2">
          <conf:fail reason="record R not executed in right order."/>
        </if>
        <assign name="form_item_next" expr="form_item_next + 1"/>
      </filled>
    </record>

    <subdialog name="s" src="#prompt">
      <filled>
        <if cond="form_item_next != 3">
          <conf:fail reason="sub dialog S not executed in right order."/>
        </if>
        <assign name="form_item_next" expr="form_item_next + 1"/>
      </filled>
    </subdialog>

    <block name="b">
      <if cond="form_item_next != 4">
        <conf:fail reason="Block B not executed in right order."/>
      </if>
      <assign name="form_item_next" expr="form_item_next + 1"/>
    </block>

    <transfer name="t" dest="anunsupporteduri:+xxx-xxx-xxxxxxx">
      <!-- Assume platform doesn't handle <transfer> (or fails on our odd URI). -->
      <error>
        <conf:comment> Caught event <value expr="_event"/> in transfer element. </conf:comment>
        <assign name="t" expr="1234"/>
        <if cond="form_item_next != 5">
          <conf:fail reason="transfer T not executed in right order."/>
        </if>
        <assign name="form_item_next" expr="form_item_next + 1"/>
        <reprompt/>
      </error>
      <filled>
        <if cond="form_item_next != 5">
          <conf:fail reason="Transfer T not executed in right order."/>
        </if>
        <assign name="form_item_next" expr="form_item_next + 1"/>
      </filled>
    </transfer>


    <!-- Assume platform doesn't handle <object> (or our odd object). -->
    <object name="o" classid="awierduri://astupidobjectname">
      <error>
        <conf:comment> Caught event <value expr="_event"/> in object element. </conf:comment>
        <assign name="o" expr="1234"/>
        <conf:comment> Form item next is <value expr="form_item_next"/>. </conf:comment>
        <if cond="form_item_next != 6">
          <conf:fail reason="object O not executed in right order."/>
        </if>
        <conf:pass/>
      </error> 
    </object>

    <block>
      <conf:fail reason="Shouldn't get here."/>
    </block>
  </form>


  <form id="prompt">
    <var name="a" expr="'AAA'"/>
    <block>
      <return namelist="a"/>
    </block>
  </form>

</vxml>
