flow designer - scripted wait for condition , wait for catalog task to be closed complete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 05:36 AM - edited 04-17-2024 06:31 AM
Hi
I am trying to implement a scripted "wait for condition" that checks whether catalog tasks generated for a particular stage is "closed complete" before moving on to the next stage.
By stage I mean the below, do note that I am dynamically generating these tasks and stages (no hard coding). Do note that all tasks for each stage needs to be in "closed complete" before moving to the next stage. Tasks in each stage are generated in parallel.
stage 1: stage 2: stage 3:
catalog task 1 catalog task 3 catalog task 4
catalog task 2 catalog task 5
step 24: generates catalog tasks dynamically
step 25: after generating the catalog tasks for a stage, I check whether there are any tasks that are not in "closed complete".
step 26: If the number of records > 0 , means there are tasks not in "closed complete"
step 27: scripted wait for
This is my scripted wait for, I basically look for sc_tasks that belong to the RITM that are not "closed complete" and sets the answer = false to wait.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 05:49 AM
@cnshum I would like to know, why aren't you using "Wait" checkbox on the catalog task activity because if you set it to "True" , it will wait until the task is closed and then move to next stage.
As per your stages,
stage 1:
catalog task 1 (Wait = True, if sequential ; Wait = False, if parallel)
catalog task 2 (Wait must be "True")
stage 2:
catalog task 3 (Wait must be "True")
stage 3:
catalog task 4 (Wait = True, if sequential ; Wait = False, if parallel)
catalog task 5 (Wait must be "True")
Post this you can cascade the state to RITM.
Please mark this as helpful and accept it as a solution if this resolves your query.
Thanks,
Sujatha V.M.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 06:24 AM - edited 04-17-2024 06:29 AM
Hi as mentioned, I'm dynamically generating the catalog tasks using a loop. I'm unable to control which tasks to wait. All tasks in each stage is generated in parallel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 06:54 AM
I dont think you need a script for conditions... You can do something like below:
Note: I would suggest not to use state as a condition because a task can be skipped or cancelled and not closed completed.
Now for transitioning to various stages, try this trick:
- Add your stages in 'Flow stages' of the flow
- Above below Lookup records action, use 'Add a Stage' to set to stage 1
- Lookup records in sc_task table for your condition + Active = true with Order by Number and Max results 2
- Wait for them to close (Wait for condition until Active = false)
- Above below Lookup records action, use 'Add a Stage' to set to stage 2
- Lookup records in sc_task table for your condition + Active = true with Order by Number and Max results 1
- Wait for it to close (Wait for condition until Active = false)
- Above below Lookup records action, use 'Add a Stage' to set to stage 3
- Lookup records in sc_task table for your condition + Active = true with Order by Number and Max results 2
- Wait for them to close (Wait for condition until Active = false)
Regards,
Sharad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 07:12 AM
You're just hard coding the catalog tasks and stages. As mentioned I'm dynamically generating the stage and catalog tasks.