Book a Demo

Author Topic: EA Object Model - how to get stereotype of Stereotyped Relationships  (Read 2975 times)

jk31434

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Hello,

I'm working on a plugin to export profiles to an xml. For my application, I cannot use the built-in "Publish Package as UML Profile".

The profiles that I will be exporting make frequent use of "stereotyped relationships" and "metarelationships" to constrain the profiles. I'm trying to output the details of the metamodel constraints.

In parsing the profiles, I cannot figure out how to get the stereotype that is used in the stereotyped relationship. What I mean is: I can get the ea_type = Dependency and stereotype = stereotyped relationship, but I cannot find the actual stereotype constraint. Shown in the image: https://imgur.com/a/rF4m6iD

How can I get this property from the object model? I'm writing my plugin in C# if it makes a difference.

Thank you in advance for your help.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile

jk31434

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: EA Object Model - how to get stereotype of Stereotyped Relationships
« Reply #2 on: January 15, 2020, 10:53:47 am »
Thank you very much for the response. After referencing the documentation I've tried several options, with no success.

I have the EA connector, and am trying to get the text value of the tagged value:
Code: [Select]
text = connector.TaggedValues.GetByName("stereotype")which returns a _ComObject. I've tried using the GetAttribute("stereotype"), and the Value property, but have been unsuccessful. Do you know what methods I need to call from here?


jk31434

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: EA Object Model - how to get stereotype of Stereotyped Relationships
« Reply #4 on: January 16, 2020, 01:33:38 am »
Thank you so much! For those wondering, my solution looked something like this:

Code: [Select]
foreach (EA.ConnectorTag t_value in connector.TaggedValues)
{
(use t_value.Value to get the stereotyped relationship type)
}