Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » How to make sense of the Comparision output
How to make sense of the Comparision output [message #1261187] Sun, 02 March 2014 09:28 Go to next message
Roger Gilliar is currently offline Roger GilliarFriend
Messages: 40
Registered: March 2010
Member
Hi,

I have difficulties to make sense of the results Comparision.getDifferences gives me. I have a very simple tree based model and I just need e.g. the Info 'Node B added to Node A ' or 'Field name of Node A' changed from Test to Test1. Is there a way to configure EMFCompare to give me this informations ?

Regards
Roger
Re: How to make sense of the Comparision output [message #1261216 is a reply to message #1261187] Sun, 02 March 2014 10:13 Go to previous messageGo to next message
Roger Gilliar is currently offline Roger GilliarFriend
Messages: 40
Registered: March 2010
Member
I think I have found one of my problems. Changing e.g. the name of a parent triggers update of all children. This probably happens because of the inverse relationship I have defined. So it seems that I just have to reject this changes. Is this right ?

Regards
Roger
Re: How to make sense of the Comparision output [message #1262166 is a reply to message #1261187] Mon, 03 March 2014 10:27 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Roger,

The Comparison output is conform to the metamodel defined in org.eclipse.emf.compare/model/compare.ecore. You can find some documentation about each class and feature embedded as annotations within this model. You might also wish to take a look at org.eclipse.emf.compare.utils.EMFComparePrettyPrinter that prints a Comparison model on a PrintStream.

Other than that, we can't really help you if you do not provide us with a little more info : what are you comparing, what do your models look like, what do you expect to see as a result (and how do you plan to process it, do you simply want to display it?)...

Regards,

Laurent Goubet
Obeo
Re: How to make sense of the Comparision output [message #1262515 is a reply to message #1261187] Mon, 03 March 2014 18:16 Go to previous messageGo to next message
Roger Gilliar is currently offline Roger GilliarFriend
Messages: 40
Registered: March 2010
Member
Hi Laurent,

using PrettyPrinter gives me the following output:

REFERENCE CHANGES
value [email]de.pfile.model.impl.ModuleImpl@1b2fde11[/email] (name: My Module Name 14444, moduleNo: null, nodeName: Module) has been added to reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@639c3c08[/email] (name: My Module Name 12, moduleNo: null, nodeName: Module) has been added to reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@2629644f[/email] (name: My Module Name 14444, moduleNo: null, nodeName: Module) has been added to reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@6778921b[/email] (name: My Module Name, moduleNo: null, nodeName: Module) has been added to reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@1cc05faf[/email] (name: My Module Name 14444, moduleNo: null, nodeName: Module) has been added to reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@19c9e8e8[/email] (name: My Module Name 12, moduleNo: null, nodeName: Module) has been added to reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@16d9e492[/email] (name: My Module Name 14444, moduleNo: null, nodeName: Module) has been added to reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@3b2d38f6[/email] (name: My Module Name, moduleNo: null, nodeName: Module) has been added to reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@15f6bcd4[/email] (name: My Module Name 12, moduleNo: null, nodeName: Module) has been added to reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@79e70d8f[/email] (name: My Module Name 14444, moduleNo: null, nodeName: Module) has been added to reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@13930aa0[/email] (name: My Module Name 14444, moduleNo: null, nodeName: Module) has been deleted from reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@1a9e986a[/email] (name: My Module Name 12, moduleNo: null, nodeName: Module) has been deleted from reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@222864cd[/email] (name: My Module Name 14444, moduleNo: null, nodeName: Module) has been deleted from reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@9f1e040[/email] (name: My Module Name, moduleNo: null, nodeName: Module) has been deleted from reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@66b98ed9[/email] (name: My Module Name 14444, moduleNo: null, nodeName: Module) has been deleted from reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@20517d3f[/email] (name: My Module Name 12, moduleNo: null, nodeName: Module) has been deleted from reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@45f5c3ac[/email] (name: My Module Name 14444, moduleNo: null, nodeName: Module) has been deleted from reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@a017516[/email] (name: My Module Name, moduleNo: null, nodeName: Module) has been deleted from reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@65adfc7b[/email] (name: My Module Name 12, moduleNo: null, nodeName: Module) has been deleted from reference modules of object 
value [email]de.pfile.model.impl.ModuleImpl@19b2364[/email] (name: My Module Name 14444, moduleNo: null, nodeName: Module) has been deleted from reference modules of object 
value [email]de.pfile.model.impl.SlaveImpl@7fd5d782[/email] (name: My Name www, nodeName: Slave, childNodeName: Module) has been added to reference slaves of object 

ATTRIBUTE CHANGES
value New Name has been changed from attribute name of object 

CONFLICTS


The problems are the changes under References. Most of the entries are triggered by just changing the name of the slave object. Maybe I have to add something like a PrimaryKey to my objects ?


BTW: My model looks like this.

class Slave extends Parent, Dragable
{
	String name
	readonly String nodeName = "Slave"
	readonly String childNodeName = "Module"
	contains Module[] modules opposite slave

}

class Module extends Dragable 
{
	String name
	PositiveInt moduleNo
	
	readonly String nodeName = "Module"
	container Slave slave opposite modules
	
	op Integer position() {
		return 1 + slave.modules.indexOf(this)
	}
	
}

[Updated on: Mon, 03 March 2014 18:17]

Report message to a moderator

Re: How to make sense of the Comparision output [message #1263541 is a reply to message #1261187] Tue, 04 March 2014 15:22 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Roger,

I suspect that your "module" objets use the name of the Slave you've changed as an identifier or as part of their identifier, which would explain why we see every single one of them as both added and deleted.

another explanation would be that you're using the match by identifier while you do not have identifiers in your model.

Could you provide us with the metamodel and sample models with which we could reproduce this issue so that we can take a quick look at what's really happening?

Laurent Goubet
Obeo
Re: How to make sense of the Comparision output [message #1263707 is a reply to message #1263541] Tue, 04 March 2014 18:05 Go to previous message
Roger Gilliar is currently offline Roger GilliarFriend
Messages: 40
Registered: March 2010
Member
The problem was that I had no identifiers. Adding an id like this

class Slave extends Parent, Dragable
{
        id String objectId
	String name
	readonly String nodeName = "Slave"
	readonly String childNodeName = "Module"
	contains Module[] modules opposite slave

}


solved the problem.

Regards
Roger
Previous Topic:How to hide or combine Diffs in UI?
Next Topic:EMF compare support basic xml?
Goto Forum:
  


Current Time: Fri Apr 19 14:36:04 GMT 2024

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

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

Back to the top