[Compare] is it possible for the diff to hold the old values? [message #619080] |
Thu, 29 May 2008 18:48 |
Jason Henriksen 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
|
|
|
Powered by
FUDForum. Page generated in 0.03626 seconds