Home » Eclipse Projects » Sirius » Grayed diagram name when reopening aird(repon diagram)
Grayed diagram name when reopening aird [message #1829110] |
Thu, 25 June 2020 10:18 |
Franco Bergomi Messages: 6 Registered: July 2009 |
Junior Member |
|
|
Hi, I'm having a strange behaviour with Sirius.
I designed a simple viewpoint with a couple of diagram representations, to display some xml files in a fancy way.
The xml files are constrained by an XSD that I transformed to .ecore, and then corresponding model/edit/editor.
I added some derived/transient/volatile references in order to easily handle name-based references in the XML.
When I create a new representation file for an xml file, I have absolutely no problem when creating diagrams, showing/removing elements from the diags, edition through property views, and saving.
If i close and then reopen the project, the aird will properly open, with the model tree.
BUT the diagrams names appear "grayed", and when I click them nothing happens.
No log, no console message, no stacktrace (even in runtime).
> see attached "Sirius_Gray.jpg" file.
I am using Obeo designer 11.1.1 / Sirius 6.1.1
How can I investigate this issues by Myself?
regards!
Franco
[Updated on: Thu, 25 June 2020 10:19] Report message to a moderator
|
|
| |
Re: Grayed diagram name when reopening aird [message #1829122 is a reply to message #1829114] |
Thu, 25 June 2020 12:19 |
|
Hi,
The greyed labels for representation are used to indicate a representation (diagram) which exists in the aird file, but is considered invalid (as per org.eclipse.sirius.business.api.query.DRepresentationDescriptorQuery.isRepresentationValid()).
The most common reason for this to happen is that the semantic element to which it is attached can no longer be found, at least using the URI which was stored in the aird. This can happen if you modify your semantic models outside the scope of the Sirius session in a way that changes the URI of the element.
Regards,
Pierre-Charles
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
| |
Re: Grayed diagram name when reopening aird [message #1829130 is a reply to message #1829122] |
Thu, 25 June 2020 14:51 |
Franco Bergomi Messages: 6 Registered: July 2009 |
Junior Member |
|
|
Hi Pierre Charles,
I found the method DRepresentationDescriptorQuery#isDangling, and it if finding that repDescriptor.getTarget() actually returns "null".
I watched the content of the aird file (target of the DSemanticDiagram:
it shows :
"<target xmi:type="TypeDtp5g" href="My.dtp5g#//@dtp5g"/>"
I notice that
However, I did some testing by adding a cross reference between 2 of my "xml" models and the link is properly resolved with the same "href" when using the reflexive EMF editor (or my dedicated generated editor)
In the opposite way, when opening my aird with the reflexive ecore editor, the referenced model is not loaded at all, even if i explicitely click on the DSemanticDiagram & refresh the property view (target).
And if I validate the .aird i get an NPE :
java.lang.NullPointerException
at org.eclipse.emf.ecore.util.EObjectValidator.validate_EveryProxyResolves(EObjectValidator.java:748)
at org.eclipse.emf.ecore.util.EObjectValidator.validate_EveryDefaultConstraint(EObjectValidator.java:351)
at org.eclipse.emf.ecore.util.EObjectValidator$DynamicEClassValidator.validate(EObjectValidator.java:1426)
at org.eclipse.emf.ecore.util.EObjectValidator$DynamicEClassValidator.validate(EObjectValidator.java:1429)
at org.eclipse.emf.ecore.util.EObjectValidator.validate(EObjectValidator.java:333)
at org.eclipse.sirius.tools.internal.validation.EValidatorAdapter.validate(EValidatorAdapter.java:70)
Seems like Sirius internally load the model in the bad way.
I'm looking if I can help Sirius do that :)
regards,
Franco
[Updated on: Thu, 25 June 2020 16:24] Report message to a moderator
|
|
|
Re: Grayed diagram name when reopening aird [message #1829135 is a reply to message #1829114] |
Thu, 25 June 2020 16:23 |
Franco Bergomi Messages: 6 Registered: July 2009 |
Junior Member |
|
|
Hi Anthony
Quote:May I ask you if the ExtendedMetada attached to the package equals to false? If that is the case I would say that this is a problem
Yes, it is tagged "false".
I Tried putting it to "true" but then, i cannot open my .xml files anymore with my generated plug-ins, so I haven't be able to do more testing in this direction.
regard,
Franco
[Updated on: Thu, 25 June 2020 16:24] Report message to a moderator
|
|
|
Re: Grayed diagram name when reopening aird [message #1829141 is a reply to message #1829135] |
Thu, 25 June 2020 17:48 |
Antonio Garmendia Messages: 93 Registered: May 2014 |
Member |
|
|
Hi Franco,
Thanks for letting me know.
I would say that the problem arises in this sense (qualified = false). If you take a look at the minimal example that I submitted you will see that also in the representations.aird the target reference is serialized as:
<target xmi:type="Family" href="sample.basicfamily#//@family"/>
and when I open the aird file with the reflective editor, in the properties view, the target reference appears empty.
In the basicfamily.ecore, if you change the qualified=true, generate a new model and a modelling project, you will see that the problem disappear. Of course, in this case, the target reference is serialized with a prefix as:
<target xmi:type="basicfamily:Family" href="example.basicfamily#//@family"/>
Kind regards,
Anthony
|
|
| | |
Re: Grayed diagram name when reopening aird [message #1829727 is a reply to message #1829711] |
Thu, 09 July 2020 14:29 |
Franco Bergomi Messages: 6 Registered: July 2009 |
Junior Member |
|
|
Hi Anthony,
I'm sorry that I wasn't able to answer before. I had to switch to another activity and didn't finish the analysis o this issue.
However I tried what you proposed (thank you), but I was not able to open my ".xml" file anymore as a model since it was violating the need (from EMF) to have prefixes everywhere.
I didn't have time enough to create a sample model with the generated editor in order to see if it would be working on Sirius.
I keep believing that Sirius is doing something strange when loading the resource.
Why ?
#1st test
I have a model "A.dtp5g" that complies with an xsd and that can be read/write with the generated model/edit/editor plugins.
I created a second model "B.dtp5g" that has a reference to A.dtp5g (To do that i intentionally added a EReference in one of the metaclasses, since it is not possible in plain xml).
So in "B.dtp5g" i have a href referencing one element (with XPath syntax like //@blabla1@blibli.2)
When i Open B model, EMF immediately loads the A model, and I can see the reference in the property view, change it, and it is then properly saved & loaded.
#2nd test
If i take the same A.dtp5G and create its representation file (.aird);
I create a View (Diagram for instance), that displays elements from A.
When i save the .aird, and read it textually, I see the same reference that I was seeing in B file (of test #1).
BUT
> If i reopen the aird file the diagram name appears "grayed", and the DRepresentationDescriptorQuery#isDangling method returns true.
> If i open the aird file with the ecore reflexive editor, the reference seems not to be resolved; it remains empty in the property view; I can set a value but it won't be saved.
and a NPE is thrown if trying to validate the model (see my previous message).
As soon as I have time, I'll try
> either to set up an example to reproduce & study this issue..
> or look through your example to extend it in order to reproduce & study the issue
regards,
Franco
|
|
| |
Goto Forum:
Current Time: Fri Sep 20 20:19:21 GMT 2024
Powered by FUDForum. Page generated in 0.04282 seconds
|