Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » [EMFCompare] Compare two models and compute the intersection of them
[EMFCompare] Compare two models and compute the intersection of them [message #1336433] Tue, 06 May 2014 11:44 Go to next message
Aleksandar Toshovski is currently offline Aleksandar ToshovskiFriend
Messages: 78
Registered: December 2011
Member
Is it possible to show only the intersection of two models... I need to show only the elements which occur in the both models and match 100%.
Re: [EMFCompare] Compare two models and compute the intersection of them [message #1338373 is a reply to message #1336433] Wed, 07 May 2014 07:20 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

EMF Compare does its work in multiple subsequent phases, one of which being to determine the mappings between the elements contained by the input models (see also the Comparison Process section of the developer guide). You can use the first parts of our API to just call this matching process and stop there, without going all the way to a full comparison.

You might want to look at what we do in our "entry point", EMFCompare#compare(...) for an example of how we use these APIs.

Depending on your model and its content, EMF Compare will try and match your EObjects either through their identifier or by content... And by default we create "Match" elements for both the matching elements and the unmatching ones : a "Match" with either of its "sides" null is an element that has no match in that side. You'll have to see how the Comparison model end up after the matching phase to see if this helps your purpose.

Laurent Goubet
Obeo
Re: [EMFCompare] Compare two models and compute the intersection of them [message #1338999 is a reply to message #1338373] Wed, 07 May 2014 13:18 Go to previous messageGo to next message
Aleksandar Toshovski is currently offline Aleksandar ToshovskiFriend
Messages: 78
Registered: December 2011
Member
Hello Laurent,

I want actually to use the EMF Compare UI and extend it. I found out three ways to do that, but I couldn't find out the right way to do it and I'm not sure which should make. Sad

1. There are some default filters. Would be possible to extend them? I looked for an extension point, but without a success.
2. There is also a new Preference Page in EMFCompare 3, so I can register new engines. Would be possible to extend the default match engine and filter the elements that doesn't exist on one of the both sides?
3. There is a postProcessor extension point. Maybe at this extension I should delete the objects, that I don't want to show?!


I like the first one. I want to extend the UI and give a way to show only the "Identical Objects" and filter the rest. What would be the most appropriate way to achieve what I want?

Re: [EMFCompare] Compare two models and compute the intersection of them [message #1352048 is a reply to message #1338999] Tue, 13 May 2014 09:24 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Aleksandar,

The first of your three options is all you need, I didn't understand from your question that having EMF Compare compute the differences wasn't an issue as long as you could filter them out of the UI.

What you need is to make sure that the "Identical elements" filter is disabled : we enable it by default to hide the elements that don't have any difference, but what you need is exactly the reverse of that.

Then, you'll have to add your own filter, with an implementation that does the opposite of the aforementionned filter (actually, you only need to copy/paste this code and change line 40 to remove the "!" from the line return !any(treeNode.eAllContents(), DATA_IS_DIFF); and line 43 to return "true" by default (i.e. "filter everything that is not a Match, or that is a Match containing differences")). This filter will have to be enabled.

Filters are contributed through the extension point org.eclipse.emf.compare.rcp.ui.filters, but that only appeared in the latest builds (it will first appear in a "released" version for Luna). You can install the M7 milestone (that contains this extension point) by using the following update site : http://download.eclipse.org/modeling/emf/compare/updates/milestones/3.0/S201405061412 .

Laurent Goubet
Obeo
Re: [EMFCompare] Compare two models and compute the intersection of them [message #1376089 is a reply to message #1352048] Fri, 23 May 2014 08:53 Go to previous message
Aleksandar Toshovski is currently offline Aleksandar ToshovskiFriend
Messages: 78
Registered: December 2011
Member
I do have M6 and I see that extension point... Unfortunately it didn't worked. Thank you very much for your answer! It is just what I need Smile
Previous Topic:CascadingDifferencesFilter and changes in moved objects
Next Topic:CompareConfiguration in v3.0 RC1
Goto Forum:
  


Current Time: Fri Mar 29 15:42:49 GMT 2024

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

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

Back to the top