Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem with referencing resources when updating the referenced resource
Problem with referencing resources when updating the referenced resource [message #647012] Tue, 04 January 2011 02:17 Go to next message
Abdel  is currently offline Abdel Friend
Messages: 10
Registered: July 2009
Junior Member
Hi all,

I have created two instances of classes from an ecore model.
insctance one is: Functional.xmi
insctance two is: Organizational.xmi

Organizational.xmi has references to Functional.xmi. The reference is based in the following unidirectional EReference
<eStructuralFeatures xsi:type="ecore:EReference" name="activity" lowerBound="1" upperBound="-1" eType="#//Activity"/>


in Organizational.xmi we can find a reference to Functional.xmi like this:
<interactionPart xsi:type="bp:PerformerRole" name="Requester" isProcessorRole="true">
<activity xsi:type="bp:InstigationEvent" href="FunctionalView.xmi#//@activity.0"/>
<activity xsi:type="bp:REAAgentIdentification" href="FunctionalView.xmi#//@activity.3"/>
<activity xsi:type="bp:ContractEvent" href="FunctionalView.xmi#//@activity.4"/>
</interactionPart>

in the Functional.xmi we define objects of type Activity like this
<activity xsi:type="bp:InstigationEvent" name="Create Requisition" outResource="//@activity.0/@ownedResource.0">
<ownedResource xsi:type="bp:Requisition" name="Purchase requisition" resResource="//@activity.4/@ownedResource.0"/>
</activity>
<activity xsi:type="bp:REAAgentIdentification" name="Process RFQ" outResource="//@activity.1/@ownedResource.0">
<ownedResource xsi:type="bp:Artifact" name="Quotation"/>
</activity>
.......

The problem comes when I load my Functional.xmi and remove entries of type Activity (using EcoreUtil.delete). The Organizational.xmi does not follow.
In the Functional.xmi, every thing is ok. but removed references still in the Organizational.xmi even if I defines a bidirectional reference.


What can i do so the deleted object will be removed from the referencing resource and
the references will be valid (for example, if I delete //@activity.4 from Functional.xmi, than //@activity.5 becomes //@activity.4 in Organizational.xmi)

Thanks a lot






[Updated on: Tue, 04 January 2011 02:19]

Report message to a moderator

Re: Problem with referencing resources when updating the referenced resource [message #647017 is a reply to message #647012] Tue, 04 January 2011 04:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Abdel,

Comments below.


Abdel wrote:
> Hi all,
>
> I have created two instances of classes from an ecore model.
> insctance one is: Functional.xmi
> insctance two is: Organizational.xmi
>
> Organizational.xmi has reference to Functional.xmi. The reference is
> based in the following unidirectional EReference
> <eStructuralFeatures xsi:type="ecore:EReference" name="activity"
> lowerBound="1" upperBound="-1" eType="#//Activity"/>
>
>
> in Organizational.xmi we can find a reference to Functional.xmi like
> this:
> <interactionPart xsi:type="bp:PerformerRole" name="Requester"
> isProcessorRole="true">
> <activity xsi:type="bp:InstigationEvent"
> href="FunctionalView.xmi#//@activity.0"/>
> <activity xsi:type="bp:REAAgentIdentification"
> href="FunctionalView.xmi#//@activity.3"/>
> <activity xsi:type="bp:ContractEvent"
> href="FunctionalView.xmi#//@activity.4"/> </interactionPart>
>
> in the Functional.xmi we define object of type Activity like this
> <activity xsi:type="bp:InstigationEvent" name="Create Requisition"
> outResource="//@activity.0/@ownedResource.0">
> <ownedResource xsi:type="bp:Requisition" name="Purchase
> requisition" resResource="//@activity.4/@ownedResource.0"/>
> </activity>
> <activity xsi:type="bp:REAAgentIdentification" name="Process RFQ"
> outResource="//@activity.1/@ownedResource.0">
> <ownedResource xsi:type="bp:Artifact" name="Quotation"/>
> </activity>
> .......
>
> The problem comes when I load my Functional.xmi and remove entries of
> type Activity (using EcoreUtil.delete). The Organizational.xmi does
> not follow. In the Functional.xmi, every thing is ok. but removed
> references still in the Organizational.xmi even if I defines a
> bidirectional reference.
Is Organizational.xmi present in the resource set? You're using the
version of deleted with recursive set to true?
>
>
> What can i do so the deleted object will be removed from the
> referencing resource and
> the references will be valid (for example, if I delete //@activity.4
> from Functional.xmi, than //@activity.5 becomes //@activity.4 in
> Organizational.xmi)
I'd expected UsageCrossReferencer.find(eObject, resourceSet) to find all
usages. The debugger might help you determine why it's not.

>
> Thanks a lot
>
>
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problem with referencing resources when updating the referenced resource [message #647179 is a reply to message #647012] Tue, 04 January 2011 21:00 Go to previous message
Abdel  is currently offline Abdel Friend
Messages: 10
Registered: July 2009
Junior Member
Thanks Ed,

I was not using the same resource set.

Now, every thing is ok

Thanks again
Previous Topic:[CDO] Conflict resolution
Next Topic:[CDO] Query Language
Goto Forum:
  


Current Time: Fri Apr 26 16:50:15 GMT 2024

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

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

Back to the top