Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Enumeration and null values
Enumeration and null values [message #477812] Fri, 10 October 2008 21:18 Go to next message
Alexandre Torres is currently offline Alexandre TorresFriend
Messages: 139
Registered: July 2009
Senior Member
Hi.

I have an Stereotype with a property. The property's type is an
Enumeration.
The problem is: even if I set the multiplicity to [0..1], my property does
not allow a null value.
Worse, it assumes the first enumeration literal as the default value.
Looking in the profile generated definition I found that it picks the
first value as the default.

I don't think this is the expected behaviour for UML...
my reasoning is...if I set [0..*] it will generate an infinite list of
default values ? of course not...

Do I have to create an specific literal named NULL ?

Thanks
Re: Enumeration and null values [message #477976 is a reply to message #477812] Mon, 17 November 2008 08:34 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Alexandre,

Creating a "NULL" enumeration literal is one option. An alternative is to
stereotype the property as EAttribute and set the 'isUnsettable' tag to
'true'.

Kenn

"Alexandre Torres" <alexandre.torres@gmail.com> wrote in message
news:7c609eb2097fdf00000fc35d7ca608de$1@www.eclipse.org...
> Hi.
>
> I have an Stereotype with a property. The property's type is an
> Enumeration. The problem is: even if I set the multiplicity to [0..1], my
> property does not allow a null value. Worse, it assumes the first
> enumeration literal as the default value. Looking in the profile generated
> definition I found that it picks the first value as the default.
>
> I don't think this is the expected behaviour for UML...
> my reasoning is...if I set [0..*] it will generate an infinite list of
> default values ? of course not...
>
> Do I have to create an specific literal named NULL ?
> Thanks
>
>
>
Re: Enumeration and null values [message #627193 is a reply to message #477812] Mon, 17 November 2008 08:34 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Alexandre,

Creating a "NULL" enumeration literal is one option. An alternative is to
stereotype the property as EAttribute and set the 'isUnsettable' tag to
'true'.

Kenn

"Alexandre Torres" <alexandre.torres@gmail.com> wrote in message
news:7c609eb2097fdf00000fc35d7ca608de$1@www.eclipse.org...
> Hi.
>
> I have an Stereotype with a property. The property's type is an
> Enumeration. The problem is: even if I set the multiplicity to [0..1], my
> property does not allow a null value. Worse, it assumes the first
> enumeration literal as the default value. Looking in the profile generated
> definition I found that it picks the first value as the default.
>
> I don't think this is the expected behaviour for UML...
> my reasoning is...if I set [0..*] it will generate an infinite list of
> default values ? of course not...
>
> Do I have to create an specific literal named NULL ?
> Thanks
>
>
>
Previous Topic:Enumeration Default Value
Next Topic:UML 2.1 metamodel in a textual notation
Goto Forum:
  


Current Time: Tue Apr 07 07:51:28 GMT 2020

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

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

Back to the top