Cross Reference in Ecore Editor [message #1805687] |
Sun, 21 April 2019 16:11  |
Eclipse User |
|
|
|
Hello,
I have two models, ModelA and ModelB.
ModelA has one classe : ClassY.
One of ModelB classes say ClassX has an attribute that references ClassY.
I made these models using Ecore.
Now, when I open the Ecore Editor and create a dynamic instance of ModelB, I need to give it the reference to ClassY. But as it does not belong to the same class the editor does not retrieve it. How can achieve that ?
Do you think that we can reference class from an external model in the Ecore Editor ?
Thank you for your help
|
|
|
|
|
Re: Cross Reference in Ecore Editor [message #1805826 is a reply to message #1805821] |
Wed, 24 April 2019 23:26   |
Eclipse User |
|
|
|
To make a *.ecore model's classifiers available for use in another *.ecore model, you must use Load Resource... in the Sample Ecore Editor's context menu to, in your example, load ModelA.ecore into the editor you are using to edit ModelB.ecore. Once you do that, the cell editors will offer choices from ModelA.ecore while editing ModelB.ecore. Once you actually use ModelA.ecore in ModelB.ecore, i.e., add a EReference foo to EClass ClassX that references EClass ClassY from ModelA, then when you open ModelB.ecore in the editor, ModelA.ecore will automatically be loaded (when the cross reference is resolved). If you enable Live Validation from the context menu or the menu bar (which is always a good idea to have enabled), all cross references will automatically be resolved by the validator whenever you load ModelB.ecore (or any other model).
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.27230 seconds