I’m not seeing many others ask questions on this, and perhaps it’s because I’m the first person to try.
I am building an unattended foreground bot using a modified REFramework model. The application that I am automating is old and unstable, and will often crash unexpectedly. When it does so, it is typically very good at presenting a popup message with the crash details. A lot of these crashes are outside of my control, and the only solution is to close the app entirely and restart it.
This sounds to me like an excellent use for a Trigger, specifically the Activities - Application Event Trigger (uipath.com). I should be able to set up this trigger inside of a trigger scope and have it watch for the popup to appear. I am recording this popup with the Object Repository and have the Event Type set to “Appeared”. I have set this up in a workflow I’m going to call a Responder (stealing the name from MediatR) to avoid confusion in the future.
The problem comes when I try to use this trigger within my app. Using an Invoke Workflow activity to invoke this responder allows it to enter the trigger scope, but then it blocks waiting for the trigger. Using a Run Local Triggers activity also blocks. This means my app never runs because it’s waiting on an event will never fire.
In small scale tests, using a parallel activity and invoking the Responder next to my State Machine seems to work, if unreliably. This method seems to introduce a lot of unexpected behavior and instability into my application.
My desired setup would be to treat this something like the UiPath Forms feature, where the main application is able to run while the Local Triggers wait for their predefined event. I want the State Machine to operate as it would, being interrupted in the case of a Local Trigger execution and allowing the trigger to complete before continuing.
What is the recommended way, if any, to integrate Local Triggers with Unattended Processes in a seamless manner?