Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Child Reference Containment Feature
Child Reference Containment Feature [message #216106] Thu, 22 January 2009 10:52 Go to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 189
Registered: July 2009
Senior Member
I want to place a Node(NodeA) inside a Compartment(Slice). But I get the
error message "'Containment Feature' must be owned by 'Domain Meta
Element' or its super type of this reference parent Node Mapping".

Does any one know how to solve the problem?

The class model is as follows:

class Network contains:
- nodes:NodeA (Containment)
- slices:Slice (Containment)

class NodeA
- network:Network (Reference)
- slice:Slice (Reference)

class Slice:
- nodes:NodeA (Reference)
- network:Network (Reference)

The top node reference at gmfmap file looks like this:

<nodes>
<containmentFeature
href="psc.ecore#//Network/slices"/>
<ownedChild>
<domainMetaElement
href="psc.ecore#//Slice"/>
<labelMappings>
<diagramLabel
href="psc.gmfgraph#SliceCompartmentLable"/>
</labelMappings>
<tool
xsi:type="gmftool:CreationTool"
href="psc.gmftool#//@palette/@tools.0/@tools.2"/>
<diagramNode
href="psc.gmfgraph#SliceContainer"/>
<children
compartment="//@nodes.1/@ownedChild/@compartments.0"
referencedChild="//@nodes.1/@ownedChild/@children.0/@ownedChild ">
<containmentFeature
href="psc.ecore#//Network/nodes"/>
<ownedChild>
<domainMetaElement
href="psc.ecore#//Node"/>
<tool
xsi:type="gmftool:CreationTool"
href="psc.gmftool#//@palette/@tools.0/@tools.1"/>
<diagramNode
href="psc.gmfgraph#SliceNode"/>
</ownedChild>
</children>
<compartments
children="//@nodes.1/@ownedChild/@children.0">
<compartment
href="psc.gmfgraph#SliceContainerCompartment"/>
</compartments>
</ownedChild>
</nodes>
Re: Child Reference Containment Feature [message #216384 is a reply to message #216106] Mon, 26 January 2009 16:48 Go to previous messageGo to next message
Vincent Grimault is currently offline Vincent GrimaultFriend
Messages: 2
Registered: July 2009
Junior Member
I have the same problem.

Can anyone help?
Re: Child Reference Containment Feature [message #216878 is a reply to message #216106] Fri, 30 January 2009 12:58 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Martin,

instead of:
> <containmentFeature href="psc.ecore#//Network/nodes"/>

you have to use:
<containmentFeature href="psc.ecore#//Slice/nodes"/>

(if Slice/nodes reference is a containment reference).

-----------------
Alex Shatalin
Re: Child Reference Containment Feature [message #216908 is a reply to message #216878] Fri, 30 January 2009 13:21 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 189
Registered: July 2009
Senior Member
Hi Alex,

no unfortunately Slice/nodes is not a containment feature. The containment is Network/nodes.
A modified solution from posting "Shortcut for 1:1:n containment reference chains in
NodeMapping/ChildReference" should help me.

thanks, Martin


Alex Shatalin wrote, On 30.01.2009 13:58:
> Hello Martin,
>
> instead of:
>> <containmentFeature href="psc.ecore#//Network/nodes"/>
>
> you have to use:
> <containmentFeature href="psc.ecore#//Slice/nodes"/>
>
> (if Slice/nodes reference is a containment reference).
>
> -----------------
> Alex Shatalin
>
>
Re: Child Reference Containment Feature [message #216915 is a reply to message #216908] Fri, 30 January 2009 13:34 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Martin,

In this case you can still specify Slice/nodes as a containment feature,
ingnore warnings, do generate code and then modify generated code (corresponding
creation command) to put newly created node into the proper containment feature.

-----------------
Alex Shatalin
Previous Topic:How to execute diagrams validation programmatically?
Next Topic:cotaintment reference
Goto Forum:
  


Current Time: Tue Mar 09 08:46:47 GMT 2021

Powered by FUDForum. Page generated in 0.01586 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top