Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » Loading an Ecore meta-model from a model instance using "Load Resource.."
Loading an Ecore meta-model from a model instance using "Load Resource.." [message #854895] |
Tue, 24 April 2012 10:36 |
Cesar Caves Messages: 29 Registered: July 2009 |
Junior Member |
|
|
Hi forum !!
Here is my problem.
I've just developed a meta-model, let's say A.ecore, whose model instances are intended to be applied to other meta-models (B.ecore, C.ecore, etc.), so that I will have a model instance A1.xmi for B.ecore, A2.xmi for C.ecore, and so on.
The way I have done this is the following:
Working with instance model I had imported models (using right-click popup option "Load Resource...) to establish cross references, so I have tried to do something similar...
Developing A.ecore, I have imported ("Load Resource...") Ecore.ecore, although not browsing the workspace, but browsing registered packages. Then, I can create classes for A.ecore with references not only pointing to other already created classes for A.ecore, but also pointing to EClass, EAttribute, EReference, etc. This went well, and, having also the possibility of displaying the Ecore classes in the diagram using drag&drop.
So, I attempted the next step: create a model instance (via "Create Dynamic Instance") conforming to A.ecore, this is A1.xmi, meant to be applied to B.ecore. For that, with A1.xmi open with the Reflexive Ecore Model editor, again "Load Resource...", this time browsing the workspace and choosing B.ecore.
What I expected is that, when creating an object ("Add new child", for example) of one of the A.ecore classes, I would have plenty of options to establish the reference of type Eclass for that object, I mean, all EClasses in Ecore.ecore + all EClasses in A.ecore and in particular the classes of previously loaded B.ecore which I'm interested in. But, to my surprise, the combo box is EMPTY.
Am I missing something?
When working with instance models (xmi files) the importing process via "Load Resource..." works well, and at first I thought that it could only be possible between artifacts inside the M1 layer. After that, when I succesfully imported Ecore.ecore (M3 layer) from A.ecore (M2 layer) crossing layers, I thought that importing B.ecore, C.ecore, etc from A1.xmi (M1 layer) would be a piece of cake... But it doesn't work... I don't understand.
Any hint?
Thanks in advance.
Regards
|
|
|
Re: Loading an Ecore meta-model from a model instance using "Load Resource.." [message #854921 is a reply to message #854895] |
Tue, 24 April 2012 11:01 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Please don't cross post the same question to multiple groups.
On 24/04/2012 12:36 PM, Cesar Caves wrote:
> Hi forum !!
>
> Here is my problem.
>
> I've just developed a meta-model, let's say A.ecore, whose model
> instances are intended to be applied to other meta-models (B.ecore,
> C.ecore, etc.), so that I will have a model instance A1.xmi for
> B.ecore, A2.xmi for C.ecore, and so on.
>
> The way I have done this is the following:
>
> Working with instance model I had imported models (using right-click
> popup option "Load Resource...) to establish cross references, so I
> have tried to do something similar...
>
> Developing A.ecore, I have imported ("Load Resource...") Ecore.ecore,
> although not browsing the workspace, but browsing registered packages.
> Then, I can create classes for A.ecore with references not only
> pointing to other already created classes for A.ecore, but also
> pointing to EClass, EAttribute, EReference, etc. This went well, and,
> having also the possibility of displaying the Ecore classes in the
> diagram using drag&drop.
>
> So, I attempted the next step: create a model instance (via "Create
> Dynamic Instance") conforming to A.ecore, this is A1.xmi, meant to be
> applied to B.ecore. For that, with A1.xmi open with the Reflexive
> Ecore Model editor, again "Load Resource...", this time browsing the
> workspace and choosing B.ecore.
>
> What I expected is that, when creating an object ("Add new child", for
> example) of one of the A.ecore classes, I would have plenty of options
> to establish the reference of type Eclass for that object, I mean, all
> EClasses in Ecore.ecore + all EClasses in A.ecore and in particular
> the classes of previously loaded B.ecore which I'm interested in. But,
> to my surprise, the combo box is EMPTY.
>
> Am I missing something?
>
> When working with instance models (xmi files) the importing process
> via "Load Resource..." works well, and at first I thought that it
> could only be possible between artifacts inside the M1 layer. After
> that, when I succesfully imported Ecore.ecore (M3 layer) from A.ecore
> (M2 layer) crossing layers, I thought that importing B.ecore, C.ecore,
> etc from A1.xmi (M1 layer) would be a piece of cake... But it doesn't
> work... I don't understand.
>
> Any hint?
>
> Thanks in advance.
>
> Regards
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Thu Apr 25 09:05:25 GMT 2024
Powered by FUDForum. Page generated in 0.02471 seconds
|