Как извлечь свойство entry/exit/do из операций состояния
Я хочу использовать интерфейс автоматизации Enterprise Architect (EA) для генерации кода из моей диаграммы StateMachine в соответствии с инфраструктурой StateMachine моей компании.
С каждым состоянием, которое я хочу точно знать, это операция входа или выхода. Пожалуйста, обратитесь к изображениям для более подробной информации.
Я использую фрагмент кода ниже (C#), чтобы получить метод действия типа, но, похоже, у него нет способа сделать это.
private void getElement(EA.Repository repository)
{
//repository.OpenDiagram(6);
EA.Diagram currentDiagram = repository.GetCurrentDiagram();
var objs = currentDiagram.DiagramObjects;
for (short obj_i = 0; obj_i < objs.Count; ++obj_i )
{
EA.Element elem = repository.GetElementByID(objs.GetAt(obj_i));
if(elem.Name == "State") //get only the state elments
{
var stateMethodList = elem.Methods;
for(short mt_i = 0; mt_i < stateMethodList.Count; ++mt_i)
{
EA.Method mt = stateMethodList.GetAt(mt_i);
EA.Parameter parameter = mt.Parameters.GetAt(index); //we can get the method's parameters using the EA.Method.Parameters attribute
string returnType = mt.ReturnType; //we can get the method's return type using EA.Method.ReturnType attribute
//I want to get method's action type but the mt seems to be the common method type, and have no attribute name EA.Method.Actions and something like that.
}
}
}
}
Я трачу много времени, чтобы найти метод действия, но пока не нашел его.