Expand my Community achievements bar.

SOLVED

Terminating a workflow with External Process step inside

Avatar

Former Community Member

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?

1 Accepted Solution

Avatar

Correct answer by
Level 10

I have asked our Eng team to take a look at this. In mean time - for more Workflow knowledge - see this session of Ask the AEM Commutiy Experts on Workflows: 

https://helpx.adobe.com/experience-manager/using/Workflows.html

Link is in the table at the start. 

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

I have asked our Eng team to take a look at this. In mean time - for more Workflow knowledge - see this session of Ask the AEM Commutiy Experts on Workflows: 

https://helpx.adobe.com/experience-manager/using/Workflows.html

Link is in the table at the start. 

Avatar

Level 2

Hi,

Any updates on that? I have very same task: do polling and track status of external process until it's completion. I want to be able to terminate long running WFs, but I do not really see way to track in code of my wf step implementation that "Terminate" command was issued. Does anybody know how to do it?

Thanks.