Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to complete the workflow inside process step in AEM?

Avatar

Level 9

I would want to complete the workflow inside process step in AEM. Actually I have series of step in my workflow model, For one of those steps, I want to end the workflow and skip the other steps. I can end the workflow using the code below

 

 

workflowSession.terminateWorkflow(workItem.getWorkflow());

 

 

 

But after terminating the workflow, the workitem is still appearing in AEM Inbox console. Tried to suspend the workflow, in this case the workitem is disappeared in Inbox but it is showing Workflow Instances console. Is there any other API to gracefully complete the workflow inside process step ?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

That's a very simple approval usecase, and the most important reason for the existance of the participant step.

 

The documentation for this feature is here: https://experienceleague.adobe.com/docs/experience-manager-65/developing/extending-aem/extending-wor...

View solution in original post

3 Replies

Avatar

Employee Advisor

I don't know if it is possible to terminate a workflow earlier from within a workflow model.

A way which works for sure is to model the workflow appropriately and decide based on the result of the previous step if to continue or not. That approach is also more obvious to anyone looking into the model.

Avatar

Level 9

Thanks for your reply. Basically in participant step, approver will have 2 options, approve and reject. If he approve the workflow it goes to next step in the workflow model whereas if he reject the workflow I want to cancel or end the workflow for which I am looking for a solution. I guess there should be a way to end the workflow if approver reject the workflow.

Avatar

Correct answer by
Employee Advisor

That's a very simple approval usecase, and the most important reason for the existance of the participant step.

 

The documentation for this feature is here: https://experienceleague.adobe.com/docs/experience-manager-65/developing/extending-aem/extending-wor...