Exit the process if condition met

Hi,

When my boolean is True I want to Close the SAP and exit the process. I dont know which activity should I choose. Terminate Workflow? If yes, what should be in Exception/Reason?

Thanks for help :slight_smile:

@Marek_Matuszak

You want to throw an exception? then you can use throw activity in that place

new BusinessRuleException("Your Exception Reason")

This Exception Reason will be shown in Orchestrator

Hi @Marek_Matuszak,

There are different activities for this scenario.
You can use kill process, Close application and in the properties, you have to give the ‘.exe’ file.

Thanks,
Bhushan

Hi @Marek_Matuszak

In your If Condition No need to Write “=True”

The Img Exists itself return Boolean Value

So just remove =True and let the variable be as it is “job_bool_exists”

And For exiting from your workflow use Kill Process or Close Application Activity.

Hope this may help you to solve your issue

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

But I dont want to close or kill UiPath. I just want my robot to stop working and give me the log “No results found or sth like this”.

Hi @Marek_Matuszak

Have you try using Break Activity der ??

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

hmm, break can work only for loops as I see. Kill Process sounds good but what should be typed as a Process Name? Has my process a name?

Hi @Marek_Matuszak

Yeah I forgot that you are not using loop. Sorry for that

Within the task manager you will see the process names like below SS
image

So you may Choose which process you want to kill and put that process name within Property

For eg :-
I want to kill Firefox Browser Process so i will put it as “Firefox”
image

Hope this may help you to solve your issue
Mark as solution if this helps you and like it :innocent:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer: