Book a Demo

Author Topic: Composition link  created by API is not correct  (Read 4617 times)

whitehouse

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Composition link  created by API is not correct
« on: August 13, 2014, 08:34:19 pm »
Recently I tried to create a diagram with connector by API
EA.Connector newConnector = sourceElement.Connectors.AddNew("", "Aggregation");
newConnector.Subtype = "Strong";
newConnector.SupplierID = targetId;
newConnector.Direction = "Destination -> Source";
newConnector.Stereotype = "ArchiMate_Composition";
newConnector.Update();



It worked but in UI the arrow of relation is not same as created manually by UI.
When I check the data there is a difference t_connector has DestIsAggregate=2 (creating by UI).

Should we consider it as a defect or my missing something in my code?

Thank you,

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Composition link  created by API is not correc
« Reply #1 on: August 13, 2014, 09:05:46 pm »
Good question. The API does not offer access to the DestIsAggregate column. It also does not seem to make sense to have the info duplicate also in the subType (as Weak/Strong). Only Sparx can give an answer here.

What you could do is to Repository.Execute("UPDATE t_connector...") to tweak it after API creation so DestIsAggregate is set as expected.

q.
« Last Edit: August 13, 2014, 09:07:03 pm by qwerty »

whitehouse

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Composition link  created by API is not correc
« Reply #2 on: August 13, 2014, 10:17:32 pm »
Quote
Good question. The API does not offer access to the DestIsAggregate column. It also does not seem to make sense to have the info duplicate also in the subType (as Weak/Strong). Only Sparx can give an answer here.

What you could do is to Repository.Execute("UPDATE t_connector...") to tweak it after API creation so DestIsAggregate is set as expected.

q.
Thank you for your approach, it woks for me,
I think it is good to put these information in some where (Connector Class document)