Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Hawk » Queries to get deleted elements(Construct queries to detect deleted elements)
Queries to get deleted elements [message #1839449] Sun, 21 March 2021 20:35 Go to next message
Saheed Popoola is currently offline Saheed PopoolaFriend
Messages: 21
Registered: June 2019
Junior Member
Is there a way to get deleted elements in a specific version via queries. For example, to get newly added elements, I use the queries Model.allInstances().select(i| i.previous.isUndefined());
For deleted elements, I need to go back to the previous version and check for elemens where x.next is undefined or null. How can I construct a query like this.

Thanks
Re: Queries to get deleted elements [message #1839469 is a reply to message #1839449] Mon, 22 March 2021 09:21 Go to previous message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Hi Saheed,

Do you need this across all types in the model, or only for one specific type? If it's for one specific type, you can take advantage of the fact that types have their own history - they have a version for each timepoint in which the set of instances changes. For instance, if I want to know all the Gizmos that were deleted in the previous version, I should be able to do this:

Gizmo.latest.prev.all.select(g|g.next.isUndefined())


If you need it for a previous version and across all types, you could do something like:

Model.allInstancesAt(timepoint).select(i | i.next.isUndefined())


You will need to calculate that timepoint in some way, which will depend on your needs.

Hope it helps,
Antonio
Previous Topic:Linking model elements
Next Topic:How to convert GraphNodeWrapper to EObject
Goto Forum:
  


Current Time: Fri Apr 26 17:18:30 GMT 2024

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

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

Back to the top