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

	<var name="list" class="java.util.ArrayList" />

	<start-state idref="displayItemlist" />

	<view-state id="displayItemlist" view="itemlist">
		<transition on="add" to="addItem" />
	</view-state>

	<subflow-state id="addItem" flow="item">
		<attribute-mapper>
			<output-mapper>
				<mapping source="item" target-collection="flowScope.list" />
			</output-mapper>
		</attribute-mapper>
		<transition on="finish" to="displayItemlist" />
	</subflow-state>

	<inline-flow id="item">
		<flow>
			<start-state idref="displayItem"/>
			
			<view-state id="displayItem" view="item">
				<transition on="submit" to="finish" />
			</view-state>

			<end-state id="finish">
				<output-mapper>
					<mapping source="requestParameters.data" target="item" />
				</output-mapper>
			</end-state>
		</flow>
	</inline-flow>

</flow>
