Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » QVTO Execution in Plugin
QVTO Execution in Plugin [message #820537] Wed, 14 March 2012 04:57 Go to next message
Benjamin Kaltenbrunn is currently offline Benjamin Kaltenbrunn
Messages: 3
Registered: March 2012
Junior Member
Hi All,

im pretty new in using Model Transformations. I'm trying to develop a Eclipse Plugin. This Plugin is a Wizard. Every step this wizard is going I'm trying to execute a QVTO M2M - transformation with the TransformationExecutor class.

But its getting kind of frustrating because I cant create the necessary Ressources for the transformation. Don't know really which type is really necessary and how to initialise these ressources. I tried initialise these URIs / Ressources in several ways but getting only errors.. as you can see in my code below. Where is my stupid error ? Smile

ConvertEcore2Ecore testTransformation = new ConvertEcore2Ecore(); (TransformationExecutor class)

URI inURI = URI.createPlatformResourceURI("C://XXX//models//inmodel.xmi", true);
Resource inResource = new ResourceSetImpl().getResource(inURI, true);

URI outURI = URI.createPlatformResourceURI("platform:/resource/XXX/model//outmodel.xmi", true);
Resource outResource = new ResourceSetImpl().createResource(outURI);


testTransformation.convertEcore2Ecore(inResource, outResource);


Thx 4 your answers...

Benni
Re: QVTO Execution in Plugin [message #820664 is a reply to message #820537] Wed, 14 March 2012 08:02 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

Both your usages of createPlatformResourceURI are wrong. The first has a
very file-like argument so use createFileURI, the second has a redundant
platform:/resource

Regards

Ed Willink

On 14/03/2012 08:57, Benjamin Kaltenbrunn wrote:
> Hi All,
>
> im pretty new in using Model Transformations. I'm trying to develop a
> Eclipse Plugin. This Plugin is a Wizard. Every step this wizard is
> going I'm trying to execute a QVTO M2M - transformation with the
> TransformationExecutor class.
>
> But its getting kind of frustrating because I cant create the
> necessary Ressources for the transformation. Don't know really which
> type is really necessary and how to initialise these ressources. I
> tried initialise these URIs / Ressources in several ways but getting
> only errors.. as you can see in my code below. Where is my stupid
> error ? :)
>
> ConvertEcore2Ecore testTransformation = new ConvertEcore2Ecore();
> (TransformationExecutor class)
>
> URI inURI =
> URI.createPlatformResourceURI("C://XXX//models//inmodel.xmi", true);
> Resource inResource = new ResourceSetImpl().getResource(inURI, true);
>
> URI outURI =
> URI.createPlatformResourceURI("platform:/resource/XXX/model//outmodel.xmi",
> true);
> Resource outResource = new
> ResourceSetImpl().createResource(outURI);
>
>
> testTransformation.convertEcore2Ecore(inResource, outResource);
>
>
> Thx 4 your answers...
>
> Benni
Re: QVTO Execution in Plugin [message #820713 is a reply to message #820664] Wed, 14 March 2012 09:30 Go to previous message
Benjamin Kaltenbrunn is currently offline Benjamin Kaltenbrunn
Messages: 3
Registered: March 2012
Junior Member
yeah sure, I know that this is the point, that the URIs aren't working and so the resource can't be created. But in fact i've no idea what would be the right URI definition.

I've a QVTO Projekt by example named QVTOProject and in this project there is a folder model and in this folder i got a modelinstance .xmi file which is the Input for my transformation.

So i just want to create an working URI / Resource for this file. I tried many things referencing like a file or like a resource or whatever and didn't find real information which createXURI I should take or a tutorial what is for what und what is working with what.

So it's a little bit frustrating getting stuck here...

Anyone have a working conclusion using this example implementation described above?

thx 4 your answers

Benni
Previous Topic:[ATL] AtlLuncher class
Next Topic:Dependencies between Metamodels
Goto Forum:
  


Current Time: Fri Aug 01 20:36:49 EDT 2014

Powered by FUDForum. Page generated in 0.01950 seconds