Defining enumeration literals in class diagram

Hello,

I’d like to create a shape with stereotype <> and list the contained literals in this shape. An example of what I want is here: http://stackoverflow.com/questions/412944/uml-class-diagram-enum . At the moment I mimic this by defining attributes with the names of the literals within a class. I can’t seem to hide the visibiltiy symbols ("+" etc.) though.

Is there a clean way to define enumeration literals in VP-UML?

Stefan

Hi Stefan,

If I remember right:

  1. Click the drop-down for “Class” on the left side of a class diagram, and select “Enumeration”.
  2. Drag the enumeration onto your diagram.
  3. Name it (for mine I called it “PharmacyType”).
  4. Right click on the enumeration class, and click Add -> Enumeration Literal. Add your literals (I added Retail, Wholesale, Specialty and Distribution). Press escape when you are done adding literals.
  5. Right click on the class that will reference the enumeration, and select Add -> Attribute
  6. Type in: “pharmacyType: PharmacyType” (without the quotes, and with your names), and press enter. Press escape.
  7. If you open the specification for the new attribute, it should show the enumeration class as the Type.

Walt