Book a Demo

Author Topic: Can I access the Member Type for a ConnectorEnd?  (Read 2992 times)

PhilG

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Can I access the Member Type for a ConnectorEnd?
« on: October 08, 2007, 01:34:13 am »
Hi,

I'm using C# to connect to the Enterprise Architect API.  

I've managed to access the classes and connectors.  I'd like to access the Member Type of a SourceRole (ConnectorEnd), but I can't find it in the object model.  I see it's stored in the database t_connector table as SourceElement.

Is there any way to access the MemberType?

Thanks in advance,

Phil

thomaskilian

  • Guest
Re: Can I access the Member Type for a ConnectorEn
« Reply #1 on: October 08, 2007, 01:53:28 am »
You need to load it like (perly) $rep->GetElementByID  ($con->SupplierID)

PhilG

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Can I access the Member Type for a ConnectorEn
« Reply #2 on: October 08, 2007, 03:50:15 am »
Hi Thomas,  
Thanks for the quick reply.

I've tried your example, here it is in C# where con is a Connector object :
Code: [Select]

Element el = CurrentRepository.GetElementByID(con.SupplierID);


To put it in to context, I have a Market class and a MarketProduct class.  Market has a collection of MarketProducts.

The element returned, using the above code, is the class (named Market) at one of the connector, but what I'm trying to obtain is the name of the MarketProducts collection class.  The Source/Target Role in the Aggregation Links properties dialog allows the entry of a Member Type (the last text box on the Source/Target Role tab).

I have defined a Member Type "ISet<MarketProducts>"  When I generate the code for the class having the aggregation collection (using the EA built-in code generation) I correctly get :
Code: [Select]

public class Market {
/// <summary>
/// Market Notes
/// </summary>
 public ISet<MarketProducts> MarketProds;
}

I want to generate the same thing, using the Automation Interface.

How can I, using the Automation Interface, obtain the Member Type of my Aggregation Link's Source Role?  I assumed it would be accessible as an attribute of the  Connector.ClientEnd but I don't see MemberType ( or SourceElement as it's refered to in the t_connector table)

Thanks again in advance,

Phil

thomaskilian

  • Guest
Re: Can I access the Member Type for a ConnectorEn
« Reply #3 on: October 08, 2007, 09:07:07 am »
You should be able to find anything you need in you el-class. Not sure how your Market class is modelled in UML (not a C guru).