9 Replies Latest reply on Mar 5, 2006 10:40 PM by gavin.king

    Problem with pageflow

    jdestef

      Hi,

      I'm having a problem with my pageflow. When I invoke to annotated begin method the pageflow does not happen. The same page I was just view is redisplayed.

      My page flow file looks like this:

      <pageflow-definition name="encounterfind">
      
       <start-state name="start">
       <transition to="encounterlist"/>
       </start-state>
      
       <page name="encounterlist" view-id="/view/encounterlist.xhtml" redirect="true">
       <transition name="encounterlist" to="encounterlist"/>
       <transition name="encounterdetail" to="encounterdetail"/>
       <transition name="bookinglist" to="bookinglist"/>
       </page>
      
       <page name="encounterdetail" view-id="/view/encounterdetail.xhtml">
       <end-conversation />
       </page>
      
       <page name="bookinglist" view-id="/view/bookinglist.xhtml">
       <end-conversation/>
       </page>
      
      </pageflow-definition>


      My bean class looks like this:

      @Stateful
      @Name("addfindencounter")
      @Conversational(ifNotBegunOutcome = "logout")
      @LoggedIn
      @Interceptors(SeamInterceptor.class)
      public class AddFindEncounterAction implements AddFindEncounter, Serializable {
      .
      .
      .
      
      @Begin(join=true, pageflow="encounterfind")
       public String start() {
       System.out.println("In findencounter.startAdd");
       userSessionStuff.setFindMode(false);
       System.out.println("In findencounter.startAdd before return");
       return "encounterlist";
       }
      


      I know the method executes as I see the output in the log.

      I have added the following to my web.xml and included the jbpmXX.jar file in my ejb jar file.

      <listener>
       <listener-class>
       org.jboss.seam.servlet.SeamListener
       </listener-class>
       </listener>
      
       <!-- 120 second conversation timeout -->
       <context-param>
       <param-name>org.jboss.seam.core.conversation.timeout</param-name>
       <param-value>120000</param-value>
       </context-param>
      
       <!-- Global JNDI name pattern for JBoss EJB3 (change for other servers) -->
       <context-param>
       <param-name>org.jboss.seam.core.init.jndiPattern</param-name>
       <param-value>patc/#{ejbName}/local</param-value>
       </context-param>
      
       <context-param>
       <param-name>org.jboss.seam.core.init.componentClasses</param-name>
       <param-value>org.jboss.seam.core.Jbpm</param-value>
       </context-param>
      
       <context-param>
       <param-name>org.jboss.seam.core.jbpm.pageflowDefinitions</param-name>
       <param-value>addfindencounter.jpdl.xml</param-value>
       </context-param>
      


      The are no error in the log file. I do see a message that jbpm is starting:

      [JbpmConfiguration] using default jbpm configuration with minimal services enabled. to enable persistence services, provide a jbpm.cfg.xml on the root of the classpath. see userguide, chapter 'Configuration'
      23:26:12,339 INFO [Initialization] done initializing Seam
      


      Any thoughts would be appreciated.

      Tx

        • 1. Re: Problem with pageflow
          ido_tamir
          • 2. Re: Problem with pageflow
            gavin.king

            What happens when you have @Begin(join=false, ....)

            I bet you already have a conversation in progress.

            • 3. Re: Problem with pageflow
              ido_tamir

              In my case:
              when @Create is present on the @Begin(join=false) then I immediately get an exception.
              when @Create is not present on the @Begin(join=false) method on the second click I get an exception.

              when @Begin(join=true) I can click as much as I want (with and without @Create).

              But I do not get a redirect. My best bet its a configuration issue,
              but I also know that once I get into a pageflow it works as expected and redirects happen.

              • 4. Re: Problem with pageflow
                jdestef

                Hi Gavin,

                Yes, that was it, I already had a conversation going.

                Tx for the help.

                • 5. Re: Problem with pageflow
                  gavin.king

                  np, should probably add a FAQ on this.

                  You know how to force a new conversation to be started, right?

                  • 6. Re: Problem with pageflow
                    gavin.king

                     

                    "ido_tamir" wrote:

                    But I do not get a redirect. My best bet its a configuration issue,
                    but I also know that once I get into a pageflow it works as expected and redirects happen.


                    The pageflow only takes effect when a new conversation starts. The problem is that a conversation is already in progress.

                    • 7. Re: Problem with pageflow
                      ido_tamir

                      Maybe I missunderstood something completely.

                      When I add a navigation-rule in faces-config.xml that makes the first transition from the pageflow start-state to the first pageflow wait-state, then it works.
                      Is that how it should work? Because I had the impression that
                      the pageflow itself should take care of the first transition irrespective from which page it got started.

                      I am pretty confident that in the case when there is no @Create on the @Begin(join=false, pageflow="flow") start-method I have no conversation already started when I activate the method (no exception). I do get an exception when I call the method a second time, indicating that the first activation created a long running conversation, but no redirect.

                      >You know how to force a new conversation to be started, right?

                      <h:commandLink action="#{pf.begin}" value="start">
                       <f:param name="conversationId" value="new"/>
                      </h:commandLink>


                      I just tried it but it does not help.
                      Sorry for being a bit slow and stubborn.

                      Thank you for your answers.
                      ido

                      • 8. Re: Problem with pageflow
                        gavin.king

                        Yes, your understanding is correct. I will take a look at your JIRA issue when I get a chance.

                        • 9. Re: Problem with pageflow
                          gavin.king

                          Yes, it was a bug, now fixed in CVS.