Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [EMF Compare] Help with API
[EMF Compare] Help with API [message #88718] |
Tue, 10 July 2007 10:59  |
Eclipse User |
|
|
|
Hi,
How would one match (and diff) between two instance models of the same
metamodel and then go on to merge those differences in java? I was
looking at the source but I can't find any concrete implementation of
MatchEngine. I tried doing a modelMatch() on DifferencesServices but it
throws and error looking for a window.
org.eclipse.emf.compare.match.statistic.DifferencesServices. getDefaultSearchWindow(DifferencesServices.java:327)
Are there any tutorials on this too or code samples ?
Thanks!
Andrew.
|
|
| |
Re: [EMF Compare] Help with API [message #88790 is a reply to message #88775] |
Tue, 10 July 2007 12:10   |
Eclipse User |
|
|
|
Thats grand, thanks very much!
Andrew.
Ar 10/07/2007 17:09, Scríobh Cédric Brun:
> Hi Andrew,
>
> tutorials and code samples are not yet ready, it's coming :)
>
> Though, to compare two models the process is basically this one:
> EObject eObject1 = ModelUtils.load(model1URI);
> EObject eObject2 = ModelUtils.load(model2URI);
> final MatchModel match = new MatchService().doMatch(
> eObject1, eObject2, new NullProgressMonitor());
> final DiffModel diff = new DiffMaker().doDiff(match);
>
> Then you can browse the diff, if you want to merge stuffs you'll have to
> create a merger using the diffelement:
> final AbstractMerger merger = MergeFactory.createMerger(element);
>
> Then you can choose:
> merger.undoInTarget();
> or
> merger.applyInOrigin();
>
>
> The "getDefaultSearchWindow()" issue is a bug :
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=195859 , it appears when the
> preferences have not been initialized.
> There is a workaround : you should open the preferences pages and set the
> default value for the "Search Window" - which is 100 by default.
>
> Cédric
>
>
> Andrew Carton wrote:
>
>> Hi,
>>
>> How would one match (and diff) between two instance models of the same
>> metamodel and then go on to merge those differences in java? I was
>> looking at the source but I can't find any concrete implementation of
>> MatchEngine. I tried doing a modelMatch() on DifferencesServices but it
>> throws and error looking for a window.
>>
>>
> org.eclipse.emf.compare.match.statistic.DifferencesServices. getDefaultSearchWindow(DifferencesServices.java:327)
>> Are there any tutorials on this too or code samples ?
>>
>> Thanks!
>> Andrew.
>
|
|
|
Re: [EMF Compare] Help with API [message #88805 is a reply to message #88775] |
Tue, 10 July 2007 12:30   |
Eclipse User |
|
|
|
Hey Cédric,
Unfortunately when I am doing that, I get this error. It looks like it
wants to be a plugin!
ption in thread "main" java.lang.NullPointerException at
org.eclipse.emf.compare.match.service.MatchService.parseExte nsionMetadata(MatchService.java:52)
at
org.eclipse.emf.compare.match.service.MatchService.<init>(MatchService.java:48)
EObject e1 = ModelUtils.load(URI.createURI("model1.uml"));
EObject e2 = ModelUtils.load(URI.createURI("model2.uml"));
MatchModel match = null;
match = new MatchService().doMatch(e1, e2, new
NullProgressMonitor());
Thanks again,
Andrew
Ar 10/07/2007 17
:09, Scríobh Cédric Brun:
> Hi Andrew,
>
> tutorials and code samples are not yet ready, it's coming :)
>
> Though, to compare two models the process is basically this one:
> EObject eObject1 = ModelUtils.load(model1URI);
> EObject eObject2 = ModelUtils.load(model2URI);
> final MatchModel match = new MatchService().doMatch(
> eObject1, eObject2, new NullProgressMonitor());
> final DiffModel diff = new DiffMaker().doDiff(match);
>
> Then you can browse the diff, if you want to merge stuffs you'll have to
> create a merger using the diffelement:
> final AbstractMerger merger = MergeFactory.createMerger(element);
>
> Then you can choose:
> merger.undoInTarget();
> or
> merger.applyInOrigin();
>
>
> The "getDefaultSearchWindow()" issue is a bug :
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=195859 , it appears when the
> preferences have not been initialized.
> There is a workaround : you should open the preferences pages and set the
> default value for the "Search Window" - which is 100 by default.
>
> Cédric
>
>
> Andrew Carton wrote:
>
>> Hi,
>>
>> How would one match (and diff) between two instance models of the same
>> metamodel and then go on to merge those differences in java? I was
>> looking at the source but I can't find any concrete implementation of
>> MatchEngine. I tried doing a modelMatch() on DifferencesServices but it
>> throws and error looking for a window.
>>
>>
> org.eclipse.emf.compare.match.statistic.DifferencesServices. getDefaultSearchWindow(DifferencesServices.java:327)
>> Are there any tutorials on this too or code samples ?
>>
>> Thanks!
>> Andrew.
>
|
|
|
Re: [EMF Compare] Help with API [message #88905 is a reply to message #88805] |
Wed, 11 July 2007 03:56  |
Eclipse User |
|
|
|
I did not understood you wanted to use EMF compare without using plugins and
extension points.
As you won't use the extension points you'll have to choose the match engine
by yourself. Basically the generic one should fit:
EObject eObject1 = ModelUtils.load(model1URI);
EObject eObject2 = ModelUtils.load(model2URI);
final MatchModel match = new DifferencesServices().modelMatch(
eObject1, eObject2, new NullProgressMonitor());
final DiffModel diff = new DiffMaker().doDiff(match);
Cédric
Andrew Carton wrote:
> Hey Cédric,
>
> Unfortunately when I am doing that, I get this error. It looks like it
> wants to be a plugin!
>
> ption in thread "main" java.lang.NullPointerException at
>
org.eclipse.emf.compare.match.service.MatchService.parseExte nsionMetadata(MatchService.java:52)
> at
>
org.eclipse.emf.compare.match.service.MatchService.<init>(MatchService.java:48)
>
>
> EObject e1 = ModelUtils.load(URI.createURI("model1.uml"));
> EObject e2 = ModelUtils.load(URI.createURI("model2.uml"));
> MatchModel match = null;
> match = new MatchService().doMatch(e1, e2, new
> NullProgressMonitor());
>
>
> Thanks again,
> Andrew
>
> Ar 10/07/2007 17
> :09, Scríobh Cédric Brun:
>> Hi Andrew,
>>
>> tutorials and code samples are not yet ready, it's coming :)
>>
>> Though, to compare two models the process is basically this one:
>> EObject eObject1 = ModelUtils.load(model1URI);
>> EObject eObject2 = ModelUtils.load(model2URI);
>> final MatchModel match = new MatchService().doMatch(
>> eObject1, eObject2, new NullProgressMonitor());
>> final DiffModel diff = new DiffMaker().doDiff(match);
>>
>> Then you can browse the diff, if you want to merge stuffs you'll have to
>> create a merger using the diffelement:
>> final AbstractMerger merger = MergeFactory.createMerger(element);
>>
>> Then you can choose:
>> merger.undoInTarget();
>> or
>> merger.applyInOrigin();
>>
>>
>> The "getDefaultSearchWindow()" issue is a bug :
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=195859 , it appears when
>> the preferences have not been initialized.
>> There is a workaround : you should open the preferences pages and set
>> the
>> default value for the "Search Window" - which is 100 by default.
>>
>> Cédric
>>
>>
>> Andrew Carton wrote:
>>
>>> Hi,
>>>
>>> How would one match (and diff) between two instance models of the same
>>> metamodel and then go on to merge those differences in java? I was
>>> looking at the source but I can't find any concrete implementation of
>>> MatchEngine. I tried doing a modelMatch() on DifferencesServices but it
>>> throws and error looking for a window.
>>>
>>>
>>
org.eclipse.emf.compare.match.statistic.DifferencesServices. getDefaultSearchWindow(DifferencesServices.java:327)
>>> Are there any tutorials on this too or code samples ?
>>>
>>> Thanks!
>>> Andrew.
>>
|
|
|
Re: [EMF Compare] Help with API [message #608682 is a reply to message #88718] |
Tue, 10 July 2007 12:09  |
Eclipse User |
|
|
|
Hi Andrew,
tutorials and code samples are not yet ready, it's coming :)
Though, to compare two models the process is basically this one:
EObject eObject1 = ModelUtils.load(model1URI);
EObject eObject2 = ModelUtils.load(model2URI);
final MatchModel match = new MatchService().doMatch(
eObject1, eObject2, new NullProgressMonitor());
final DiffModel diff = new DiffMaker().doDiff(match);
Then you can browse the diff, if you want to merge stuffs you'll have to
create a merger using the diffelement:
final AbstractMerger merger = MergeFactory.createMerger(element);
Then you can choose:
merger.undoInTarget();
or
merger.applyInOrigin();
The "getDefaultSearchWindow()" issue is a bug :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=195859 , it appears when the
preferences have not been initialized.
There is a workaround : you should open the preferences pages and set the
default value for the "Search Window" - which is 100 by default.
Cédric
Andrew Carton wrote:
> Hi,
>
> How would one match (and diff) between two instance models of the same
> metamodel and then go on to merge those differences in java? I was
> looking at the source but I can't find any concrete implementation of
> MatchEngine. I tried doing a modelMatch() on DifferencesServices but it
> throws and error looking for a window.
>
>
org.eclipse.emf.compare.match.statistic.DifferencesServices. getDefaultSearchWindow(DifferencesServices.java:327)
>
> Are there any tutorials on this too or code samples ?
>
> Thanks!
> Andrew.
|
|
|
Re: [EMF Compare] Help with API [message #608683 is a reply to message #88775] |
Tue, 10 July 2007 12:10  |
Eclipse User |
|
|
|
Thats grand, thanks very much!
Andrew.
Ar 10/07/2007 17:09, Scríobh Cédric Brun:
> Hi Andrew,
>
> tutorials and code samples are not yet ready, it's coming :)
>
> Though, to compare two models the process is basically this one:
> EObject eObject1 = ModelUtils.load(model1URI);
> EObject eObject2 = ModelUtils.load(model2URI);
> final MatchModel match = new MatchService().doMatch(
> eObject1, eObject2, new NullProgressMonitor());
> final DiffModel diff = new DiffMaker().doDiff(match);
>
> Then you can browse the diff, if you want to merge stuffs you'll have to
> create a merger using the diffelement:
> final AbstractMerger merger = MergeFactory.createMerger(element);
>
> Then you can choose:
> merger.undoInTarget();
> or
> merger.applyInOrigin();
>
>
> The "getDefaultSearchWindow()" issue is a bug :
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=195859 , it appears when the
> preferences have not been initialized.
> There is a workaround : you should open the preferences pages and set the
> default value for the "Search Window" - which is 100 by default.
>
> Cédric
>
>
> Andrew Carton wrote:
>
>> Hi,
>>
>> How would one match (and diff) between two instance models of the same
>> metamodel and then go on to merge those differences in java? I was
>> looking at the source but I can't find any concrete implementation of
>> MatchEngine. I tried doing a modelMatch() on DifferencesServices but it
>> throws and error looking for a window.
>>
>>
> org.eclipse.emf.compare.match.statistic.DifferencesServices. getDefaultSearchWindow(DifferencesServices.java:327)
>> Are there any tutorials on this too or code samples ?
>>
>> Thanks!
>> Andrew.
>
|
|
|
Re: [EMF Compare] Help with API [message #608684 is a reply to message #88775] |
Tue, 10 July 2007 12:30  |
Eclipse User |
|
|
|
Hey Cédric,
Unfortunately when I am doing that, I get this error. It looks like it
wants to be a plugin!
ption in thread "main" java.lang.NullPointerException at
org.eclipse.emf.compare.match.service.MatchService.parseExte nsionMetadata(MatchService.java:52)
at
org.eclipse.emf.compare.match.service.MatchService.<init>(MatchService.java:48)
EObject e1 = ModelUtils.load(URI.createURI("model1.uml"));
EObject e2 = ModelUtils.load(URI.createURI("model2.uml"));
MatchModel match = null;
match = new MatchService().doMatch(e1, e2, new
NullProgressMonitor());
Thanks again,
Andrew
Ar 10/07/2007 17
:09, Scríobh Cédric Brun:
> Hi Andrew,
>
> tutorials and code samples are not yet ready, it's coming :)
>
> Though, to compare two models the process is basically this one:
> EObject eObject1 = ModelUtils.load(model1URI);
> EObject eObject2 = ModelUtils.load(model2URI);
> final MatchModel match = new MatchService().doMatch(
> eObject1, eObject2, new NullProgressMonitor());
> final DiffModel diff = new DiffMaker().doDiff(match);
>
> Then you can browse the diff, if you want to merge stuffs you'll have to
> create a merger using the diffelement:
> final AbstractMerger merger = MergeFactory.createMerger(element);
>
> Then you can choose:
> merger.undoInTarget();
> or
> merger.applyInOrigin();
>
>
> The "getDefaultSearchWindow()" issue is a bug :
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=195859 , it appears when the
> preferences have not been initialized.
> There is a workaround : you should open the preferences pages and set the
> default value for the "Search Window" - which is 100 by default.
>
> Cédric
>
>
> Andrew Carton wrote:
>
>> Hi,
>>
>> How would one match (and diff) between two instance models of the same
>> metamodel and then go on to merge those differences in java? I was
>> looking at the source but I can't find any concrete implementation of
>> MatchEngine. I tried doing a modelMatch() on DifferencesServices but it
>> throws and error looking for a window.
>>
>>
> org.eclipse.emf.compare.match.statistic.DifferencesServices. getDefaultSearchWindow(DifferencesServices.java:327)
>> Are there any tutorials on this too or code samples ?
>>
>> Thanks!
>> Andrew.
>
|
|
|
Re: [EMF Compare] Help with API [message #608691 is a reply to message #88805] |
Wed, 11 July 2007 03:56  |
Eclipse User |
|
|
|
I did not understood you wanted to use EMF compare without using plugins and
extension points.
As you won't use the extension points you'll have to choose the match engine
by yourself. Basically the generic one should fit:
EObject eObject1 = ModelUtils.load(model1URI);
EObject eObject2 = ModelUtils.load(model2URI);
final MatchModel match = new DifferencesServices().modelMatch(
eObject1, eObject2, new NullProgressMonitor());
final DiffModel diff = new DiffMaker().doDiff(match);
Cédric
Andrew Carton wrote:
> Hey Cédric,
>
> Unfortunately when I am doing that, I get this error. It looks like it
> wants to be a plugin!
>
> ption in thread "main" java.lang.NullPointerException at
>
org.eclipse.emf.compare.match.service.MatchService.parseExte nsionMetadata(MatchService.java:52)
> at
>
org.eclipse.emf.compare.match.service.MatchService.<init>(MatchService.java:48)
>
>
> EObject e1 = ModelUtils.load(URI.createURI("model1.uml"));
> EObject e2 = ModelUtils.load(URI.createURI("model2.uml"));
> MatchModel match = null;
> match = new MatchService().doMatch(e1, e2, new
> NullProgressMonitor());
>
>
> Thanks again,
> Andrew
>
> Ar 10/07/2007 17
> :09, Scríobh Cédric Brun:
>> Hi Andrew,
>>
>> tutorials and code samples are not yet ready, it's coming :)
>>
>> Though, to compare two models the process is basically this one:
>> EObject eObject1 = ModelUtils.load(model1URI);
>> EObject eObject2 = ModelUtils.load(model2URI);
>> final MatchModel match = new MatchService().doMatch(
>> eObject1, eObject2, new NullProgressMonitor());
>> final DiffModel diff = new DiffMaker().doDiff(match);
>>
>> Then you can browse the diff, if you want to merge stuffs you'll have to
>> create a merger using the diffelement:
>> final AbstractMerger merger = MergeFactory.createMerger(element);
>>
>> Then you can choose:
>> merger.undoInTarget();
>> or
>> merger.applyInOrigin();
>>
>>
>> The "getDefaultSearchWindow()" issue is a bug :
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=195859 , it appears when
>> the preferences have not been initialized.
>> There is a workaround : you should open the preferences pages and set
>> the
>> default value for the "Search Window" - which is 100 by default.
>>
>> Cédric
>>
>>
>> Andrew Carton wrote:
>>
>>> Hi,
>>>
>>> How would one match (and diff) between two instance models of the same
>>> metamodel and then go on to merge those differences in java? I was
>>> looking at the source but I can't find any concrete implementation of
>>> MatchEngine. I tried doing a modelMatch() on DifferencesServices but it
>>> throws and error looking for a window.
>>>
>>>
>>
org.eclipse.emf.compare.match.statistic.DifferencesServices. getDefaultSearchWindow(DifferencesServices.java:327)
>>> Are there any tutorials on this too or code samples ?
>>>
>>> Thanks!
>>> Andrew.
>>
|
|
|
Goto Forum:
Current Time: Mon May 05 09:17:20 EDT 2025
Powered by FUDForum. Page generated in 0.03097 seconds
|