cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Claimed Task by using taskCandidateGroup ?

tomcheng76
Champ in-the-making
Champ in-the-making
Hi community,

Hi, i have a task which candidate group is "manager".
I can get the task by calling taskService.createTaskQuery().taskCandidateGroup("manager").list();

However, if one of the manager, lets say "peter", claimed the task
I can no longer get the task by taskCandidateGroup, only by taskAssignee.

It is troublesome because
i want all "manager" to able to get all task statistics even the task is claimed by someone.

How to get claimed task by taskCandidateGroup?

I hope you understand my question.

Thanks in advance Smiley Happy
8 REPLIES 8

tomcheng76
Champ in-the-making
Champ in-the-making
By editing activiti-engine-5.6.jar\org\activiti\db\mapping\entity\Task.xml
remove the line
217a218
>         and T.ASSIGNEE_ is null

The problem is solved…
may be activiti team can change the method to taskCandidateGroup(boolean include_claim_task)

I am not sure the impact of changing that line though, is it safe ?
Is there any better solutions ?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
should be a new method, with a new query. Changing this query is a no-go

frankee787
Champ on-the-rise
Champ on-the-rise
Why do you want to get the tasks once it has been claimed by someone in the Group. Doesnt it cause more problem by retrieving that task. I believe (if needed at all) it should be a new query altogether with a more distinguishing name.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Read his requirement frankee787. He wants the MANAGER of the group to see these tasks. E.g. to be able to reassign them in case of illness. He never mentioned using it for normal users. Very valid usease I think

tomcheng76
Champ in-the-making
Champ in-the-making
should be a new method, with a new query. Changing this query is a no-go

How to do this?
Is there any tutorial on extending activiti task functionality?

Thanks

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
sorry, there is no pluggable way to extend Activiti in this regard. But you can always use the source and change that

frederikherema1
Star Contributor
Star Contributor
Thats the power of open-source… As ronald says, the functionality required is not the 'normal' way of using the claimed/unclaimed state of tasks.

mschaefer
Champ in-the-making
Champ in-the-making
I do not understand the Activit Core team in that case: All other query methods do only add the expected parameters but taskCandidateGroup() adds this overstrict "assignee = null". And there is also taskUnassigned() which adds "assignee = null", right?
How do you know what is the the 'normal' way of handling taks in an application? I have a real world client in a real word application and because of this strange idea that an assigned task should no more be visible by another one in that group, one must make an ugly workaround to bypass the API? Disappointing…

Regards
Martin