Triggers and State Machines

Hi all,

How do you use a trigger with a state machine? Attempting to do so renders an error that triggers are not allowed inside a state machine, but this raises the question about what the trigger slot is for if not triggers.

Using a trigger scope within the trigger slot does not create this error, but I have not attempted to run code in this state. It also appears you can use an invoke workflow activity targeting an activity containing a trigger here, but I have also not tried this.

What I’d like is that if a certain condition is triggered, the state machine would use that branch.

As a bonus question, can this be treated like an interrupt, similarly to if a user were to press CTRL+C in a console app? In some situations, I would like the branch to be taken immediately, even if the State hasn’t completed its block of code yet.

Pls, read the tooltips it has the issue details.

image

I was able to sort of put together an answer based on this video.

It seems my confusion was the result of a name collision. Triggers in transitions are not the same thing as Triggers which react to events.

It also seems I was able to indirectly answer my question - I cannot have a UiPath State Machine transition based on a trigger.

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