This is an old question, but I just hit this and needed an answer to it as well and thought it might help others to answer it. I am using this as part of unit testing, where it IS extremely useful to just get to a particular state (I want to be sure that if at state A, if a sequence of events happens, it goes to state B - and still goes there after I tinker with the state machine XML!)
I finally found this code in SCXMLTestHelper and it worked. Just call it with the executor and the destination state.
public static void setCurrentState(SCXMLExecutor exec, final String id) throws IllegalArgumentException{
try {
exec.reset();
} catch (ModelException me) {
throw new IllegalArgumentException("Provided SCXMLExecutor "
+ "instance cannot be reset.");
}
TransitionTarget active = (TransitionTarget) exec.getStateMachine().
getTargets().get(id);
if (active == null) {
throw new IllegalArgumentException("No target with id '" + id
+ "' present in state machine.");
}
Set current = exec.getCurrentStatus().getStates();
current.clear();
current.add(active);
}