How to complete the workflow inside process step in AEM? | Community
Skip to main content
Mario248
New Participant
August 26, 2022
Solved

How to complete the workflow inside process step in AEM?

  • August 26, 2022
  • 1 reply
  • 1253 views

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 ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

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-workflows/workflows-step-ref.html?lang=en#participant-steps-and-choosers

1 reply

joerghoh
Employee
August 26, 2022

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.

Mario248
Mario248Author
New Participant
August 29, 2022

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.

joerghoh
joerghohAccepted solution
Employee
August 29, 2022

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-workflows/workflows-step-ref.html?lang=en#participant-steps-and-choosers