Flow Designer: Run all items in list, independently through For Each Item In

Mark Brogna
Tera Contributor

I am trying to solve an issue where I grab each value from a list collector variable and run independently through the same workflow, assigning a few tasks.

MarkBrogna_0-1738797649588.png

The issue is that I want task 1 assigned for all three business services:

  1. Asset-IBM Task 1
  2. Acrobat Distiller Task 1
  3. BOW-IBM Task 1

When 'Asset-IBM Task 1' is complete, I want that service to be assigned task 2, 'Asset-IBM Task 2' while the other two services are still at task 1.

 

Further, the RITM will only close when all tasks for each business service are complete. The main issue seems to be the 'Wait' attribute with the Create Catalog Task action.  I built in a flow variable that iterates through the 'For Each Item In' loop.  The wait condition waits until all are created and then it will wait. Not sure how to get Task 2 to work as I want each value treated independently.

 

MarkBrogna_1-1738798059727.png

MarkBrogna_2-1738798059876.png

 

 

 

4 REPLIES 4

Natan F Rosa
Kilo Guru

Hello,

Always will is three tasks or will can add more tasks?

I want each item to operate independently as three tasks will be assigned.

 

If task 1 is finished for the first business service, it should move to task 2. Whereas the second business service will still be at task 1.

 

If for any reason a task is rejected, it would only affect one business service and not the other.

Kai Tingey
Tera Guru

Hi Mark


You can do it like this

 

KaiTingey_0-1738805581717.png

 

- look up all business service records in list collector by sys_id

- for each (business service record)

- if not 'asset ibm' (sys id of record does not match asset ibm sys_id) - create task 1, deselect wait condition. This will create all tasks at the same time.

- if list collector contains sys_id of asset ibm record

- create asset ibm task 1 - wait condition is selected this time

- create asset ibm task 2

- look up all catalog tasks associated with the RITM where active = true

- if active tasks exist (count greater than 0)

- for each catalog task, wait for condition active = false

- close RITM

 

I'm assuming you want all task 1's spawning at the same time, which is why it's broken out like this. There might be a neater way of doing it but this works.

 

Hope that helps

Viraj Hudlikar
Giga Sage

Hello @Mark Brogna 

As per your requirement this is something I tried in PDI:
1) My main Flow

VirajHudlikar_0-1739100402584.png

VirajHudlikar_1-1739100461083.png

VirajHudlikar_2-1739100525574.png

VirajHudlikar_3-1739100553657.png

 

2) All Subflows:

1) 3 Task Creation:

VirajHudlikar_4-1739100649156.png

VirajHudlikar_5-1739100722352.png

 

VirajHudlikar_6-1739100792926.png

VirajHudlikar_7-1739100837660.png

 

VirajHudlikar_8-1739100894297.png

 

2) Gatther All Catalog Task Status

VirajHudlikar_9-1739100982561.png

VirajHudlikar_10-1739101035869.png

 

Now over catalog Item i have a list collector reference to user table, so submitted with three user randomly as show below:

VirajHudlikar_11-1739101155836.png

 

Now when RITM was created flow got triggered and it created three initial Ctask as required now one I kept as it is and other two I updated with other states as showed below:

VirajHudlikar_12-1739101267866.png

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.