API 在 Enterprise Architect 中获取 StateNode 的类型

API to fetch the type of StateNode in Enterprise Architect

我有一个 activity 图表,其中包含初始节点和最终节点。都是StateNode类型,元类型是Pseudostate。如何从数据库或 API 的角度识别特定节点是初始节点还是最终节点?

您可以使用EA.Element.Subtype

来自documentation

Long

Notes: Read/Write

A numeric subtype that qualifies the Type of the main element

  • For Event: 0 = Receiver, 1 = Sender
  • For Class: 1 = Parameterised, 2 = Instantiated, 3 = Both, 0 = Neither, 17 = Association Class

If 17, because an Association Class has been created through the user interface, MiscData(3) contains the ID of the related Association; as MiscData is read-only, you cannot create an Association Class through the Automation Interface.

  • For Note: 1 = Note linked to connector, 2 = Constraint linked to connector
  • For StateNode: 100 = ActivityIntitial, 101 = ActivityFinal
  • For Activity: 0 = Activity, 8 = composite Activity (also set to 8 for other composite elements such as Use Cases) For Synchronization: 0 = Horizontal, 1 = Vertical

Note that there are many more Types than indicated in these examples.