Attended Automation - How to Pause robot execution when screen is locked?


#1

Whenever there is screen saver or user does the screen lock (ctrl + alt + del). I want to pause the execution of attended bot.

Anyone have idea on how we to do this?

Currently, I am taking decision based on timeout exception on some activities. But Is there generic way to do this?

Note: I can implement Global Exception handler but it will require more effort for updating existing try catch in my workflows.


#2

Not sure if this will help you, but try this custom activity in your Parallel to see if screen is locked or screensaver is active and pause your WF. Once the screen is unlocked, it will resume the workflow.

ID = processes.Where(Function(s) s.ProcessName.ToLower.Contains("uipath.executor")).First().Id

image

VVaidya.PauseWF.Activities.1.0.7.nupkg (9.7 KB)

Use something like below as Isolated Workflow in your parallel activity, so that Uipath creates a separate thread and will be helpful for suspend/resume the WF and will not conflict with existing PID.

PauseWorkFlow.xaml (16.5 KB)

I built this in the past to pause and resume the wf using keyboard, but haven’t really finished it. I can’t guarantee this will work perfectly. Give a shot if you want.

image


#3

Thanks @vvaidya - I tried this way - I am using “Check Screen Lock” activity in Parallel activity, I am keep checking is screen is locked or not. If screen is locked then I am using messagebox… Once user will unlock machine user will click on “OK” in message box to continue.

Pause WF activity is not working but however message box will solve my purpose so Pause and Resume not required.

Thank you once again.


#4

This is for feedback purpose…What do you mean by Pause WF is not working? Did you get
any errors or WF is not pausing even if send the PID?

What is your studio version? I’m using 2018.3 and the pause is working fine,
but sometimes even if the pause workflow is isolated
the activity PID and WF PID are being same, in that case workflow does not
resume automatically.


#5

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.