<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/webflow
    http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd">

  <input-mapper>
    <input-attribute name="mail"/>
    <input-attribute name="unmodifiableTo"/>
    <input-attribute name="pageTitleCode"/>
    <input-attribute name="pageDescriptionCode"/>
    <input-attribute name="formSubmitCode"/>
    <input-attribute name="ignoreEmailFailure"/>
  </input-mapper>

  <start-state idref="form"/>

  <view-state id="form" view="mail.CreateForm">
    <render-actions>
      <action bean="mail.createAction" method="setupForm"/>
    </render-actions>
    <transition on="submit" to="send">
      <action bean="mail.createAction" method="bindAndValidate"/>
    </transition>
  </view-state>

  <action-state id="send">
    <action bean="mail.createAction" method="send"/>
    <transition on="success" to="finish"/>
    <transition on-exception="org.unitedfront2.web.controller.mail.UserNotFoundException" to="form"/>
  </action-state>

  <end-state id="finish"/>

</flow>
