[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.emft] Re: [EMF Compare] Understanding EMF Compare

Hi Timothy,

In the case described, there is no way to discriminate between two elements other than through their name attribute. Between "Real" and "Double" Iéd have thought EMF Compare wouldn't be able to match those two elements. Do you have IDs/XMI IDs in your model? If yes, take a look at MatchOptions.OPTION_IGNORE_(XMI_)ID or if you're comparing through the GUI nad not code, the option window => preferences => EMF Compare => "ignore (xmi) id while matching".

IDs or not, since EMF Compare matched your two elements (you've got an UpdateAttribute instead of two "ModelElementChange" differences); it's only natural that merging the difference makes the second model into a copy of the first. It is possible to manually create the diff, but would be better to try and determine how your two PrimitiveTypes can be similar enough for EMF Compare to match them.

Laurent Goubet
Obeo

Timothy Marc a écrit :
Hello all Comparer,

i'm a newbie to EMF Compare and i want to understand this great stuff. I have a model with four elements

Element:Root
PrimitiveType{name=Integer}
PrimitiveType{name=Real}
PrimitiveType{name=Boolean}
PrimitiveType{name=String}

Than, i create another similiar model like this

Element:Root
PrimitiveType{name=Integer}
PrimitiveType{name=Double}
PrimitiveType{name=Boolean}
PrimitiveType{name=String}

Only the Real value changed to Double. After merging these two models, the resulting models is exactly the second model. I've introspected the DiffModel and a Update difference was detected.

What i want the merge algorithm to do is to copy the new double primitive type into the existing model, so that five primitive types are contained in the root instead of four. So, for me a general questions has raised:

Is it possible to build the diff of these two models and than just copy the missing elements into the left model? I didn't want to get the models merged entiredly in the end.

And how did EMF Compare indicated that two instances are "equal"?

Thx
Timothy

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr/";>Obeo</a>
email;internet:laurent.goubet@xxxxxxx
url:http://www.obeo.fr
version:2.1
end:vcard