cancel
Showing results for 
Search instead for 
Did you mean: 

Long Java Service Task

rschneidman
Champ in-the-making
Champ in-the-making
I have a java service task that takes a long time to execute. While the service task is executing, a get request using the REST api returns that the current activity is the last user task. Is there any call that I can make using the REST api to determine that the java service task is in the middle of execution.

Thanks.
3 REPLIES 3

trademak
Star Contributor
Star Contributor
If you would use a async Java service task, you can query and see that the current state is the service task execution.

Best regards,

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

I think you can make service task asynchronous (it has other side effects too).

Regards
Martin

pmsevestre
Champ in-the-making
Champ in-the-making
I think that long running tasks (java or anything else, like shell tasks, with run times from few minutes to even hours) are better modeled by a task executed by an external actor. Following this line of thinking, what I  prefer to do is to model those tasks as a "Human Task", assigned to a particular group or user - a job runner group, for instance.

You can choose a polling strategy (eg, using the REST api) or a task listener in order to kick off your tasks. This approach _will_ add extra complexity to your environment, but OTOH your jobs will be completely decoupled from the process, something that can be handy if you are reusing existing stuff link bash scripts or the like.