How to add Children of a Concept via Open API?

Hi,

now that I've finally managed to create a Concept and Editor via Open API, I would like to know how to add children to the concept. Unfortunately I only managed to insert references (see image below):

mpsReferences.png


Snippet of my code:
// create concept
node<ConceptDeclaration> stub = new node<ConceptDeclaration>();
  ⋮
// create children 
node<LinkDeclaration> link1 = new node<LinkDeclaration>(); 
link1.role.set("TestRole1"); 
link1.target.set(concept/FloatingPointConstant/);
link1.sourceCardinality.set(enum member value/Cardinality : 0..n/);
  ⋮
// add children
stub.linkDeclaration.add(link1);
prettyPrint();
What do I have to do, in order to add this under the children instead of the references section?


Thanks in advance!

Cheers,
Dennis
2 comments
You have to set the metaClass to enum/LinkMetaclass.aggregation, I believe. Reference type of links is the default for the LinkMetaclass enum.

Vaclav
0

Please sign in to leave a comment.