1 Reply Latest reply on Aug 14, 2006 11:09 PM by wondermike

    multiple pageflows

    wondermike

      Hello, I'm using the sample app generated by seam-gen (from http://www.jboss.com/index.html?module=bb&op=viewtopic&t=88326) and I'm trying to implement a second pageflow.
      The easiest way to start was to copy pageflow.jpdl.xml to pageflow2.jpdl.xml, copy first-page.xhtml to ctrfirst-page.xhtml (same with second and third). The pageflow started from a different page than home.xhtml.
      In the file pageflow2.jpdl.xml I renamed everything appropriate (so did I in ctr*.xhtml):

      <?xml version="1.0"?>
      
      <pageflow-definition name="shellflow2">
      
       <start-page name="start2" view-id="/contractlist.xhtml">
       <redirect/>
       <transition name="first-page2" to="first-page2"/>
       </start-page>
      
       <page name="first-page2" view-id="/ctrfirst-page.xhtml">
       <redirect/>
       <transition to="first-page2"/>
       <transition name="continue-flow2" to="continue-flow-decision2"/>
       </page>
      
       <decision name="continue-flow-decision2" expression="#{flowBean2.continueFlow}">
       <transition name="true" to="second-page2"/>
       <transition name="false" to="start2"/>
       </decision>
      
       <page name="second-page2" view-id="/ctrsecond-page.xhtml">
       <redirect/>
       <transition to="second-page2"/>
       <transition name="third-page2" to="third-page2"/>
       </page>
      
       <page name="third-page2" view-id="/ctrthird-page.xhtml">
       <redirect/>
       <end-conversation />
       </page>
      
      </pageflow-definition>


      In components.xml I included the new file:
      ...
       <component class="org.jboss.seam.core.Jbpm">
       <property name="processDefinitions">processdefinition.jpdl.xml</property>
       <property name="pageflowDefinitions">pageflow.jpdl.xml</property>
       <property name="pageflowDefinitions">pageflow2.jpdl.xml</property>
       </component>
      ...
      


      Moreover I copied FlowBean.java, SimpleFlow.java and SimpleFlowAction.java to FlowBean2.java and so on. Of course SimpleFlowAction2.java looks like this:
      ...
      @Name("pageflow2")
      ...
       @Begin(pageflow="shellflow2")
       public void begin() {
       System.out.println("pageflow2: SHELLFLOW METHOD HIT!!!");
       }
      
       public String gotoFirstPage() {
       System.out.println("pageflow2: 1st page");
       return "first-page2";
       }
      
       public String gotoSecondPage() {
       System.out.println("pageflow2: 2nd page");
       return "second-page2";
       }
      ...
      


      Now the secod pageflow works perfectly, but the first pageflow is broken:
      04:42:17,281 INFO [STDOUT] SHELLFLOW METHOD HIT!!!
      04:42:17,281 ERROR [STDERR] javax.ejb.EJBTransactionRolledbackException: java.lang.IllegalArgumentException: pageflow definition not found: shellflow
      04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:93)
      04:42:17,281 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
      04:42:17,281 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:201)
      04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      04:42:17,281 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
      04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      04:42:17,281 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
      04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:188)
      04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
      04:42:17,281 ERROR [STDERR] at $Proxy182.begin(Unknown Source)
      04:42:17,281 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      04:42:17,281 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      04:42:17,281 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      04:42:17,281 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      04:42:17,281 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
      04:42:17,281 ERROR [STDERR] at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:32)
      04:42:17,281 ERROR [STDERR] at org.jboss.seam.Component.callComponentMethod(Component.java:1334)
      04:42:17,281 ERROR [STDERR] at org.jboss.seam.Component.callCreateMethod(Component.java:1322)
      04:42:17,281 ERROR [STDERR] at org.jboss.seam.Component.newInstance(Component.java:1312)
      04:42:17,281 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1263)
      04:42:17,281 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1246)
      04:42:17,281 ERROR [STDERR] at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
      04:42:17,281 ERROR [STDERR] at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
      04:42:17,281 ERROR [STDERR] at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
      04:42:17,281 ERROR [STDERR] at com.sun.el.parser.AstValue.getTarget(AstValue.java:62)
      04:42:17,281 ERROR [STDERR] at com.sun.el.parser.AstValue.invoke(AstValue.java:147)
      04:42:17,281 ERROR [STDERR] at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
      04:42:17,281 ERROR [STDERR] at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
      04:42:17,281 ERROR [STDERR] at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
      04:42:17,281 ERROR [STDERR] at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
      04:42:17,281 ERROR [STDERR] at javax.faces.component.UICommand.broadcast(UICommand.java:106)
      04:42:17,281 ERROR [STDERR] at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
      04:42:17,281 ERROR [STDERR] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
      04:42:17,281 ERROR [STDERR] at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
      04:42:17,281 ERROR [STDERR] at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
      04:42:17,281 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      04:42:17,281 ERROR [STDERR] at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      04:42:17,281 ERROR [STDERR] at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      04:42:17,281 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      04:42:17,281 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      04:42:17,281 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      04:42:17,281 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      04:42:17,281 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      04:42:17,281 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      04:42:17,281 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      04:42:17,281 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      04:42:17,281 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
      04:42:17,281 ERROR [STDERR] Caused by: java.lang.IllegalArgumentException: pageflow definition not found: shellflow
      ...
      04:42:17,343 ERROR [SeamExceptionFilter] uncaught exception handled by Seam
      javax.servlet.ServletException: Error calling action method of component with id _id6:_id10
      ...
      04:42:17,343 INFO [SeamExceptionFilter] killing transaction
      04:42:17,343 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
      javax.faces.FacesException: Error calling action method of component with id _id6:_id10
       at
      ...
      Caused by: javax.ejb.EJBTransactionRolledbackException: java.lang.IllegalArgumentException: pageflow definition not found: shellflow
      ...
      Caused by: java.lang.IllegalArgumentException: pageflow definition not found: shellflow
      

      (I shortened the stacktrace a little bit)

      Did I screw up something? How can I get the first workflow get back to work again?

      I suspect the components.xml, but I'm not sure. This must be the right place to define further pageflows which are defined in separate files, isn't it?

      TIA for any suggestions.