Author Topic: How to find the destination of a Connector of a Realize (Python win32com API)  (Read 282 times)

keesbghs

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Background.

I'm investigating the possibility to read Requirements and "solutions" from an EA project. I am using Python with the win32com library. Much of the documentation I find from this Reference https://sparxsystems.com/enterprise_architect_user_guide/17.0/add-ins___scripting/reference.html. At the moment my Python code can see all the Packages, Elements and Connectors.

The problem.

However, given a Connector (https://sparxsystems.com/enterprise_architect_user_guide/17.0/add-ins___scripting/connector2_2.html) I cannot see what it is connecting to. The one end of the connector is obvious, that's the Element->Realize where I find the connector. What is the other end? There is a ConnectorEnd, but that doesn't help me (yet).

Strangely, when I digest the raw database I can see a t_connector table, which does have a Start_Object_ID and a End_Object_ID. I even wrote some Python code with SQLalchemy (which BTW is way faster than the win32com method). This basically gives the information that I need. But I don't want to have to mix SQL and win32com. I also have to modify Packages/Elements which I certainly don't want to change via SQL.

keesbghs

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Maybe I'm just confusing what Connector is. Maybe it is just the Realize itself that I should be looking at.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
A connector as a ClientID (ElementID of the source) and SupplierID (ElementID of the target)
This corresponds to Start_Object_ID and End_Object_ID (naming them the same wouldn't have been too easy ;D)

Geert

keesbghs

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Correct, these are the ones. Thanks

I should have payed more attention to the "ElementID" in "The ElementID of the element at the source end of this connector." I don't know why I didn't see that one before.