Book a Demo

Author Topic: C# EA.Interop: determine connected target attribute of a connector  (Read 5076 times)

exsypher

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Hi guys,

i have a connector linked to a attribute of an interface. I am trying to determine the attribute to which the connector is linked.
I just managed to get the target by GetElementById(Connector.SupplierID) but this returns only the Interface element.

When I open the property window of the connector I can see the Connector Properties and there it has a "Target" with the value <InterfaceName>.<AttributeName> (which i am trying to get).

I'd appreciate any help, thanks alot.

Kind Regards

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1403
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: C# EA.Interop: determine connected target attribute of a connector
« Reply #1 on: February 13, 2018, 11:30:43 pm »
Hi,

The attribute is probably associated via the "Link to element feature". To find this attribute, you need to look at the StyleEx value of the connector (best is to query the t_connector table).

Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


exsypher

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: C# EA.Interop: determine connected target attribute of a connector
« Reply #2 on: February 13, 2018, 11:44:43 pm »
Hi,

thanks for the quick reply. Yes it is done by "Link to Element Feature". Can you pls explain in detail what this t_connector is and how to access the linked attribute with it? I couldnt find it within the Connector class or anywhere and StyleEx seems to be just a string, I couldnt find out what to do with it.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: C# EA.Interop: determine connected target attribute of a connector
« Reply #3 on: February 13, 2018, 11:54:32 pm »
Hello,


t_connector is the table in the EA database. In the API, it essentially corresponds to the Connector class. But for what you're after, I don't think you need to bother querying the database.

The "link to element feature" is not core UML, so it's not reflected in any of the regular Connector properties. Instead, you have to decode StyleEx (I don't think you need to query the database to retrieve this, there's a .StyleEx property in the API).

As for decoding it, that's a little complicated, but not too hard. Have a search through the forum -- it's been discussed many times before.


/Uffe
My theories are always correct, just apply them to the right reality.

exsypher

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: C# EA.Interop: determine connected target attribute of a connector
« Reply #4 on: February 14, 2018, 12:24:22 am »
Alright got it thank u