[QVTo] mapping operation not executed [message #555353] |
Thu, 26 August 2010 12:07 |
2bro2b Messages: 12 Registered: August 2010 |
Junior Member |
|
|
hi,
i recently started with Model Transformation using QVT Operational.
I´m facing the following problem now:
i successfuly registered the source and target metamodels in Eclipse, both are in ecore.
i started to define a mapping operation like this one:
main(){
aadl_source.objects()[AadlSpec]->map AadlSpecMapping();
}
mapping AadlSpec::AadlSpecMapping() : SimulationConfig{
}
I have a suitable source Model URI and can start the transformation.
But the mapping operation "AadlSpecMapping" is never executed.
I debugged into the transformation and the source Model "aadl_source" shows that it conatins an Object with the value "AadlSpec". I can also get alle the objects out of the source model in a variable with the following commands
var AllObjects : Set(Element);
AllObjects := aadl_source.objects();
it seems like i can just not access the object "AadlSpec".
Has anyone an idea ?
Thanks in advance
[Updated on: Thu, 26 August 2010 12:11] Report message to a moderator
|
|
|
Re: [QVTo] mapping operation not executed [message #555375 is a reply to message #555353] |
Thu, 26 August 2010 12:58 |
Eclipse User |
|
|
|
Originally posted by: dhendriksREMOVE_THIS.tueREMOVE.THIS.nl
Hi 2bro2b,
could you post the complete qvto file? Especially the transformation
header (input/output) and the metamodel imports are of interest.
For instance, I had the same problem when using platform URIs instead of
the namespace URIs for the metamodels.
Also, if the source and target language are different, but have the same
class names, it may be that the [AadlSpec] points to the target language
instead of the source language. I always forget which one is the default.
A side node: do you want to translate all objects of type AadlSpec or
only the root objects of that type? You currently do the former. For the
later, one would use .rootObjects() instead of .objects(), which I think
is the more common approach.
Dennis
2bro2b wrote:
> hi,
>
> i recently started with Model Transformation using QVT Operational.
>
> I´m facing the following problem now:
> i successfuly registered the source and target metamodels in Eclipse,
> both are in ecore.
>
> i started to define a mapping operation like this one:
>
>
> main(){
> aadl_source.objects()[AadlSpec]->map AadlSpecMapping();
> }
>
> mapping AadlSpec::AadlSpecMapping() : SimulationConfig{
> }
>
>
>
> I have a suitable source Model URI and can start the transformation.
> But the mapping operation "AadlSpecMapping" is never executed.
> I debugged into the transformation and the source Model "aadl_source"
> shows that it conatins an Object with the value "AadlSpec". I can also
> get alle the objects out of the source model in a variable with the
> following commands
>
>
>
> var AllObjects : Set(Element); AllObjects := aadl_source.objects();
>
>
>
> it seems like i can just not access the object "AadlSpec".
>
> Has anyone an idea or an advice ?
|
|
|
Re: [QVTo] mapping operation not executed [message #555417 is a reply to message #555375] |
Thu, 26 August 2010 14:27 |
2bro2b Messages: 12 Registered: August 2010 |
Junior Member |
|
|
thanks for your fast answer.
Here is a first attempt on accessing objects in the source model:
modeltype AADL_source uses 'http:///AADL/core';
modeltype Target_Model uses 'http://target';
transformation AADL_trans1(in aadl_source: AADL_core, out target: Target_Model);
main(){
aadl_source.objects()[AadlSpec]->map AadlSpecMapping();
-- get all Objects
var AllObjects : Set(Element);
AllObjects := aadl_source.objects();
}
mapping AadlSpec::AadlSpecMapping() : SimulationConfig{
-- ...
}
I registered the Metamodels in the qvt project properties, the "Metamodel Mappings".
Also there are not the same class names in source and target model, thus AadlSpec should point to the source model.
Normally there is only one Object in der source model of the type AadlSpec. So i could also use .rootObjects() to access it.
[Updated on: Thu, 26 August 2010 14:28] Report message to a moderator
|
|
|
Re: [QVTo] mapping operation not executed [message #555538 is a reply to message #555417] |
Fri, 27 August 2010 06:05 |
Eclipse User |
|
|
|
Originally posted by: dhendriksREMOVE_THIS.tueREMOVE.THIS.nl
Hello 2bro2b:
I assume you double-checked the namespace URIs. The one with three
slashes seems a bit odd.
Instead of registering the metamodels in the QVT project properties, you
could try exporting the projects: right click the projects, choose
Export, Plug-in Development, Deployable plug-ins and fragments, Next,
select the eclipse installation directory (the one that contains the
'plugins' directory), Finish. Restart Eclipse. Remove the metamodel
mappings from the QVTo project, and try again.
rootObjects() should be more efficient than objects(), especially for
large models.
Dennis
2bro2b wrote:
> thanks for your fast answer.
> Here is a first attempt on accessing objects in the source model:
>
>
>
> modeltype AADL_source uses 'http:///AADL/core';
> modeltype Target_Model uses 'http://target';
>
>
> transformation AADL_trans1(in aadl_source: AADL_core, out target:
> Target_Model);
>
>
> main(){
> aadl_core.objects()[AadlSpec]->map AadlSpecMapping();
>
> // get all Objects
> var AllObjects : Set(Element);
> AllObjects := aadl_core.objects();
> }
>
> mapping AadlSpec::AadlSpecMapping() : SimulationConfig{
> -- ...
> }
>
>
>
> I registered the Metamodels in the qvt project properties, the
> "Metamodel Mappings".
> Also there are not the same class names in source and target model, thus
> AadlSpec should point to the source model.
>
> Normally there is only one Object in der source model of the type
> AadlSpec. So i could also use .rootObjects() to access it.
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.06776 seconds