Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF Compare Example
EMF Compare Example [message #621518] Tue, 27 October 2009 03:51 Go to next message
saadbin abid is currently offline saadbin abidFriend
Messages: 61
Registered: October 2009
Location: Ireland
Member
Hello Fellow Emf compare users,

I am very new to EMF compare and have just started with it. I have downloaded all plug-ins and started working with initial examples. which worked fine for me. But now.I am having trouble in comparing and understanding Emf merge model.

1. I am comparing two models, instances of same meta model. after executing EMF compare i get *.emfdiff file i am having same left and right elements and references to them even though i am loading both from difference directories resources (But in the same resource). same names and elements but different "hrefs" for left and right model. I am confused why is it so?

2. When i try to traverse for unmatched elements (after change by adding new elements to left model) i cannot traverse it properly? (any example available)

3. I would to solve the following scenario with emf compare
model a
model b
in the beginning both are having similar elements in them .
i am changing model "a" and than comparing it with model "b". now i want to synchronize "b" w.r.t "a" automatically. Is there anyway in EMF compare untility?

thank you very much for consideration
regards
saad
Re: EMF Compare Example [message #621519 is a reply to message #621518] Tue, 27 October 2009 08:37 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070504010300050905030705
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi saad,

comments inlined below.

Laurent

saad bin abid a écrit :
> Hello Fellow Emf compare users,
>
> I am very new to EMF compare and have just started with it. I have
> downloaded all plug-ins and started working with initial examples. which
> worked fine for me. But now.I am having trouble in comparing and
> understanding Emf merge model.
>
> 1. I am comparing two models, instances of same meta model. after
> executing EMF compare i get *.emfdiff file i am having same left and
> right elements and references to them even though i am loading both from
> difference directories resources (But in the same resource). same names
> and elements but different "hrefs" for left and right model. I am
> confused why is it so?

Don't really understand your question here. Different hrefs means the
two elements are not "the same". You're probably looking at a
MatchElement which "left" reference points to the left model and "right"
reference to the right model. These elements allow us to match similar
elements from both models, and looking at the MatchElement in "visual"
mode (in the sample ecore editor) will probably give two elements
looking really similar if you haven't changed the name of one of the two
in one of the two models.

>
> 2. When i try to traverse for unmatched elements (after change by adding
> new elements to left model) i cannot traverse it properly? (any example
> available)

Sorry, don't understand your question. What does "I cannot traverse it
properly" mean? You get an exception? How do you "traverse" your
elements : in the sample ecore editor, through code, ...? Examples of a
comparison from start to finish, merge included, can be found in the
org.eclipse.emf.compare.example.standalone example.

>
> 3. I would to solve the following scenario with emf compare
> model a
> model b
> in the beginning both are having similar elements in them .
> i am changing model "a" and than comparing it with model "b". now i want
> to synchronize "b" w.r.t "a" automatically. Is there anyway in EMF
> compare untility?

Comparing a and b is done through
DiffService.doDiff(a, b);
MatchService.doMatch(diff);

The same kind of facility is accessible for the merge through
"MergeService.merge(differences, direction)"

>
> thank you very much for consideration
> regards
> saad
>


--------------070504010300050905030705
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyLyI+T2JlbzwvYT4NCmVtYWls O2ludGVybmV0
OmxhdXJlbnQuZ291YmV0QG9iZW8uZnINCnVybDpodHRwOi8vd3d3Lm9iZW8u ZnINCnZlcnNp
b246Mi4xDQplbmQ6dmNhcmQNCg0K
--------------070504010300050905030705--
Re: EMF Compare Example [message #621526 is a reply to message #621518] Thu, 29 October 2009 01:36 Go to previous messageGo to next message
saadbin abid is currently offline saadbin abidFriend
Messages: 61
Registered: October 2009
Location: Ireland
Member
Hello Laurent,
I just figure out the problem. As i was using both merging and differencing at the same time so that was the reason i wasn't able to see the changes i was making and also 3 way compare better suited to solve my problem. anyhow thanks for your quick replies.

my next question is that is it possible to save merge as new file some where else on disk or serialize that as snap shot?

I want to merge file a.xml with file b.xml and save it as file c.xml on disk
regards
saad
Re: EMF Compare Example [message #621535 is a reply to message #621526] Thu, 29 October 2009 09:11 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060105090109060305080409
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi saad,

Saving the merged file elsewhere is not possible in this order. What you
can do is copy a.xml to c.xml (so that "a.xml" is now a backup), compare
"c.xml" with "b.xml" (instead of comparing a.xml and b.xml) and merge
all changes to c.xml. That would do the trick for you would it not?

Laurent Goubet
Obeo

saad bin abid a écrit :
> Hello Laurent,
> I just figure out the problem. As i was using both merging and
> differencing at the same time so that was the reason i wasn't able to
> see the changes i was making and also 3 way compare better suited to
> solve my problem. anyhow thanks for your quick replies.
>
> my next question is that is it possible to save merge as new file some
> where else on disk or serialize that as snap shot?
>
> I want to merge file a.xml with file b.xml and save it as file c.xml on
> disk regards
> saad


--------------060105090109060305080409
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyLyI+T2JlbzwvYT4NCmVtYWls O2ludGVybmV0
OmxhdXJlbnQuZ291YmV0QG9iZW8uZnINCnVybDpodHRwOi8vd3d3Lm9iZW8u ZnINCnZlcnNp
b246Mi4xDQplbmQ6dmNhcmQNCg0K
--------------060105090109060305080409--
Previous Topic:EMF Compare Example
Next Topic:[MWE] DirectoryCleaner not working when called from parent project with Maven
Goto Forum:
  


Current Time: Thu Apr 25 00:11:31 GMT 2024

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

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

Back to the top