|Re: EMF-Compare Diffs as Command? [message #903146 is a reply to message #902302]
||Wed, 22 August 2012 08:18
| Laurent Goubet
Registered: July 2009
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.
Powered by FUDForum
. Page generated in 0.01635 seconds