You can use the following API to retrieve a current State of a specified object. If the object has more than one active State, it recognizes which the runtime State is, and finds it.
public static State getState(Object_ object) { ... }
The following code fragment shows how to get the current state of a specified object using ALH API
ALH.getState(o);
It returns the Instance of the following
com.nomagic.uml2.ext.magicdraw.statemachines.mdbehaviorstatemachines.State.