3 Replies Latest reply on Oct 23, 2011 10:38 PM by ossa

    How to find the last action party

    ossa

      Greetings from Singapore

       

      My question is how find out who was the last action party (user completed the last human task of a particular process instance).

       

       

      Can I use the org.jbpm.task.service.TaskClient.query method with a customized query? But I don't have the syntax of the query. I had been searching the javadoc for the Human Task package but to no avail. Can someone point me to the correct url? It is not in the Documentation library.

       

      Many thanks

      Huang Zeliang

        • 1. Re: How to find the last action party
          salaboy21

          Hm.. I'm trying to understand your requirements here..

          So you want to find out who was the last person of completing a task related with a process right?

          If that's the requirement, yes a named query will be the answer.

          Take a look at the orm.xml file provided inside the jbpm-human-task module to add an extra query that recieves the process instance ID and order the task by the last completed within that process instance. The syntax for the named queries is standard (JPAQL - HQL) syntax so you can find tons of examples if you google JPA named queries or JPA QL.

          Cheers

           

          PS: first hit-> http://download.oracle.com/javaee/5/tutorial/doc/bnbtg.html

          • 2. Re: How to find the last action party
            ossa

            Thanks for the fast reponse. I will try it out.

            • 3. Re: How to find the last action party
              ossa

              Hi Mauricio, I had briefly went through the tutorial and some other pages on the internet.

              So should I create my own EntityManager and use its createNamedQuery(String arg0) method to execute the query?

              Or I can actually use the query(qlString, size, offset, responseHandler)  method of org.jbpm.task.service.TaskClient class for convinience?

              If I can, how do I pass in the processInstanceId into this query method?