|
|
Re: Copying derived attribute [message #1434896 is a reply to message #1434878] |
Tue, 30 September 2014 19:30 |
Al B Messages: 47 Registered: June 2012 |
Member |
|
|
Ed,
It's derived from the content in the description attribute and it cannot be set explicitly or edited because it's read-only.
description="Requirement (ID) {id1::int} holds"
However, you provided me with information I was looking for; which is the copier deliberately omits derived features because they're generally derived from context. Thus, in my case, the metadata attribute was neither transient, volatile, and not changeable so it shouldn't be set as derived. Instead, it should be just read-only.
Thanks!
[Updated on: Tue, 30 September 2014 19:46] Report message to a moderator
|
|
|
Re: Copying derived attribute [message #1435132 is a reply to message #1434896] |
Wed, 01 October 2014 04:02 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Al,
I assume that "it can't be set explicitly" implies its not changeable,
in which case you can't call eSet for that feature, which is how the
copier would copy it. Of course that seems contradictory to the fact
you show it in the serialization because normally the deserializer will
try to set it when its present. Also, you show the description present
in the copy, so certainly the derivation has the value it needs for its
derivation. Perhaps it's more an issue of which point in time you're
computing the derivation? If you look in
org.eclipse.emf.ecore.util.EcoreUtil.Copier.copy(EObject) you can see it
copies the features in the order in which they appear in the model, so
if a containment reference comes before an attribute, that reference's
containment tree will be copied before the attribute...
On 30/09/2014 9:30 PM, Al B wrote:
> Ed,
>
> It's derived from the content in the description attribute and it
> cannot be set explicitly or edited because it's read-only.
>
> description="Requirement (ID) {id1::int} holds"
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02574 seconds