Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Aric Rohner on April 10, 2014, 06:25:38 am

Title: Why would connector DiagramID always be 0?
Post by: Aric Rohner on April 10, 2014, 06:25:38 am
Anyone know why the connector DiagramID always has a value of 0 in the following function?  Is there an alternative way to find out what diagram a connector is shown on?

Code: [Select]
function describeConnector( cnxn ) {
      
     var cnxn as EA.Connector;
     Session.Output( cnxn.ID + ", " + cnxn.Stereotype + ", " + cnxn.DiagramID );
}

Here is a sample of the output.
Code: [Select]
ConnectorID=1932, Stereotype=RDA_Includes1..1, DiagramID=0      
ConnectorID=1954, Stereotype=RDA_RefersTo, DiagramID=0      
ConnectorID=1948, Stereotype=RDA_Includes0..1, DiagramID=0      
Title: Re: Why would connector DiagramID always be 0?
Post by: Mauricio Moya (Arquesoft) on April 10, 2014, 06:44:10 am
DiagramID property is Long type, but a connector can be shown in several diagrams, so it seems DiagramID is not the suitable way to find the diagram(s) in which a connector is shown.
Title: Re: Why would connector DiagramID always be 0?
Post by: qwerty on April 10, 2014, 08:22:57 am
MMoya is right. There's quite some rubbish left in the API. To find out where a connector is shown you need to

Very tedious.

q.
Title: Re: Why would connector DiagramID always be 0?
Post by: Eve on April 10, 2014, 09:10:34 am
MMoya is partially right.

It's not used except for Communication Messages and Sequence messages. These messages only appear on one diagram (because they are representing a single sequence each) and will have their diagramid set.
Title: Re: Why would connector DiagramID always be 0?
Post by: qwerty on April 10, 2014, 07:13:01 pm
Quote
MMoya is partially right.

It's not used except for Communication Messages and Sequence messages. These messages only appear on one diagram (because they are representing a single sequence each) and will have their diagramid set.

Ha! Some new info for my Inside book :)

q.