[QVTo] How to specify source & target [meta]models? [message #490490] |
Thu, 08 October 2009 19:55  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
"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
|
|
|
Powered by
FUDForum. Page generated in 0.03678 seconds