Sirius diagram updation through Xtext editor

156 Views Asked by At

I am using my own resource which is not of type XMI Resource.If I create Eobjects in Sirius diagram editor it is reflecting in Xtext editor but vice versa is not working .If I try to edit any elements short name in Xtext editor Sirius diagram is lost. I feel my diagram is lost due to Resource is not able to get the updated element based on URI fragment. Plaese help me how i can get the updated element URI fragment so that diagram should not get lost.

1

There are 1 best solutions below

0
On

When you save your Xtext editor, it triggers a reload of the resource by Sirius (they do not share the same editing domain or resourceSet).

During the load, your resource creates a new model in memory. The elements previously known by Sirius cannot be retrieved: you modified an attribute which impact the URI fragment. The Sirius graphical elements reference the old elements.

If you launch a refresh (from the tool bar of the diagram), it might retrieve some content but the layout will be lost as the (re)loaded model is a new set of objects.

You mid find some hints in the following resources: