AnsweredAssumed Answered

Jobs and long running tasks

Question asked by krraghavan on Jun 30, 2016
Latest reply on Jul 13, 2016 by martin.grofcik
I have a situation and it's quite likely that I don't properly understand how asynchronous tasks work.  Here's a brief description:

1. Our workflows include several long running tasks (order of hours) that are Java Service tasks.  These tasks make an asynchronous call to an external system and poll the server to figure out if the task was completed (based on a handle that is returned when the job is submitted).
2. If the workflow engine crashes during this long running polling task, I want to be able to just continue the polling task and pick up from the polling task.

Since everything that happens before the polling tasks effectively marks a transaction boundary for us we made the polling task Asynchronous in the hope that it would create an execution in the table which can be resumed when the workflow engine comes back up.  However, what's happening is that depending on our poll cycle, the job that is created for asynchronous tasks kicks in and the poll task gets invoked multiple times.

Are we doing this wrong?  What is the preferred/recommended way to do this for our use case.  Please let me know if more information is required.