Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 08:26 Go to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
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 08:41 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

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 08:52 Go to previous message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
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: Sat Oct 05 03:46:11 GMT 2024

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

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

Back to the top