How to make process fault if condition is met

Hi everyone!

I have a process that goes through many try catches that set boolean values on whether a step in the process has failed or not. I would like the process as a whole to fault if all boolean values are set to false.

Is there a “Fault Process” Activity or something similar I can call if a condition is met?

Have you considered use of the Global Exception Handler?
https://studio.uipath.com/docs/global-exception-handler

With this, all exceptions are caught at a global level, you can rethrow those that you want to terminate the overall process.

Alternatively - you could look at Terminate Workflow

However, I would also suggest that you do not overuse the Try Catch activities. If you have built your workflow in an efficient way, you should be able to throw exceptions at key points in the process, rather than every individual task. It makes it easier to maintain and you have to ask yourself is it good practice to work that way. An experienced programmer would say no.

2 Likes

Thank you for your response!

I will take a look into the terminate workflow activity, because it seems that might be solution I need.

I chose to encapsulate 3 main steps in the process in try catches to allow the process to know which parts have failed, and attempt to debug the situations that most commonly cause it to fail. It can also continue onto the rest of the workflow without it having a domino effect and faulting all the rest of the process.

I’m sure there are more efficient ways to achieve this. I’m still in the very beginning of the UiPath Academy, so I have been winging most of my projects to the best of my current knowledge.

I will also look into the Global Exception Handler! Thanks for everything :slight_smile: