Synchronization problem from Xtext to Sirius [message #1767538] |
Fri, 07 July 2017 02:23 |
mind calm Messages: 57 Registered: July 2017 |
Member |
|
|
HI,
I met a problem when I use Xtext and Sirius to edit my model.
In my model "my.family", I have 3 elements A B and C. In Xtext editor, it is like this:
Man A,
Man B,
Man C
In the Sirius diagram, there has 3 DNode Instances:
DNode A refers to my.family.members[0]
DNode B refers to my.family.members[1]
DNode C refers to my.family.members[2]
If I insert a element D before B in xtext editor:
Man A,
Man D,
Man B,
Man C
than save the model in xtext editor, the Sirius editor will reload it and synchronize to diagram.
but the location (also size) of B C D will be mismatched:
DNode A refers to my.family.members[0]
the 2nd DNode "B" change name to "D", refers to my.family.members[1]
the 3rd DNode "C" change name to "B", refers to my.family.members[2]
there will be a new DNode "C", and get a random location (maybe there has a algorithm for this initial location).
It seems in diagram, Man D take place of Man B, Man B take place of Man C, Man C get a new location.
The reason of this problem is the mapping relation between Xtext model elements and Sirius diagram elements, is depend on index of xtext model element, which is very week and unreliable.
If the type of elements are different, the diagram will be more inconceivable, while we editing (insert, delete or change type of element) in xtext editor.
My question is, any one have some idea to solve this problem? Or any solution to enhance the relationship between Xtext model elements and Sirius diagram elements?
best regards!
Best regards!
by Keep Mind Calm
|
|
|
Re: Synchronization problem from Xtext to Sirius [message #1767711 is a reply to message #1767538] |
Mon, 10 July 2017 08:17 |
|
Hi
It seems you should look for eKeys to allow Sirius to reference your domain elements with something like my.family.members[name='foo'] instead of my.family.members[1]
To do so, you need to set the eKeys property of your containment EReference in your family.ecore metamodel.
Regards,
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05906 seconds