3 Replies Latest reply on Feb 6, 2009 3:44 AM by dhanushgopinath

    findReceiveTokens query finds InvokeAction too

      One of our BPEL flows sometimes gets into a state where corresponding Token is not marked as ended. The END_ column is null. We do not understand why this happens yet. However as a consequence of this, when JBoss restarts this BPEL flow war file fails to deploy and throws ClassCastException in

      Receive receive = (Receive) token.getNode();
      


      in IntegrationControl.java

      When we investigated the problem, we noticed that the 'findReceiveTokens' query finds all actions and not just receive action. However from above code it seems JBPM only wanted to select ReceiveActions there. Then we changed the query to select only ReceiveAction by using discriminator value 'R' and deployment started working.

      This seems like a bug, should we file a JIRA issue?

      Also it will be great if someone can suggest under what circumstances Token is not marked as 'ended'. Why is it referring to InvokeAction at that point?

      Thank you,
      Meghana

        • 1. Re: findReceiveTokens query finds InvokeAction too
          dhanushgopinath

          Hi Meghana,

          This is something which i understood from R&D.

          A Token is an object that represents an execution (http://docs.jboss.org/jbpm/v3/userguide/graphorientedprogramming.html#anexecution).

          When the process is getting executed a token will have different nodes depending upon its flow of execution, it can have receive, invoke or assign or anything else. And it holds onto the last node that it executed if the process is not ended. When a process ends, its tokens also ends.

          So when you do

          token.getNode();
          


          you will always get the last node it executed. In your case its coming as invoke action since that was the last node which executed and the process has not ended properly.

          So I think this might not be a bug. Not sure 100%.

          Hope this helps.

          Dhanush


          • 2. Re: findReceiveTokens query finds InvokeAction too

            That is my understanding as well. Thanks for confirming it though.

            However I think there is still a bug because the code in IntegrationControl is expecting to find only ReceiveActions however under this 'bad state' scenario, it also finds InvokeAction as the query does not tell Hibernate to find only ReceiveActions.

            Btw, we are using JBPM 3.2 with BPEL 1.1 GA on JBoss 4.0.5GA and Hibernate 3.2 GA.

            Thanks,
            Meghana

            • 3. Re: findReceiveTokens query finds InvokeAction too
              dhanushgopinath

              Yea. In findReceiveTokens API, it may still be a bug, since its returning all the tokens.

              I am using JBPM 3.2 with BPEL 1.1.1 on JBoss 4.2.0GA and Hibernate 3.2 GA.

              Btw how did you change the query ?