<?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-2.0.xsd">

    <input name="myOrder" required="true"/>
    
    <view-state id="takePayment" view="flows/cake1/payment/takePayment" model="flowScope.paymentForm">
        <on-entry>
          <set name="flowScope.paymentForm" 
              value="new com.rwd.springFlow4B.cake.domain.payment.PaymentForm()" />
        </on-entry>
        <transition on="paymentSubmitted" to="verifyPayment" />
        <transition on="cancel" to="cancel" />
    </view-state>

    <action-state id="verifyPayment">
        <evaluate result="myOrder.payment" expression=
            "cakeFlowActions.verifyPayment(flowScope.paymentForm)" />
        <transition to="paymentTaken" />
    </action-state>
            
    <!-- End state -->
    <end-state id="cancel" />
    <end-state id="paymentTaken" />
</flow>
