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

	<!-- Order -->
	<view-state id="showOrder" view="flows/cake1/order/showOrder">
		<transition on="createCake" to="createCake" />
		<transition on="checkout" to="orderCreated" />
		<transition on="cancel" to="cancel" />
	</view-state>

	<view-state id="createCake" view="flows/cake1/order/createCake" model="flowScope.cake">
		<on-entry>
			<set name="flowScope.cake" value="new com.rwd.springFlow4B.cake.domain.cake.Cake()" />
			<evaluate result="viewScope.toppingsList" expression="T(com.rwd.springFlow4B.cake.domain.cake.Topping).asList()" />
		</on-entry>
		<transition on="addCake" to="showOrder">
			<evaluate expression="myOrder.addCake(flowScope.cake)" />
		</transition>
		<transition on="cancel" to="showOrder" />
	</view-state>


	<!-- End state -->
	<end-state id="cancel" />
	<end-state id="orderCreated" />
</flow>
