How to Create a Basic Workflow Loop? | Community
Skip to main content
Level 3
May 1, 2023
Solved

How to Create a Basic Workflow Loop?

  • May 1, 2023
  • 2 replies
  • 1055 views

Hi All,

I am just wanting to create a basic approval workflow. I noticed a blog post re. conditional loop but I don't quite understand the process.

All I want is for when a change is rejected it goes back to the author to make changes and then resubmit for approval/publishing

Here is the workflow I currently have. I don't think I have set the goto steps correctly so currently when I run the workflow they just close the workflow. I'm not sure what I need to do.


Any help would be greatly appreciated.

Kindest Regards,
Reece

Best answer by RooRue

Thanks Siva for the suggestion. It may have confused me more so I actually went back to the guide here and tried the loopcount method.. to my surprise i've got it working now with this setup. 

This allows the author to submit for approval/publish, the approver to reject, submit to legal or skip to publishers and then the publishers can either reject or publish the page. 

Thanks again for trying to help. Really appreciated. 

2 replies

Siva_Sogalapalli
Community Advisor
Community Advisor
May 1, 2023

You can write custom process step for the rejection and keep it after Reject Participant step something like below: 

 

 

Here is the sample code you can write in process step and configure it.

Please note that you need to choose appropriate route based on your workflow model structure.

 

List<Route> backRoutes = session.getBackRoutes(item); 
Route rte = backRoutes.get(0);
session.complete(item, rte);

 

Note: Please make sure to disable Handler advance checkbox for the process step. 

 

Hope this helps. 

 

RooRueAuthorAccepted solution
Level 3
May 1, 2023

Thanks Siva for the suggestion. It may have confused me more so I actually went back to the guide here and tried the loopcount method.. to my surprise i've got it working now with this setup. 

This allows the author to submit for approval/publish, the approver to reject, submit to legal or skip to publishers and then the publishers can either reject or publish the page. 

Thanks again for trying to help. Really appreciated.