Permalink
Switch branches/tags
Nothing to show
Find file
937fff6 Feb 26, 2013
U-krishna-PC\krishna added webflow test case
executable file 78 lines (56 sloc) 2.65 KB
<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">
<secured attributes="permitAll"/>
<persistence-context/>
<on-start>
<evaluate expression="orderController.initializeForm()" result="flowScope.orderForm"/>
</on-start>
<view-state id="selectCategory" view="selectCategory" model="orderForm">
<on-render>
<evaluate expression="orderController.initializeSelectableCategories()" result="requestScope.selectableCategories"/>
</on-render>
<transition on="next" to="selectBooks"/>
<transition on="cancel" to="end" />
</view-state>
<view-state id="selectBooks" view="selectBooks" model="orderForm" >
<on-render>
<evaluate expression="orderController.initializeSelectableBooks(orderForm)" result="requestScope.selectableBooks" />
</on-render>
<transition on="add" >
<evaluate expression="orderController.addBook(flowScope.orderForm)" />
<render fragments="selectedBooks"/>
</transition>
<transition on="next" to="selectDeliveryOptions" />
<transition on="reset" to="selectBooks">
<evaluate expression="orderForm.resetSelectedBooks()" />
</transition>
<transition on="previous" to="selectCategory" />
<transition on="cancel" to="end" />
</view-state>
<view-state id="selectDeliveryOptions" view="selectDeliveryOptions" model="orderForm">
<transition on="previous" to="selectBooks" />
<transition on="finish" to="placeOrder">
<evaluate expression="orderController.validateDeliveryDate(flowScope.orderForm, messageContext)"/>
</transition>
<transition on="cancel" to="end" />
</view-state>
<!-- Refactored: no longer needed, the placeOrders-flow uses Web Flow security. When the user is not authenticated
we will be redirected to the login page via Spring Security.
<decision-state id="loginCheck">
<if test="externalContext.sessionMap.contains('authenticatedAccount') == true" then="placeOrder" else="authenticate"/>
</decision-state>
<subflow-state id="authenticate" subflow="authentication">
<transition on="authenticationOk" to="createOrder"/>
<transition on="previous" to="selectDeliveryOptions"/>
</subflow-state>
-->
<subflow-state id="placeOrder" subflow="secured/placeOrders">
<input name="orderForm"/>
<output name="orderId"/>
<transition on="endOrderOk" to="endOrderOk"/>
</subflow-state>
<end-state id="endOrderOk" view="redirect:/secured/ordersOverview?orderOk=true&amp;orderId={orderId}"/>
<end-state id="end" view="redirect:/public/main.htm"/>
</flow>