Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Removing an Edge(Removing an Edge (relationship) from a diagram.)
Removing an Edge [message #1688464] Fri, 20 March 2015 19:14 Go to next message
Christian Delany is currently offline Christian DelanyFriend
Messages: 1
Registered: March 2015
Junior Member
Hello,

In the last few weeks I have been working on a project which involves creating a custom modelling tool. I'm fairly new to modelling, EMF and Sirius.

Somewhere in the metamodel, I have this class Pagina which has a [0..*] relation with itself called "enlaces".

index.php/fa/21254/0/

Here is an example of an instance of the metamodel:

index.php/fa/21256/0/

In that image, the edges are mapped to the Pagina instance nodes, and have the target finder expression: feature:enlaces

I'm trying to setup the operation to remove a selected edge from a node (on the model). I have tried combining the following setups:

I defined a change context operation set to:

  • "var:element": which if I'm not wrong should refer to the semantic source element.
  • "[elementView.oclAsType(DEdge).sourceNode.oclAsType(DSemanticDecorator).target/] ": which *should* refer to the semantic source element as well.


I defined an unset operation with the element expression set to:

  • "feature:enlaces": this deletes all the edges connected to the source node (because it returns all the semantic elements that are on "enlaces"
  • "[elementView.oclAsType(DEdge).targetNode.oclAsType(DSemanticDecorator).target/]": this doesn't work at all, just resets the edge graphical element to it's default position.


Here is an example screenshot of one of the attempts:

index.php/fa/21255/0/

I also tried using the Acceleo interpreter (selecting an edge) from the diagram editor to see if I could retrieve the target node using an Acceleo expression and I was sucessful.

index.php/fa/21257/0/

I have looked arround in the forums and found some threads where people seem to have the same problem, but none of the porposed solutions have worked so far. Feel free to ask for any information.

Thank you in advance. Please excuse me if I there is any linguistic mistake. I'm still getting used to the modeling domain terms.
Re: Removing an Edge [message #1689004 is a reply to message #1688464] Sun, 22 March 2015 11:30 Go to previous messageGo to next message
Marcin Trycz is currently offline Marcin TryczFriend
Messages: 12
Registered: August 2014
Junior Member
I'd advise to use english names in your projects, as it will make asking for help much easier, as it's easier to understand the semantics of your domain.

Also, you have not clearly stated *what exactly* your problem is, although as I get it, you're having problems in deleting an edge. Also, you did not state *what exactly* goes wrong (logs, errors, etc.)

I see you defined the "enlaces [0..*]" Reference, so it will probably be created as a *List of Pagina* inside your "pagina" object.

1. First of all, have you already tried using the default logic of Sirius, instead of implementing a custom "delete action"?
2. Are you able to act upon the bare Ecore instead of the Sirius diagram?
3. The way you defined your model, inside your "pagina" you'll have a *list* of references to other "pagina". If you unset that, you'll lose *all* of your outgoing edges form that "pagina". That's probably not what you want.
3b. Also, in your initial Ecore, you can specify the "unsettable" property on many things, this way you enable the "Unset" operation. But again, that's probably *not* what you want, as unsetting the *list* will make you loose *all* outgoing edges from that "pagina".

My best advice would be to just try the default delete logic (Ecore has a set of operations for basic model manipulation, and Sirius builds on that). If that fails, try to implement your "enalces" edge as an *object* based, instead of an *relation* based edge.

Good luck!


I'm just a user.
Re: Removing an Edge [message #1708912 is a reply to message #1689004] Tue, 22 September 2015 12:22 Go to previous messageGo to next message
Amine Lajmi is currently offline Amine LajmiFriend
Messages: 3
Registered: September 2015
Junior Member
Hi,

I have the same problem with Christian, i.e. I'm unable to delete an edge based on a relation mapping. I think the problem has been *clearly* stated, and a lot of similar threads speak about this issue, and the fact is it's impossible to know what's going on under the hood as everything is done internally and there is no way to debug that stuff.

Any updates about this ?
Thanks in advance.

Regards,
Re: Removing an Edge [message #1708924 is a reply to message #1708912] Tue, 22 September 2015 13:46 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 703
Registered: July 2009
Senior Member
Le 22/09/2015 14:57, Amine Lajmi a écrit :
> Hi,

Hi.

> I have the same problem with Christian, i.e. I'm unable to delete an
> edge based on a relation mapping. I think the problem has been *clearly*
> stated, and a lot of similar threads speak about this issue, and the
> fact is it's impossible to know what's going on under the hood as
> everything is done internally and there is no way to debug that stuff.
>
> Any updates about this ?

It seems we missed Christian's first post, but from what I understand of
the problem as stated by him, the solution he outlines works fine (see
the attached project), so I don't really know what more to say.

If your own case is different from what the one in the attached project,
we'll need more details.

Regards,

--
Pierre-Charles David - Obeo

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


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Removing an Edge [message #1708943 is a reply to message #1708924] Tue, 22 September 2015 16:11 Go to previous message
Amine Lajmi is currently offline Amine LajmiFriend
Messages: 3
Registered: September 2015
Junior Member
Hi Pierre Charles David,

Thank you for the input. In the meanwhile, I have fixed the problem by setting:
change context
|_ [elementView.oclAsType(DEdge).sourceNode.oclAsType(DSemanticDecorator).source/]

it seems to do the same thing than what you provided in the example (despite the difference at the end)
changecontext
|_ [elementView.oclAsType(DEdge).sourceNode.oclAsType(DSemanticDecorator).target/]

Not sure what does this mean, but it does the trick.
Regards,
Previous Topic:How to delete a graphical element
Next Topic:Edge towards/from container list
Goto Forum:
  


Current Time: Tue Apr 23 13:46:54 GMT 2024

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

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

Back to the top