01-05-2018 04:39 AM
Hi,
I am using activiti in my spring web application. Here I assigned task to particular group not to candidate user. Now, i need to display candidate user tasks and groups tasks individually. But both are coming with same tasks.
taskService.createTaskQuery().taskCandidateUser(user.getUsername()).list()
taskService.createTaskQuery().taskCandidateGroup(groupType).list()
I assigned only to group. why candidateUser also returns same tasks? Please let me know if anyone know about this.
Thanks
01-05-2018 07:39 AM
This is indeed the intended behaviour - if the user is a member of a group then they are automatically a candidate for any tasks for which the group is a candidate and the taskCandidateUser query will reflect that. You can see how this is implemented by looking at Activiti/TaskQueryImpl.java at 6.x · Activiti/Activiti · GitHub and Activiti/Task.xml at 6.x · Activiti/Activiti · GitHub - the method is automatically called in virtue of the mybatis config. You can find more explanation and a solution using a native SQL query in the thread getting a user's candidate tasks without the user's group tasks
Explore our Alfresco products with the links below. Use labels to filter content by product module.