Skip to main content



      Home
Home » Modeling » EMF » Read-Only attributes persisted in model.uml and caused into error (Error is shown when loading a diagram with an element and its readonly attribute)
Read-Only attributes persisted in model.uml and caused into error [message #1162612] Wed, 30 October 2013 09:56 Go to next message
Eclipse UserFriend
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 Papyrus - model.uml?

Thanks in advance.

Erik
Re: Read-Only attributes persisted in model.uml and caused into error [message #1162649 is a reply to message #1162612] Wed, 30 October 2013 10:22 Go to previous messageGo to next message
Eclipse UserFriend
Erik,

An attribute for which isChangeable is false should almost always have
isTransient true. Then it won't be serialized and then the deserializer
won't see something in the serialization it wants to set into the
model. It's also typically the case that an attribute for which
isChangeable is false, also has isDerived true because how else could an
instance ever have a value different from the default unless it's
derived from something else that can actually be changed?

On 30/10/2013 2:56 PM, Erik Schondorff wrote:
> 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 Papyrus - model.uml?
>
> Thanks in advance.
>
> Erik
Re: Read-Only attributes persisted in model.uml and caused into error [message #1164088 is a reply to message #1162649] Thu, 31 October 2013 08:28 Go to previous message
Eclipse UserFriend
Hey Ed,

thanks for your hint. This works fine Smile

Erik
Previous Topic:Instance of Ecore.ecore
Next Topic:EMF RAP Localization
Goto Forum:
  


Current Time: Mon Apr 28 12:54:33 EDT 2025

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

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

Back to the top