33 lines
1.2 KiB
XML
Executable File
33 lines
1.2 KiB
XML
Executable File
<?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">
|
|
|
|
<persistence-context/>
|
|
|
|
<input name="#{id}" value="#{flowScope.id}"/>
|
|
|
|
<start-actions>
|
|
<evaluate expression="#{bookingService.findHotelById(id)}" result="#{flowScope.hotel}" />
|
|
<evaluate expression="#{hotel.createBooking(currentUser)}" result="#{flowScope.booking}" />
|
|
<evaluate expression="#{entityManager.persist(booking)}" />
|
|
</start-actions>
|
|
|
|
<view-state id="enterBookingDetails">
|
|
<transition on="proceed" to="reviewBooking">
|
|
<evaluate expression="booking.validate(messageContext)" />
|
|
</transition>
|
|
<transition on="cancel" to="bookingCancelled" />
|
|
</view-state>
|
|
|
|
<view-state id="reviewBooking">
|
|
<transition on="confirm" to="bookingConfirmed" />
|
|
<transition on="revise" to="enterBookingDetails" />
|
|
<transition on="cancel" to="bookingCancelled" />
|
|
</view-state>
|
|
|
|
<end-state id="bookingConfirmed" commit="true" />
|
|
|
|
<end-state id="bookingCancelled" />
|
|
|
|
</flow> |