Self-reference in viatra [message #1758263] |
Sun, 26 March 2017 04:17  |
Eclipse User |
|
|
|
Hi,
In the past days, i tried to use viatra to copy the TTC model, but when i copy elements of Switch and Segment, it is hard to implement the self-reference 'connectsTo' with vql and xtend. Could you offer me any advice? Or could you show me an example?
The attachment is the meta-model of TTC, you can refer to is.
Hope for your reply and thanks in advance!
|
|
|
Re: Self-reference in viatra [message #1758343 is a reply to message #1758263] |
Mon, 27 March 2017 16:20   |
Eclipse User |
|
|
|
Hi,
I don't really understand what are you trying to achieve here. In general, self-references can be easily extended in VQL using two variables, like `Switch.connectsTo(a,b);` or even `Switch.connectsTo(a,a);` depending on what you want to achieve. If you provide a more precise use case, I would be better equipped to suggest a use.
However, if you only want to copy the model (or a subtree of it), you could also have a look at the EcoreUtil#copy static method provided by EMF.
Best regards,
Zoltán
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03614 seconds