Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Daiim on October 02, 2018, 11:15:10 pm

Title: Create Connector to Connector via API
Post by: Daiim on October 02, 2018, 11:15:10 pm
Hi there,

I want to create an connector from an element to another connector. But providing the ConnectorID as SupplierID does not work. Any Ideas how to handle this case using the API?

Code: [Select]
IDualElement element = [...] // fetch element
IDualConnector connector = [...] // fetch connector

//--- create connector to connector
IDualConnector traceReference = element.Connectors.AddNew("", "Trace");
traceReference.SupplierID = connector.ConnectorID;
traceReference.Update();  // << crash
Title: Re: Create Connector to Connector via API
Post by: Geert Bellekens on October 02, 2018, 11:34:31 pm
IIRC there is some kind of dummy end object created to represent the connector, probably using t_xref.

You will probably have to replicate this somehow, using the backdoor operation Repository.Execute(SQL)

Geert