Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Ecore Tools » Accessing external meta-models and code generation
Accessing external meta-models and code generation [message #1599563] Tue, 03 February 2015 18:34 Go to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 325
Registered: March 2011
Senior Member
If I have a (meta)model M1 that needs references to elements from another (meta)model M0, defined in a separate modelling project, I can import M0 in M1 by adding M0 to the Project dependencies of M1. However, when I generate code from the genmodel of M1, this generates the code for M0 as well, inside the src folder of M1. This pretty much defeats the purpose of reusable models, yielding duplicate code (the code for M0 is now in two places: M0/src and M1/src). Is there a way to generate code for M1 so that it refers to the already generated code for M0 in its own project? Without this ability, as soon as we have a couple of models depending on others, we get into a maintenance nightmare.

Thanks.

I'm using

Ecore Diagram Editor 2.0.3.201411191338 org.eclipse.emf.ecoretools.design.feature.group Eclipse Modeling Project

with

Eclipse Modeling Tools 4.4.1.20150109-0740 epp.package.modeling null

on

Eclipse Modeling Tools

Version: Luna Service Release 1a (4.4.1)
Build id: 20150109-0600
Re: Accessing external meta-models and code generation [message #1705784 is a reply to message #1599563] Wed, 19 August 2015 07:55 Go to previous message
Thomas Lieser is currently offline Thomas LieserFriend
Messages: 1
Registered: August 2015
Junior Member
I'm myself quite new to this. But the solution (to me) was to "reload the genmodel" and specify what your root package and your referenced packages are (you Need to include ecore and genmodel in the dependencies).

see pic for better explanation
Previous Topic:Error loading representations file in Mars (regression?)
Next Topic:Opening .ecorediagram diagrams in Luna??
Goto Forum:
  


Current Time: Tue Apr 24 01:25:26 GMT 2018

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

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