Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] QVT doesn't find objects
[QVTO] QVT doesn't find objects [message #506923] Mon, 11 January 2010 06:09 Go to next message
PBarendrecht is currently offline PBarendrechtFriend
Messages: 36
Registered: November 2009
Location: Eindhoven, Netherlands
Member
Hi all,

I would like to transform a Cifx metamodel to an Ariadne metamodel. To get started, I used this code:

modeltype Cifx uses "platform:/resource/Files/Cif2.ecore"; --"http://se.wtb.tue.nl/cif/cif-2.1.0";
modeltype Ariadne uses "platform:/resource/Files/ariadne.ecore"; --"http://ariadne.org/ariadne-1.0.0";

transformation CifxToAriadne(in modelIn:Cifx, out modelOut:Ariadne);

main() {
	log("In Main");	
	log (Cifx::Model.allInstances()->size().toString() );
	log( modelIn.objects()[Model]->size().toString() ); 
	log( modelIn.objectsOfType(Model)->size().toString() );
	log( modelIn.objects()->size().toString() );  
	
	log( modelIn.objects()->asOrderedSet()->at(2).metaClassName() ); 


My instance of the Cifx model has a rootObject Specification, with a child Model. The further transformation didn't return results, so I wrote three lines which print out the number of Model objects, and one for the total amount of objects. The code above returns these results:

In Main
0
0
0
219
Model

But there IS a Model object, the last print says so itself!

How is that possible? I need to transform the Model from the Cifx model to Ariadne, but because QVT says there aren't any models present in the Cifx instance, my transformation obviously doesn't work.
Re: [QVTO] QVT doesn't find objects [message #507054 is a reply to message #506923] Mon, 11 January 2010 20:33 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi PBarendrecht ,

Could you please post metamodel 'Cif2.ecore' and input model used for
the 'in modelIn:Cifx' here.

Note on posted example - it's better to reference metamodel using NsURI.
Correspondence 'NsURI' to 'workspace metamodel location' is established
using "Project Properties/QVT Settings/Metamodel Mappings".

Regards,
Sergey.

PBarendrecht wrote:
> Hi all,
>
> I would like to transform a Cifx metamodel to an Ariadne metamodel. To
> get started, I used this code:
>
>
> modeltype Cifx uses "platform:/resource/Files/Cif2.ecore";
> --"http://se.wtb.tue.nl/cif/cif-2.1.0";
> modeltype Ariadne uses "platform:/resource/Files/ariadne.ecore";
> --"http://ariadne.org/ariadne-1.0.0";
>
> transformation CifxToAriadne(in modelIn:Cifx, out modelOut:Ariadne);
>
> main() {
> log("In Main");
> log (Cifx::Model.allInstances()->size().toString() );
> log( modelIn.objects()[Model]->size().toString() ); log(
> modelIn.objectsOfType(Model)->size().toString() );
> log( modelIn.objects()->size().toString() );
> log( modelIn.objects()->asOrderedSet()->at(2).metaClassName() );
>
> My instance of the Cifx model has a rootObject Specification, with a
> child Model. The further transformation didn't return results, so I
> wrote three lines which print out the number of Model objects, and one
> for the total amount of objects. The code above returns these results:
>
> In Main
> 0
> 0
> 0
> 219
> Model
>
> But there IS a Model object, the last print says so itself!
>
> How is that possible? I need to transform the Model from the Cifx model
> to Ariadne, but because QVT says there aren't any models present in the
> Cifx instance, my transformation obviously doesn't work.
Re: [QVTO] QVT doesn't find objects [message #507990 is a reply to message #506923] Fri, 15 January 2010 13:19 Go to previous message
PBarendrecht is currently offline PBarendrechtFriend
Messages: 36
Registered: November 2009
Location: Eindhoven, Netherlands
Member
Problem solved. It had something to do with a conflict between a Package and a Class, they both had the same name.
Sergey mentioned that in QVTO 3.0 everything works fine.
Previous Topic:[ATL] correspond m target elements to 1 source element
Next Topic:[ATL] ATL data types
Goto Forum:
  


Current Time: Sun Aug 25 08:05:44 GMT 2019

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

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

Back to the top