Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTo] How to specify source & target [meta]models?
[QVTo] How to specify source & target [meta]models? [message #490490] Thu, 08 October 2009 19:55 Go to next message
Tassilo Horn is currently offline Tassilo HornFriend
Messages: 93
Registered: July 2009
Member
Hi,

I'm trying to do my first QVTo transformation. I created a new QVTo
project with a Families2Persons.qvto. Then I declare the transformation
with

transformation Families2Persons(in srcModel:Families,
out destModel:Persons);

Unfortunately, Families and Persons cannot be found. "Type of
transformation parameter should be a model type".

The soure metamodel is in another project Families in
metamodel/Families.ecore, the model instance is in
models/example.families.

The target metamodel is in the project Persons in
metamodel/Persons.ecore.

I tried opening the project properties and added a Metamodel Mapping

Src: platform:/resource/Families/metamodel/Families.ecore
Tgt: platform:/resource/Persons/metamodel/Persons.ecore

but that doesn't help. Still the metamodels seem not to be found.

What am I doing wrong?

Bye,
Tassilo
Re: [QVTo] How to specify source & target [meta]models? [message #490560 is a reply to message #490490] Fri, 09 October 2009 07:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Tassilo,

You need to declare a modeltype for every metamodel you want to involve.
The modeltype uniquely identifies a metamodel by its nsURI.

Add modeltype declarations like bellow before your transformation
signature.

modeltype Families uses "<your-nsURI-1>";
modeltype Persons uses "<your-nsURI-2>";


What you have done so far only ensures that workspace located ecore files
become resolvable by nsURI. The modeltype declaration brings the elements
from the referenced metamodel into the scope of your transformation.

Try using QVTO editor templates, it also supports modeltype template which
can
even automate registration of workspace ecore files into your project.

Regards,
/Radek


On Thu, 08 Oct 2009 21:55:09 +0200, Tassilo Horn <thorn@fastmail.fm> wrote:

> Hi,
>
> I'm trying to do my first QVTo transformation. I created a new QVTo
> project with a Families2Persons.qvto. Then I declare the transformation
> with
>
> transformation Families2Persons(in srcModel:Families,
> out destModel:Persons);
>
> Unfortunately, Families and Persons cannot be found. "Type of
> transformation parameter should be a model type".
>
> The soure metamodel is in another project Families in
> metamodel/Families.ecore, the model instance is in
> models/example.families.
>
> The target metamodel is in the project Persons in
> metamodel/Persons.ecore.
>
> I tried opening the project properties and added a Metamodel Mapping
>
> Src: platform:/resource/Families/metamodel/Families.ecore
> Tgt: platform:/resource/Persons/metamodel/Persons.ecore
>
> but that doesn't help. Still the metamodels seem not to be found.
>
> What am I doing wrong?
>
> Bye,
> Tassilo
Re: [QVTo] How to specify source & target [meta]models? [message #490562 is a reply to message #490560] Fri, 09 October 2009 08:04 Go to previous message
Tassilo Horn is currently offline Tassilo HornFriend
Messages: 93
Registered: July 2009
Member
"radek dvorak" <dvorak.radek@gmail.com> writes:

Hi Radek,

> You need to declare a modeltype for every metamodel you want to
> involve. The modeltype uniquely identifies a metamodel by its nsURI.
>
> Add modeltype declarations like bellow before your transformation signature.
>
> modeltype Families uses "<your-nsURI-1>";
> modeltype Persons uses "<your-nsURI-2>";

Thanks, that does the trick!

> What you have done so far only ensures that workspace located ecore
> files become resolvable by nsURI. The modeltype declaration brings the
> elements from the referenced metamodel into the scope of your
> transformation.

I see.

> Try using QVTO editor templates, it also supports modeltype template
> which can even automate registration of workspace ecore files into
> your project.

Great.

Again, thanks for the explanations.

Bye,
Tassilo
Previous Topic:[ATL] How to return a null value from a helper
Next Topic:[QVTO] resolve issue with nested mappings
Goto Forum:
  


Current Time: Fri Apr 26 07:45:46 GMT 2024

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

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

Back to the top