I built an automise-project with an async action group. In this group there are some actions that wait for a variable to become true. To be sure the project ends within a defined period, I check for a timeout. If the timeout arises I raise an exception. The idea is that the async action group shall be abandoned.
My problem is that the catch block will not be called until the wait for variable action ends. Is there a way to avoid this problem?
For better understanding here is a really simple example:
When using Async Action Groups, only the immediate children are run simultaneously. This means in the example above this children of task2 will not be executed until both task1 and task2 have completed. The result of the Async action group will not be evaluated until all the child actions have completed.
In your case even if you replace task2 with a Raise Exception action and set a timeout of 10 seconds on the Wait or Variable action, the Async action group will always take 10 seconds to complete even though the exception is raised immediately.
Unfortunately this means in this situation there is no way of avoiding this problem.
that’s a pitty. Will there be a chance that during wait on variable automise will check for two variables? In case of the exception another variable could be set that says that the run has to be stopped. When wait for variable checks for var1 to be true or varStopRun to be true the exception could be handled in task1.
I think I found a workaround. In case the exception has to be raised varStopRun and the WatiForVariable will be set to true. Before continuing in task1 there has to be a check if varStopRun is set. It’s not as smart as just stopping the run by raising the exception. But I think that could work.