|
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 |
|
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 #1352048 is a reply to message #1338999] |
Tue, 13 May 2014 09:24 |
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.04243 seconds