Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] How to register other metamodels?
icon5.gif  [Acceleo] How to register other metamodels? [message #508175] Sun, 17 January 2010 06:52 Go to next message
Anderson Ledo is currently offline Anderson LedoFriend
Messages: 13
Registered: July 2009
Junior Member
Hi,

I've searched a lot, but I haven't found a way of registering other metamodels different from the ones available in Acceleo MTL. I want to write some generators for metamodels from the AtlanMod [1], however the great majority isn't present in the metamodels registered in the tool.

I think it is a common problem, but I really have not found a solution and I would appreciate any tip.

Thanks in advance!
Cheers.
----
[1] - http://www.emn.fr/z-info/atlanmod/index.php/Ecore


Anderson Ledo
Campina Grande, Brazil
Re: [Acceleo] How to register other metamodels? [message #508176 is a reply to message #508175] Sun, 17 January 2010 06:59 Go to previous messageGo to next message
Anderson Ledo is currently offline Anderson LedoFriend
Messages: 13
Registered: July 2009
Junior Member
With the MOFScript tool you can specify a path for the metamodels you want to use or you can add your ecore metamodels directly inside the plugin directory. It would be nice if an equivalent solution were available.

Regards...


Anderson Ledo
Campina Grande, Brazil
Re: [Acceleo] How to register other metamodels? [message #509066 is a reply to message #508176] Thu, 21 January 2010 05:34 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040701040009050805040506
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Anderson,

Sorry for the delay, I let your question slip trough. You can use
metamodels not only through their NsURI, but also by using their path
relative to the workspace in the module signature.

For example if your metamodel is in projet "myproject", in the folder
"model" within your workspace, you can define an Acceleo module such as
[module('/myproject/model/mymetamodel.ecore')/]

Laurent Goubet
Obeo

Anderson Ledo wrote:
> With the MOFScript tool you can specify a path for the metamodels you
> want to use or you can add your ecore metamodels directly inside the
> plugin directory. It would be nice if an equivalent solution were
> available.
>
> Regards...


--------------040701040009050805040506
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------040701040009050805040506--
Re: [Acceleo] How to register other metamodels? [message #509630 is a reply to message #509066] Sat, 23 January 2010 19:41 Go to previous messageGo to next message
Anderson Ledo is currently offline Anderson LedoFriend
Messages: 13
Registered: July 2009
Junior Member
Hi Laurent,

Thanks for the reply.
Unfortunatelly it didn't work yet.

I may be missing some simple detail.

What I've done...
I created an Acceleo project using the "Acceleo Module Wizard" and reproduced the example you presented. But, it simply gives me the same compilation error mensage "The metamodel couldn't be resolved". I tried a lot of different ways of defining the path, but without success (for instance, I also tried relative and absolute paths that are valid if used inside Java classes in the same project for accessing static files, but they also didn't worked inside the module definition).

What I've asked myself...
Do you know if it depends on any Eclipse configuration detail?
Are you using the same version I am? (mine is 0.8.1) Does it matter somehow?
Have you had the chance to try something similar to the given example? So that a piece of code would be greatly useful...

Well, I hope the explanation and questions above to be clear and helpful.

Again, thanks in advance.


Anderson Ledo
Campina Grande, Brazil
Re: [Acceleo] How to register other metamodels? [message #509634 is a reply to message #509630] Sat, 23 January 2010 21:38 Go to previous messageGo to next message
Andre is currently offline AndreFriend
Messages: 29
Registered: November 2009
Location: Brazil
Junior Member
HI anderson.

i'm not an expert on Acceleo, but have you tried the steps below?

1) generate the genmodel of the Ecore file
2) generate all files from genmodel
3) run a new Eclipse application
4) on the new workspace, create the Acceleo Project (you already did this)
5) create a New Acceleo Module File; on Metamodel URI, click on 'Browse...', then 'Runtime Version'.. your metamodel should appear now..

i hope it will work..


Andre Silva
Natal-RN
Brazil
Re: [Acceleo] How to register other metamodels? [message #510650 is a reply to message #509634] Thu, 28 January 2010 08:53 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010508000204050207070707
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Anderson,

Version 0.8.1 didn't have what's needed to resolve metamodels as
workspace-relative pathes. You have to follow Andre's step-by-step to
get your metamodel to be resolved with its NsURI only.

Laurent Goubet
Obeo

Andre wrote:
> HI anderson.
>
> i'm not an expert on Acceleo, but have you tried the steps below?
>
> 1) generate the genmodel of the Ecore file
> 2) generate all files from genmodel
> 3) run a new Eclipse application
> 4) on the new workspace, create the Acceleo Project (you already did this)
> 5) create a New Acceleo Module File; on Metamodel URI, click on
> 'Browse...', then 'Runtime Version'.. your metamodel should appear now..
>
> i hope it will work..
>


--------------010508000204050207070707
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------010508000204050207070707--
Re: [Acceleo] How to register other metamodels? [message #511261 is a reply to message #510650] Sun, 31 January 2010 23:50 Go to previous messageGo to next message
Anderson Ledo is currently offline Anderson LedoFriend
Messages: 13
Registered: July 2009
Junior Member
Andre, I followed your suggestion and it worked, but I had one issue. I'll describe it here and how I solved it just for documentation purposes:

Issue: Although the metamodel is available when you create the new Acceleo project, the java class coresponding to the acceleo file (e.g. 'Generate.java' for 'generate.mtl') raises a compilation error because it doesn't find the reflective interfaces and implementations created from the genmodel.
Solution: You just need to open the project that contains the generated EMF implementation in your new Eclipse instance.

Andre and Laurent, thank you for the answers. Smile


Anderson Ledo
Campina Grande, Brazil
Re: [Acceleo] How to register other metamodels? [message #511270 is a reply to message #511261] Mon, 01 February 2010 02:48 Go to previous messageGo to next message
Andre is currently offline AndreFriend
Messages: 29
Registered: November 2009
Location: Brazil
Junior Member
Hi Anderson

It seems that this issue is the same reported on this thread:
http://www.eclipse.org/forums/index.php?t=msg&goto=50155 5&

It still happens to me. To fix this, i clean the projeto or just open a model of the metamodel used on the .mtl file.



Andre Silva
Natal-RN
Brazil
Re: [Acceleo] How to register other metamodels? [message #1715310 is a reply to message #510650] Sat, 21 November 2015 19:27 Go to previous message
Guillermo Serratto is currently offline Guillermo SerrattoFriend
Messages: 1
Registered: June 2015
Junior Member
Hi Andre, im trying to do the same of Anderson Ledo. But i dont understand how to do the steps 2 and 3

2) generate all files from genmodel
3) run a new Eclipse application

can yo explain me this? Thanks!
Previous Topic:Uml to Java issue
Next Topic:[Acceleo] template/generation error listening
Goto Forum:
  


Current Time: Fri Mar 29 00:38:30 GMT 2024

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

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

Back to the top