Defaulting with Xtext [message #641500] |
Thu, 25 November 2010 17:31 |
Florian Gessner Messages: 20 Registered: November 2010 |
Junior Member |
|
|
Hi all,
I've created a model which contains entities which can be linked with each other via associations. These associations should always be bi-directional.
e.g.
entity a {
}
entity B {
ref a : A;
}
For the example an association / reference from A to B should automatically be added as B defines a reference to A.
How can I handle this with XText , ... . The automatically created association on the opposite should also be usable in the editor.
Thanks and Best Regards
Florian
[Updated on: Thu, 25 November 2010 17:33] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Defaulting with Xtext [message #739348 is a reply to message #641500] |
Mon, 17 October 2011 11:25 |
Meinte Boersma Messages: 434 Registered: July 2009 Location: Leiden, Netherlands |
Senior Member |
|
|
You could check in the generated .ecore/.genmodel files whether any side of the association (i.e., non-containing EReference) is transient or not. If not, it should work but you'll probably have to add some scoping to get it to actually work.
You can modify the generated .ecore through a post-processor. Modification of the AST after parsing an instance is harder since it's not kept (automagically) in synch with the editor model.
Xtext blogs: executable models...again? | workshop material | custom scoping with Xtend
|
|
|
Powered by
FUDForum. Page generated in 0.12592 seconds