Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Compare] Is it possible to ignore the element order?
[EMF Compare] Is it possible to ignore the element order? [message #632564] Wed, 13 October 2010 13:13 Go to next message
Jan Baart is currently offline Jan BaartFriend
Messages: 2
Registered: October 2010
Junior Member
Hi,

I'm trying to compare a refactored model to a specified target model
using EMF Compare. This is working fine and as expected but I'd like to
give the user an option to ignore re-ordered elements. Because the user
has to manually create a target model this might be more convenient than
making sure the elements have the same order as in the source model.
However, it seems to me there is no way to make EMF Compare ignore the
order.

Am I just overlooking something or is this not possible? I noticed the
papers mention a change of order as a basic possible difference between
models but in certain cases, semantically, reordering is not a
difference at all.

thanks

Jan
Re: [EMF Compare] Is it possible to ignore the element order? [message #632643 is a reply to message #632564] Wed, 13 October 2010 17:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Jan

This should not be a problem.

If the meta-model collection isOrdered then ordering matters.

If the meta-model collection !isOrdered then EMF Compare should be
blind; raise a bug.

Regards

Ed Willink

On 13/10/2010 14:13, Jan Baart wrote:
> Hi,
>
> I'm trying to compare a refactored model to a specified target model
> using EMF Compare. This is working fine and as expected but I'd like to
> give the user an option to ignore re-ordered elements. Because the user
> has to manually create a target model this might be more convenient than
> making sure the elements have the same order as in the source model.
> However, it seems to me there is no way to make EMF Compare ignore the
> order.
>
> Am I just overlooking something or is this not possible? I noticed the
> papers mention a change of order as a basic possible difference between
> models but in certain cases, semantically, reordering is not a
> difference at all.
>
> thanks
>
> Jan
Re: [EMF Compare] Is it possible to ignore the element order? [message #633048 is a reply to message #632643] Fri, 15 October 2010 08:19 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Jan,

As Ed mentionned, we only consider "order" important if you defined it as such in your metamodel. We do not, however, provide a way for the user to ignore order changes in ordered references.

You'll need to open your meta model, select the reference where order isn't important, open its properties (right click => show properties view) and set "ordered" to "false" for EMF Compare to ignore it.

Laurent Goubet
Obeo
Re: [EMF Compare] Is it possible to ignore the element order? [message #633084 is a reply to message #632564] Fri, 15 October 2010 10:05 Go to previous message
Patrick Konemann is currently offline Patrick KonemannFriend
Messages: 116
Registered: July 2009
Senior Member
Hi Jan,

I had a similar issue and maybe this is or interest to you.

The comparisons I have contain a lot of order changes but I am not interested in them.
I'm calling EMF Compare programmatically, so I can access the computed diffmodel.
Before opening the compare UI for the user, I remove all order changes:

org.eclipse.emf.compare.mpatch.util.MPatchUtil.removeDiffEle mentOfType(snapshot.getDiff(), Collections.singleton(DiffPackage.Literals.REFERENCE_ORDER_C HANGE));

MPatchUtil is available in the CVS repository of EMF Compare, or I can post the method here if you like.


Hope it helps
Patrick


On 13-10-2010 15:13, Jan Baart wrote:
> Hi,
>
> I'm trying to compare a refactored model to a specified target model using EMF Compare. This is working fine and as expected but I'd like to give the user an option to ignore re-ordered elements. Because the user has to manually create a target model this might be more convenient than making sure
> the elements have the same order as in the source model. However, it seems to me there is no way to make EMF Compare ignore the order.
>
> Am I just overlooking something or is this not possible? I noticed the papers mention a change of order as a basic possible difference between models but in certain cases, semantically, reordering is not a difference at all.
>
> thanks
>
> Jan
Previous Topic:[EMF Compare] Duplicate differences into DiffModel
Next Topic:[Texo] running tools outside eclipse
Goto Forum:
  


Current Time: Wed Apr 24 22:17:34 GMT 2024

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

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

Back to the top