5 Replies Latest reply on Jan 28, 2010 6:47 AM by Sebastian Schneider

    Re-assigning tasks

    Kai Weingärtner Newbie



      I have 2 questions regarding re-assining previously assigned tasks.


      1. AFAIK jBPM does not differentiate between an assigned task and a task which is in progress, is that correct?


      I would like to be able to find and (manually) reassign already assigned tasks, as long as the assignee is not currently working on it (escalation).


      2. How can I retrieve tasks for which a person is a candidate even though the task is already assigned?


      I tried the TaskQuery, but filtering for candidates also adds a filter for unassigned tasks.



      Is there maybe another way to handle my use case?

      - The task should be assigned to a user (sees it in his personal task list, not visible in group task list)

      - The assigned task has to be retrieved with just the candidate group

      - Updating the assignee via setAssignee( a user from that candidate group )


      Any help is much appreciated,


      Kai Weingärtner

        • 1. Re: Re-assigning tasks
          Ronald van Kuijk Master

          1: No, a task can be assigned but not started yet

          2: Try the createTaskQuery on the taskService. Not sure if it contains what you want but I think (hope) it does





          • 2. Re: Re-assigning tasks
            Kai Weingärtner Newbie

            Hello Ronald,


            thank you for your quick response!


            Regarding your answers:


            1. If jBPM makes that difference, then I wonder how I can set or query for that status 'started'. I haven't found anything suitable on taskService. Could you point me to it?


            I found a property progress on the task, if you mean that. I suppose I could set and query for that. But the TaskQuery does not allow to filter by that, and I doubt that field is indexed.


            2. As I mentioned, I had a look at TaskQuery (and TaskQueryImpl), but the filter for candidates also sets the filter for unassigned.

            I need something like "What tasks could I take, if none had an assignee, i.e. what tasks am i a candidate for".


            It would be nice if TaskQuery.candidate would only set the candiate filter and one could set the unassigned filter by oneself.


            Best regards, Kai

            • 3. Re: Re-assigning tasks
              Ronald van Kuijk Master

              Oops, sorry, missed these last details. Was in a hurry to catch a bus, so did not read everything.


              Well, then you could try to get access to the (Db)Session and do a manual query, or simply 'patch' the taskquery and submit an issue for it. The reason that I think this should be in jBPM (maybe even a method on the taskservice later) is that for managers this is also an interesting thing to be able to reassing task in case of sickness... Mention this when reporting the issue (real life sensible usecases always help in getting things prioritized)


              Regarding the status, you have to iterate over tasks to indeed (ab)use the progres, or make sure it is indexed, or hope (expect) that if you do this for moderatly sized tasklists, your dbms optimizes the query and uses indexed fields first. I assume that this is not a method that will be used a lot...

              • 4. Re: Re-assigning tasks
                Kai Weingärtner Newbie

                Thank you Ronald,


                I added an issue for the candidate query here: https://jira.jboss.org/jira/browse/JBPM-2773


                Best regards, Kai

                • 5. Re: Re-assigning tasks
                  Sebastian Schneider Master
                  I just voted for the issue because of the supplied use case (employee's illness).