cancel
Showing results for 
Search instead for 
Did you mean: 

What 'taskService.claim' means?

hamed
Champ in-the-making
Champ in-the-making
Hi
could you please explain me the concept of claim i have worked with jbpm 3 for months and i haven't seen something like this!
Regards
10 REPLIES 10

hamed
Champ in-the-making
Champ in-the-making
is it difficult for you to explain that? or my question is so silly?

partizano
Champ in-the-making
Champ in-the-making
Hi,

Task not always has assigned user. So "Claim" means "set assigned user".

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
no, GET assigned tou yourself. If assiging to someone else it is setAssigninee (but this is all in the docs)

partizano
Champ in-the-making
Champ in-the-making
no, GET assigned tou yourself.
The name of the topic - "What "taskService.claim" means?" So Hamed is intrested in org.activiti.engine.TaskService.claim(String taskId, String userId) method. And as it says in the docs - "Claim responsibility for a task: the given user is made assignee for the task.".

hamed
Champ in-the-making
Champ in-the-making
Thank Alexander
i'v read that in doc, but i have a question related to my previous question : when do we use Claim? when we assign the task to the group  that has users,  which one of them should claim that?!
And if i want to assign the task to some group that all users in it should complete the task in order to signal the task to next step, what should i do??!

partizano
Champ in-the-making
Champ in-the-making
when do we use Claim?
When the user claim the task it means that the user begin to work on the task.

when we assign the task to the group that has users, which one of them should claim that?!
There is no assigned group in activiti, there is candidate group.

And if i want to assign the task to some group that all users in it should complete the task in order to signal the task to next step, what should i do??!
You should set candidate group for the task, and then user which wants to complete the task should at first run "claim" operation, then "complete"

heymjo
Champ on-the-rise
Champ on-the-rise
Also, the API difference between claim() and assign() is that claim() will throw an exception if the task has already been claimed by someone else. That is quite a nice feature, assuming that it works well with regards to concurrency etc.

Only thing is that it could throw a better exception rather than the standard ActivitiException, created an issue for this http://jira.codehaus.org/browse/ACT-991.

hamed
Champ in-the-making
Champ in-the-making
My thanks to all of you for your help.

lpavone
Champ in-the-making
Champ in-the-making
Hi all,
I want to reopen the discussion.
I have a doubt about how to work claim() and setAssignee() method respect to concurrency.
If I use either the engine works well in case that many users claims the task at the same time??
Or I need to check the concurrency ??

thanks!