Ok. Do you have another (non-containment) reference from N1 to N2? (I suppose
so)
In this case you can try to still represent N2 as a border items (and child
elements) of N1. In .gmfmap model you have to specify this reference (N1->N2)
as a containment one for ChlidReference below N1 Node mapping pointing to
N2 NodeMapping. AFAIKSee current version of .gmfmap editor does not allow
you to do it (only containment references are visible in this place in .gmfmap
editor), but you can try setting appropriate value in text editor, or making
this reference containment, setting the value in .gmfmap editor and setting
this reference back to non-containment. Then you can try to generate code
ignoring all the validation errors reported to you.
Finally youâll get the situation then N2 is a child element of N1 on diagram
(and can be visualized as border items). In addition you have to correct
creation of N2 â from now it will be possible to create N2 nodes only âinsideâ
N1 nodes and appropriate container will not be assigned to newly created
N2 instances automatically by generated code. To fix this problem you can
either modify generated N2CreateCommand or modify EMF-generated N1 implementation
class (Collection returned from N1.getN2s()) to assign N2 to the appropriate
collection on attaching it to N1.
Iâve tried to describe possible solution for this situation using current
version of GMF here. In addition suggest you to review âborder itemsâ GMF
feature first to be sure this is what you want from the final diagram editor
first.
HTH
-----------------
Alex Shatalin