Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:56 Go to next message
Erik Schondorff is currently offline Erik SchondorffFriend
Messages: 25
Registered: October 2013
Junior Member
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 14:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Read-Only attributes persisted in model.uml and caused into error [message #1164088 is a reply to message #1162649] Thu, 31 October 2013 12:28 Go to previous message
Erik Schondorff is currently offline Erik SchondorffFriend
Messages: 25
Registered: October 2013
Junior Member
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: Thu Apr 25 05:16:39 GMT 2024

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

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

Back to the top