External Job completion for a suspended instance

Hi,

I’m trying to use an External Jobs to implement some long-running tasks in my application. This works fine for an active process instance but, if I suspend an instance while the external job is running, I’m not able to signal its completion using ExternalWorkerCompletionBuilder.complete(). The main reason, it seems, is that suspend() also removes the external job entry from its table.

I’ve tried to postpone the job completion by saving the completion task in an ad-hoc task and listening to a “resume” event. However, this also didn’t work: activateProcessInstanceById() recreates the external job entry but this entry is now unlocked so I can’t complete it.

Is there a way to reacquire he lock for a particular external job so I can complete it ?

PS: There seems to be a related question in the forum for a similar situation related to sending signals to a suspended instance, but it never got an answer, so I’m creating this new topic.

Flowable details: 6.6.0, MS-SQL DB.

Hey @psevestre,

Currently there is no way to reacquire an External Job. Or at least no way with a public API. Have a look at AcquireExternalWorkerJobsCmd to see how it is been done currently.

Cheers,
Filip

Hi, Filip.

Thanks for the answer. I’ll take a look and see if I can create a custom command for that;

Regards,
Philippe