Why is "KillAllProcesses" in "If First Run" Sequence?


I am trying to understand the mechanism of the REframework!

In times of error in the “Process Transaction” state, it will direct to the Init state and reopen the applications. Am I right?

I think the reason to go back to the Init is to close all the already open applications and restart them to get rid of any chances of conflicting with each other. And this would be done by “KillAllProcesses”.

But in the Init state, “KillAllProcesses” is not supposed to work unless it is a first run, which means “KillAllProcesses” will work only once in the beginning of the process.

Then how can the process restart in a clean base when an error occurs?

Thank you!!!


1 Like

Hi @Daun,

You may use Element Exists activity in InitAllApplications (outside If First Run) and use If activity.
In Then section, attach and close the window that you to get rid of. Leave Else part blank.

Hope this helps.


1 Like

Hi @Daun
Ofcourse if you hit some error your application will stop right.Then running again your application will hit the KillProcesses and thats the rightway to do.

All the REFrameWork files, together with the documentation are found here: GitHub - UiPath/ReFrameWork: Robotic Enterprise Framework Template

cheers :smiley:

Happy learning :smiley:


When system exception occurs during processing phase the Init phase will be executed. Because the Config parameter has a value you will not enter First Run and not killing any used applications. As I see it is wrong. The Framework should encourage gracefully closing of all application, and then killing all processes after all system exceptions. System Exception basically means that you do not know the status and closing/killing must ensure that you are back to an expected and controlled status.
Maybe you could use the System Exception transaction action for this, but I would not prefer that.