Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » [EMF Compare] Is there any way to tweak matching phase?(Some way to configure matching logic during comare?)
[EMF Compare] Is there any way to tweak matching phase? [message #1702482] Wed, 22 July 2015 15:51 Go to next message
Richard Ral is currently offline Richard RalFriend
Messages: 6
Registered: December 2013
Junior Member
Dear all,

Could anybody suggest me a way to configure Matching Engine in the EMF Compare, so that during he matching phase I can change the behavior of the matcher for specific EObject elements. The problem is when I am using objects of classes that don't have id attributes and there is at least 3 objects, that have types with the same super-type. It might be even the case that two compared files with models are exactly the same, still EMF Compare will calculate some differences. So the only option is to change somehow the matching procedure. As it was already discussed on https://www.eclipse.org/forums/index.php/t/1049514/, equality helper is not used during the matching phase. So the question is: Is there any other possibility to change the matching logic without reimplementing it from the scratch?

For example if I am comparing two elements of type A they are matched if they have same size or any other logic specific to this concrete types.

Thank you in advance for the answer!
Best regards,
Richard
Re: [EMF Compare] Is there any way to tweak matching phase? [message #1702568 is a reply to message #1702482] Thu, 23 July 2015 09:55 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Richard,

We are matching elements mainly through their id. If you have any way to compute one for the elements that are not properly matched in your case, you might want to look towards defining customidentifiers for EMF Compare's use.
Otherwise, we fall back to a similarity-bassed matching, and it seems this similarity doesn't do the trick in your case to properly match your elements together.

You could insert your own implementation of an IEObjectMatcher in between the identifier and similarity ones, in order to match these particular elements your own way while leaving the usual matchers do the work for you in all other cases. If you look at the sample code I've linked just above, you'll see that it uses a "idMatcher" and "fallbackMatcher". You could use the same kind of strategy to insert your own in between.

Laurent Goubet
Obeo
Previous Topic:MatchService.doMatch ConcurrentModificationException
Next Topic:Merge referenced pseudo conflicts results in defect model
Goto Forum:
  


Current Time: Thu Dec 26 20:07:27 GMT 2024

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

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

Back to the top