cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement long-running tasks in Activiti?

zlatan316
Champ on-the-rise
Champ on-the-rise
Hi,

My process is a simple model with 2 service tasks. ServiceTask1 can take over 15 minutes to run in the execute() method, and ServiceTask2 completes in mere seconds. What happens is that ServiceTask1 will cause the Activiti database to timeout as the transaction has remained open longer than 5 minutes.

I want to instead run this ServiceTask so that it can run for however long it wants until it then tells the process to continue with ServiceTask2. I understand in Activiti 5:17(and 5.18), there is a new JobExecutor which can help with executing a long running task but I can find any code examples of its use, or a diagram example of how to model the execution of these longer running Service Tasks.

Can anyone assist?
10 REPLIES 10

jbarrez
Star Contributor
Star Contributor
@pmsevestre: that is indeed a good idea.
However, I'm not a big fan of calling processes from within Java (it's not simple and always behaves differently than one assumes). so not sure if it should be something for core Activiti … ?