Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Compare] Compare UML models
[EMF Compare] Compare UML models [message #513054] Mon, 08 February 2010 11:46 Go to next message
Karsten Thoms is currently offline Karsten Thoms
Messages: 353
Registered: July 2009
Location: Dortmund
Senior Member

I am trying to compare two versions of an UML model (with profiles applied) in an standalone environment (to be more precise: from an MWE process in a custom workflow component). The UML package is registered and models are loaded correctly.

I'm comparing like follows:
			MatchModel match = MatchService.doContentMatch(v1, v2, options);
			DiffModel diff = new GenericDiffEngine().doDiff(match);
			ctx.set(outputSlot, diff);
			
            final ComparisonResourceSnapshot snapshot = DiffFactory.eINSTANCE.createComparisonResourceSnapshot();
            snapshot.setDate(Calendar.getInstance().getTime());
            snapshot.setMatch(match);
            snapshot.setDiff(diff);
            ModelUtils.save(snapshot, "result.emfdiff");


In the resulting DiffModel I get just two entries:
- One ModelElementChangeLeftTarget with kind==Addition and leftElement=[v1]
- One ModelElementChangeRightTarget with kind==Deletion and leftElement=[v2]

It seems that the result is "the model is added in the one file and deleted in the other". I would expect that the DiffModel contains entries for each real change. What am I doing wrong here?

Next issue: When I try to compare those models with the UI takes forever in the phase "Processing matched roots' contents". Is this a known problem?

Kind regards,
~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [EMF Compare] Compare UML models [message #513061 is a reply to message #513054] Mon, 08 February 2010 12:09 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten Thoms
Messages: 353
Registered: July 2009
Location: Dortmund
Senior Member

When I change
MatchService.doContentMatch(v1, v2, options);
to
MatchService.doMatch(v1, v2, options);

it works. Why does doContentMatch() not give the expected result? What's the difference between both methods?

~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [EMF Compare] Compare UML models [message #514426 is a reply to message #513061] Mon, 15 February 2010 00:10 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1621
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030408050102070500030702
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Karsten,

doContentMatch() compares the content of the two given elements, doMatch
() goes up to the resource to compare (it is an equivalent to
doResourceMatch()). If you've got nothing under the two elements you
give the MatchService, I'd understand that you don't get much results.

With this in mind, are the results you get irrelevant or did you in fact
get accurate results considering only the content of v1 and v2 ?

laurent Goubet
Obeo

Karsten Thoms wrote:
> When I change
> MatchService.doContentMatch(v1, v2, options);
> to
> MatchService.doMatch(v1, v2, options);
>
> it works. Why does doContentMatch() not give the expected result? What's
> the difference between both methods?
>
> ~Karsten


--------------030408050102070500030702
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
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------030408050102070500030702--
Re: [EMF Compare] Compare UML models [message #514454 is a reply to message #513054] Mon, 15 February 2010 07:36 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten Thoms
Messages: 353
Registered: July 2009
Location: Dortmund
Senior Member

Hi Laurent!

Thanks for your reply! We decided now to follow another way, since the results we got from comparing UML models directly did not allow us to evaluate the results easily. What we want to achieve is compare different states of our class model, which has an applied profile. From that we want to derive a change report for our generated interfaces, which is DDL on the backend and an XSD on the frontend. What made life complicate with UML directly is:
- associations
- tagged values (no direct relation to the profiled element)
- derived attributes and relations

We now transform the UML models to EMF models that are tighter bound to what we use in code generation. Comparing these models with EMF compare is far easier to evaluate.

Best wishes,
~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [EMF Compare] Compare UML models [message #514675 is a reply to message #514454] Tue, 16 February 2010 05:14 Go to previous message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1621
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040605090505050005070804
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Karsten,

Thanks for the feedback ;). We know that EMF Compare indeed has problems
with UML specificities, yet a comparison engine tightly bound to UML is
not planned yet.

Laurent Goubet
Obeo

Karsten Thoms wrote:
> Hi Laurent!
>
> Thanks for your reply! We decided now to follow another way, since the
> results we got from comparing UML models directly did not allow us to
> evaluate the results easily. What we want to achieve is compare
> different states of our class model, which has an applied profile. From
> that we want to derive a change report for our generated interfaces,
> which is DDL on the backend and an XSD on the frontend. What made life
> complicate with UML directly is:
> - associations
> - tagged values (no direct relation to the profiled element)
> - derived attributes and relations
>
> We now transform the UML models to EMF models that are tighter bound to
> what we use in code generation. Comparing these models with EMF compare
> is far easier to evaluate.
>
> Best wishes,
> ~Karsten


--------------040605090505050005070804
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
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------040605090505050005070804--
Previous Topic:[EEF] Databinding and non-SWT UIs
Next Topic:[EMF Compare] Compare UML models
Goto Forum:
  


Current Time: Wed Jul 30 01:24:16 EDT 2014

Powered by FUDForum. Page generated in 0.01802 seconds