Terminating a workflow with External Process step inside
Hi, All
I have a workflow containing external process as one of its steps. If I happen to terminate the workflow during this step execution (i.e. while doing poling via hasFinished(...)), this pooling seems to never stop.
I tried to add check if the workflow is ABORTED in the hasFinished(...) and handleResult(...) to exit immediately if that's the case:
if ("ABORTED".equalsIgnoreCase(workItem.getWorkflow().getState())) { return; }This helped to interrupt the infinite pooling. However, when the bundle or AEM restarts, hasFinished(...) and handleResult(...) are called one again for each workflow interrupted in this way.
I there a right way to cancel an external step execution (or underlying job execution) when a workflow is terminated?