cancel
Showing results for 
Search instead for 
Did you mean: 

Run Background jobs in Activiti Explorer

shuchi
Champ in-the-making
Champ in-the-making
Hi,

I have a use-case wherein I want to assign multiple tasks on a single click of button in Activiti Explorer. The problem with this is since the Engine Service API for Task assignment is a synchronous call, the UI keeps waiting if the number of tasks is large. I want to move this operation to a background job and have a call back to Explorer (if possible) or user can just refresh the status after some time.

For running background jobs, I need to create a thread pool. But creating a thread pool for every web request is a waste. At which level, do I associate the thread pool?

Can anyone tell me how I can achieve the background job logic?

Thanks,
Shuchi
2 REPLIES 2

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Shuchi.

To make assignment asynchronous, I would create a service which will just take the request and record it somewhere. Service will answer immediately after the successful recording. Another thread will consume records and will make assignments accordingly.

Regards
Martin

Hi Martin,

This would be an external service. I was wondering if I can do this inside Activiti Explorer.