Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EOL fully qualified name
EOL fully qualified name [message #1834830] Wed, 18 November 2020 16:50 Go to next message
Ludovico Iovino is currently offline Ludovico IovinoFriend
Messages: 33
Registered: July 2019
Member
Hi all, I have a problem with eol and a specific example.

I have an ecore with this specification:
p
p1
A
p2
A

where p1 and p2 are subpackages of p and both contain a metaclass A.

If I use an EOL expression like M.getAllOfType( self.name) where M is a model conform to the metamodel above I get all the instances including both the classes as type. Is there a way to specify the A metaclass object and not the name in this operation?

thanks a lot
Re: EOL fully qualified name [message #1834833 is a reply to message #1834830] Wed, 18 November 2020 18:10 Go to previous messageGo to next message
Alfonso de la Vega is currently offline Alfonso de la VegaFriend
Messages: 18
Registered: January 2016
Junior Member
Hello Ludovico,

As others have suggested in the past [1], avoiding having several packages in the same metamodel can prevent the apparition of bugs with existing tools (I guess that can be extended for having EClasses with the same name!).

If you currently cannot avoid that metamodel structure, you can use "::" separators to specify a fully qualified name including all nested packages (e.g. "p::p1::A").

I have put together an example in the newly available playground for Epsilon [2] (thank you for any feedback on that!). In my case, the second query (all instances of type "A", unqualified) only shows instances of the first A class found in the metamodel, instead of showing all of them. When using the qualifiers you can get the instances of the precise type you are interested in.

Regards,
Alfonso

[1] https://eclipsesource.com/blogs/2013/03/19/emf-dos-and-donts-5/
[2] https://bit.ly/3pHQgvu

[Updated on: Wed, 18 November 2020 19:52] by Moderator

Report message to a moderator

Re: EOL fully qualified name [message #1834861 is a reply to message #1834833] Thu, 19 November 2020 09:48 Go to previous message
Ludovico Iovino is currently offline Ludovico IovinoFriend
Messages: 33
Registered: July 2019
Member
thanks Alfonso, I'll try.
Previous Topic:API to access mapping definition
Next Topic:Bag equality implementation seems unintuitive
Goto Forum:
  


Current Time: Thu Mar 28 13:27:35 GMT 2024

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

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

Back to the top