ECore diagram reference creation [message #717630] |
Sun, 21 August 2011 19:57 |
janpojer Messages: 40 Registered: July 2011 |
Member |
|
|
Hi,
My goal is to be able to create an editor, where I can create an instance of Item and as its child create another Item as an instance of the same very same class (ie. Father - Son relation: both Son and Father are instances of the same class - Man and i need to connect them using, lets say, hasSon relation). So in the ecore model i need to create a reference to the same class. But whenever i do create such refenrece in the ecore diagram and set the container property to true (so i can model it using emf editor), then after reloading the .genmodel it throws the following error:
A containment reference of a type with a container feature xxx that requires instances to be contained elsewhere cannot be populated.
Any idea how to workout this "self reference" relation?
Thanks in advance
Jan
[Updated on: Sun, 21 August 2011 19:58] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: ECore diagram reference creation [message #717958 is a reply to message #717945] |
Mon, 22 August 2011 20:07 |
janpojer Messages: 40 Registered: July 2011 |
Member |
|
|
Ok, I will try to explain more in depth.
Using the ecore file I am trying to define necessary means to create an editor for my so called Domain Knowledge. Simply put it is a collection of functions where each functions can have some incoming and outgoing ports. But also it can hold another function. This should signal inheritance relation. So to sum it up I would like to be able to create a child item Function within Function.
To demonstrate in on real data, lets say i wanna fill my domain knowledge with Bluetooth sensor with one incoming and one outgoing port, my editor would look as follows:
DK
|- Sensor: Bluetooth Sensor 1
|- IncomingPort: Port 1
|- OutgoingPort: Port 2
But also, I want to be able to have the ability to add advance Bluetooth sensor that would have one more port but would share the other ports (inherit it). So i want my diagram to look like as follows:
DK
|- Sensor: Bluetooth Sensor 1
|- IncomingPort: Port 1
|- OutgoingPort: Port 2
|- Sensor: Advanced Bluetooth Sensor
|- IncomingPort: Port 3
What I am struggling with is to be able to create a reference in my ecore model that points at the same type... (To have the Sensor type hold 0 to many other instances of Sensor type) I can create the reference, but once I set the containment property of the reference to true (to make it appear in create child menu) I get on reloading .genmodel the error mentioned on top...
Does it make more sence now?
[Updated on: Mon, 22 August 2011 20:10] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03749 seconds