Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Trouble With Element Based Edges(Sirius odesign learning)
Trouble With Element Based Edges [message #1779279] Thu, 04 January 2018 18:04 Go to next message
Brandon Lewis is currently offline Brandon LewisFriend
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

Re: Trouble With Element Based Edges [message #1779289 is a reply to message #1779279] Thu, 04 January 2018 21:46 Go to previous messageGo to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
Similar to this previous post, but the solution here was so far removed from the "Family Tutorial" I'm having trouble understanding the solution.

https://www.eclipse.org/forums/index.php/t/830878/
Re: Trouble With Element Based Edges [message #1779310 is a reply to message #1779289] Fri, 05 January 2018 08:55 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi,

I don't think qualified names are relevant to the problem.
Can you show me the AQL expressions you are using for source, target and semantic candidate if you use it?
And also the precondition expression if you have one

Regards,
Pierre


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

[Updated on: Fri, 05 January 2018 08:59]

Report message to a moderator

Re: Trouble With Element Based Edges [message #1779418 is a reply to message #1779310] Sun, 07 January 2018 03:42 Go to previous messageGo to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
Thanks for offering to help Pierre. After a handful of more attempts, this turns out to be all my fault! :-)

My xtext DSL uses a the DerivedStateAwareResource stuff and basically I was choosing my semantic candidates from the direct AST rather than the derived parts. I had the Domain class stuff and Source/Target stuff correct, but was returning a bad collection of EObjects for matching. The Sirius Interpreter helped dramatically in the debug.

So, I can draw my pictures now and hooked in some basic runtime stuff into a RCP. Really fun.
Re: Trouble With Element Based Edges [message #1779447 is a reply to message #1779418] Mon, 08 January 2018 08:38 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi,

I am glad you fixed your problem.
When you have difficulties like that or if your expression is complicated, don't hesitate to use services in your expression to compute what you need with JAVA code directly. You will now for sure if your problem is related to your expressions or not.

Regards,

Pierre


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Trouble With Element Based Edges [message #1779483 is a reply to message #1779447] Mon, 08 January 2018 14:13 Go to previous message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 268
Registered: May 2012
Senior Member
I had not thought of using services in that way. Really good tip. Thanks.
Previous Topic:Can Sirius work with the new version of GEF
Next Topic:A way to reduce memory cost during create diagram
Goto Forum:
  


Current Time: Tue Apr 23 12:55:38 GMT 2024

Powered by FUDForum. Page generated in 0.03444 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top