Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EVL] How to acces a element in my model
[EVL] How to acces a element in my model [message #989174] Wed, 05 December 2012 00:44 Go to next message
Sebastian Rivera is currently offline Sebastian Rivera
Messages: 7
Registered: December 2012
Junior Member
Hi , first I attached a picture of my metamodel to explain what I need help with

From the picture you can see that a navigational class has attributes and operations.So I don't know how to make or the syntax to create a constraint that checks all the navigational attributes associated with a specific navigational class. Like check for each navigational class all of navigational attributes associated with it.

Thanks in advance for your help

pd: sorry for my English, not my native language Razz
Re: [EVL] How to acces a element in my model [message #989279 is a reply to message #989174] Wed, 05 December 2012 13:48 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 881
Registered: July 2009
Senior Member
Hi,

Would the following work?

context NAVIGATIONALATTRIBUTE {

constraint SomeConstraint {
check: ...
}

}

Cheers,
Dimitris
Re: [EVL] How to acces a element in my model [message #989343 is a reply to message #989174] Wed, 05 December 2012 18:17 Go to previous messageGo to next message
Sebastian Rivera is currently offline Sebastian Rivera
Messages: 7
Registered: December 2012
Junior Member
not really,I want to do something like this (i know the sintax and the code its not right)

context NAVIGATIONALCLASS {

constraint SomeConstraint {
check: self.name = "something" and self.NavigationalClassNavigationalAttribute.name="anotherthing";

}

}

Something like that so i can check all the navigational attributes associated with a navigational class in specific and check the value name in both the class and the attribute.

I hope that clarifies what i'm trying to do

thx for the help
Re: [EVL] How to acces a element in my model [message #989351 is a reply to message #989343] Wed, 05 December 2012 18:52 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 881
Registered: July 2009
Senior Member
Hi,

If you need to check only the attributes of a specific class (X) you could use a guard to specify this e.g.

context NAVIGATIONALATTRIBUTE {

constraint SomeConstraint {
guard: self.eContainer()./*this navigates to the container NAVIGATIONALCLASS*/.name = "X"
check: ...
}

}

Cheers,
Dimitris
Re: [EVL] How to acces a element in my model [message #989357 is a reply to message #989351] Wed, 05 December 2012 20:10 Go to previous messageGo to next message
Sebastian Rivera is currently offline Sebastian Rivera
Messages: 7
Registered: December 2012
Junior Member
I think thats it , i will try it later since i cant at the moment and will comment back.

Thx alot for all the help
Re: [EVL] How to acces a element in my model [message #989594 is a reply to message #989357] Thu, 06 December 2012 22:11 Go to previous messageGo to next message
Sebastian Rivera is currently offline Sebastian Rivera
Messages: 7
Registered: December 2012
Junior Member
it worked perfect
I got a last question, its there a place where i can check all the things i can use with evl like the .eContainer()? , because i never knew that existed.

Thx alot again
Re: [EVL] How to acces a element in my model [message #989595 is a reply to message #989594] Thu, 06 December 2012 22:17 Go to previous message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 881
Registered: July 2009
Senior Member
Hi Sebastian,

eContainer() is a method of EObject which is the interface that all EMF model elements conform to (see http://download.eclipse.org/modeling/emf/emf/javadoc/2.4.3/org/eclipse/emf/ecore/EObject.html for more methods)

Cheers,
Dimitris
Previous Topic:Cancel EVL validation that is in progress
Next Topic:[Eugenia] Defining icon as link decoration
Goto Forum:
  


Current Time: Wed Oct 22 21:52:21 GMT 2014

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

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