Defining a Valid Values List

Often, a given piece of data may have a set of valid values much smaller than that allowed by the data type. For these cases, you can define a set of values that the user can select from.

For example, there are 676 two-letter combinations, but only 50 two-letter state codes in the US. To assure data integrity it is best if the user is allowed to chose one of the 50 states instead of entering any possible two-letter code. It is good practice to limit input to the set of valid values whenever this is possible.

BPM object attributes can be configured with a set of predefined valid values. When you do this, the attribute will be presented to the user as a drop-down list, rather than a field. Thus, the user will only be able to select from the choices provided.

There are three possible Valid Values settings for a BPM object attribute:
Valid Values Setting Description Presented As
All Any value within the bounds of the data type is accepted. This is the default setting. Text field
Static List One of a list of values is accepted. The list is fixed at design time. Drop-down list
Dynamic Method One of a list of values is accepted. The list is dynamically built by a method in run-time. Drop-down list

The dynamic method is more flexible. For example, you can pull the information from a database. The static list is easy to configure without writing any code, so here we use a static list. To add a static list of valid values to an attribute:

  1. In the Project Navigator, expand the ExpenseReport BPM Object (BPM Object icon 
				).
  2. Double-click on the costCenter attribute. The editor for the costCenter attribute will open.
  3. In the Valid Values section, select Static List, and check the Edit Value Descriptions option. A Value / Description table will appear.
  4. To add an entry to the table, click on the plus sign and enter a numeric value in the Value column, and a text string in the Description column. Add the values shown in the table below:
    Value Description
    100 Sales
    200 Marketing
    500 Support
  5. Set the Default Value field to 100.
  6. Save your changes and close the editor for this attribute.
With this step, the BPM object's data model is complete. In the following task you will define an instance variable to hold the BPM object in each instance.