Home » Modeling » Compare » How to compare two "feature model" with EMF Compare(How to compare two "feature model" with EMF Compare)
How to compare two "feature model" with EMF Compare [message #1237065] |
Tue, 28 January 2014 19:32 |
Julio Sandobalin Messages: 12 Registered: August 2013 |
Junior Member |
|
|
Hi guys,
I done comparison of two models Ecore (m1.ecore and m2.ecore) successfully with EMF Compare 3.0. But, now I need compare two "feature model" (model.yafm - is generated with plugin from eclipse https://bitbucket.org/jpikl/yafmt/overview) with EMF Compare. I have this code:
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("yafm", new GenericXMLResourceFactoryImpl());
String string1 = "/path1/daigram.yafm";
String string2 = "/path2/daigram.yafm";
URI uri1 = URI.createFileURI(string1);
URI uri2 = URI.createFileURI(string2);
Resource resource1 = resourceSet.getResource(uri1, true);
Resource resource2 = resourceSet.getResource(uri2, true);
IComparisonScope scope = new DefaultComparisonScope(resource1, resource2, resource1);
Comparison comparison = EMFCompare.builder().build().compare(scope);
EMFComparePrettyPrinter.printComparison(comparison, System.out);
and I have this response:
Matched resources :
Left = file: /path1/daigram.yafm
Right = file:/path2/daigram.yafm
+----------------------------------------+----------------------------------------+----------------------------------------+
| Left | Right | Origin |
+----------------------------------------+----------------------------------------+----------------------------------------+
+----------------------------------------+----------------------------------------+----------------------------------------+
REFERENCE CHANGES
ATTRIBUTE CHANGES
value ecore.xml.type:text=
has been remotely deleted from attribute mixed of object
value group=org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@2a13fd05 (mixed: [ecore.xml.type:text=
, feature=org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@7bdb4020 (mixed: [], anyAttribute: [id=f_2056068678, name=son1, lower=0, upper=1]), ecore.xml.type:text=
, feature=org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@70f951bb (mixed: [], anyAttribute: [id=f_1713913655, name=son2, lower=1, upper=1]), ecore.xml.type:text=
], anyAttribute: [lower=1, upper=1]) has been remotely deleted from attribute mixed of object
value ecore.xml.type:text=
has been remotely deleted from attribute mixed of object
value feature=org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@64868d8 (mixed: [], anyAttribute: [id=f_1206774617, name=Hija, lower=1, upper=1]) has been remotely added to attribute mixed of object
value feature=org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@68688e1c (mixed: [ecore.xml.type:text=
, feature=org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@284a05d1 (mixed: [], anyAttribute: [id=f_849044402, name=New feature, lower=0, upper=1]), ecore.xml.type:text=
], anyAttribute: [id=f_1206774617, name=New feature, lower=1, upper=1]) has been remotely deleted from attribute mixed of object
CONFLICTS
I need to obtain the detail of the information with EMFComparePrettyPrinter.printMatch(comparison, stream). Is this possible? How I can do?
I don´t have any problem with ecore diagrams, but with other diagrams I can't obtain the correct answer.
Thanks in advance for your help.
Regards.
|
|
| |
Goto Forum:
Current Time: Tue Sep 24 10:18:29 GMT 2024
Powered by FUDForum. Page generated in 0.05549 seconds
|