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

	<var name="myOrder" class="com.rwd.springFlow4B.cake.domain.Order" />

	<!-- Customer -->
	<subflow-state id="customer" subflow="cake1/customer">
		<input name="myOrder" value="myOrder" />
		<transition on="customerReady" to="order" />
	</subflow-state>

	<!-- Order -->
	<subflow-state id="order" subflow="cake1/order">
		<input name="myOrder" value="myOrder" />
		<transition on="orderCreated" to="payment" />
	</subflow-state>

	<!-- Payment -->
	<subflow-state id="payment" subflow="cake1/payment">
		<input name="myOrder" value="myOrder" />
		<transition on="paymentTaken" to="saveOrder" />
	</subflow-state>

	<action-state id="saveOrder">
		<evaluate expression="cakeFlowActions.saveOrder(myOrder)" />
		<transition to="thankYou" />
	</action-state>

	<view-state id="thankYou" view="flows/thankYou">
		<transition to="endState" />
	</view-state>

	<!-- End state -->
	<end-state id="endState" />

	<global-transitions>
		<transition on="cancel" to="endState" />
	</global-transitions>
</flow>
