[jboss-user] [JBoss Seam] - Problems Starting Page Flows

Delphi's Ghost do-not-reply at jboss.com
Tue Apr 17 12:08:39 EDT 2007


I've been looking into pageflows and come across a number of oddities which, maybe I'm misunderstand the where's and whens of pageflows, but maybe someone has some insights. 

I have test.xml that contains a bunch of test links with the different ways of starting page flows : 

Using propagation and pageflow inline on an s:link
Annotating the action method with @Begin(pageflow="TestFlow")
A plain action method that starts a page flow manually


Test.xhtml



  |   <s:link value="inline pageflow with xxx outcome" action="#{TestAction.stringFunc('xxx')}" propagation="begin" pageflow="TestFlow"/><br/>
  |   <s:link value="inline pageflow with 'page1' outcome" action="#{TestAction.stringFunc('page1')}" propagation="begin" pageflow="TestFlow"/><br/>
  |   <s:link value="inline pageflow with 'next' outcome" action="#{TestAction.stringFunc('next')}" propagation="begin" pageflow="TestFlow"/><br/>		   
  |   <s:link value="annotated pageflow with 'xxx' outcome" action="#{TestAction.annotatedStringFunc('xxx')}"/><br/>
  | 		   <s:link value="annotated pageflow with 'page1' outcome" action="#{TestAction.annotatedStringFunc('page1')}"/><br/>		   
  |   <s:link value="annotated pageflow with 'next' outcome" action="#{TestAction.annotatedStringFunc('next')}"/><br/>		  
  |   <s:link value="Manual PageFlow start in code" action="#{TestAction.manualStartFlow}"/><br/>
  | 
  | 

My bean actions are listed below :


  | 	public String manualStartFlow() {
  | 		log.info("Manual StartFlow called");
  | 		Pageflow.instance().begin("TestFlow");
  | 		return "ManualStartFlow";
  | 	}
  | 
  | 
  | 	public String stringFunc(String input) {
  | 		log.info("Called String Func with '#0'", input);
  | 		return input;
  | 	}
  | 
  | 	@Begin(pageflow="TestFlow")
  | 	public String annotatedStringFunc(String input) {
  | 		log.info("Called annotated String Func with '#0'", input);
  | 		return input;
  | 	}
  | 
  | 

I have added the page flow into the components.xml file and written the flow as follows :


  | <?xml version="1.0"?>
  | 
  | <pageflow-definition xmlns="http://jboss.com/products/seam/pageflow"
  | 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  | 	xsi:schemaLocation="http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-1.2.xsd"
  | 	name="TestFlow">
  | 
  | 
  | 	<start-page name="teststart" view-id="/testpage1.xhtml">
  | 		<transition name="next" to="test2" />
  | 		<transition name="ManualStartFlow" to="test2"/>
  | 		<transition name="page1" to="test1"/>		
  | 		<redirect/>
  | 	</start-page>
  | 	
  | 
  | 	<page name="test1" view-id="/testpage1.xhtml">
  | 		<transition name="next" to="test2" />
  | 	</page>
  | 
  | 	<page name="test2" view-id="/testpage2.xhtml">
  | 		<transition name="next" to="test3" />
  | 		<transition name="prev" to="test1" />
  | 	</page>
  | 
  | 	<page name="test3" view-id="/testpage3.xhtml"
  | 		no-conversation-view-id="/meetinglist.xhtml">
  | 		<transition name="prev" to="test2" />		
  | 	</page>
  | 
  | </pageflow-definition>
  | 

Obviosuly, this is testing code which is why page 1 appears in the start-page and test1 page.

The problem is that one of the following happens : 

The conversation, and page flow starts but there is no navigation to page 1. This usually happens when the outcome is 'xxx' from the string function.
If I return "next" or "ManualStartFlow" as the outcome, I end up on page 2 of the flow
If I return "page1" from the outcome I end up on page 1, probably because of the transition from start-page to page 'page1'.

Once I am in the pages (testpage1,2 or 3) everything works fine, I just have problems starting the flow.

In cases where I stay on the same page (test.xhtml) and I end up in a conversation and try to start a new one I obviously get the Seam Debug Page because of starting a conversation from an existing one (which is fine). On the debug page, I can see the list of conversations, and despite not navigating there, they all say testpage1.xhtml in the view id. This indicates to me that the conversation and flow is starting, it's just not navigating in cases where I return 'xxx' from the outcome of the methods.

I would have thought that if you click a link, button, or call a method that starts a pageflow, then you would automatically end up on the view-id referenced by the start-page definition (in this case testpage1). Currently it looks like I need to return an outcome that will determine where you go automatically from the page-start view id, and not returning an expected outcome results in staying on the same page.

Is that the case?

DG

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

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



More information about the jboss-user mailing list