Trouble With Element Based Edges [message #1779279] |
Thu, 04 January 2018 18:04 |
Brandon Lewis Messages: 268 Registered: May 2012 |
Senior Member |
|
|
I have a multi-meta model Xtext DSL that I'm working on and I want to draw some diagrams using Sirius. I have a basic Xtext editor up and working and I can make use of both meta-models in my Xtext language - i.e. one domain model can make references to another instance of some other domain model.
In my top level meta-model 1 (mm1), I have a Class that handles tracking the connection between two Objects of meta-model 2 (mm2), it's called the Interconnection and it has features internal and external that are of a Type specified in mm2 (that type being BusInterface).
Note: when I make these internal/external references (non-containment), I have to use qualified names in Xtext. For example, the reference to the external element must be qualified with the ComponentInstance name. BusInterface name.
Snipet from my DSL code:
comp u_comp_1 (.intf1 (u_comp_2.intf2),
.intf2 (u_comp_3.intf1)
);
comp u_comp_2 (.intf1 (u_comp_3.intf2),
.intf2 (u_comp_1.intf1)
);
comp u_comp_3 (.intf1 (u_comp_1.intf2),
.intf2 (u_comp_2.intf1)
);
I'm mainly showing this to illustrate the use of qualified names and to show how simple the idea is.
The
.<internal BusInterface> (<external BusInterface>),
format is capturing the internal and external features of the Interconnection Class. In my DSL, the external BusInterface reference always is by qualified name.
I have been able to create Nodes using my Xtext created domain model for each "ComponentInstance" in my mm1. And I've been able to draw Brodered Nodes on each ComponentInstance for each "BusInterface" (mm2) that is contained by that Component. So I've been able to map my connection points in Sirius to graphical elements. The Bordered Nodes are what I want to connect to (and are the Source/Targets of my Element Based Edge).
So this demonstrates I've been able to map classes from two different meta-models successfully into Sirius - so all the meta-models are linked into the *.odesign file and I can see auto-complete working across the multiple meta-models.
But I am noticing that when using the interpreters with the EMF editor, I don't see qualified names (because all the labels are just the name feature)
But I can't figure out to to get a Element Based Edge to show up. I've been trying to several hours. I'm able to load my DSL model into the EMF editors in the runtime, and use the SIrius Interpreter and find what I think I'm looking for using aql: expressions, but nothing is working - I don't see any edge creations.
I want an Element Base Edge for each Interconnection instance and I want to use the semantic features of internal and external (whose referenced Class is the target of each Bordered Node I've drawn) to be the Source and Target of that Edge.
I suspect that I'm running into a qualified naming problem in translation between Xtext, EMF, and Sirius? Is that possible? Or when I write these expressions I'm not in the right scope and thus I'm writing the wrong aql expression (I'm checking these with the interpreter and copying/pasting so that should guarantee no typos)
I have no idea. Please let me know if screenshots of my settings might help.
[Updated on: Thu, 04 January 2018 18:11] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04247 seconds