Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo3] Generation for user defined metamodels(How to generate code for metamodels that are defined in the workspace ?)
[Acceleo3] Generation for user defined metamodels [message #557846] Thu, 09 September 2010 04:26 Go to next message
Eclipse UserFriend
Hello,

I am investigating if Acceleo would be an option for one of our project (so, I am very new to Acceleo).

We desinged our own model using EMF and used GMF to create a graphical editor. Now, we would like to be able to generate code from a diagram that was made by the user.

For this, I would like to specify my own metamodel when creating a new project with Acceleo. I found this thread: http://www.eclipse.org/forums/index.php?t=msg&goto=50817 5&#msg_508175 in which the poster has the same problem as me. I tried the suggestion from Laurent but I still have the same error ("The metamodel couldn't be resolved"). I really want my Acceleo project to be part of the same workspace as my ecore model and GMF editor (I need to develop them both in parallel).
In one of the reply from Laurent, it seems that version 3 of Acceleo supports this but I didn't find a way to do it.

Any idea what I might be doing wrong ?
Thanks.
Re: [Acceleo3] Generation for user defined metamodels [message #557850 is a reply to message #557846] Thu, 09 September 2010 04:41 Go to previous messageGo to next message
Eclipse UserFriend
Hi Cedric,

In order to use a metamodel that is in the same workspace as your Acceleo project:

1- you can use the relative path to your metamodel instead of its URI. Here is a screenshot of how to do it: Click me !. The key here is the [module generate('platform:/resource/org.eclipse.acceleo.test/model/ MetaTest.ecore')/] instead of [module generate('http://myURI.com')/]

2- you can use the normal URI of your metamodel while your metamodel stays in another project or anywhere else if the project that contains your metamodel is a dependency of your Acceleo project and if that metamodel is registered thanks to EMF extention point (org.eclipse.emf.ecore.dynamic_package). Here are two screenshots to see how it's done : n°1 and n°2

Stephane Begaudeau, Obeo
Re: [Acceleo3] Generation for user defined metamodels [message #557853 is a reply to message #557850] Thu, 09 September 2010 04:52 Go to previous message
Eclipse UserFriend
Hello Stéphane,

Thanks a lot for the very quick reply. Indeed, your first solution works fine, I was confused with the syntax to use.

Cédric
Previous Topic:[Xtend/Xpand] Encoding problem
Next Topic:[Acceleo3] Generating code for nested elements
Goto Forum:
  


Current Time: Tue Mar 11 07:20:36 EDT 2025

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

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

Back to the top