2 Replies Latest reply on Jun 19, 2009 1:46 PM by mwohlf

    jBPM: process business key may not be null

      Hi,


      I'm trying out the Seam/jBPM integration. When trying to start a business process with the following:


      @Name("mycomponent")
      @Stateless
      public class MyTestAction implements MyTest {
           private MyClass memberField;
           // ...
           @CreateProcess(definition = "my-process",
                processKey = "#{mycomponent.memberField.memberFieldMember}")
           public String tryItOut() {
                Object v = Expressions.instance().createValueExpression(
                          "#{mycomponent.memberField.memberFieldMember}").getValue();
                log.info("The process key should be [#0]", v);
                // ...
           }
      }
      


      Now, according to the log output, the EL expression evaluates to myKey and therefore is not null. However, when the tryItOut() method returns and the transaction is committed, Seam fails miserably claiming:


      12:23:48,781 ERROR [application] javax.ejb.EJBTransactionRolledbackException: process business key may not be null
      javax.faces.el.EvaluationException: javax.ejb.EJBTransactionRolledbackException: process business key may not be null
           at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
      ...
      



      Since I know the processKey paramater to the @CreateProcessAnnotation is correct, why would Seam complain that it is null?

        • 1. Re: jBPM: process business key may not be null

          This is looking quite weird and could actually be a bug: I changed the EL expression to someStaticKey and now it works. Therefore, the EL must really evaluate to null for some reason. However, within the method, the same EL (copy-paste) evaluates to the intended string (myKey) that is also printed in the log output.


          Am I doing something wrong or does this look like a bug to you too?

          • 2. Re: jBPM: process business key may not be null
            mwohlf

            maybe You have 2 instances of mycomponent somewhere in your app and the annotation gets a different instance than the value expression?


            Try printing the hashCode() of the instance in the getMemberField() method and compare them for both calls.