Simple merge case [message #670102] |
Thu, 12 May 2011 16:42 |
js Missing name Messages: 73 Registered: July 2009 |
Member |
|
|
I have the following scenario:
Now I would like to create:
Model_merged : [A,B,C,D,X]
So basically its a "union" of Model_old and Model_new.
But currently I don't get the 'D' object from Model_old in Model_merged which instead contains:
Here is the code I use:
// potentially modifies model2
public static EObject compare(EObject model1, EObject model2) {
DiffModel diff = null;
MatchModel contentMatch = null;
Map<String, Object> options = new HashMap<String, Object>();
try {
// doContentMatch from current model and down
contentMatch = MatchService.doContentMatch(model1, model2, options);
} catch (InterruptedException e) {
e.printStackTrace();
}
diff = DiffService.doDiff(contentMatch, false);
final List<DiffElement> differences = new ArrayList<DiffElement>(diff.getOwnedElements());
// This will merge all references to the right model (second argument).
MergeService.merge(differences, true);
return model2;
}
Is it possible (using any diff/compare tools at all) to create this union between two different models?
|
|
|
Powered by
FUDForum. Page generated in 0.02750 seconds