Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357673 - New Acceleo module file cannot find my custom ecore metamodel
Summary: New Acceleo module file cannot find my custom ecore metamodel
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.1.0   Edit
Hardware: PC Windows XP
: P3 major
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-14 15:02 EDT by Guido Pennella CLA
Modified: 2015-05-27 08:57 EDT (History)
1 user (show)

See Also:


Attachments
Use of a custom metamodel (304.94 KB, image/png)
2011-09-15 03:44 EDT, Stephane Begaudeau CLA
no flags Details
Screenshot that show that the metamodel cannot be seen (185.52 KB, image/png)
2011-09-15 14:26 EDT, Guido Pennella CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Pennella CLA 2011-09-14 15:02:08 EDT
Build Identifier: I20110613-1736

Adding Acceleo module files that use a custom metamodel, defined in a project in the same workspace and referenced by the Acceleo project (i.e.: the project that hold the metamodel is an EMF one and has been inserted in the list of projects in the required plug-ins in the MANIFEST file) there is no way to tell in the wizard of the module file creation to add the URI of the custom metamodel. 
Workaround: use any metamodel and substitute the URI in the generated MTL file and perform a CLEAN of the projects. Then in the MTL reflective editor will be possible to access the custom metamodel.
Pls note that in version 3.0 of Acceleo that problem was not present (i.e.: referencing the EMF project in the MANIFEST in the old wizard was possible to see the metamodel URI).

Reproducible: Always

Steps to Reproduce:
1. Define a new EMF project with a custom ECORE metamodel
2. Build the Eclipse plug-ins set via a EMF GENMODEL generation procedure
3. Define a new Acceleo project
4. Insert the EMF generated plug-ins in the MANIFEST of the Acceleo project as required plug-ins
5. Create a new Acceleo module file and try to search for the EMF metamodel URI ... is not possible to find (see also Workaround in the details of the bug).
Comment 1 Stephane Begaudeau CLA 2011-09-15 03:44:07 EDT
Created attachment 203388 [details]
Use of a custom metamodel

Acceleo uses the standard EMF view of the metamodels available and while Acceleo can work with metamodels in the workspace, EMF requires that a metamodel should be in a plugin to appear in this view. I've extended the regular EMF dialog to use our own Package Registry. The custom metamodel will only be visible by selecting the "runtime versions" since "development time version" should only be for metamodel registered as a plugin with their dedicated genmodel. The fix has been contributed on HEAD, it will be available in Acceleo 3.2.0.
Comment 2 Stephane Begaudeau CLA 2011-09-15 03:44:57 EDT
A screenshot of the result is available in the attachments.
Comment 3 Guido Pennella CLA 2011-09-15 14:26:48 EDT
Created attachment 203434 [details]
Screenshot that show that the metamodel cannot be seen
Comment 4 Guido Pennella CLA 2011-09-15 14:31:39 EDT
Hi

I do always create the metamodel + genmodel and in HELIOS I was able to see it in the "runtime versions". In INDIGO I cannot see my metamodel (see my attachment) in "runtime versions".
Comment 5 Stephane Begaudeau CLA 2011-09-16 04:04:32 EDT
Since we are using the default EMF view that uses the global EMF package registry, and since this package registry does *not* follow any ".ecore" metamodel from the workspace. It just keep track of ".ecore" metamodels registered thanks to the dedicated extension point with or without their genmodels (dev vs runtime versions). What you saw before was the consequence of a bug from Acceleo since we were putting your metamodel from the workspace in the global EMF package registry. It could create several problems with other Eclipse tools.

Starting with Acceleo 3.1.0 we now have our own package registry and we do not *ever* register anything in the global EMF package registry (we can read from it but we only store things in our package registry). That's why it "worked" in Acceleo 3.0.x and why it won't work in Acceleo 3.1.x

So what you saw was the consequence of an old bad behavior that could prevent other EMF based tools from working with metamodels registered that way. Now other EMF based tools won't see this metamodel (if they want to work with the metamodels in the workspace, they'll have to do it by themself) but since this view still use the default EMF package registry, you can't see workspace metamodels like in any other regular EMF based tools. For Acceleo 3.2.9, I have created a fix to plug this view to our own package registry so now you'll be able to see all the metamodels that we have registered + those registered using the regular way in the EMF package registry.

The fix will be available in Acceleo 3.2.0. If you want to try it right now, you can download a nightly build right here: 
https://hudson.eclipse.org/hudson/job/m2t-acceleo-master/43/artifact/Acceleo.p2.repository/

It's a nightly build so use it with caution.
Comment 6 Laurent Goubet CLA 2015-05-27 08:57:24 EDT
Closing resolved bugs