Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Delete Element Based Edge together with its Target/Source
Delete Element Based Edge together with its Target/Source [message #1743651] Sun, 18 September 2016 08:57 Go to next message
Xi Ng is currently offline Xi NgFriend
Messages: 26
Registered: June 2016
Junior Member
Hello,

I would like to implement the following behavior:

- If a Node/Container is deleted, I want all related (Element Based) Edges (outgoingEdges, incomingEdges) to be deleted too. At the moment, the edge just disappears with the node from the diagram, so I can not see it. But in the corresponding MyTry.mymodel (in the mymodel.example folder) it still exists.

- If a (Element Based) Edge is deleted, I do NOT want the related Nodes/Containers (target, source) to be deleted.

How or better where do I implement this?

I tried it with adding a "Delete Operation" to the Node/Container to invoke also deleting the edge, when deleting the Node/Container:
Element Edition > Delete Element > Change Context: var:element.incomingEdges > Remove

But that does not work. I would appreciate any hints.

Thank you
Xing
Re: Delete Element Based Edge together with its Target/Source [message #1743776 is a reply to message #1743651] Mon, 19 September 2016 14:49 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 496
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Xi,

There are several errors in "var:element.incomingEdges" :
. var:element is an access to the variable element: you can't add nothing after.
. if you want to navigate the model from the element, just use another interpreter, like AQL for exemple: "aql:element.incomingEdges"
. i think that incomingEdges is not a feature of your metamodel, you should replace it by your domain feature or service to retrieve the element to remove from the current element to delete.
. there might be several edges to delete: a "For" model operation would be a better idea than the "Change context"
. you can also navigate on the "view" model and retrieve the semantic element you want to delete.

For the last point, the "elementView" variable is the clicked element which will be delete among the semantic element when you will call the delete tool:
"aql:elementView.incomingEdges.concat(elementView.outgoingEdges).target->asOrderedSet()"
.target is used to navigate from the "graphical" model to your domain model.
->asOrderedSet is used to transform the result in a set and avoid duplicates.



Regards,

Maxime - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Delete Element Based Edge together with its Target/Source [message #1743957 is a reply to message #1743776] Wed, 21 September 2016 07:17 Go to previous messageGo to next message
Xi Ng is currently offline Xi NgFriend
Messages: 26
Registered: June 2016
Junior Member
Hello Maxime,

it worked with "For" and then letting "Remove" run over all the collection of edges plus the element it self.
Thank you so much Smile !

Regards
Xing
Re: Delete Element Based Edge together with its Target/Source [message #1824504 is a reply to message #1743957] Thu, 16 April 2020 13:46 Go to previous message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 116
Registered: October 2019
Senior Member
Thank you for this one.
Previous Topic:Java services doesn't work
Next Topic:Diagram import name localization
Goto Forum:
  


Current Time: Sun Oct 25 17:55:35 GMT 2020

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

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

Back to the top