2 Replies Latest reply on Jul 13, 2010 10:04 AM by Jaber C. Mourad

    getting all not completed task for a processInstance

    Jaber C. Mourad Novice

      Hi,

       

      I'm looking for a solution to get all the next tasks for a particular process instance in jbpm 4.4...

       

      I try this :

      taskService.createTaskQuery().processInstanceId(processInstanceId).list();

       

      But I've got only the "active" tasks, is there a other way to all next tasks, active or not ?

       

      Regards

        • 1. Re: getting all not completed task for a processInstance
          HuiSheng Xu Master

          Hi Jaber,

           

          What's mean 'next task'?

           

          If you mean the task of the next step,  I am afraid to say there is no way to do that,  because util execution arrival the activity, the related task could be created and be queried.

           

          If you mean the history task,  you could use historyService.createHistoryTaskQuery() to do query.

           

          Regards.

          1 of 1 people found this helpful
          • 2. Re: getting all not completed task for a processInstance
            Jaber C. Mourad Novice

            Effectivelly, you are totally right !

             

            My fisrt idea was to show terminated tasks (easy to get with a modified historyTask, because ther is no taskname in historyTask), current tasks and future tasks to do, but my first idea was too simplist...

             

            So I changed my mind and get only the current opened tasks, and that enough !

             

            If I need more I think it is more complicated using the list of activities of a processDefinition and crossing it to tasks from the current instance...

             

            Regards