Page 1 of 1

Properly Creating a Connector in Java OpenAPI

PostPosted: Wed Aug 02, 2017 4:59 pm

In Cameo Systems Modeler, I am trying to create a connector programmatically from within a plugin using the Java OpenAPI. I have two Part Properties that I need to connect, each with their own specific ports. I am having trouble finding the proper code to perform this operation.

Currently what I am attempting is the following:
Code: Select all
Connector connector = project.getElementsFactory().createConnectorInstance();
List<ConnectorEnd> ends = connector.getEnd();

StereotypesHelper.addStereotypeByString(ends.get(0), "NestedConnectorEnd");

StereotypesHelper.addStereotypeByString(ends.get(1), "NestedConnectorEnd");

Once this connector is added to the model, however, it does not appear like connectors created using Cameo. Any help would be appreciated.

Re: Properly Creating a Connector in Java OpenAPI

PostPosted: Thu Aug 03, 2017 11:44 pm
by Rolandas

Maybe you could attach a screenshot, what is your connector like created in Cameo and what you get.
From code i see, you created a simple connector and added "NestedConnectorEnd" stereotypes, but did not set any "propertyPath" for it. So maybe you mean that is not same, as from Cameo it creates with the paths?
If it is so, you will need to set the "NestedConnectorEnd" tag value yourself, as right now there is no OpenAPI to automatically calculate it.

No Magic Support Team

Re: Properly Creating a Connector in Java OpenAPI

PostPosted: Fri Aug 04, 2017 9:27 am
Thanks for the response! Setting the propertyPath for the NestedConnectorEnd stereotype seems to have solved my problem.