}
for (String className : classes) {
Class clz = Class.forName(className);
Field factoryField = clz.getDeclaredField("stateMachineFactory");
factoryField.setAccessible(true);
StateMachineFactory factory = (StateMachineFactory) factoryField.get(null);
if (classes.size() == 1) {
return factory.generateStateGraph(graphName);
}
String gname = clz.getSimpleName();
if (gname.endsWith("Impl")) {
gname = gname.substring(0, gname.length()-4);
}
ret.addSubGraph(factory.generateStateGraph(gname));
}
return ret;
}