How to create a "loop" of activities within a workflow? (orchestration)

patricklatella
Mega Sage

Hi gang,

I've got a workflow I'm building for the AD Orchestration activity "Remove user from group", and I have a catalog item that has a list of applications as variables, all with their own checkbox...so the user can select multiple applications from within the one catalog item that they want a user removed from in AD.

So what I need to do is to somehow have the workflow cycle through the orchestration activities for each application that the user needs to be removed from.  Some guidance so far has indicated building an array of the applications that the user needs to be removed from in AD, and then have the workflow loop through the orchestration activities for each one...and then finish after they have all be done.  

Not sure exactly how to set this up...any help would be great!  

Here's an image to somewhat show what I'm trying to do.  Each circle through the orchestration "loop" would remove the user from 1 AD group...and then finish when all of the selected applications from the catalog item are complete.

find_real_file.png

1 ACCEPTED SOLUTION

thomas_wright1
Giga Contributor

Yup, build a scratchpad array of applications that were checked, create a scratchpad var to hold a counter, right after your process failure activity check to see if the counter equals the length of the array.  If not, then loop back to the remove user from AD group, increment your counter and do another check.  If the counter equals the array length, then you've done your last one, go to end. 

 

hope this helps.  

View solution in original post

5 REPLIES 5

patricklatella
Mega Sage

perhaps something like where I declare a variable to equal the number of applications that were selected from the catalog item...and then have it subtract 1 each time it goes through until the variable = 0.  But then somehow I need to know that it's not repeating?  just thinking out loud

patricklatella
Mega Sage

and here's the form to provide more context.  Some of these applications I want to go through the orchestration loop...so if 5 of these checkboxes are selected, I need to the workflow to loop through the orchestration activities for each application selected...these need to be handled individually as they all match with unique AD groups the user needs to be removed from.

find_real_file.png

stevenfroggattk
Tera Guru
Hi Patrick, Just wondered if you managed to get anywhere with this? I have a very similar scenario and have no idea where to start! Thanks Steve

thomas_wright1
Giga Contributor

Yup, build a scratchpad array of applications that were checked, create a scratchpad var to hold a counter, right after your process failure activity check to see if the counter equals the length of the array.  If not, then loop back to the remove user from AD group, increment your counter and do another check.  If the counter equals the array length, then you've done your last one, go to end. 

 

hope this helps.