How to find whether database is connected after using Connect activity

Hi All,
I am trying to connect to DB2 db through ODBC using Connect activity, but I am not finding a way to tell whether the connection is successful (like IsConnected) in other programs. I searched forum but did not find a concrete answer. I will appreciate it if you can provide help on this.

if Process will go thru “Connect” activity it means you have Connection.:
I use Retry Scope:
After triggering activity BOOL variable changes to True, and I get a connection.

Thank you will try your approach, I think it works with Sql Server through sql client.

Still not clear to me how you are testing is true? is it like “czy_ok = true”?

It depends on the specific activity of Retry Scope.
If you have an activity / module / workflow in Retry Scope Action that ends with a business exception or an application error, you will not know about this error, because Retry Scope aims to properly execute its workflow. So, after an AE or BE error, RetryScope will repeat the Action call from the beginning as many times as you give it in the parameters.

This means that if the critical activity in the Retry Scope Action is successful, you can set the Boolean variable to True, then you know that the action has been performed.

The only error that shortens the Retry Scope is an error in the activity execution after reaching the limit of attempts.

In my case, I declare the Bool variable to False as the start of each activity attempt, successively executing the critical activity, and then changing the Bool variable to True.
The condition for leaving the Retry Scope loop is the True condition of the Bool variable.

I understood the logic, but how do you test boolean variable in condition of Retry Scope? Which activity you use. I did not find any activity to test in Retry scope condition to end the loop.