Stop Execution of a Process for an Attended Robot by using Hotkeys and not the Robot Tray

Is it possible to trigger a Stop of the execution of a process on an Attended Robot without using the Robot Tray and on the same time let the robot finish current transaction and then exit?

One of the way to achieve the Stopping of the execution of a process on an Attended Robot without using the Robot Tray, could be by using the Monitor Events activity used with a Hotkey Trigger activity inside a Parallel activity along with a Do While activity, which will execute an Invoke Workflow until the hotkey is not pressed.

Bellow is a small example: 

·         Create a boolean variable, lets call it ContinueOrNot and assign the value of True

·         Add a Parallel activity bellow 

·        On one side of the Paralel add  a Monitor Event activity, inside it a Hotkey Trigger and in the Event Handler another assign activity where ContinueOrNot gets the value of False (the hotkey was pressed and the workflow should not continue the next loop/transaction) and another Terminate Workflow activity (the "Reason" field can be fill with any type of reason)

·         On another side add a Do While activity with the condition ContinueOrNot (will execute while the ContinueOrNot  is True)   and inside an Invoke Workflow activity with the process that needs to be executed.

·        The activities are in parallel, so even if the hotkeys was pressed it will still finish the last transaction and only after the transaction will be processed it will check the value of ContinueOrNot which is False and will exit the do while, will trigger Terminate workflow and the workflow will stop the next execution/transaction
 

Image_2020-04-30_19-16-26.png