Skip to main content



      Home
Home » Eclipse Projects » Sirius » When delete edge
When delete edge [message #1768950] Tue, 25 July 2017 03:53 Go to next message
Eclipse UserFriend
Hello.

I want to use 'Delete element' when delete edge.
The attachment is meta model and odesign file.

index.php/fa/30113/0/

index.php/fa/30112/0/

What I want to do is when I delete Make relationship (i.e., ++ relationship),
the value of Problem2's parent attribute be unset by Problem1.
I used 'Delete element' and set the following.

In Change Context, browse expression - var:element
In Unset, Feature Name - parent
Element Expression - [elementView.oclAsType(DEdge).targetNode.oclAsType(DSemanticDecorator).target/]

The problem is when I delete edge, it doesn't work.
Even, I cannot delete Make relationship.

How can I solve this problem.
Please help me.

Thank you so much.

Best regards,
Grace

[Updated on: Tue, 25 July 2017 04:02] by Moderator

Re: When delete edge [message #1768983 is a reply to message #1768950] Tue, 25 July 2017 08:19 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

If I understood correctly the confusion here is between org.eclipse.sirius.viewpoint.DSemanticDecorator.getTarget() and org.eclipse.sirius.diagram.DEdge.getTargetNode().

- DSemanticDecorator.getTarget() represents the reference between a graphical element (DNode, DNodeContainer, DEdge) and a semantic element.
- DEdge.getTargetNode() represents the reference between an edge and the target Node.

However, in your case using DEdge.getTargetNode() would work only if your diagram is unsynchronized. What your delete tool should unset, is not the graphical element, but the semantic element. Therefore, you should not use the elementView, but the element variable and then unset the reference you are looking for (targetBusinessConcept?).

Regards,
Steve
Re: When delete edge [message #1769137 is a reply to message #1768983] Wed, 26 July 2017 22:49 Go to previous messageGo to next message
Eclipse UserFriend
Thank you so much, Steve.

I could succeed to delete an edge as you mentioned.
I changed the values as the following.

Feature Name: targetBusinessConcept
Element Expression: [element.oclAsType(DEdge).targetNode/]

By the way, I have one more question.
When I delete an edge, the "parent" feature in the source node of the edge also unset the value which is the same with [element.oclAsType(DEdge).targetNode/].
The attachment is my odesign file.
Could you help me again?
Thanks again.

Best regards,
Grace

index.php/fa/30150/0/


[Updated on: Wed, 26 July 2017 22:52] by Moderator

Re: When delete edge [message #1769171 is a reply to message #1769137] Thu, 27 July 2017 04:59 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

What is your question?

The element variable correspond to the semantic element not the DEdge. Is this your issue?

Regards,
Steve
Re: When delete edge [message #1769222 is a reply to message #1769171] Thu, 27 July 2017 22:37 Go to previous messageGo to next message
Eclipse UserFriend
I could success to delete an edge and unset what I wanted (feature name: targetBusinessConcept).

What I want to do one more thing when an edge is deleted is also unset the value (feature name: parent) in a source of the edge.

As the previous image, under the "delete" function, I changed context as "var:source" and unset "parent" with [element.oclAsType(DEdge).targetNode/].
However, I couldn't what I expected.
Could you let me know how to fix it?

Thank you so much.

Best regards,
Grace
Re: When delete edge [message #1769272 is a reply to message #1769222] Fri, 28 July 2017 09:30 Go to previous message
Eclipse UserFriend
It does not work because the element variable is a semantic element, not a DEdge. Furthermore, what you want to unset is in the semantic model, not the DEdge.targetNode reference. If you do unset the targetNode reference but not the reference in the semantic model, the refresh will recreate the reference in the graphical model (synchronization).

Regards,
Steve
Previous Topic:Problem during Loading models in RCP
Next Topic:[RESOLVED] Cardinalities on begin/end labels
Goto Forum:
  


Current Time: Sun Jul 27 14:40:35 EDT 2025

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

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

Back to the top