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: 100
Registered: March 2020
Senior 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: 300
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: 100
Registered: March 2020
Senior 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 messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
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 Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How To Use The Element Based Edge Creation Tool [message #1848513 is a reply to message #1833043] Mon, 06 December 2021 13:25 Go to previous messageGo to next message
Tim Duncan is currently offline Tim DuncanFriend
Messages: 21
Registered: November 2021
Junior Member
Hi Laurent,

Same question for me. Could you help to see where is the problem?

With Regards.

index.php/fa/41425/0/
index.php/fa/41426/0/
index.php/fa/41427/0/
index.php/fa/41428/0/
index.php/fa/41429/0/
  • Attachment: 1.PNG
    (Size: 57.60KB, Downloaded 554 times)
  • Attachment: 2.PNG
    (Size: 45.56KB, Downloaded 640 times)
  • Attachment: 3.PNG
    (Size: 31.10KB, Downloaded 562 times)
  • Attachment: 4.PNG
    (Size: 35.47KB, Downloaded 589 times)
  • Attachment: 5.PNG
    (Size: 31.97KB, Downloaded 584 times)
Re: How To Use The Element Based Edge Creation Tool [message #1848518 is a reply to message #1848513] Mon, 06 December 2021 18:01 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hi Tim,

In your Edge Mapping definition, I think that you need to fix two expressions:
- your semantic candidate expression: I do not see the definition of the parent of your Edge Mapping (the Diagram Description) but I guess its "Domain Class" is the MetaClass that contains your "Project" EClass. Therefore, your expression misses "one level of containment" and should probably be "aql:projects.versionRelation" (or "feature:eAllContents" but it can be less performant).
- you still need to fill the source finder expression otherwise Sirius will not know from which source your reference should be starting. In your case it would just be "feature:eContainer".

Your edge creation tool looks good to me.

Best regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How To Use The Element Based Edge Creation Tool [message #1848569 is a reply to message #1848518] Wed, 08 December 2021 10:01 Go to previous message
Tim Duncan is currently offline Tim DuncanFriend
Messages: 21
Registered: November 2021
Junior Member
Thanks, Steve : )
Previous Topic:How to convert Sirius Project to Eclipse Plugin?
Next Topic:[ANN] Sirius 6.6.0
Goto Forum:
  


Current Time: Fri Apr 19 15:58:20 GMT 2024

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

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

Back to the top