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.
Asked
Active
Viewed 135 times
1 Answers
1
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:
- White Paper on Sirius and Xtext
- Talk Integrating Xtext and Sirius: Strategies and Pitfalls: video, slides
- Blog post presenting several ways to from the Sirius editors or the properties

Maxime Porhel
- 41
- 1
- 2