It used to work just fine. Then I upgraded my project to UiPath.System.Activities 23.4.4 and now the Check True throws a CheckPointException error on the third attempt of the Retry Scope. It seems to be related to the ErrorMessage property which you say is optional. But again the exception only happens on the third Retry.
Actually I think the error happens when it actually tries to return true. Reviewing the logs/output it looks like it was on the second retry when the Check True should have returned true that it threw the CheckPointException.
It throws the CheckPointException when the value Expression calculates to False. I tested it on
- 23.4.4
- 22.10.8
- 21.10.5
and the functionality seems to be the same. From which package version did you upgrade?
The Error Message being optional, seems to mean that if you don’t provide an ErrorMessage, it will throw a generic CheckPointException. If you do provide a message, it throws a CheckPointException with the message.
Before, it didn’t throw an exception at all. It shouldn’t throw an exception if the ErrorMessage isn’t filled in, because then it can’t be used in the condition block of a Retry Scope. I don’t remember what I upgraded from. Probably 22.x
Still it’s functioning like documented:
Is it possible that you are mixing with the Is True activity? That one doesn’t throw an exception (but unfortunately is not compatible with Windows projects).
Also, I don’t think there’s any problem in using the Check True activity in the condition block of the Retry Scope. If the Expression equals to False and an exception is thrown, it will just trigger a retry. When out of retries, the Retry Scope will also throw an exception. Or is there something I’m missing?
I’m not using Is True. You can see Check True in the screenshot I posted.
And the documentation isn’t correct. It shouldn’t throw an exception if the stated optional ErrorMessage property is left blank, because throwing an exception interferes with being able to use it as a condition of the Retry Scope.
That’s not how it works. The true/false result in the condition is what is needed. An Exception takes you out of the Retry Scope (and either faults your job or sends you to a Catch block if you’re inside a Try/Catch).
Is it in this thread? Can’t see it.
Just try it out. Place only a Check True activity in the condition block of a Retry Scope, and set the Expression to False. You’ll see the retries do happen. It’s the same as if an exception occurs in the action scope.
I happened to be playing around with the Check True activity and ran into this error again. I upgraded to System Activities 23.10.3 to see if the behavior has changed, and it has not.
I did notice this in the tooltip though:
So Check True returns true if the expression is true, but if the expression is false it throws an exception. It’s basically this:
And to me this makes no sense. I simply want Check True to return true or false, like the old Microsoft “Is True” activity did. That way it can be used in places where a “returns boolean” activity is needed.