cancel
Showing results for 
Search instead for 
Did you mean: 

How to get tasks where user would be candidate if not already assigned

schmke
Champ in-the-making
Champ in-the-making
I have a situation where a particular task has a candidate group and I display the tasks a user is a candidate for (member of the group) and they can claim them and they become assigned to them.  This all works fine.

However, I have a requirement for other members of the group to be able to see and claim these tasks, the scenario being a user goes on vacation with tasks assigned to them and another user wants to search and see a list of candidate but already assigned tasks and be able to claim them and work on them.  Or a manager wants to see a list of all the tasks for the group, assigned or not, and dole out assignments or reassign tasks.

It appears all the TaskQuery methods that deal with candidate groups only return the tasks that are not assigned, e.g. the SQL in Task.xml seems to always have these qualifications together:

and RES.ASSIGNEE_ is null
and I.TYPE_ = 'candidate'

So is there a way to fulfill my requirement?  Or would it require an enhancement to the API to specify to return tasks that are candidates even if already assigned?

Thanks.
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

use http://activiti.org/userguide/index.html#advanced.custom.sql.queries to execute your custom queries.
(I would prefer concept of deputies in case of vacations.)

Regards
Martin

Thanks for the reply.  I knew of the custom queries but was hoping the standard API would support what I need so had not looked at it yet but will now.

But tell me more about deputies and how that might be implemented in Activiti.  I don't see a mention of the term in the User Guide.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

deputies:
Activiti engine does not take care about who is signed in (anybody can complete the task which is claimed to somebody else. Your solution build on the top of activiti engine has to take care about the deputies.  The approach you described above is to allow another users to see and unclaim tasks assigned to somebody else. The deputies should work in the following way user who is on vacation has another user (deputy) which can act on behalf of him/her. (As I wrote solution must support it)

Regards
Martin