Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] dynamic vs generated package used by Acceleo Plug-in Application
[Acceleo] dynamic vs generated package used by Acceleo Plug-in Application [message #757609] Sun, 20 November 2011 05:39 Go to next message
Vlad Gheorghe is currently offline Vlad Gheorghe
Messages: 111
Registered: May 2011
Senior Member
Hello,

I have a metamodel MM1 present in a plug-in project in the development workspace. The plug-in registers MM1 using the generated_package extension point.


I also have an Acceleo generator plug-in in the same workspace, which takes instances of MM1 as input.

Question:
How can I control which version of the metamodel MM1, dynamic or generated, is used when running the generator as an Acceleo Plug-in Application ?

I suspect that this was changed between Acceleo 3.1 and 3.2:
3.1 - uses generated pacakage
3.2 - uses dynamic package

However, I need to use the generated package always, as MM1 has some parts implemented in Java.

Regards,
Vlad Gheorghe

Re: [Acceleo] dynamic vs generated package used by Acceleo Plug-in Application [message #757696 is a reply to message #757609] Mon, 21 November 2011 04:39 Go to previous message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1621
Registered: July 2009
Senior Member
Vlad,

The metamodel URI you use in your module declaration should always be the metamodel's NsURI, no relative or platform:/... URI (in the line "module myModule('<myPackageNsURI>')").

Is that your case? If yes, could you open the ".emtl" file corresponding to your module and tell us what URI is used there? Should be at the very top of the file, with lines looking as such :
<input>
  <takesTypesFrom href="myPackageNsURI#/"/>
</input>


Laurent Goubet
Obeo
Re: [Acceleo] dynamic vs generated package used by Acceleo Plug-in Application [message #757874 is a reply to message #757609] Sun, 20 November 2011 07:38 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4003
Registered: July 2009
Senior Member
Hi Vlad

EMF does not initialize its standalone support for platform:/resource,
platform:/plugin; you must activate it yourself.
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=361063)

Acceleo 3.0, 3.1, 3.2 are differently broken for URIs of the form
.../../.... which EMF creates at Acceleo edit-time as platform:/resource
relative. Acceleo establishes a resolution base heuristically at
run-time so that ../../.... may sometimes resolve in your file system
layout. (https://bugs.eclipse.org/bugs/show_bug.cgi?id=360926)

You have three choices:

a) get lucky with Acceleo 3.x's current algorithms
b) use only generated package URIs such as http:/...
c) use some nasty workarounds to make platform: and friends work (see
org.eclipse.ocl.examples.codegen)

b) is simple and predictable; just make sure there are no
platform:/resource, platform:/plugin, ../../.... URIs anywhere. Acceleo
should then autogenerate the standalone registrations and you don't need
to edit any Java code.

Regards

Ed Willink



On 20/11/2011 10:39, Vlad Gheorghe wrote:
> Hello,
>
> I have a metamodel MM1 present in a plug-in project in the development
> workspace. The plug-in registers MM1 using the generated_package
> extension point.
>
>
> I also have an Acceleo generator plug-in in the same workspace, which
> takes instances of MM1 as input.
>
> Question:
> How can I control which version of the metamodel MM1, dynamic or
> generated, is used when running the generator as an Acceleo Plug-in
> Application ?
>
> I suspect that this was changed between Acceleo 3.1 and 3.2:
> 3.1 - uses generated pacakage
> 3.2 - uses dynamic package
>
> However, I need to use the generated package always, as MM1 has some
> parts implemented in Java.
>
> Regards,
> Vlad Gheorghe
>
>
Previous Topic:Beginner needs a helping hand either on jet or acceleo to process ecore model
Next Topic:[acceleo 3.2] Don't understand the error/problem with a simple query modification
Goto Forum:
  


Current Time: Tue Jul 22 03:38:46 EDT 2014

Powered by FUDForum. Page generated in 0.02286 seconds