Retry Scope is almost an incredibly powerful tool. As of right now it’s a great time saver for quick linear process chains, but it has so much more potential.
Ideally I think you all should at the VERY LEAST add the ability to check multiple conditions within the “Condition” Block. The way I’d envision this working personally, is having Condition Groups, and within those groups, the ability to set And/Or between the conditionals. So for Example:
Conditions {
Group 1 { //Success Group
Subgroup 1 {
Element 1 Exists AND Element 2 Exists
}
OR
Subgroup 2 {
Element 3 Exists OR Element 4 Exists
}
}
OR
Group 2 { //Error Group
Element 5 Exists
}
}
The ability to just press a button to create a new group within the Conditions block and build out a conditional statement would be amazing. As of right now, as far as I’m aware the only way to do this is to tediously build out a while loop that tracks many conditions or breaks on various conditions.
One thing I use in the condition block is the “IS TRUE” or “IS FALSE” activity. This allows you to check multiple conditions. These activities are found in the Workflow Manager Activities package.
But, it’s an interesting idea to basically have a “Condition Scope” or something like that to use multiple condition activities grouped by maybe AND, OR, ANDALSO, ORELSE, etc. I’m not sure how you would set it up, but could be useful for someone who doesn’t want to use expressions in an “IS TRUE” activity (ie elementExists1 AND elementExists2)
So if i want to retry i would put like a “fake” throw? I mean when i first saw the activity, i was hoping it would also serve the purpose of simple retry mechanism to avoid having to create while loops controlling counter variables etc…
If you Throw an exception, it will perform the retry, because if you roll-over the condition part, it says a retry will happen if an exception occurs OR the condition is not true. However, if you are basing your retry on a condition, you should use a condition in the condition part (not a “fake” throw). As I mentioned previously, you can use the “IS TRUE” activity for this (which I use most of the time anyway). On the other hand, there are times you would want to Throw the exception, but in the case of Retry scopes, it would not be common nor necessary.
Note: if a Retry scope fails, it will not say the exact error message, so make sure you name your Retry Scope to something meaningful to identify the issues that occurred. And, don’t overuse the Retry scope in a way which many errors could occur inside, making it difficult to debug.
I hope that helps with using Retrys. I actually use them a lot, to accomplish things like FilePath type ins in Save Dialogues for consistency (ie using Get Text to verify the FilePath was typed in correctly) or for times when an application has a portion which is randomly faulting a requires a few retry attempts. I also use this frequently to wait for a file to exist when downloading files - you can use the Path Exists or Is True using condition File.Exists(FilePath), and it will dynamically continue once file is ready or throw an exception if it fails to download.
This helps to a degree, but unfortunately doesn’t help the overarching issue of checking multiple issues… Currently I’m checking 3 conditions and using a switch to set a string to "TRUE" and using the String Is Match Condition to check it. The Is True Activity is definitely a good starting point for the time being, though.
What Package is the Is True Activity in? In the process I’m developing at the moment I have the standard UiPath.System.Activities (v19.8.0), UiPath.UIAutomation.Activities (v19.8.0-ce), (and some other irrelevant standard Packages) and have added UiPath.Web.Activities (v1.4.3), but when I search the Activity I don’t find it. Is there a later version of the UiPath.System.Activities?
Nice, thx, i have to be honest here, i didn’t pay attention to the existence of the “IS TRUE” activity, which one is it exactly? Edit: i see it above now