I have a process that some times it fails and leaves the process un-finished.
I need for the process that if in cases of error to reset and start again. By reset, I mean to close all open applications related to the process and start again.
Therefore, the first question is, how can I prevent for the process to fail. Basically if the process fails then reset and start again.
The second question is, how can I check if an application is open and if it is close it. Is it possible to do it through task manager, vba or command prompt?
you can handle in main Try Catch and Finally, and in the Finally have a Close Application Sequence, you can use CloseApplication Activity ( you can specify ContinueOnError as True ) and TimeOutMs 2000 under Target, ( this would automatically handle if the application is opened it will close , else it will continue in 2 seconds
this Try Catch can be with in a While Loop , till it is successful on the process, you can keep restart the application within the bot
I’m not sure if I get all your comments. I’ve added the TryCatch activity, but I’m not sure what is the function of the Finally part. Initially I’ve used it to capture that there was an error (errorFound), but then the processes was not completing. I’ve moved the ErrorFound assignment to the Catches section, but I’m finding the the process ends rather than being permanently on.
I’m not sure I understand what you mention in relation to closing the activity.
I’m starting the robot with the following command (in case it makes any difference):
C:>“C:\Program Files (x86)\UiPath Studio\UiRobot.exe” /file:“C:\Users\FINROB1\Desktop\Share\OnDemand\Main.xaml” /target corp.aaaaaa.com\finrob1 /monitored
I’m not sure if I have a problem with the catch try or with how I’m initiating the robot.
I tried your process (attached), but it doesn’t seem to work . The process stills ends. Do I also need to loop the monitor events > CheckIfNewFile? I would think that this would need to run continuously.