Need to iterate each catalog task of the RITM using Flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 08:47 AM
Hello,
How to achieve this
Let's say I have a RITM000001, now I need to iterate through all the catalog task associated with the RITM000001, and if any catalog task is open then I need to wait until all the tasks goes in complete States
If all the catalog tasks associated with the RITM000001are in closed States I need to close the RITM state
Thanks in advance 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 09:24 AM
I usually set up a sub-flow and use it wherever needed.
The sub-flow accepts a single input: a requested item reference.
The logic is to execute a loop that contains a Look Up Record (not Records!) action, and a Wait for Condition action.
The key is to configure the Look Up Record action so that it does not fail on error (if no record is found) and the "loop until" condition as Look Up Record.Status is "Error".
In each loop, a single active Catalog Task is looked up.
If as a result of the lookup the Status property of the Look Up Record is "Success" (a record has been found) then the Wait for Condition is executed with the condition "Found Catalog Task Active is false".
At this point the Flow will wait for the Catalog Task found to be closed.
After the Catalog Task is closed, the "loop until" condition is evaluated, and will not be fulfilled (the last lookup record Status was "Success") so the loop will be executed once more.
A new lookup happens and if a Catalog Task is still running, it will be found a new wait will be executed.
If on the other hand the lookup finds no Catalog Task, the Status property of the Look Up Record will be "Error" (so not "Success"), the Flow will thus not enter the Wait for Condition action and will move to evaluating the "loop until" condition which this time will be fulfilled so the flow exits.
Thus if this sub-flow is called right before setting stage to "Completed" (at the end of the flow), it will allow holding up the main Flow as long as there is one active Catalog Task, no matter who or how that Catalog Task might have been attached to the Requested Item.
(The flow variable in the picture is just the sys_id of the Requested Item passed in as sub-flow parameter - not really needed.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 10:00 AM
I recently had this request. What I did was run a look up records activity for all tasks where the parent was RITMXXX. Then followed that with a for each loop that added a wait for condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 10:14 AM
What about the Catalog Tasks that may be added (manually or otherwise) after the lookup happens?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 10:17 AM