简体   繁体   English

如何在状态机图中准确获取元素的类型Enterprise Architect

[英]How to get exactly type of element in state machine diagram Enterprise Architect

I want to find exactly type of element in StateMachine diagram (Initial State, Choice, EntryPoint, ExitPoint...) using EA.Automation interface. 我想使用EA.Automation接口在StateMachine图中找到元素的确切类型(初始状态,选择,EntryPoint,ExitPoint ...)。 see the pictures below: 参见下面的图片:

I used the code snippet below: 我使用了下面的代码片段:

void GetRealTypeOfNodes(EA.Diagram diagram)
    {
        var objects = diagram.DiagramObjects;
        foreach(EA.DiagramObject obj in objects)
        {
            EA.Element elem = Repository.GetElementByID(obj.ElementID); 

            MessageLogger.log(elem.Type, obj.ObjectType.ToString(), elem.Name, obj.GetType().ToString());
        }
    }

but what I get is: 但是我得到的是:

  • type of elements: "StateNode" - not as expected, Eg: Initial State or Choice 元素类型:“ StateNode”-不符合预期,例如:初始状态或选择

Could you help me to get what exactly I want? 您能帮我得到我想要的东西吗?

You need to inspect Element.SubType : 您需要检查Element.SubType

  • 11 = decision 11 =决定
  • 3 = initial 3 =初始

This might be documented somewhere in EA's help, or it might not. 这可能会在EA帮助的某个地方记录下来,也可能没有。 Issue the query 发出查询

SELECT name, ntype FROM t_object

in the SQL scratch pad. 在SQL暂存器中。 This will return the subType in ntype and you can find out missing ones. 这将返回subTypentype ,你可以找到失踪者。

According to my Inside book, StateNode s can take the values 3, 4, 10, 11, 12, 13, 14, 100 and 101 as SubType . 根据我的《内部书》, StateNode可以将值StateNode和101用作SubType But I have not listed, which is which. 但是我没有列出,这是哪个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用C#访问Enterprise Architect中的状态机图元素的操作和属性 - How to access Operations and Attributes of a State Machine diagram element in Enterprise Architect using C# 如何在 Enterprise Architect 中获取图表槽和加载项中的选定元素? - How to get the selected element in a diagram trough and Add-In in Enterprise Architect? 如何通过C#插件删除企业架构图中的连接器 - How to delete a connector in enterprise architect diagram through c# addin 在Enterprise Architect中设置图对象的位置和大小 - Set position and size of Diagram Objects in Enterprise Architect Enterprise Architect UML图,类模型 - Enterprise Architect UML Diagram, Class Model 如何使用 C# 访问状态机图的触发类型的图元素? - How to access Trigger type of diagram elements of a state machine diagram using C#? 通过加载项在企业架构图中显示标签 - Show Tags in Enterprise-Architect Diagram via Add-In 使用Enterprise Architect为C#WCF服务创建序列图 - Using Enterprise Architect to create a Sequence Diagram for a C# WCF Service Sparx Enterprise Architect版本10 - 从源创建类图 - Sparx Enterprise Architect Version 10 - Create Class Diagram from Source 新行未显示在Enterprise Architect的元素注释中 - New line not displayed in element notes of Enterprise Architect
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM