Eclipse Community Forums Forum Search:

Home » Modeling » Epsilon » My first transformation
My first transformation Mon, 11 July 2011 15:08
 Federico TomassettiMessages: 190Registered: July 2009 Location: Dublin Senior Member
Hi, I am trying to execute my first transformation with ETL.

pre {
'Running ETL'.println();
var jm : new JavaModel!SelfReference;
}

rule Jamopp2Javamodel
transform s : jamoppModel!CompilationUnit
to t : JavaModel!Statement {

}


I get an error:
Running ETL

In the run configuration I inserted a reference to a registered package with the name "JavaModel". This package contains the EClass SelfReference but it is not found.
Any suggestion?
Re: My first transformation [message #695391 is a reply to message #695354] Mon, 11 July 2011 16:18
 Antonio Garcia-DominguezMessages: 458Registered: January 2010 Senior Member
When you use X!Y, "X" is not the name of an EPackage, but rather the name of the model you loaded. Please make sure that the model you use to load the registered package is called JavaModel.

Re: My first transformation [message #695417 is a reply to message #695391] Mon, 11 July 2011 17:22
 Federico TomassettiMessages: 190Registered: July 2009 Location: Dublin Senior Member
I tried loading the JavaModel package both as a Registered meta-model and as a model under the name "JavaModel". It did not work.
Re: My first transformation [message #695439 is a reply to message #695417] Mon, 11 July 2011 18:12
 Steffen ZschalerMessages: 232Registered: July 2009 Senior Member
When you say "as a model under the name "JavaModel"", what do you mean
exactly? The model you have is a metamodel, so you should not add it as
a model using the label JavaModel and ensure that the metamodel of that
is the JavaModel metamodel.

Steffen

On 11/07/2011 18:22, Federico Tomassetti wrote:
> I tried loading the JavaModel package both as a Registered meta-model
> and as a model under the name "JavaModel". It did not work.
Re: My first transformation [message #695450 is a reply to message #695439] Mon, 11 July 2011 19:17
 Antonio Garcia-DominguezMessages: 458Registered: January 2010 Senior Member

If you load a registered EPackage as a model, you are loading an Ecore model, which contains your metamodel. The only types you can work with are EClass, EAttribute and so on: the Ecore types.

If you want to use the JavaModel EPackage to create a model, you need to load a proper model based on your metamodel. You can add an empty model to a launch configuration by setting the "Read on load" option to false.

By the way, have you checked our examples? This one should be useful:

http://eclipse.org/gmt/epsilon/examples/index.php?example=org.eclipse.epsilon.examples.tree2graph
Re: My first transformation [message #695632 is a reply to message #695450] Tue, 12 July 2011 07:53
 Federico TomassettiMessages: 190Registered: July 2009 Location: Dublin Senior Member
Yes, I read the example before posting

It works: I did not understand that I have to configure the "unexisting model" and refer to the metamodel there. It was not clear to me reading the examples.

Thank you!
 Previous Topic: (no subject) Next Topic: ClassCastException on ETL
Goto Forum:

Current Time: Fri May 26 01:57:49 GMT 2017