Book a Demo

Author Topic: Association Class  (Read 3501 times)

Correia

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Association Class
« on: August 23, 2011, 11:54:38 am »
Hi
I'm trying to find out, from an Element which is an association class, its related connector (an association m:n  between 2 other classes).
The user's guide says that AssociationClassConnectorID attribute from Element class "contains the Connector ID of the respective Association connector".
Which method from Element class allows me query the AssociationClassConnectorID attribute?
Thanks
A.Correia


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Association Class
« Reply #1 on: August 23, 2011, 04:41:50 pm »
You get the connector id from the property Element.AssociationClassConnectorID and then you use Repository.GetConnectorByID to get the actual connector object.

Geert

Correia

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Association Class
« Reply #2 on: August 23, 2011, 09:23:59 pm »
Hi Geert

Thank you for your reply.
I'm using java and I think I cannot access AssociationClassConnectorID property directly. Probably I should use a method from Element class.
I've tried all for an instance of Association Class that I have in a classs diagram and none of them return the connector ID that I need in order to use Repository.GetConnectorByID
Regards
Correia

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Association Class
« Reply #3 on: August 23, 2011, 09:37:19 pm »
Hmm, I don't think using java or .net should make a difference.
Are you sure you're on the latest version (9.0.908) I think this property is fairly recent.

Geert

Correia

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Association Class
« Reply #4 on: August 25, 2011, 11:10:45 am »
In fact I'm using the latest version (9.0.908). Even so I still don't know which Element method give me access to the AssociationClassConnectorID property.
Anyway, I discovered a workaround for the problem by iterating trough all connectores and recording   in a java Collection a subset of them which were related with AssociationClasses. The connector should be included in the subset if  the query to the Connector.GetTransitionEvent() method returns an  Association Class ID  (which is actually the same as an Element ID).
After the previous operation anytime we need to access the ConnectorID of the Association Class we  simply have to query the java collection.
Thanks for your time
Correia