Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTo] mapping operation not executed
[QVTo] mapping operation not executed [message #555353] Thu, 26 August 2010 08:07 Go to next message
2bro2b is currently offline 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 08:11]

Report message to a moderator

Re: [QVTo] mapping operation not executed [message #555375 is a reply to message #555353] Thu, 26 August 2010 08:58 Go to previous messageGo to next message
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 10:27 Go to previous messageGo to next message
2bro2b is currently offline 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 10:28]

Report message to a moderator

Re: [QVTo] mapping operation not executed [message #555538 is a reply to message #555417] Fri, 27 August 2010 02:05 Go to previous messageGo to next message
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.
>
>
Re: [QVTo] mapping operation not executed [message #555604 is a reply to message #555353] Fri, 27 August 2010 05:58 Go to previous message
2bro2b is currently offline 2bro2b
Messages: 12
Registered: August 2010
Junior Member
Hi Dennis,

exporting the project as plugin solved the problem, now the mapping operation is executed.

Thanks for you help
Previous Topic:Extraction to multiple files
Next Topic:[QVTO] AST and Pretty Printing
Goto Forum:
  


Current Time: Wed Aug 27 17:12:56 EDT 2014

Powered by FUDForum. Page generated in 0.02246 seconds