[QVTO] QVT doesn't find objects [message #506923] |
Mon, 11 January 2010 01:09  |
Eclipse User |
|
|
|
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 15:33   |
Eclipse User |
|
|
|
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04831 seconds