7 Replies Latest reply on Apr 20, 2012 3:20 AM by arunvg

    How to return the history of user tasks in JBPM5

    kermeson

      Hi,

       

      I am working on a project with jbpm5, I would like to know how to get the history of user tasks of an instance of the process with the following information: start date, end date, status, owner.

       

      I tried to get the history of user tasks from the task table, but this table has no fields start date, end date. Could anyone help me?


        • 1. Re: How to return the history of user tasks in JBPM5
          salaboy21

          We can create a simple listner to get that information, right now the TaskData class is keeping some of that informaiton. We will definitely include an out of the box mechanism for that in the future versions as stated in the WS-HT spec.

          Cheers

          1 of 1 people found this helpful
          • 2. Re: How to return the history of user tasks in JBPM5
            kermeson

            Thanks Mauricio,

             

            I must implement a ProcessEventListener? This interface has no methods where i can get the start date of the task, end date of the task. Do you have any sample of how implement this listener?

            This information should be stored in another table?

             

            I noticed that some of the functionality of jbpm 5.3 is "Pluggable strategies for task cleanup".  So i will not be able to use the task table to keep the history, right?

             

            I appreciate your help.

            • 3. Re: How to return the history of user tasks in JBPM5
              salaboy21

              ProcessEventListener will not help because what you need is a custom listener for the human task component not for the process engine. Are you using the Mina human task component? JMS? local?

               

              The "Pluggable strategies for task cleanup" will not affect that it will only affect the runtime data, meaning that if you want to keep logs of the interactions you should do it in different tables, so internally the component can clean up itself to not keep information forever. The Pluggable strategies for task cleanup is something optional that you can include with basically a ProcessEventListener.

              Cheers

              • 4. Re: How to return the history of user tasks in JBPM5
                kermeson

                Hi Mauricio,

                 

                I am using the class LocalTaskService to manage human tasks. Is there an example of how to customize a listener for human task component? I appreciate your help.

                • 5. Re: How to return the history of user tasks in JBPM5
                  calca

                  I think you can create your own TaskEventListener implementation, and then add it to task service with TaskService.addEventListener method.

                   

                  Hope this help,

                   

                  Demian

                  • 6. Re: How to return the history of user tasks in JBPM5
                    kermeson

                    Hi Demian,

                     

                    thanks for reply. i tried to implement  a TaskEventListener, but this interface has not methods to get created date of task, start date of task. how to get this insformation?

                    • 7. Re: How to return the history of user tasks in JBPM5
                      arunvg

                      We also got into the same problem .

                       

                      From the task events we could retrieve only task ids.

                       

                      We tried to retrieve other details of the task from the TaskServiceSession.getTask(taskid) method.

                       

                      But  my worry about this approach is whether it can have some Performance impact.