Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » reference ecore model path of a different ecore model
reference ecore model path of a different ecore model [message #772328] Thu, 29 December 2011 14:26 Go to next message
Ashton Cummings is currently offline Ashton CummingsFriend
Messages: 5
Registered: December 2011
Junior Member
Here is my problem.

We currently have several ecore models for our applications. One of the ecore models (mainModel.ecore) has stuff that is common in all the rest of the models. So, what i want to do is have all the other models reference the contents of that one model so we do not have to constantly copy the contents of that one model into all the models everytime there is a change.

Is this possible and how can i do this? I am very new to ecore and still do not understand a lot of the terminology.


--------------------------------------------------------------------------------

Here is what i attempted so far:

I tried "load resource..." by loading the mainModel.ecore into all the other models and deleting the local references. There were a lot of places that i had to fix after doing this and i did. After re-generating the source and trying to compile there are places where it tried accessing the "dotpath" that was local to the original file and i do not know how to change that "dotpath" to reference the "loaded resource". So it is not able to resolve those paths.

Thanks!
Re: reference ecore model path of a different ecore model [message #772795 is a reply to message #772328] Fri, 30 December 2011 15:55 Go to previous messageGo to next message
Ashton Cummings is currently offline Ashton CummingsFriend
Messages: 5
Registered: December 2011
Junior Member
Here is another addition. This might actually solve my problem, if it is possible.

How do i get
EcoreUtil.getRootContainer
to return the container of the loaded resource? I need to have that location so that i can resolve certain paths from that root.

Thanks
Re: reference ecore model path of a different ecore model [message #774082 is a reply to message #772328] Tue, 03 January 2012 08:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Ashton,

Comments below.


On 29/12/2011 3:26 PM, Ashton Cummings wrote:
> Here is my problem.
>
> We currently have several ecore models for our applications. One of
> the ecore models (mainModel.ecore) has stuff that is common in all the
> rest of the models. So, what i want to do is have all the other models
> reference the contents of that one model so we do not have to
> constantly copy the contents of that one model into all the models
> everytime there is a change.
>
> Is this possible and how can i do this?
Yes. This shows an example:
http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.emf.doc/tutorials/slibmod/slibmod.html
> I am very new to ecore and still do not understand a lot of the
> terminology.
>
>
> --------------------------------------------------------------------------------
>
>
> Here is what i attempted so far:
>
> I tried "load resource..." by loading the mainModel.ecore into all the
> other models and deleting the local references.
You mean replacing them with the loaded ones?
> There were a lot of places that i had to fix after doing this and i did.
If you replaced all references, there should be nothing left to fix,
except to delete things that aren't referenced anywhere...
> After re-generating the source and trying to compile there are places
> where it tried accessing the "dotpath" that was local to the original
> file and i do not know how to change that "dotpath" to reference the
> "loaded resource". So it is not able to resolve those paths.
It sounds like your model wasn't well formed. Did it validate okay?
>
> Thanks!
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: reference ecore model path of a different ecore model [message #774083 is a reply to message #772795] Tue, 03 January 2012 08:29 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Ashton,

You shouldn't need to resolve paths yourself.

On 30/12/2011 4:55 PM, Ashton Cummings wrote:
> Here is another addition. This might actually solve my problem, if it
> is possible.
>
> How do i get EcoreUtil.getRootContainer to return the container of the
> loaded resource? I need to have that location so that i can resolve
> certain paths from that root.
>
> Thanks


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: reference ecore model path of a different ecore model [message #774218 is a reply to message #774082] Tue, 03 January 2012 14:32 Go to previous messageGo to next message
Ashton Cummings is currently offline Ashton CummingsFriend
Messages: 5
Registered: December 2011
Junior Member
Ed Merks wrote on Tue, 03 January 2012 03:28

It sounds like your model wasn't well formed. Did it validate okay?


Yes it validated ok. But the compiling still fails in certain places where data types are not resolving.
Re: reference ecore model path of a different ecore model [message #774262 is a reply to message #774218] Tue, 03 January 2012 16:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Ashton,

Did you try the example? It's extremely common to have models that
reuse things from other models. That shouldn't cause any problems.
Unfortunately you've really not described anything concrete that I can
help you with. You'll have to show/describe something more concrete to
get further help.


On 03/01/2012 3:32 PM, Ashton Cummings wrote:
> Ed Merks wrote on Tue, 03 January 2012 03:28
>> It sounds like your model wasn't well formed. Did it validate okay?
>
>
> Yes it validated ok. But the compiling still fails in certain places
> where data types are not resolving.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: reference ecore model path of a different ecore model [message #774343 is a reply to message #774262] Tue, 03 January 2012 18:37 Go to previous message
Ashton Cummings is currently offline Ashton CummingsFriend
Messages: 5
Registered: December 2011
Junior Member
Ed Merks wrote on Tue, 03 January 2012 11:01
Ashton,

Did you try the example?


Not yet, i will as soon as i get the chance. Thanks for the help and i will keep you posted.
Previous Topic:Ecore genaration via xsd have some problems.
Next Topic:[CDO] ID generation location
Goto Forum:
  


Current Time: Sat Apr 20 02:11:28 GMT 2024

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

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

Back to the top