Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How To Use The Element Based Edge Creation Tool
How To Use The Element Based Edge Creation Tool [message #1832944] Tue, 29 September 2020 16:57 Go to next message
Thomas Chiang is currently offline Thomas ChiangFriend
Messages: 50
Registered: March 2020
Member
I have defined an element based edge that I can define from the tree editor that displays in my model just fine but when I try to create it from my creation tool it doesn't work. The link isn't created between the elements that I select.

I have the tool defined as such:
Begin > Change Context var:source > Create Instance Model::eClass > Set 'tgt', var:target

I don't know what I am doing wrong here, since this is an element based edge that I have defined in my metamodel I assumed that I would need to create and instance and still access the target and source variables in order to set them. I haven't been able to find any tutorial about using the creation tool for element based edges and previous forum posts haven't been clear about the steps required for defining the creation tool from start to end.
Re: How To Use The Element Based Edge Creation Tool [message #1833043 is a reply to message #1832944] Thu, 01 October 2020 09:44 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 270
Registered: July 2009
Senior Member
Hi Thomas,

There is an example of Element Based Edge creation tool in EcoreTools: see /org.eclipse.emf.ecoretools.design/description/ecore.odesign#n615 . Maybe you can get inspiration from it.

If you can join your metamodel project and your design project, we can maybe see what is wrong. There is not enough information in your post to detect the problem.

Regards,


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How To Use The Element Based Edge Creation Tool [message #1833180 is a reply to message #1833043] Mon, 05 October 2020 16:49 Go to previous messageGo to next message
Thomas Chiang is currently offline Thomas ChiangFriend
Messages: 50
Registered: March 2020
Member
Hi Laurent,

I figured out what my problem was thanks to this post here:
https://www.eclipse.org/forums/index.php/t/1083419/

Apparently for the element based edge creation tool you need to set the reference name and the variable name to the same thing for it to work, which you don't have to do node and container creation. I don't actually know what the variable name field actually does though so I don't know why it needs to be set like that in order for it to work since for nodes and containers if you leave variable name at its default value of 'instance' everything works just fine. Any idea why that is?
Re: How To Use The Element Based Edge Creation Tool [message #1833651 is a reply to message #1833180] Tue, 20 October 2020 11:45 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 508
Registered: May 2011
Senior Member
Hello,

In an element based edge creation tool, you usually need a Create Instance model operation. The reference Name is the name of the containing EReference where the new element will be placed. This means that the Create Instance needs to be in the proper context with a Change Context operation if nedded (usually using the viriable var:source).
The variable name is just an identifier that can be used in sub model operation. For instance, under your Create Instance model operation, you may want to had a Set operation to set the name or the target of the reference you are creating. If in these sub operation you need to reference the newly created element, you then can use the defined variable name (var:instance by default).

Best regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:oclIsKindOf returning unexpected values
Next Topic:How to reconnect the source of an edge
Goto Forum:
  


Current Time: Wed Apr 21 12:24:07 GMT 2021

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

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

Back to the top