Classes and types Java enums Rational Rhapsody allows use to include Java enums (introduced in Java 5.0) in your models. Adding a Java enum to a model To add a Java enum to your model, right-click the package to which you would like to add the enum and select Add New > Enum . Enums are displayed as their own category in the Rational Rhapsody browser. Defining constants for a Java enum To define constants for an enum: 1. Double-click the relevant enum in the browser to open its Features window. 2. Select the Enum Values tab. 3. Click in the list. 4. Click the Name column to change the default name assigned by Rational Rhapsody. 5.
Click the Value column to define the argument values that will be used to instantiate this instance of the enum (if you are providing more than one argument, separate them with commas). 6. Optionally, add comments for the constants you have defined. 7. Click OK . After they have been defined, enum constants appear underneath the relevant enum in the browser. 120 User Guide