Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Ecore automatically imported and displayed
Ecore automatically imported and displayed [message #1743972] Wed, 21 September 2016 08:30 Go to next message
Fernando Macias is currently offline Fernando MaciasFriend
Messages: 20
Registered: March 2014
Junior Member
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 #1743979 is a reply to message #1743972] Wed, 21 September 2016 09:36 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Fernando,

This might be a normal behavior if your m1.ecore have some EClass which inherits from types of the Ecore meta-metamodel or some attributes typed by some Ecore datatypes.

"This causes Ecore metaclasses (EClass, EReference, etc.) to appear in any diagram I try to initialize." Do you use your own VSM or does this occur with EcoreTools ?
If this is your own VSM, you might look into your semantic candidates expressions to restrict/control the scope of elements you want to display on your diagrams.

If you observe this in EcoreTools, could you make a reproduction case to explicit the situation you see as problematic ?

Regards,

Maxime
Re: Ecore automatically imported and displayed [message #1744032 is a reply to message #1743979] Wed, 21 September 2016 15:00 Go to previous messageGo to next message
Fernando Macias is currently offline Fernando MaciasFriend
Messages: 20
Registered: March 2014
Junior Member
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 #1744223 is a reply to message #1744032] Fri, 23 September 2016 12:58 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Fernando,

I think you should look into your semantic candidates expressions. You should avoid empty expressions for those properties: an empty semantic candidate expression will force Sirius to look into the whole resource set to find object which are instances of the domain class of the current mapping.

You might find more information in the presentation I gave for SiriusCon2015 and EclipseCon NA 2016: http://www.slideshare.net/mporhel/how-tomakerobustscalablemw-econna2016-59292844

Regards,

Maxime
Re: Ecore automatically imported and displayed [message #1744297 is a reply to message #1744223] Sat, 24 September 2016 09:59 Go to previous messageGo to next message
Fernando Macias is currently offline Fernando MaciasFriend
Messages: 20
Registered: March 2014
Junior Member
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 Smile

Thanks again for all your help!

Cheers,

Fernando
Re: Ecore automatically imported and displayed [message #1744349 is a reply to message #1744297] Mon, 26 September 2016 09:00 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Fernando,

Glad to read that.

Since you filled the semantic candidates expression, I am not sure your preconditions are still needed.

Regards,

Maxime.
Re: Ecore automatically imported and displayed [message #1744351 is a reply to message #1744349] Mon, 26 September 2016 09:10 Go to previous message
Fernando Macias is currently offline Fernando MaciasFriend
Messages: 20
Registered: March 2014
Junior Member
Hi Maxime,

Thanks for the advice! But if I take it away, I get two diagrams every time: one for my model and one for Ecore.ecore, and I am not interested in the second one.

Regards,

Fernando
Previous Topic: Authorized Sides missing at Conditional Style
Next Topic:Show Nodes selectively from another Model
Goto Forum:
  


Current Time: Thu Apr 18 09:34:57 GMT 2024

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

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

Back to the top