Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » My first transformation
My first transformation [message #695354] Mon, 11 July 2011 15:08 Go to next message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: 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
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 16:18 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
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 Go to previous messageGo to next message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: 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 Go to previous messageGo to next message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: 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 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 19:17 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

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 07:53 Go to previous message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: July 2009
Location: Dublin
Senior Member

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 Apr 16 20:34:55 GMT 2024

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

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

Back to the top