Dynamic EMF [message #1656338] |
Sat, 07 March 2015 08:08  |
Eclipse User |
|
|
|
I need to add an extra EAttribute to an eObject.
For doing this, I extend the eClass of this eObject using Dynamic EMF. I succeed doing that.
Then, I added eAttribute to this dynamically created eClass. Then, the extended eObject is created successfully.
Now, I want to add all the values of EStructuralFeatures from the originalObject to the extendedObject.
The following method fails to do that: What is wrong in this method?
public static EObject clone( EObject originalObject,EObject extendedObject) {
for ( Iterator i = extendedObject.eClass().getEStructuralFeatures().iterator(); i.hasNext(); )
{
EStructuralFeature feature = (EStructuralFeature) i.next();
extendedObject.eSet( feature, originalObject.eGet( feature ) );
}
return extendedObject;
}
|
|
|
|
|
|
Re: Dynamic EMF [message #1664122 is a reply to message #1662089] |
Tue, 10 March 2015 14:57  |
Eclipse User |
|
|
|
Hi,
In addition to Ed's comment, it is probably also necessary for the
other connected clients to have the same package available locally in
their VMs. Moreover, if you're dealing with dynamically created Ecore
models, although CDO supports dynamic Ecore, it does not support
changes to an Ecore model once that model has been published to it.
Cheers,
Christian
On 2015-03-09 22:57:01 +0000, UmaShankar Subramani said:
> Hi,
>
> Thanks for you reply. That worked.
>
> But I have another problem now. After extending the new original
> class, now I have the extended class with additional EAttribute.
>
> This EAttribute is named "type". I set a value to the EAttribute in
> the extended eObject.
> Then I add it to a resource. The resource file is saved and sent as a
> CDORemoteSessionMessage to all CDO clients.
>
> The clients then try to load the resource file like the following
>
> resource.load(message.getInputStream(),null);
>
> Here is where I get the following exception:
>
> Caused by: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature
> 'type' not found.
|
|
|
Powered by
FUDForum. Page generated in 0.04615 seconds