Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EVL] Access to parent node
[EVL] Access to parent node [message #1274064] Fri, 21 March 2014 00:05 Go to next message
Johnny Soab is currently offline Johnny SoabFriend
Messages: 1
Registered: March 2014
Junior Member

I have a simple metamodel defined as follows:

class Model {
  val Root[1] root;

class Node {
  attr String name;
  val Child[*] childs;

class Root extends Node {

class Child {

class Mand extends Node, Child {

I can therefore create two nodes with a reference between them. How can I, with two nodes between them through EVL, access to the parent node? I tried "Node.self" but it gives me error.. is there any way?

Thank you!
Re: [EVL] Access to parent node [message #1274414 is a reply to message #1274064] Fri, 21 March 2014 12:42 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 1520
Registered: July 2009
Location: York, UK
Senior Member

Hi Johny,

The quick and dirty way is to use EMF's eContainer() operation (i.e. self.eContainer()). The proper way is to define an opposite reference in your metamodel e.g.

class Node {
attr String name;
val Child[*]#parent children;
ref Child#children parent;

Previous Topic:How to refer to UML profile within ETL module
Next Topic:sortedBy
Goto Forum:

Current Time: Thu Apr 26 21:26:10 GMT 2018

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

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