cancel
Showing results for 
Search instead for 
Did you mean: 

Tasks without candidate groups

stefanr2
Champ in-the-making
Champ in-the-making
Using TaskQuery, is it possible to query all task that have no candateGroup assigned?
Thanks,
Stefan.
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
Currently, there is no way of querying the tasks that don't have a candidate group, only all unassigned tasks in general (so including the ones with or without candidate group)

stefanr2
Champ in-the-making
Champ in-the-making
Thanks for your response. What would you suggest as workaround?
I want to put an authorization layer on top of the task service to check if a user has the permission to execute a task or not. For all unauthenticated users I need to know whether a task is assigned to a candidate (access denied) or not (can be accessed without authentication).

stefanr2
Champ in-the-making
Champ in-the-making
Just for the records: I found a way to achieve this by providing a custom TaskSession (that decorates the default implementation) and filters all unwanted Tasks. The check for assigned candidates can be done by calling TaskEntity#getIdentityLinks().

frederikherema1
Star Contributor
Star Contributor
Please bare in mind that this can get slow woth large list of tasks (n+1 queries performed)