|Read-Only attributes persisted in model.uml and caused into error [message #1162271]
||Wed, 30 October 2013 09:07
| Erik Schondorff
Registered: October 2013
Hi Christian ,|
I just thought, if the attribute is read-only, there would be exist an automated process that a read-only attribute would not be persisted, or, that it would not be read from the *.uml file.
The attribute is persisted like every other attribute of the class. Maybe I can try the volatile-property for an attribute.
So, I wrote this topic to the EMF-Community:
But at all, thanks for help
Best regards, Erik
[Updated on: Wed, 30 October 2013 14:38]
Report message to a moderator
|Re: Read-Only attributes persisted in model.uml and caused into error [message #1162560 is a reply to message #1162271]
||Wed, 30 October 2013 13:15
| Christian W. Damus
Registered: July 2009
The Eclipse implementation of the UML metamodel handles such cases
within its resource implementation.
Is this an attribute in a model of your own devising? How does it end
up being persisted in a *.uml file? This may be difficult to fix
because the UMLResource has to be used to load the UML file, so you
cannot use your own resource implementation.
And how did you end up with a serialization that has values for a
read-only attribute? I would expect that to be derived and transient
in the *.ecore. If this is a result of model evolution (the attribute
was writable in a previous version of the ecore but is not now) then
you may be able to use EMF's Ecore2Ecore mappings to handle migration,
but I don't know much about that.
In any case, I think this question is really an EMF question and will
probably find the best help on the EMF forum.
On 2013-10-30 09:07:39 +0000, Erik Schondorff said:
> Hello community,
> I have a read-only attribute defined in my *.ecore model, so it has no
> setAttribute - method in the corresponding *.impl.java.
> This causes in an error when loading a diagram, which has a model
> element with its read-only attribute because the attribute is persisted
> in the model.uml and the setAttribut-method does not exists. What can I
> do, when a read-only attribute should not be persisted in the model.uml?
> Thanks in advance.
> Erik :)
Powered by FUDForum
. Page generated in 0.01695 seconds