Skip to main content



      Home
Home » Modeling » Epsilon » My first transformation
My first transformation [message #695354] Mon, 11 July 2011 11:08 Go to next message
Eclipse UserFriend
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
Type 'JavaModel!SelfReference' not found (D:\Workspaces\CodeMonitor\it.polito.softeng.javamodel\src\it\polito\softeng\javamodel\jamopp2javamodel.etl@3:25)

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 12:18 Go to previous messageGo to next message
Eclipse UserFriend
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 13:22 Go to previous messageGo to next message
Eclipse UserFriend
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 14:12 Go to previous messageGo to next message
Eclipse UserFriend
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 directly to your launch configuration. Instead, you need to add
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 15:17 Go to previous messageGo to next message
Eclipse UserFriend
Federico: oops, seems I misread your first message.

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 03:53 Go to previous message
Eclipse UserFriend
Yes, I read the example before posting Smile

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: Tue Jul 15 10:13:29 EDT 2025

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

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

Back to the top