Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » AQL for deleting edges to/from alias
AQL for deleting edges to/from alias [message #1824186] Thu, 09 April 2020 08:25 Go to next message
Akira Tanaka is currently offline Akira TanakaFriend
Messages: 98
Registered: March 2010
Member
Dear Sirius experts/users,

I am working on aql for deleting edges to/from alias model element. I would very much appreciate any suggestion or comment from you.

Since the real project is complex, I created a simplified version of ecore model and odesign file, which are for slightly extended network (node+link) diagramming tool based on Sirius.

[Ecore model]
index.php/fa/37778/0/

Interesting part is an introduction of Alias pointing to original Node. Since diagram size increases, it is sometimes very useful to have alias element to represent common or important concepts to connect to at various places in the large diagram.

[Model Diagram]
index.php/fa/37774/0/

Above sample diagram shows 3 nodes (A, B, and C) and 1 allias, representing node A, and links among them.

[The objective]
I would like to achieve the following. When deleting the original node (in this case, node A), any number of aliases representing original node should also be deleted with incoming/outgoing edges associated with them.

[Curent status]
I am able to delete diagram elements, but am not able to delete semantic element. In this case, if I delete node A, the result looks like:
index.php/fa/37775/0/

However the model file looks like this, and I get error messages when trying to save the file (because of those undeleted elements).
index.php/fa/37776/0/

[Delete tool for Node]
index.php/fa/37777/0/

Code for loop i, j, k are:
i: aql:elementView.incomingEdges.target + elementView.outgoingEdges.target ->asOrderedSet()
j: aql:self.eContainer().eContents().eCrossReferences()->filter(network::Alias)->select(i|i.representing.name=self.name)->asOrderedSet()
k: aql:j.oclAsType(DNode).incomingEdges.target+ j.oclAsType(DNode).outgoingEdges.target ->asOrderedSet()

It seems i works but j and k do not work. I would appreciate any comment or suggestion.

Thank you very much in advance.
Akira
  • Attachment: Diagram1.png
    (Size: 41.76KB, Downloaded 502 times)
  • Attachment: Diagram2.png
    (Size: 36.97KB, Downloaded 305 times)
  • Attachment: Diagram3.png
    (Size: 16.44KB, Downloaded 285 times)
  • Attachment: Diagram4.png
    (Size: 22.65KB, Downloaded 283 times)
  • Attachment: Diagram0.png
    (Size: 37.23KB, Downloaded 293 times)

[Updated on: Thu, 09 April 2020 08:32]

Report message to a moderator

Re: AQL for deleting edges to/from alias [message #1824193 is a reply to message #1824186] Thu, 09 April 2020 10:21 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 172
Registered: July 2009
Senior Member
Hello Akira,

Could you attached your sample project with, Metamodel projetct, .edit project, .design project and samples project?
It will be simplier to reply.

Thank you.

Regards,
Re: AQL for deleting edges to/from alias [message #1824198 is a reply to message #1824193] Thu, 09 April 2020 11:33 Go to previous messageGo to next message
Akira Tanaka is currently offline Akira TanakaFriend
Messages: 98
Registered: March 2010
Member
Dear Julien,

Thank you very much for the response.

I am attaching two zip files for metamodel project and test model project. BTW, I usedObeoDesigner Community version 11.3 on Mac.

Best
Akira
  • Attachment: Metamodel.zip
    (Size: 148.51KB, Downloaded 91 times)
  • Attachment: Model.zip
    (Size: 10.51KB, Downloaded 52 times)
Re: AQL for deleting edges to/from alias [message #1824234 is a reply to message #1824198] Fri, 10 April 2020 13:26 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 172
Registered: July 2009
Senior Member
Hello Akira,

II found a solution but I had to modify your metamodel.
In your tool when you try to remove the link associated with the alias with the request : aql:self.eContainer().eContents().eCrossReferences()->filter(network::Alias)->select(i|i.representing.name=self.target.name)->asOrderedSet()
Your context is on an alias and when you make this request aql:j.oclAsType(DNode).incomingEdges.target+ j.oclAsType(DNode).outgoingEdges.target ->asOrderedSet(), j corresponds to an allias and not to an DNode is therefore the reason why it does not delete the link in the model.
I modified your metamodel to add a reference opposite to the representation reference.
I attach the new metamodel and the odesign.

Regards,
Re: AQL for deleting edges to/from alias [message #1824241 is a reply to message #1824234] Fri, 10 April 2020 14:44 Go to previous message
Akira Tanaka is currently offline Akira TanakaFriend
Messages: 98
Registered: March 2010
Member
Dear Julien,

Thank you very much for the solution. I really appreciate it. Actually I thought about this (i.e. adding opposite reference) but did not try, since Node A in my real project plays an important role with lots of properties and I did not want to add further properties (opposite references [compatibility with legacy tool was another reason]) at that time. That's why I tried rather complex AQL statements. However, by looking at how things work, I think this approach is simpler, requires no human interaction(input) to add opposite direction properties to Node A, and so I should take your approach.

Thank you very much for your help.
Best regards,
Akira
Previous Topic:Problem applying creation tool to container
Next Topic:Collapse all table lines by default
Goto Forum:
  


Current Time: Thu Apr 25 14:47:48 GMT 2024

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

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

Back to the top