This commit is contained in:
Keith Donald
2008-02-27 17:28:17 +00:00
parent c1ca5923d3
commit bf2cf1e5c9

View File

@@ -5,28 +5,18 @@
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
<attribute name="description" value="The flow that handles the process of booking a hotel for a user" />
<!--
Indicates this flow requires a persistence context
One will be created automatically when this flow starts; all data access will use it automatically
-->
<attribute name="persistenceContext" value="true" />
<input-mapper>
<mapping source="#{id}" target="#{flowScope.id}" />
</input-mapper>
<start-state idref="loadHotel"/>
<start-state idref="enterBookingDetails"/>
<action-state id="loadHotel">
<evaluate-action expression="#{bookingService.findHotelById(id)}" result="#{flowScope.hotel}" />
<transition on="success" to="createBooking"/>
</action-state>
<action-state id="createBooking">
<start-actions>
<evaluate-action expression="#{bookingService.findHotelById(id)}" result="#{flowScope.hotel}" />
<evaluate-action expression="#{flowHelper.createBooking(hotel, user, entityManager)}" result="#{flowScope.booking}" />
<transition on="success" to="enterBookingDetails" />
</action-state>
</start-actions>
<view-state id="enterBookingDetails" view="bookingForm.xhtml">
<transition on="proceed" to="confirmBooking">
@@ -41,13 +31,9 @@
<transition on="cancel" to="cancel" />
</view-state>
<end-state id="cancel">
<!-- Indicates any changes to managed persistent entities should NOT be committed to the database -->
<attribute name="commit" value="false" type="boolean" />
</end-state>
<end-state id="cancel" />
<end-state id="bookingAuthorized">
<!-- Indicates changes to managed persistent entities should be committed to the database at this point -->
<attribute name="commit" value="true" type="boolean" />
</end-state>