Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » When delete edge
When delete edge [message #1768950] Tue, 25 July 2017 07:53 Go to next message
eunjung park is currently offline eunjung parkFriend
Messages: 72
Registered: April 2015
Member
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 08:02]

Report message to a moderator

Re: When delete edge [message #1768983 is a reply to message #1768950] Tue, 25 July 2017 12:19 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
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


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: When delete edge [message #1769137 is a reply to message #1768983] Thu, 27 July 2017 02:49 Go to previous messageGo to next message
eunjung park is currently offline eunjung parkFriend
Messages: 72
Registered: April 2015
Member
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: Thu, 27 July 2017 02:52]

Report message to a moderator

Re: When delete edge [message #1769171 is a reply to message #1769137] Thu, 27 July 2017 08:59 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

What is your question?

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

Regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: When delete edge [message #1769222 is a reply to message #1769171] Fri, 28 July 2017 02:37 Go to previous messageGo to next message
eunjung park is currently offline eunjung parkFriend
Messages: 72
Registered: April 2015
Member
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 13:30 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
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


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Problem during Loading models in RCP
Next Topic:[RESOLVED] Cardinalities on begin/end labels
Goto Forum:
  


Current Time: Tue Apr 23 10:13:43 GMT 2024

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

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

Back to the top