Loop in Process Flow

Hello everybody,

This is my first post on the Community Forums, so it's nice to meet you all!

I started working on my first OutSystems project and I have a process-related question: how can I use loops in a process flow? I can't figure out how...

I want to loop through a variable-size list of approvers and assign an activity to each one of them. I will wait for the first approver to complete his task, continue the loop, go to approver 2...and so on. Each approver is retrived from a database table at run-time.

If it's not possible to use loops directly in a process flow, how would you address this issue, what is the best next thing?

Thank you for your help,

Hi Liviu,

Welcome to the OutSystems community!

A great place to start would be the reference help (http://www.outsystems.com/help/servicestudio/8.0/default.htm#Designing_Processes/Overview_of_Designing_Processes.htm). You have a whole chapter about patterns there where you can get more information.

I hope this helps.

Hi André,

Thank you for your quick reply!

Unfortunately, I have read the chapters about Processes from the Help and I didn't find anything relevant (or maybe I'm missing it...).

I also edited my post in order to make it more clear that I have a variable-sized list and I know the approvers only at run-time.

Thank you!
I though this pattern might help you: http://www.outsystems.com/help/servicestudio/8.0/Designing_Processes/Executing_Multiple_Instance_Activities.htm

You can use an automatic activity to create a record for each approver an have a parallel process for that approval.
Yes, this is the way I started. Your anwser was useful because I improved my design after reading the pattern you pointed out the second time.

Now I'll have to make some tests to be sure that the activity instances are created and executed in the same order I create the approver records. I don't think I'll have problems with this, anyway.


Finally my process works and it's implemented in such a way that it "simulates" a loop. But I have another question.

Is it possible to implement an approver-proxy functionality? Is there a place where a user can define a substitute for himself and then all Human Activities (past and future) appear in the substitute's Taskbox (and of course, approve and reject them)?

It seems that my first project that uses processes is pretty complex. :)

Thanks for the help,
Hi Liviu,

There's no out-of-the-box way of doing that. This also depends on your scenario, do you wan to transfer current acitvities to the substitute or only new ones?
You can use the APIs to set reassign users to activities. For new activiites you will have to implement the logic to determine wich user is assigned when the activity is created.

Happy coding ;)
Yes, I thought that I didn't see anything out of the box. :)
Then...I'll start implementing my own logic.