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 is undefined or null. How can I construct a query like this.

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: 597
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:|

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

Model.allInstancesAt(timepoint).select(i |

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

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

Current Time: Tue May 28 01:08:49 GMT 2024

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

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

Back to the top