|how to view the merged model? [message #931885]
||Wed, 03 October 2012 12:06
| Kosala Yapa
Registered: September 2010
I have two ecore models, which i am going to merge.
File fileModelA = new File(file1);
File fileModelB = new File(file2);
//register XMI resource factory for all other extensions
ResourceSet resourceSet = new ResourceSetImpl();
EObject model1 = ModelUtils.load(fileModelA,resourceSet);
EObject model2 = ModelUtils.load(fileModelB,resourceSet);
MatchModel match = MatchService.doContentMatch(model1, model2, Collections.<String, Object> emptyMap());
DiffModel diff = DiffService.doDiff(match);
// Merges all differences from model1 to model2
List<DiffElement> differences = new ArrayList<DiffElement>(diff.getOwnedElements());
now if i display differences, that is empty. This is because of differences are merged.
Iterator<DiffElement> it = diff.getDifferences().iterator();
if i did not do merge, that display differences.
Problem: How can I display/view merged model?
Thanks in advance!
|Re: how to view the merged model? [message #957521 is a reply to message #931885]
||Thu, 25 October 2012 05:33
| Laurent Goubet
Registered: July 2009
Displaying the model is more of an EMF question. Once you have merged the differences, you should either
- save the model to disk and open it in the Ecore editor (or whatever editor you use to create these models), or
- create a "console" printer for the EMF model.
I don't think EMF provides any mean to print a model to the console/standard output, so you'll have to create it yourself. Your best bet is solution 1, opening the file in its own editor.
[Updated on: Thu, 25 October 2012 05:33]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01414 seconds