Search code examples
enterprise-architect

Adding the source role and destination role for aggregation connector through addin


We have created Aggregation connector through Add-in where source and destination are of type class which has attributes in it.Now if we try to set the source role and destination role as attributes but its is not able to update it in EA.So which API can we use for setting the source role and destination role.

Please refer the image below:


Solution

  • To set connector roles through the API use the Connector.ConnectorEnd class and update its Role property.

    EA.Connector c = Session.Repository.GetConnectorByGuid("<theGUID>");
    EA.ConnectorEnd client = c.ClientEnd;
    Client.Role = "<theNameOfTheRole>";
    client.Update();
    

    Accordingly to update the supplier end

     EA.Connector c = Session.Repository.GetConnectorByGuid("<theGUID>");
     EA.ConnectorEnd supplier = c.SupplierEnd;
     supplier.Role = "<theOtherRole>";
     supplier.Update();
    

    In both cases you have to supply the right GUID or get the connector by other appropriate means. The role itself is just a string value and not related to any class attributes. The EA GUI however offers existing attribute names in the role name drop down.

    For more details please refer to the ConnectorEnd class in Sparx' Help.