Skip to main content



      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 04:25 Go to next message
Eclipse UserFriend
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 594 times)
  • Attachment: Diagram2.png
    (Size: 36.97KB, Downloaded 385 times)
  • Attachment: Diagram3.png
    (Size: 16.44KB, Downloaded 371 times)
  • Attachment: Diagram4.png
    (Size: 22.65KB, Downloaded 367 times)
  • Attachment: Diagram0.png
    (Size: 37.23KB, Downloaded 371 times)

[Updated on: Thu, 09 April 2020 04:32] by Moderator

Re: AQL for deleting edges to/from alias [message #1824193 is a reply to message #1824186] Thu, 09 April 2020 06:21 Go to previous messageGo to next message
Eclipse UserFriend
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 07:33 Go to previous messageGo to next message
Eclipse UserFriend
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 136 times)
  • Attachment: Model.zip
    (Size: 10.51KB, Downloaded 106 times)
Re: AQL for deleting edges to/from alias [message #1824234 is a reply to message #1824198] Fri, 10 April 2020 09:26 Go to previous messageGo to next message
Eclipse UserFriend
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 10:44 Go to previous message
Eclipse UserFriend
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: Sun Jun 15 01:27:35 EDT 2025

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

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

Back to the top