Pageflow Configuration?
connerjohn Aug 2, 2006 4:30 PMI'm trying to follow the Number Guess example but can't seem to make pageflows work in an example applications. I took a shell from an application that I created earlier that works and added the pageflow configuration items. Any thoughts on what I'm missing.
components.xml
<component class="org.jboss.seam.core.Jbpm"> <property name="pageflowDefinitions">pageflow.jpdl.xml</property> </component>
facelets
page1.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:s="http://jboss.com/products/seam/taglib" template="/template.xhtml"> <ui:define name="title">Page 1</ui:define> <ui:define name="caption">Page 1</ui:define> <ui:define name="content"> <h:form> This is page 1<br /> <h:commandButton type="submit" value="Goto Page 2" action="test2"/> <h:commandButton type="submit" value="Goto Page 3" action="test3"/> </h:form> </ui:define> </ui:composition>
page2.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:s="http://jboss.com/products/seam/taglib" template="/template.xhtml"> <ui:define name="title">Page 2</ui:define> <ui:define name="caption">Page 2</ui:define> <ui:define name="content"> <h:form> This is page 2<br /> <h:commandButton type="submit" value="Goto Page 4" action="done"/> </h:form> </ui:define> </ui:composition>
action
import javax.ejb.Stateful; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.Begin; import org.jboss.seam.annotations.Create; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Scope; import com.itsolut.core.utils.AppUtils; @Stateful @Name("processFlowNameAction") @Scope(ScopeType.CONVERSATION) public class Cart implements ICart { public Cart(){ LOG.fatal("========================="); LOG.fatal("=== Cart =========="); LOG.fatal("=== conversation id["+org.jboss.seam.core.Manager.instance().getCurrentConversationId()+"] ="); LOG.fatal("========================="); } @Create @Begin(pageflow="testflow") public void start(){ LOG.fatal("========================="); LOG.fatal("=== start =========="); LOG.fatal("=== conversation id["+org.jboss.seam.core.Manager.instance().getCurrentConversationId()+"] ="); LOG.fatal("========================="); } public void selectAddr(){ LOG.fatal("========================="); LOG.fatal("=== selectAddr =========="); LOG.fatal("=== conversation id["+org.jboss.seam.core.Manager.instance().getCurrentConversationId()+"] ="); AppUtils.LOG.fatal("========================="); } public void newAddr(){ LOG.fatal("========================="); LOG.fatal("=== newAddr =========="); LOG.fatal("=== conversation id["+org.jboss.seam.core.Manager.instance().getCurrentConversationId()+"] ="); LOG.fatal("========================="); } public void page2Action(){ LOG.fatal("========================="); LOG.fatal("=== page2Action ========="); LOG.fatal("=== conversation id["+org.jboss.seam.core.Manager.instance().getCurrentConversationId()+"] ="); LOG.fatal("========================="); } public void page3Action(){ LOG.fatal("========================="); LOG.fatal("=== page3Action ========="); LOG.fatal("=== conversation id["+org.jboss.seam.core.Manager.instance().getCurrentConversationId()+"] ="); LOG.fatal("========================="); } }
pageflow
<pageflow-definition name="testflow"> <start-page name="displayPageOne" view-id="/page1.xhtml"> <redirect/> <transition name="test2" to="selectedAddr"> <action expression="#{processFlowNameAction.selectAddr}" /> </transition> <transition name="test3" to="newAddr"> <action expression="#{processFlowNameAction.newAddr}" /> </transition> </start-page> <page name="selectedAddr" view-id="/page2.xhtml"> <transition name="done1" to="doneP"> <action expression="#{processFlowNameAction.page2Action}" /> </transition> </page> <page name="newAddr" view-id="/page3.xhtml"> <transition name="done2" to="doneP"> <action expression="#{processFlowNameAction.page3Action}" /> </transition> </page> <page name="doneP" view-id="/page4.xhtml"> <redirect/> <end-conversation /> </page> </pageflow-definition>
When I navigate to http://localhost:9090/example-app/page1.seam the page1.xhtml is displayed; but I'm not in a page flow and the buttons will not work.
Here is what is in the log
2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.contexts.Lifecycle] >>> Begin web request 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.manager 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.manager 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.core.Manager] No stored conversation 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.pageflow 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.pageflow 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] After restoring conversation context: ConversationContext(5) 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] committing transaction after phase: INVOKE_APPLICATION(5) 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] beginning transaction prior to phase: RENDER_RESPONSE(6) 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.Component] instantiating Seam component: facesMessages 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.Component] initializing new instance of: facesMessages 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: conversation 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.Component] instantiating Seam component: businessProcess 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.Component] initializing new instance of: businessProcess 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.Component] instantiating Seam component: conversation 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.Component] initializing new instance of: conversation 2006-08-02 16:13:54,406 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to Seam component 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.core.Manager] Discarding conversation state: 5 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing page context 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] committing transaction after phase: RENDER_RESPONSE(6) 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Contexts] destroying: class org.apache.myfaces.shared_tomahawk.renderkit.html.util.JavascriptUtils.OLD_VIEW_ID 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.AddResourceFactory.CACHE_MAP_KEY 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.component.html.util.ExtensionFilter.doFilterCalled 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Contexts] destroying: facelets.Encoding 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.application.jsp.JspStateManagerImpl.SERIALIZED_VIEW 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Contexts] destroying: com.sun.facelets.legacy.ELCONTEXT 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation context 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Contexts] destroying: facesMessages 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Contexts] destroying: businessProcess 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Contexts] destroying: conversation 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.pageflow 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing server-side conversation context 2006-08-02 16:13:54,421 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
Any suggestions on what I'm missing.
Thanks,
-- JC