Author Topic: Enumerations - Empty attributes?  (Read 3361 times)

bob

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Enumerations - Empty attributes?
« on: May 19, 2016, 07:24:41 pm »
Hi :)

Is it somehow possible to give an enumeration type's value the possibility to be empty?

I know that is was possible in EA 11 but doesnt seem like it is in 12.x!

Thanks again in advance,
N.O.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8204
  • Karma: +193/-23
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Enumerations - Empty attributes?
« Reply #1 on: May 19, 2016, 08:50:38 pm »
You can remove the type, but I think that since version 12.1.1229 or so the default type is empty again (like it should)

Geert

bob

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Enumerations - Empty attributes?
« Reply #2 on: May 19, 2016, 10:06:07 pm »
Well maybe this one wasnt defined clearly either:

I have an Enumeration type with the values:

A
B
C
D

now i want to add a fifth value which is empty..

So it would be:

A
B
C
D
" "
Hope this clarifies what i need :P

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8204
  • Karma: +193/-23
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Enumerations - Empty attributes?
« Reply #3 on: May 19, 2016, 10:20:06 pm »
Hmm why would you need that? I don't think that is even UML compliant.

Geert

StefanPears

  • EA User
  • **
  • Posts: 119
  • Karma: +6/-0
  • Unwissenheit schützt vor Erkenntnis nicht
    • View Profile
Re: Enumerations - Empty attributes?
« Reply #4 on: May 19, 2016, 10:49:11 pm »
An enumeration value cannot be empty but you can give it a value like "empty", "unspecified", "none" or like that. And you can define a behaviour like writing a NULL value into a database table column.

bob

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Enumerations - Empty attributes?
« Reply #5 on: May 19, 2016, 11:14:08 pm »
That sounds like a plan, how would I define that kind of behavior?!

StefanPears

  • EA User
  • **
  • Posts: 119
  • Karma: +6/-0
  • Unwissenheit schützt vor Erkenntnis nicht
    • View Profile
Re: Enumerations - Empty attributes?
« Reply #6 on: May 20, 2016, 01:10:28 am »
Well, there are a number of ways I guess. For example this one: Assuming you have a database class with stereotype entity and a UI class with stereotype boundary. The database class has an optional attribute (multiplicity [0..1] with a data type of your enumeration and the UI class has the same attribute but mandatory, then you can write into the database attribute description: if user selected 'none' from the dropdown then a NULL value is written   ....  or s.th. like that.