3 Replies Latest reply on Jun 20, 2008 12:52 AM by Neil C

    Missing task or process id When Starting Process

    Neil C Novice

      I am attempting to initiate a process with the press of a button.  First, here is the button in my facelet:


      <input type="button" jsfc="h:commandButton" styleClass="submitButton" id="beginOrderButton"
                      action="#{orderAction.beginOrder}"
                      value="Place Order" />
      



      Incidentally, s:button doesn't make a difference.


      Now here is the method referenced as orderAction.beginOrder



         @Create
         @CreateProcess(definition = "orderProcess")
         @StartTask(pageflow = "orderPageflow")
         public void beginOrder() {
            actor.setId("sales");
         }
      



      Finally, here is the exception:



      java.lang.IllegalStateException: task/process id may not be null
              at org.jboss.seam.bpm.BusinessProcessInterceptor.getProcessOrTaskId(BusinessProcessInterceptor.java:159)
              at org.jboss.seam.bpm.BusinessProcessInterceptor.beforeInvocation(BusinessProcessInterceptor.java:60)
              at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:43)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
              at com.myapp.web.sales.OrderAction_$$_javassist_0.beginOrder()V(OrderAction_$$_javassist_0.java:???)
              at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
              at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
              at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
              at org.jboss.seam.Component.callComponentMethod(Component.java:2074)
              at org.jboss.seam.Component.callCreateMethod(Component.java:1997)
              at org.jboss.seam.Component.newInstance(Component.java:1968)
              at org.jboss.seam.Component.getInstance(Component.java:1865)
              at org.jboss.seam.Component.getInstance(Component.java:1832)
              at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
              at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
              at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
              at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
              at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
              at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
              at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
              at org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
              at org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
              at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      
      



      I am not sure exactly what this exception could mean, and as far as I can tell, I am following the examples in the Seam distribution. 


      Any insight into what's going on here is appreciated.


      Thanks.

        • 1. Re: Missing task or process id When Starting Process
          Norman Richards Expert

          @StartTask requires a task, which doesn't exist.  I may be missing something, but I don't think it would ever make sense for @CreateProcess and @StartTask to be on the same node.

          • 2. Re: Missing task or process id When Starting Process
            Neil C Novice

            Thanks, Norman, I actually came to the same conclusion, so I tried something different.  The good news is no exception happens.


            The bad news is that nothing at all happens either.  Let me explain.


            Just to explain what I want to happen in plain English, I begin on a page called customerDetails.  When I press the button on there called Place Order, I want the process to start and for the user to navigate to a page called beginOrder.  It is at that page where the first task begins and all the fun happens. 


            The button called Place Order is the same as in my previous post.  However, I made some changes to my config files.


            First, pages.xml:


             <page view-id="/customerDetails.jspx">
                  <navigation from-action="#{orderAction.beginOrder)}">
                     <begin-conversation />
                     <redirect view-id="/sales/beginOrder.jspx"/>
                  </navigation>
               </page>
               <page view-id="/sales/beginOrder.jspx">
                  <begin-task pageflow="orderPageflow"/>
               </page>
            



            Now, the beginning of the order process definition:


            <start-state name="start">
                  <transition to="placeOrder"/>
               </start-state>
               <task-node name="placeOrder">
                  <task name="placeOrder" description="Place Order">
                     <assignment actor-id="sales"/>
                  </task>
                  <transition name="shop" to="shop"/>
                  <transition name="backToConfirmation" to="confirm"/>
               </task-node>
            .
            .
            .
            



            Now, the beginning of the order pageflow:


            <start-page view-id="/sales/beginOrder.jspx" name="beginOrder">
                  <description>Begin Order</description>
                  <redirect/>
                  <transition name="shop" to="shop"/>
                  <transition name="backToConfirmation" to="confirm"/>
            </start-page>
            <page view-id="/sales/shop.jspx" name="shop">
                  <description>Shop</description>
            <redirect/>
            .
            .
            .
            



            And finally, the Java code that starts everything:


               @Create
               @CreateProcess(definition = "orderProcess")
               public void beginOrder() {
                  actor.setId("sales");
               }
            



            The problem is that when I press the button on the customerDetails facelet now...nothing happens.  I just come right back to the original page.


            Any insight into why Seam doesn't know where to go next is appreciated.  Let me know if you need further information.


            Thanks.

            • 3. Re: Missing task or process id When Starting Process
              Neil C Novice

              FYI, I tried this in my pages.xml:


              <page view-id="/customerDetails.jspx">
                    <navigation from-action="#{orderAction.beginOrder)}">
                       <redirect view-id="/sales/beginOrder.jspx"/>
                       <begin-task pageflow="orderPageflow"/>
                    </navigation>
              </page>
              



              And I tried this:



              <page view-id="/customerDetails.jspx">
                    <navigation from-action="#{orderAction.beginOrder)}">
                       <begin-conversation join="true"/>
                       <redirect view-id="/sales/beginOrder.jspx"/>
                       <begin-task pageflow="orderPageflow"/>
                    </navigation>
              </page>
              



              Same result for both as before.  Nothing happens.  I am simply redirected to the original page.


              Thanks.