Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Compare] is it possible for the diff to hold the old values?
[Compare] is it possible for the diff to hold the old values? [message #619080] Thu, 29 May 2008 18:48
Jason Henriksen is currently offline Jason HenriksenFriend
Messages: 231
Registered: July 2009
Senior Member
Hi all,

I guess I slightly mis-understood what compare would do for me. I'm
wondering if I'm just not using it correctly or there's some parameter
that I could set.

Right now I'm comparing two an old version of an object and a new
version of an object. I'd like to get the diff so that I can build an
object log.

After my compare I get this XML

<diff:ModelInputSnapshot xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:diff="http://www.eclipse.org/emf/compare/diff/1.1">
<diff left="original.xml" right="altered.xml">
<ownedElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:UpdateAttribute">
<attribute
href="http://model.lab.vsp.com#//Lab/labHeadquarterId"/>
<leftElement href="original.xml#/"/>
<rightElement href="altered.xml#/"/>
</subDiffElements>
<subDiffElements xsi:type="diff:UpdateAttribute">
<attribute href="http://model.lab.vsp.com#//Lab/labType"/>
<leftElement href="original.xml#/"/>
<rightElement href="altered.xml#/"/>
</subDiffElements>
<subDiffElements xsi:type="diff:DiffGroup">
<subDiffElements xsi:type="diff:UpdateAttribute">
<attribute
href="http://model.lab.vsp.com#//Affiliation/affiliationType"/>
<leftElement href="original.xml#//@affiliationList.0"/>
<rightElement href="altered.xml#//@affiliationList.0"/>
</subDiffElements>
<leftParent href="original.xml#//@affiliationList.0"/>
</subDiffElements>
<subDiffElements xsi:type="diff:AddModelElement">
<leftParent href="original.xml#/"/>
<rightElement href="altered.xml#//@contactList.2"/>
</subDiffElements>
<leftParent href="original.xml#/"/>
</subDiffElements>
</ownedElements>
</diff>
</diff:ModelInputSnapshot>

Let's focus on the updated attribute:

<subDiffElements xsi:type="diff:UpdateAttribute">
<attribute
href="http://model.lab.vsp.com#//Lab/labHeadquarterId"/>
<leftElement href="original.xml#/"/>
<rightElement href="altered.xml#/"/>
</subDiffElements>

I had thought that the diff would display the old VALUE of the
attribute, not just the resource that it's located in. The old resource
will be getting deleted momentarily and replaced with the new one so I
wont have it to refer back to.

This is still somewhat helpful because I can see what was changed, but I
don't have any idea what it used to be. I'd love to see something more
like this:

<subDiffElements xsi:type="diff:UpdateAttribute">
<attribute
href="http://model.lab.vsp.com#//Lab/labHeadquarterId"/>
<leftElement href="original.xml#/" value="AAA"/>
<rightElement href="altered.xml#/" value="BBB"/>
</subDiffElements>


Certainly I can see how this request is tricky. In cases where a whole
sub-object was deleted what would be stored? I'm not sure.

Is this something that is even remotely possible, or is this kind of a
diff outside the current scope of the project?

Thanks!

Jason Henriksen
Previous Topic:[EMF Compare] Does EMF Compare really need to know about IFile and so on?
Next Topic:[CDO Hibernate] Problem with containingClass of CDOFeatures
Goto Forum:
  


Current Time: Sun Mar 29 16:49:03 GMT 2020

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

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

Back to the top