State Machine -- any way to output the name of the current State?

Is there a way to access the name of the current State in a state machine? I’m wondering if there is a property or method of the State Machine object that I can access. I’m creating some tests around a state machine, and would like to be able to know at any point what the current State is, for testing, logging and output. Is this possible?

Otherwise, I know I could create a global or state machine scope variable and update it as each state is reached. But I’m wondering if there is already something built in? Or perhaps a way to grab an activity’s parent container’s name, so that I wouldn’t have to type it out in full which may introduce error?

Hi @Terry_Marr,

In my knowledge as well, there is no direct activity to fetch the state bot is in currently.

But yes you can identify it using few methods you explained already or you can also follow the instructions in the below post for same:

Hope this helps.

Regards
Sonali

@Terry_Marr,

No inbuilt machnisum available, we will have to use workarounds you already mentioned.

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