Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Persistence issues of visual constraints when using dynamic ecore extensions
Persistence issues of visual constraints when using dynamic ecore extensions [message #1752881] Mon, 30 January 2017 09:23 Go to next message
Joerg Hermann is currently offline Joerg HermannFriend
Messages: 15
Registered: September 2012
Location: Munich
Junior Member
Hi *,
to support some user specific customizations in the model, I have introduced dynamic extensions of the static Ecore metamodel, following the description from https://www.ibm.com/developerworks/library/os-eclipse-dynamicemf/.
Basically, there is a common superclass defined in the static model, which is then subclassed by dynamic classes. The type of the superclass is referenced from the Sirius description to be represented by a border node.
The dynamic model extensions are created within the resourceImpl of the static model to have them available whenever a model is loaded.
This works fine so far, the dynamic instances are serialized correctly and read back as well and the property view shows all the attributes that have been defined in the dynamic classes.

The only thing that is not working is persisting of the positions of the border nodes associated with these dynamic instances. Even more, the diagram is marked as 'dirty' immediately after opening, which is even a bit more annoying.
Looking at the *.aird, I saw, that these instances always get new xmi:id values. It seems that Sirius treats them as completely new instances within the loaded model. (see attached screenshot with a comparison of the serialized version after modifying the positions (left) and after closing/reopening, which reverts to the defaults (right)).

Is there any way to convince Sirius that I'm still referring to the same objects (btw. there is no difference in the serialized model between these two cases)?
Any ideas or suggestions are highly appreciated Smile

Kind regards,
Joerg
Re: Persistence issues of visual constraints when using dynamic ecore extensions [message #1752911 is a reply to message #1752881] Mon, 30 January 2017 15:11 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
Hi Joerg,

Indeed, your editor is dirty because Sirius created a new graphical element considering the target instance as a new one. That is probably because of an unstable id. Following the resource implementation useUUIDs, the target semantic element will be referenced using fragments (//@school/@classes.0/@students.0) or an Id.
That could be the consequence of a dynamic instance of a dynamic inheritance. This is not something well supported. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=355188#c2
Could you give us the href value of the target semantic element ? This href attribute is probably different after the border node has been re-created.

Regards,

Florian
Re: Persistence issues of visual constraints when using dynamic ecore extensions [message #1752980 is a reply to message #1752911] Tue, 31 January 2017 15:10 Go to previous messageGo to next message
Joerg Hermann is currently offline Joerg HermannFriend
Messages: 15
Registered: September 2012
Location: Munich
Junior Member
Hi Florian,
first of all, thanks a lot for your hint.
I made some more investigations; I try to summarize below:
* The instances of the dynamic extended eClasses are serialized correctly into the 'main' model. These instances get the namespace prefix as specified within the dynamic ePackage, like <myReference xsi:type="dynextensionpkg:ExtendedClassName" ...
* The model is serialized as XMI, but I do not use UUID's; I have double checked in the resource getId() function; it alway returns null.
* I tried to modify the getId() to return a stable Id for the instances of the dynamic extension; -> no change
* Finally, I tried to serialize the package of the dynamic extension, which was in memory only before into a resource within the workspace. On next start, I loaded the metamodel from this resource instead of creating it dynamically again. Now, the positions of my border nodes remained stable.

The last trial at least shows a partial solution, but it contradicts the dynamic extension behavior that I have implemented.
Do you know, what is the criteria for the objects to be regarded as 'new'?
Is it possibly the fact, that the non-serialized metamodel comes without a resource?
Can you think of a way to tweak this to 'simulate' the resource-based behavior?
Any ideas are helpful... I will continue my trials in the meantime; maybe I can track down the differences between the two cases...

-
kind regards,
Joerg
Re: Persistence issues of visual constraints when using dynamic ecore extensions [message #1753025 is a reply to message #1752980] Wed, 01 February 2017 09:17 Go to previous message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
Hi Joerg,

I wonder if the target semantic element URI is the same before and after the graphical element has been recreated ?
Actually we have never tested this use case in Sirius and I have no additional clues. You can try to obtain additional answers about dynamic extensions on the EMF forum but I'm not sure this use case is supported.

Regards,

Florian
Previous Topic:[ANN] Sirius 4.1.3
Next Topic:Potential Performance Leak when using an Xtext + Xbase DSL
Goto Forum:
  


Current Time: Fri Apr 26 00:07:29 GMT 2024

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

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

Back to the top