Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Stereotype: Default value setting on a multi-valued enumeration
Stereotype: Default value setting on a multi-valued enumeration [message #1755030] Mon, 27 February 2017 08:50 Go to next message
Bernd Zeuner is currently offline Bernd ZeunerFriend
Messages: 18
Registered: July 2009
Junior Member
Hallo,

I have defined an enumeration typed attribute in a stereotype which has a multiplicity of [1..3]. A single literal of the enumeration is defined as the default value; this is done via InstanceValue.

Unfortunately the default value (defined in the profile) does not appear in the
attributes of a class in a model which has the profile applied; the set is empty (settingActor: SettingActor [1..3] = []).

Did I define the default value in the profile in the wrong way?

Thank you for your help.

Regards
Bernd
Re: Stereotype: Default value setting on a multi-valued enumeration [message #1755043 is a reply to message #1755030] Mon, 27 February 2017 13:11 Go to previous messageGo to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 341
Registered: July 2009
Location: Paris Saclay, France
Senior Member
I have tested this scenario and I remark this problem when the property of the stereotype has an upper value greater than 1.
To be correct the default value must be a collection with 3 instanceValues, but there is no construction in UML to express a collection of InstanceValue... This is a lack of UML.
Best regards,
Patrick
Re: Stereotype: Default value setting on a multi-valued enumeration [message #1755047 is a reply to message #1755030] Mon, 27 February 2017 13:53 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Dear Bernd,

I guess when you say that the default value does not appear in the attributes of a class, you actually mean that it does not get assigned to the multivalued stereotype attribute typed with the enumeration.

I confirm that the assignment does not get done. This is not specific to enumerations, but would be the same for an integer value assigned to a multi-valued property. The problem is the combination of a collection with a single default value: semantically, it is not clear how many elements should be created for a multi-valued attribute. So, while I am not sure, I don't think that it is possible.
Re: Stereotype: Default value setting on a multi-valued enumeration [message #1755052 is a reply to message #1755047] Mon, 27 February 2017 15:57 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

It could be possible using an OCL expression - an OpaqueExpression with an OCL-valued body.

If you want to have a purer AST, then an ExpressionInOCL is a more powerful ValueSpecification, but there is no UML2/Papyrus tooling support for hybrid UML+OCL ASTs.

Beware. A bad bug with OCL support for Enumeration-valued InstanceValues was fixed about six months ago.

Regards

Ed Willink
Previous Topic:How to build and run the papyrus source code?
Next Topic:Reference is displayed incorrectly in Papyrus 2
Goto Forum:
  


Current Time: Tue Apr 16 07:57:59 GMT 2024

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

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

Back to the top