Home » Eclipse Projects » Sirius » Ecore automatically imported and displayed
Ecore automatically imported and displayed [message #1743972] |
Wed, 21 September 2016 04:30  |
Eclipse User |
|
|
|
Hi everybody,
I have been using Sirius for a while now, and every time I create a new representations file for en Ecore metamodel (both in a Modelling project or in legacy mode), the Ecore meta-metamodel is automatically imported. That is, if I open the .aird file as text, I can see the next two lines:
<models xmi:type="ecore:EPackage" href="m1.ecore#/"/>
<models xmi:type="ecore:EPackage" href="http://www.eclipse.org/emf/2002/Ecore#/"/>
This causes Ecore metaclasses (EClass, EReference, etc.) to appear in any diagram I try to initialize. So far, I would close the representations file, open it as text, manually delete the reference to Ecore (second line of the two above), save, and re-open, which solves the problem but is not convenient for intensive use.
If I try to delete Ecore by right-clicking it > Remove model, both Ecore and whichever other model I was representing (m1.ecore in the example) dissappear.
Any ideas of what might be going wrong? Thanks in advance!
Best regards,
Fernando
|
|
| |
Re: Ecore automatically imported and displayed [message #1744032 is a reply to message #1743979] |
Wed, 21 September 2016 11:00   |
Eclipse User |
|
|
|
Hi Maxime,
Thanks for the quick reply!
The only direct references that I have to Ecore types on m1.ecore are some attributes of type EString and EBoolean.
This happens with my own viewpoint. If I do the same, but choosing the "Design" viewpoint from EcoreTools, I still get the .aird file with references to Ecore and m1, but I get two separate empty diagrams, one for each. In each of these diagrams, the "Add Related Elements" option works properly, showing me the just the EClasses from m1 on "m1 class diagram", and the Ecore EClasses and enumerations on "ecore class diagram".
So I think that EcoreTools is working properly. It is on the creation of diagrams from my own viewpoint where I would like to avoid Ecore from being imported. Is that possible?
Regards,
Fernando
|
|
| |
Re: Ecore automatically imported and displayed [message #1744297 is a reply to message #1744223] |
Sat, 24 September 2016 05:59   |
Eclipse User |
|
|
|
Hi Maxime,
I have been looking into it, and I was finally able to solve it. Here's what I did:
Since I am creating a special representation for Ecore metamodels (not for XMI instances), in the Diagram description of my viewpoint, I had already specified ecore.EPackage as domain class.
Now, I have added [thisEObject.nsURI <> 'http://www.eclipse.org/emf/2002/Ecore'/] as precondition.
And also, following your advice, I filled in the "Semantic Candidates Expression" field in my custom representation for EClass, EAttribute, etc. with feature:eClassifiers. I was confused at first because the variables self and thisEObject in those actually refer to the EPackage, but once I realized it, it was pretty straightforward 
Thanks again for all your help!
Cheers,
Fernando
|
|
| | |
Goto Forum:
Current Time: Sat Mar 22 12:54:10 EDT 2025
Powered by FUDForum. Page generated in 0.03018 seconds
|