[jboss-user] [JBoss Seam] - Re: [DVD example] how to directly go back to the checkout pa

ellenzhao do-not-reply at jboss.com
Sun Nov 26 13:54:48 EST 2006


Just Got it with two pageflow definition files. :-)  (the names of the transition nodes and view ids are modified according to the requirement of my application. But the idea is not difficult to capture...

the boomBookingFlow.jpdl.xml:

  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <pageflow-definition name="roomBookingFlow">
  | 	<start-state name="start">
  | 		<transition to="preference" />
  | 	</start-state>
  | 
  | 	<page name="preference" view-id="/reservations/preferences.xhtml">
  | 		<redirect />
  | 		<transition name="pricing" to="checkAvailability">
  | 			<action expression="#{roomBooking.doPricing}" />
  | 		</transition>
  | 		<transition name="cancel" to="cancelPage" />
  | 	</page>
  | 
  | 	<decision name="checkAvailability"
  | 		expression="#{roomBooking.roomAvailable}">
  | 		<transition name="true" to="payment" />
  | 		<transition name="false" to="preference" />
  | 	</decision>
  | 
  | 	<page name="payment" view-id="/reservations/payment.xhtml"
  | 		no-conversation-view-id="/reservations/preferences.xhtml">
  | 		<redirect />
  | 		<transition name="next" to="checkLoggedIn" />
  | 		<transition name="back" to="preference" />
  | 		<transition name="cancel" to="cancelPage" />
  | 	</page>
  | 
  | 	<decision name="checkLoggedIn" expression="#{login.loggedIn}">
  | 		<transition name="true" to="checkPayment" />
  | 		<transition name="false" to="loginPage" />
  | 	</decision>
  | 
  | 	<page name="loginPage" view-id="/login.xhtml">
  | 		<transition name="login" to="checkLoggedIn">
  | 			<action expression="#{login.login}" />
  | 		</transition>
  | 		<transition name="newguest" to="registerConversation">
  | 			<action expression="#{register.startEdit}" />
  | 		</transition>
  | 		<transition name="continue" to="checkPayment" />
  | 		<transition name="back" to="payment" />
  | 		<transition name="cancel" to="cancelPage" />
  | 	</page>
  | 
  | 	<page name="registerConversation" view-id="/register/account.xhtml" />
  | 
  | 
  | 	<decision name="checkPayment"
  | 		expression="#{roomBooking.validPayment}">
  | 		<transition name="true" to="review" />
  | 		<transition name="false" to="payment" />
  | 	</decision>
  | 
  | 	<page name="review" view-id="/reservations/review-details.xhtml"
  | 		no-conversation-view-id="/reservations/preferences.xhtml">
  | 		<redirect />
  | 		<transition name="book" to="confirmation">
  | 			<action expression="#{roomBooking.bookRoom}" />
  | 		</transition>
  | 		<transition name="back" to="payment" />
  | 		<transition name="cancel" to="cancelPage" />
  | 	</page>
  | 
  | 	<page name="confirmation" view-id="/reservations/complete.xhtml"
  | 		no-conversation-view-id="/reservations/preferences.xhtml">
  | 		<redirect />
  | 		<end-conversation />
  | 	</page>
  | 
  | 	<page name="cancelPage" view-id="/home.xhtml"
  | 		no-conversation-view-id="/home.xhtml">
  | 		<redirect />
  | 		<end-conversation />
  | 	</page>
  | 
  | </pageflow-definition>
  | 

the register.jpdl.xml:

  | <pageflow-definition name="newguest">
  | 	<start-state name="start">
  | 		<transition to="account" />
  | 	</start-state>
  | 
  | 	<page name="account" view-id="/register/account.xhtml">
  | 		<redirect />
  | 		<transition name="next" to="checkPassword" />
  | 	</page>
  | 
  | 	<decision name="checkPassword"
  | 		expression="#{register.validNamePassword}">
  | 		<transition name="true" to="detail" />
  | 		<transition name="false" to="account" />
  | 	</decision>
  | 
  | 
  | 	<page name="detail" view-id="/register/detail.xhtml"
  | 		no-conversation-view-id="/register/account.xhtml">
  | 		<redirect />
  | 		<transition name="prev" to="account" />
  | 		<transition name="next" to="confirmation" />
  | 	</page>
  | 
  | 	<page name="confirmation" view-id="/register/confirmation.xhtml"
  | 		no-conversation-view-id="/register/account.xhtml">
  | 		<redirect />
  | 		<transition name="edit" to="detail" />
  | 		<transition name="confirm" to="complete">
  | 			<action expression="#{register.saveUser}" />
  | 		</transition>
  | 
  | 	</page>
  | 
  | 	<page name="complete" view-id="/register/complete.xhtml"
  | 		no-conversation-view-id="/register/account.xhtml">
  | 		<redirect />
  | 		<end-conversation />
  | 	</page>
  | 
  | </pageflow-definition>
  | 
  | 

the diagrams are here:

The room booking flow:

[img]http://www.ningning.org/gallery/main.php/d/28-2/roomBooking-pageflow.png[/img]

The register flow

[img]http://www.ningning.org/gallery/main.php/d/26-2/register-pageflow.png[/img]

Here the register conversation is a nested conversation of the room booking conversation. 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988659#3988659

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988659



More information about the jboss-user mailing list