Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Compare] nested references in the model diff(How can we merge models when a attribute has nested references)
[EMF Compare] nested references in the model diff [message #516062] Mon, 22 February 2010 16:03 Go to next message
Sabri Skhiri is currently offline Sabri SkhiriFriend
Messages: 43
Registered: February 2010
Member
Hi,

I am studying the EMF compare merger and I found a problem with the merge of reference.
I reproduced the problem with the inventory meta-model I got from the EMF CVS: org.eclipse.emf/org.eclipse.emf.cdo/examples/org.gastro.inve ntory/model/inventory.ecore it would be easier to describe.

In this meta-model you can find
* Section which has a attribute Offering with Containment = false => a reference
* Offering has a attribute product with Containment = false as well
In my right model I have got
Section:: Section1
-Offering:: offer1
-- Product:: product1
In my left model, If I add an offering :
Section: Section1
-Offering:: offer1
-- Product:: product1
-Offering:: offer2
-- Product:: product1
The diff model will detect an ModelElementChangeLeftTarget
<subDiffElements xsi:type="diff:DiffGroup">
       <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
       <rightParent href="platform:/resource/Model%20Compare/cdo-compare/tocompare/resto1c.inventory#/0/@menuCards.0/@sections.0"/>
        <leftElement href="platform:/resource/Model%20Compare/cdo-compare/tocompare/resto1.inventory#/0/@menuCards.0/@sections.0/@offerings.1"/>
         </subDiffElements>
        <rightParent href="platform:/resource/Model%20Compare/cdo-compare/tocompare/resto1c.inventory#/0/@menuCards.0/@sections.0"/>
       </subDiffElements>

If I do a merge LeftToRigth, I will have the offer2 merged but not the its reference to product1:
Section: Section1
-Offering:: offer1
-- Product:: product1
-Offering:: offer2

In this case a second compare with I want :
Section: Section1
-Offering:: offer1
-- Product:: product1
-Offering:: offer2
-- Product:: product1

will give us the updated reference:
 
<subDiffElements xsi:type="diff:UpdateReference">
      <reference href="http://www.gastro.org/inventory/1.0#//Offering/product"/>
          <rightElement href="platform:/resource/Model%20Compare/cdo-compare/tocompare/resto1c.inventory#/0/@menuCards.0/@sections.0/@offerings.1"/>
            <leftElement href="platform:/resource/Model%20Compare/cdo-compare/tocompare/resto1.inventory#/0/@menuCards.0/@sections.0/@offerings.1"/>
             <leftTarget href="platform:/resource/Model%20Compare/cdo-compare/tocompare/resto1.inventory#/0/@departments.0/@stocks.0/@products.0"/>
            <rightTarget href="platform:/resource/Model%20Compare/cdo-compare/tocompare/resto1c.inventory#/0/@departments.0/@stocks.0/@products.0"/>
  </subDiffElements>
  <rightParent href="platform:/resource/Model%20Compare/cdo-compare/tocompare/resto1c.inventory#/0/@menuCards.0/@sections.0/@offerings.1"/>
 </subDiffElements>
  <rightParent href="platform:/resource/Model%20Compare/cdo-compare/tocompare/resto1c.inventory#/0/@menuCards.0/@sections.0"/>


In summary, to be able to merge the addition of an Offering and a product, I needed to merge twice.
1. Is it normal that have to detect this change in 2 times ? Does it mean that the ModelElementChangeLeftTargetMerger does not care about the nested reference within the newly-added child ? (in this case product)
2. Does it mean that if I had n nested references, I would be able to merge by comparing and merging n times ?
3. Which method do you advise to merge nested references?

Thank you !

Sabri.



[Updated on: Mon, 22 February 2010 16:05]

Report message to a moderator

Re: [EMF Compare] nested in the model diff [message #516216 is a reply to message #516062] Tue, 23 February 2010 08:53 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.
--------------090501030004050601010607
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Sabri,

Please use the EMF newsgroup for any question related to EMF Compare.

The reference under the merged element should have been copied along ...
fot it not to be merged means we have a bug in the merger code. Please
raise a bug against EMF Compare for this issue.

Laurent Goubet
Obeo

Sabri Skhiri wrote:
> Hi,
>
> I am studying the EMF compare merger and I found a problem with the
> merge of reference.
> I reproduced the problem with the inventory meta-model I got from the
> EMF CVS: org.eclipse.emf/org.eclipse.emf.cdo/examples/org.gastro.inve
> ntory/model/inventory.ecore it would be easier to describe.
>
> In this meta-model you can find * Section which has a attribute Offering
> with Containment = false => a reference
> * Offering has a attribute product with Containment = false as well
> In my right model I have got
> Section:: Section1
> -Offering:: offer1
> -- Product:: product1
> In my left model, If I add an offering :
> Section: Section1
> -Offering:: offer1
> -- Product:: product1
> -Offering:: offer2
> -- Product:: product1
> The diff model will detect an ModelElementChangeLeftTarget
>
> <subDiffElements xsi:type="diff:DiffGroup">
> <subDiffElements xsi:type="diff:ModelElementChangeLeftTarget">
> <rightParent
> href=" platform:/resource/Model%20Compare/cdo-compare/tocompare/res to1c.inventory#/0/@menuCards.0/@sections.0 "/>
>
> <leftElement
> href=" platform:/resource/Model%20Compare/cdo-compare/tocompare/res to1.inventory#/0/@menuCards.0/@sections.0/@offerings.1 "/>
>
> </subDiffElements>
> <rightParent
> href=" platform:/resource/Model%20Compare/cdo-compare/tocompare/res to1c.inventory#/0/@menuCards.0/@sections.0 "/>
>
> </subDiffElements>
>
> If I do a merge LeftToRigth, I will have the offer2 merged but not the
> its reference to product1:
> Section: Section1
> -Offering:: offer1
> -- Product:: product1
> -Offering:: offer2
>
> In this case a second compare with I want :
> Section: Section1
> -Offering:: offer1
> -- Product:: product1
> -Offering:: offer2
> -- Product:: product1
>
> will give us the updated reference:
>
> <subDiffElements xsi:type="diff:UpdateReference">
> <reference
> href="http://www.gastro.org/inventory/1.0#//Offering/product"/>
> <rightElement
> href=" platform:/resource/Model%20Compare/cdo-compare/tocompare/res to1c.inventory#/0/@menuCards.0/@sections.0/@offerings.1 "/>
>
> <leftElement
> href=" platform:/resource/Model%20Compare/cdo-compare/tocompare/res to1.inventory#/0/@menuCards.0/@sections.0/@offerings.1 "/>
>
> <leftTarget
> href=" platform:/resource/Model%20Compare/cdo-compare/tocompare/res to1.inventory#/0/@departments.0/@stocks.0/@products.0 "/>
>
> <rightTarget
> href=" platform:/resource/Model%20Compare/cdo-compare/tocompare/res to1c.inventory#/0/@departments.0/@stocks.0/@products.0 "/>
>
> </subDiffElements>
> <rightParent
> href=" platform:/resource/Model%20Compare/cdo-compare/tocompare/res to1c.inventory#/0/@menuCards.0/@sections.0/@offerings.1 "/>
>
> </subDiffElements>
> <rightParent
> href=" platform:/resource/Model%20Compare/cdo-compare/tocompare/res to1c.inventory#/0/@menuCards.0/@sections.0 "/>
>
>
> In summary, to be able to merge the addition of an Offering and a
> product, I needed to merge twice.
> 1. Is it normal that have to detect this change in 2 times ? Does it
> mean that the ModelElementChangeLeftTargetMerger does not care about the
> nested reference within the newly-added child ? (in this case product)
> 2. Does it mean that if I had n nested references, I would be able to
> merge by comparing and merging n times ?
> 3. Which method do you advise to merge nested references?
> Thank you !
>
> Sabri.
>
>
>
>


--------------090501030004050601010607
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=
--------------090501030004050601010607--
Previous Topic:[JS4EMF] Proposal feedback
Next Topic:[EMF Compare] nested in the model diff
Goto Forum:
  


Current Time: Thu Apr 25 13:21:44 GMT 2024

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

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

Back to the top