Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Delete Edge
Delete Edge [message #1630830] Mon, 23 February 2015 12:22 Go to next message
Adrien Lefevre is currently offline Adrien LefevreFriend
Messages: 27
Registered: January 2015
Junior Member
Good morning,

I'm trying to delete an edge between two nodes (Relation Based Edge).
My first element called A is linked to my second one called B. I changed their attributes: B is "satisfiedBy" A and A "satisfies" B.

http://nsm08.casimages.com/img/2015/02/23//15022301134219105213000536.png

http://nsm08.casimages.com/img/2015/02/23//15022301134319105213000537.png

http://nsm08.casimages.com/img/2015/02/23//15022301134219105213000535.png

Thanks to an unset, I can delete the value of my target's attribute "satisfiedBy" but I don't know how to delete the source's attribute "satisfies". I tried the following code but it didn't work for "satisfies".

http://nsm08.casimages.com/img/2015/02/23//15022301195019105213000551.png

http://nsm08.casimages.com/img/2015/02/23//15022301195019105213000552.png

http://nsm08.casimages.com/img/2015/02/23//15022301195019105213000553.png

By the way, do you know if I can fin a book explaining how to use Sirius?

Thank you,

Adrien.

[Updated on: Mon, 23 February 2015 12:23]

Report message to a moderator

Re: Delete Edge [message #1654150 is a reply to message #1630830] Fri, 06 March 2015 15:02 Go to previous messageGo to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 197
Registered: June 2010
Senior Member
Hi Adrien,

From what I conclude from you post it seems that you are having a bidirectional association between Stakeholders. I don't have any information regarding the multiplicities of the association ends. Assuming that the association represents a collection, the element expression should hold the element that you want to remove from the association. I think the expression in 'satisfiedBy' is ok.

I think that the way associations are implemented in ecore already ensures that whenever you change one end of a bidirectional association, the other end is updated too. So simply unsetting the 'satisfiesBy' property should automatically also result in unsetting the corresponding 'satifsies' property. So, would it work if you simply omitted the second action (unsetting 'satisfies')?
Re: Delete Edge [message #1654197 is a reply to message #1630830] Fri, 06 March 2015 15:28 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 503
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Adrien,

If your two EReference are not bi-directionnal (eOpposite), you have to
put the second unset operation in a ChangeContext able to navigate to
the second element (on which you want to unset the satifies attribute).

The order of your operations might depend on your edge mapping
definition (who is the source, who is the target). Note that for a
Relation Base Edge mapping, the source semantic element will be the
semantic element of the source of the edge.



Le 23/02/2015 13:22, Adrien Lefevre a écrit :
> Good morning,
>
> I'm trying to delete an edge between two nodes (Relation Based Edge).
> My first element called A is linked to my second one called B. I changed
> their attributes: B is "satisfiedBy" A and A "satisfies" B.
>
>
>
>
>
>
>
> Thanks to an unset, I can delete the value of my target's attribute
> "satisfiedBy" but I don't know how to delete the source's attribute
> "satisfies". I tried the following code but it didn't work for "satisfies".
>
>
>
>
>
>
>
> By the way, do you know if I can fin a book explaining how to use Sirius?

There's no plan for this right now, but Obeo provides training if you're
interested (including in English): see
http://www.obeo.fr/en/services/training for details.

You can also find the documentation online
(https://www.eclipse.org/sirius/doc/) or in your Eclipse help (Help >
Help Contents > Sirius)

>
> Thank you,
>
> Adrien.

Regards,


--
Maxime - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Delete Edge [message #1661208 is a reply to message #1654197] Mon, 09 March 2015 14:28 Go to previous messageGo to next message
Adrien Lefevre is currently offline Adrien LefevreFriend
Messages: 27
Registered: January 2015
Junior Member
Good morning,

This is the definition of my link:

http://nsm08.casimages.com/img/2015/03/09//15030903252119105213049924.png

As you can notice, the Target Finder Expression is a feature, satisfiedBy. Does it mean when I delete the link, I can only have a role on this feature?

I also tried with two ChangeContext like that:

http://nsm08.casimages.com/img/2015/03/09//15030903284219105213049933.png

But nothing happened, still the same problem.

thank you,

Adrien.
Re: Delete Edge [message #1690503 is a reply to message #1661208] Fri, 27 March 2015 16:17 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 503
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Adrien


Le 09/03/2015 15:28, Adrien Lefevre a écrit :
> Good morning,
> This is the definition of my link:
>
>
>
> As you can notice, the Target Finder Expression is a feature,
> satisfiedBy. Does it mean when I delete the link, I can only have a role
> on this feature?

This means that your delete tool has to unset the feature on the source
element. And if the satifies reference is not an eopposite of
satifiedBy, you will have to unset this one too.

You have a RelationBased edge mapping, so the semantic element of your
DEdge will be the source semantic element: for edges described by
RelationBase edge mappings: [element/] isEquivalent to
elementView.oclAsType(DEdge).sourceNode.oclAsType(DNode).target/]

>
> I also tried with two ChangeContext like that:
>
>

IMO, if you the two features are not eOpposite and are multi-valued:
. your first change context should be [element/]
. your first Unset element expression should be
[elementView.osclAsType(DEdge).targetNode.oclAsType(DNode).target/]
. your second change context should be something like
[elementView.osclAsType(DEdge).targetNode.oclAsType(DNode).target/]
. your second Unset element expression should be
[element/]


If the features you want to unset are not multi-valued, you can let the
element expression empty, Sirius will just unset the feature.

You might also look at the ecore tool VSM [1] to see how the delete tool
for the ESuperTypes edges for has been implemented.

>
> But nothing happened, still the same problem.
> thank you,
>
> Adrien.


Regards

--
Maxime - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius

--
[1] EcoreTools 2 VSM:
http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/tree/org.eclipse.emf.ecoretools.design/description/ecore.odesign?h=2.0


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Delete Edge [message #1833494 is a reply to message #1690503] Wed, 14 October 2020 20:40 Go to previous message
Thomas Chiang is currently offline Thomas ChiangFriend
Messages: 50
Registered: March 2020
Member
Hi,

Was there ever a confirmed solution to this problem? I am running into the same issue where I am trying to create a Delete Element Edition for a bi-directional relation based edge. I've been going through the advanced tutorial to try to figure it out and then I stumbled across this page in the forum.

Previous Topic:Programmaticaly changing location and size of diagram elements
Next Topic:Modeling Project Manager should be able to Load Resource which Identified by Content Type
Goto Forum:
  


Current Time: Tue Apr 20 14:55:31 GMT 2021

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

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

Back to the top