Expand my Community achievements bar.

SOLVED

How to Create a Basic Workflow Loop?

Avatar

Level 4

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.

RooRue_0-1682918111302.png


Any help would be greatly appreciated.

Kindest Regards,
Reece

1 Accepted Solution

Avatar

Correct answer by
Level 4

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. 

RooRue_0-1682922520301.png

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. 

View solution in original post

2 Replies

Avatar

Community Advisor

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

 

Siva_Sogalapalli_1-1682919291063.png

 

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. 

 

Siva_Sogalapalli_0-1682919258172.png

Hope this helps. 

 

Avatar

Correct answer by
Level 4

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. 

RooRue_0-1682922520301.png

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.