<?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">

  <start-state idref="form"/>

  <view-state id="form" view="widget.UpdateForm">
    <entry-actions>
      <action bean="widget.updateAction" method="setupForm"/>
    </entry-actions>
    <transition on="submit" to="bindAndValidate"/>
  </view-state>

  <action-state id="bindAndValidate">
    <action bean="widget.updateAction" method="bindAndValidate"/>
    <transition on="success" to="update"/>
    <transition on-exception="java.lang.IllegalArgumentException" to="form"/>
  </action-state>

  <action-state id="update">
    <action bean="widget.updateAction" method="update"/>
    <transition on="success" to="finish"/>
  </action-state>

  <end-state id="finish" view="externalRedirect:/widget/update.html"/>

</flow>
