cancel
Showing results for 
Search instead for 
Did you mean: 

How to claim multiple tasks at once?

swamy2156
Champ on-the-rise
Champ on-the-rise
Hi.,

I can claim a task by calling taskService.claim(taskId, userName);
Similarly Is there a way to claim multiple tasks(a.k.a bulk tasks) all at once. In my case, my task view page has pagination which can show tasks up to 100 tasks at a time and I provided CLAIM ALL flexibility to end user. When CLAIM ALL selected, in background, I am looping for each task to claim and publish 2 events on Acquire action. Its taking approximately 3-4 minutes.

Is there any better approach for claim bulk tasks all at once?


Thanks,
Swamy.
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

claim all is not provided by API. You can extend the API.

Regards
Martin

swamy2156
Champ on-the-rise
Champ on-the-rise
Martin,

As I said earlier Claim of 100 tasks and each task will publish 2 events once claim is done and for this process its taking approx. 4 min. By the way when I look into the source code, I notice that, only one thread Thread-X is taking care of all claiming all 100 tasks one by one and publishing n-claim events. Most the process time is spent by the Thread-X at events publishing.

As of now, I am separate out publishing into a new Therad in TaskListener Implementer notice() method. With this change, claiming 100 tasks duration bring down to 30seconds. Instead of this, Is it correct way to separate out the publishing events into a new Thread at TaskEntity level itself??

Thanks,
Swamy.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Swamy,

Your statement is: Events publishing is time consuming. Did you investigate why? When you find the cause you can optimize it more.
(e.g. implement your own command to claim all tasks…)

Regards
Martin