- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2022 04:11 PM
I have a workflow that generates one RITM, then generates 4 sequential SCTASKs. The goal is to set the State of the RITM and REQ as "Canceled" if any one of the SCTASK States is set to "Canceled". This would prevent any of the other SCTASKs from being generated and effectively prevent the continuation of the REQ.
I thought I could use the Workflow Editor to evaluate each SCTASK's State, but it looks like it is more involved than a simple GUI. Do I need to create a Script on the IF CONDITION to evaluate the CATALOG TASK? If so, what resources can I review to develop my script? I followed the example listed in the IF CONDITION's Script field, but it doesn't appear to have worked (i.e. the workflow proceeded as normal instead of Canceling the REQ/RITM).
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 02:39 AM
Hi Tim,
The best way to do this since you have a workflow that is creating the tasks is to add conditions (shown in yellow on the workflow at the bottom of the activities) to each Catalog Task activity. The conditions will act as the if statement to evaluate the result of the activity, then you connect each to the path you want it to take.
To add a condition, right-click on the activity header, and choose Add Condition. Give the condition a Name that will appear on the workflow, the Condition field should be like
activity.result==3
where 3 is the state value for Closed Complete out of the box. You will need a condition for every possible inactive state of the Catalog Task, so out of the box that's 3, 4, and 7 for Closed Complete, Closed Incomplete, and Closed Skipped respectively. You can also combine two or more like
activity.result==4 || activity.result==7
to follow the same path if the Catalog Task is Closed Incomplete or Closed Skipped. You'll then want to delete the Always condition by right-clicking directly on it and choosing Delete. You can also access the conditions from the related link at the bottom of the activity definition window.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2022 02:39 AM
Hi Tim,
The best way to do this since you have a workflow that is creating the tasks is to add conditions (shown in yellow on the workflow at the bottom of the activities) to each Catalog Task activity. The conditions will act as the if statement to evaluate the result of the activity, then you connect each to the path you want it to take.
To add a condition, right-click on the activity header, and choose Add Condition. Give the condition a Name that will appear on the workflow, the Condition field should be like
activity.result==3
where 3 is the state value for Closed Complete out of the box. You will need a condition for every possible inactive state of the Catalog Task, so out of the box that's 3, 4, and 7 for Closed Complete, Closed Incomplete, and Closed Skipped respectively. You can also combine two or more like
activity.result==4 || activity.result==7
to follow the same path if the Catalog Task is Closed Incomplete or Closed Skipped. You'll then want to delete the Always condition by right-clicking directly on it and choosing Delete. You can also access the conditions from the related link at the bottom of the activity definition window.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 08:35 AM
Thank you Brad for assisting me! I did not even realize I could add Conditions to the Tasks. I have tried out your proposed solution and it works great! I also appreciate you providing me so much detail in such a simple and understandable way. Thank you again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 11:37 AM
That's great to hear, and you are quite welcome!