|
|
|
|
Re: CDO cannot find EClassifier after diffs are merged and about to be committed [message #1006652 is a reply to message #1006645] |
Fri, 01 February 2013 10:30 |
|
Never mind, you've answered some of my questions with the post you've added while I was writing .
I believe that the issue comes from a mix of reasons. You are comparing things that come from different sources : one is an XMI resource you've loaded from the disk, the other is already a CDO object. The URIs used by both for their references will be different. EMF Compare will never resolve proxies by itself : something that is a proxy is out of the comparison scope. It seems that "MyType" is in such a case : "eProxyURI: http://example.com/myuri#//MyType" means that it has not been resolved; thus it is out of the scope.
Basically, if you tell EMF Compare that the comparison scope is only the two given EObjects ("right" and "left" in your example), then anything outside of these two objects will be neither matched nor differenced... let alone resolved. Because of that, "MyType" will not be matched. That would not cause any harm if your two objects were from the same source; but since one is CDO, the other is XMI loading... the Proxy URIs pointing towards "MyType" are distinct on both sides. Since we can only compare proxies through their URIs, we cannot tell that this is an object that should not be copied to the left, but rather referenced directly.
You will need to either change your approach so that all of your cross references are resolved and within the comparison scope, or extend the default behavior of EMF Compare to handle the comparison of your proxies by yourself. This can be done by replacing the EqualityHelper with something similar to this code.
Laurent Goubet
Obeo
|
|
|
Re: CDO cannot find EClassifier after diffs are merged and about to be committed [message #1006661 is a reply to message #1006652] |
Fri, 01 February 2013 11:04 |
Erdal Karaca Messages: 854 Registered: July 2009 |
Senior Member |
|
|
The problems exist with references to meta model elements:
EClass MyType
- some features...
EClass MyOtherType
- myType: EClass
I.e. the serialized object of type MyOtherType has a reference to the EClassifier MyType (not an instance of MyType).
Shouldn't EMF Compare be able to automatically resolve references to the EClass here?
Or: how would I make all my cross refs be resolved (at once)? Do you know of a simple call?
Laurent Goubet wrote on Fri, 01 February 2013 11:30Never mind, you've answered some of my questions with the post you've added while I was writing .
I believe that the issue comes from a mix of reasons. You are comparing things that come from different sources : one is an XMI resource you've loaded from the disk, the other is already a CDO object. The URIs used by both for their references will be different. EMF Compare will never resolve proxies by itself : something that is a proxy is out of the comparison scope. It seems that "MyType" is in such a case : "eProxyURI: http://example.com/myuri#//MyType" means that it has not been resolved; thus it is out of the scope.
Basically, if you tell EMF Compare that the comparison scope is only the two given EObjects ("right" and "left" in your example), then anything outside of these two objects will be neither matched nor differenced... let alone resolved. Because of that, "MyType" will not be matched. That would not cause any harm if your two objects were from the same source; but since one is CDO, the other is XMI loading... the Proxy URIs pointing towards "MyType" are distinct on both sides. Since we can only compare proxies through their URIs, we cannot tell that this is an object that should not be copied to the left, but rather referenced directly.
You will need to either change your approach so that all of your cross references are resolved and within the comparison scope, or extend the default behavior of EMF Compare to handle the comparison of your proxies by yourself. This can be done by replacing the EqualityHelper with something similar to this code.
Laurent Goubet
Obeo
|
|
|
|
Re: CDO cannot find EClassifier after diffs are merged and about to be committed [message #1007269 is a reply to message #1006674] |
Tue, 05 February 2013 10:20 |
|
Hi,
Quote: Shouldn't EMF Compare be able to automatically resolve references to the EClass here?
It's not that EMF Compare cannot. It does not. Most EMF tools see proxies as a mere implementation detail and simply let EMF resolve everything by default. EMF Compare is designed to handle very large models, even models that would not fit in the memory, as long as they are properly fragmented : we consider proxies to be out of the comparison scope, and will thus never resolve them.
So either you resolve the proxies yourself, as you did here, if they hold no real meaning to you (i.e. your models are small or you do not need them properly fragmented), or you tell EMF Compare how to handle your own proxies as I hinted in my previous post. No choice is really "better" than the other, it really depends on your use case .
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.05264 seconds