Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Customization and Team support(Customization and Team support)
Customization and Team support [message #1066838] Thu, 04 July 2013 16:14 Go to next message
Kamel Ouadou is currently offline Kamel OuadouFriend
Messages: 1
Registered: July 2013
Junior Member
Hi,
I'm working with EMFCompare2.0 and I try to integrate it with our team provider implementation.
What we need is the ability to customize the default Diff Engine and Match Engine in order to hide complexity of our meta-models. For instance we want to igonre some classes and features using custom diff engine and custom match engine.
With EMFCompare 1.3; we've defined our custom engines and use them by EMFCompare Extension points but with EMFCompare 2.0 there are not same extension points and specially no extension point on DiffEngine.

I've looked to the Developper Guide in order to do customization but I don't find how to change EMFCompare.Builder().().() chained calls when comparison is launched from Team support menus such as "Compare with .." menu or any "Team>> Merge Tool" menu.

Thanks & Regards,

Kamel


Re: Customization and Team support [message #1066916 is a reply to message #1066838] Fri, 05 July 2013 07:02 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Kamel,

There are quite a few extension points for EMF Compare, and you can take a look at the extensions we provide for UML and GMF comparisons for examples of use. The most important would be org.eclipse.emf.compare.rcp.postProcessor that will allow you to alter the result of every single phase of the comparison. This "post-processing" way of doing things has proven to be enough for our extension use cases, though if you need to replace the default behavior as a whole, this can only be done (through extension points) for the match, using the org.eclipse.emf.compare.rcp.matchEngine extension point.

The wiki is not fully written yet, and though we made sure that most of EMF Compare can be extended at will, we are still missing a lot of extension points (most extensions can only be setup programatically for now). If there are things you cannot achieve using the existing extension facilities, please elaborate on your use case and what you need in fine.

Laurent Goubet
Obeo
Re: Customization and Team support [message #1403699 is a reply to message #1066916] Fri, 25 July 2014 12:39 Go to previous messageGo to next message
Veronique BlanchetFriend
Messages: 1
Registered: July 2014
Junior Member
Hi,

I'm a beginner with EMF Compare. I'm also trying to customize the Diff Engine. I want first to do a comparison without taking into account the "move" difference, in order to have only "delete" and "add" difference and to get a comparison using only those two ones. Then I will maybe need to add others kind of differences (or to adapt the differences). That's why I decided to extend the DefaultDiffEngine class as written in the Developer Guide.
I found an extension point corresponding to this engine (org.eclipse.emf.compare.rcp.diffEngine) in the org.eclipse.emf.compare.rcp package and I added my extension.
But I don't understand what to do next in order to make it works. Indeed, actually when I launch it, I can just select it on the configuration menu, but it's not used for the comparison. I mean if I have a breakpoint on the class I created, it is never called.

In the developer guide, it's written that we need to write this:
Quote:
A custom diff engine can then be used for your comparisons:

IDiffEngine customDiffEngine === new MyDiffEngine(...);
EMFCompare.builder().setDiffEngine(customDiffEngine).build().compare(scope);


but where are we supposed to write this ?

Thank you in advance,

Best regards,

Veronique

[Updated on: Thu, 31 July 2014 15:14]

Report message to a moderator

Re: Customization and Team support [message #1404350 is a reply to message #1403699] Thu, 31 July 2014 12:57 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Véronique,

First, please create your own threads instead of "hijacking" another's, as this will allow for faster triaging from our side.

That being said, if what you need is only to ignore the "move" differences, you can just follow the example from the developper guide. As you can see, though this example tells you how to do this programmatically, it only requires you to have your own sub-class of DefaultDiffEngine.

Diff engines can also be provided to EMF Compare dynamically through the org.eclipse.emf.compare.rcp.diffEngine extension point. You can see how we do it for the default one in the plugin.xml file of the rcp plugin. For yours to be used, you have to make sure that you provide one with a ranking higher than the default one (higher than 100). As long as its ranking is higher than the default, and you haven't changed the preference to another engine (which disables the ranking), yours should be used.

Laurent Goubet
Obeo
Previous Topic:Programmatically "merge without deletions"
Next Topic:Get EObjects that cause a difference
Goto Forum:
  


Current Time: Tue Mar 19 11:45:09 GMT 2024

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

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

Back to the top