Skip to main content



      Home
Home » Modeling » QVT-OML » Type references for nested EClasses
Type references for nested EClasses [message #1859499] Mon, 12 June 2023 11:59 Go to next message
Eclipse UserFriend
Hello,

let's say that there is an EClass called "Foo" in an Ecore model "bar". "Foo" is in the package "baz".

If I were to import the Ecore model "bar" in my qvto file with "modeltype BAR uses <platform path>", I should be able to reference the EClass "Foo" in mapping signatures with "BAR::baz::Foo". Now I ask myself, why isn't "baz::Foo" sufficient? Root-level EClasses do not need an explicit mention of the model they are in.

Here's a concrete example - I am currently working with the Palladio metamodel. Consider the following mapping signatures:

The mapping signature
mapping RepositoryDefinition::cRepositoryToPalladioRepository() : repository::Repository
is invalid because of unknown type repository::Repository, whilst "PALLADIO::repository::Repository" works fine.

The mapping signature
 mapping PlaceholderClass::cPlaceholderClassToPalladioDummyClass() : DummyClass 
is however valid, despite not explicitly giving the full path of "PALLADIO:DummyClass".

RepositoryDefinition and PlaceholderClass are EClasses from my local metamodel CM, the main procedure has inModel set as CM and outModel as PALLADIO.

Is this working as intended? Why is the model name necessary to resolve nested EClasses?

Thanks in advance.

Regards
K.

[Updated on: Mon, 12 June 2023 18:47] by Moderator

Re: Type references for nested EClasses [message #1859503 is a reply to message #1859499] Mon, 12 June 2023 15:50 Go to previous messageGo to next message
Eclipse UserFriend
Hi Kaan

I'm afraid Eclipse QVTo only supports fully qualified names (including the root package name, 'pcm' in this case) or simple names (completely omitting the package name because it is inferred from the metamodel imports).

If you want to import nested packages more concisely, try the #// operator when importing a metamodel : 'modeltype baz uses <platform path>#//baz'. The #// operator should resolve nested packages, but it only seems to be supported inside metamodel mappings as per https://bugs.eclipse.org/bugs/show_bug.cgi?id=376274 .


Kind regards
Christopher
Re: Type references for nested EClasses [message #1859508 is a reply to message #1859503] Mon, 12 June 2023 18:49 Go to previous messageGo to next message
Eclipse UserFriend
Hello Christopher,

I see. Thanks for your informative answer, I had no idea about the #// operator.

Best regards
K.
Re: Type references for nested EClasses [message #1859529 is a reply to message #1859508] Tue, 13 June 2023 13:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi

Firstly, there is no "#//" operator. Rather there is a "#" separator between URI and fragment. Within a fragment "/" separates hierarchical levels with a leading "/" starting at the root. I suspect that "//" starts at the root and then steps from the boring document level to the first element.

Secondly, I agree that baz::Foo should work by searching up the prevailing context hierarchy for a "baz" and then down to resolve "Foo" within the context.

Regards

Ed Willink

[Updated on: Tue, 13 June 2023 16:04] by Moderator

Re: Type references for nested EClasses [message #1859532 is a reply to message #1859529] Tue, 13 June 2023 16:09 Go to previous message
Eclipse UserFriend
https://bugs.eclipse.org/bugs/show_bug.cgi?id=582063 raised.
Previous Topic:Transformation involving UML profiles
Next Topic:Create QVTo project programmatically
Goto Forum:
  


Current Time: Sun Aug 31 11:12:49 EDT 2025

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

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

Back to the top