Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF-Compare Diffs as Command?
EMF-Compare Diffs as Command? [message #902302] Thu, 16 August 2012 21:21 Go to next message
Stefan Kuhn is currently offline Stefan Kuhn
Messages: 12
Registered: July 2009
Junior Member
Hi, I wonder if it's possible to compare an older and a newer version of
a model and execute the differences as a command?

I've asked this 2 days ago on StackOverflow:

http://stackoverflow.com/questions/11950822/emf-model-diff-as-change-model-command
Re: EMF-Compare Diffs as Command? [message #903146 is a reply to message #902302] Wed, 22 August 2012 08:18 Go to previous message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1632
Registered: July 2009
Senior Member
Hi Stefan,

Sorry, I don't monitor the "eclipse-emf" tag on stack overflow on a regular basis, so I missed that. I'll answer there too, but in the meantime :

- Using EMF Compare 1.3
You will need to call the diff process programmatically (MatchService.match then DiffService.diff) to retrieve the DiffModel. After that, you can apply all these diffs from within your own command (encapsulate the call to MergeService.merge within a RecordingCommand). From there, you can merge all diffs from a command and retrieve the corresponding ChangeModel if you need it (we have no conversion from DiffModel to ChangeModel). This is cumbersome, but do-able if you are in a context where you can merge (nothing prevents you from undoing the command afterwards if you only needed the ChangeModel). Probably the safest way until we finish cooking EMF Compare 2.0.

- Using EMF Compare 2
EMF Compare 2 is currently in its development phase, and though merging is not yet done within commands, it is our goal with this version. However, you can obtain the ChangeModel more easily with this new version. What you need is to create your own IDiffProcessor and use it to instantiate the DefaultDiffEngine. The Diff Processor will be notified whenever we detect a difference on references or attributes. You can then create the corresponding ChangeModel.

Laurent Goubet
Obeo
Previous Topic:[CDO/Hibernate] Default values are not recognized
Next Topic:[CDO] Performance Evaluation
Goto Forum:
  


Current Time: Sun Oct 26 07:58:51 GMT 2014

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

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