Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » how to load EFeatureMapEntry of the referred ecore using XMI Resource load(EMF FeatureMapEntry load )
how to load EFeatureMapEntry of the referred ecore using XMI Resource load [message #1806924] Fri, 17 May 2019 17:00 Go to next message
Harikarthik PC is currently offline Harikarthik PCFriend
Messages: 3
Registered: December 2015
Junior Member
I have a ecore(A.ecore) generated based on xsd. The generated ecore contains mixed attributes.
I need to use the above ecore(A) as a part of sirius based another ecore(B.ecore).
I used load resource option in EMF, to load the resource(A.ecore) in B.

B.ecore :
--> Class BClass
---->mixedB : EFeatureMapEntry [ with Extended metaData and wildcard entry set]
---->init : InitType [EReference with Containment true ]

A.ecore :
--> InitType
---->anotherClassObj : AnotherClass [EReference with containment true]
----> Class AnotherClass
-------->mixedA : EFeatureMapEntry [ with Extended metaData and wildcard entry set]

Problem 1 : when I try to load B.ecore as XMIResource, the mixed though it gets persisted, while loading the mixed text is not getting resolved

Problem 2 : I loaded the B.ecore as XMLResource, the mixedB is getting resolved, but,
though I am able to persist InitType and mixed data under B using ecore sample editor, it is unable resolve anotherClassObj of A while loading.It says feature not found exception
<BClass>
<init>
<anotherClassObj>5</anotherClassObj>
</init>
</BClass>

I need to persist and load like the above xml .
What is the best approach to solve this using EMF.

Thank you.
Re: how to load EFeatureMapEntry of the referred ecore using XMI Resource load [message #1806926 is a reply to message #1806924] Fri, 17 May 2019 21:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
When your model is based on a *.xsd, an XyzResourceFactoryImpl is generated (with the necessary options for processing the extended metadata options on your *.ecore model) so you should ensure that this factor is used to create the resources used to load and save your model instances; generally there will be a registration in the plugin.xml to use that factory, so you should ensure your file extension is unique so that your registered factory is used. Do not use some arbitrary XMIResourceImpl that's created by some other resource factory.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: how to load EFeatureMapEntry of the referred ecore using XMI Resource load [message #1807101 is a reply to message #1806926] Wed, 22 May 2019 15:39 Go to previous messageGo to next message
Harikarthik PC is currently offline Harikarthik PCFriend
Messages: 3
Registered: December 2015
Junior Member
Thanks for your reply Ed.

"should ensure that this factor is used to create the resources used to load and save your model instances; generally there will be a registration in the plugin.xml to use that factory, so you should ensure your file extension is unique so that your registered factory is used"

-- Could you please share a link or snippet, how to do this?
Re: how to load EFeatureMapEntry of the referred ecore using XMI Resource load [message #1807102 is a reply to message #1807101] Wed, 22 May 2019 15:52 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Everything you need is normally generated. What's in your plugin.xml right now?

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How can I add an ECore Modeling Project into my CDO Repository
Next Topic:Error "An Exception occurred while dispatching debug events" while executing acceleo Trans
Goto Forum:
  


Current Time: Thu Mar 28 08:44:24 GMT 2024

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

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

Back to the top