Adding Fields to a Default Form

In this task you add an attribute to a class in a business object model. As a result, a corresponding control is placed on the default form.

When a business object model is used to define the parameters for a user task, controls are placed on the default form to correspond to each attribute of the associated class in the business object model. If you add an attribute to the class, a new control for that attribute will be added to the form.

Procedure

  1. Click the tab for the business object model in the editor. If the business object model is not open, in the Project Explorer navigate to FormsTutorialStart > Business Objects > BusinessObjectModel.bom. Double-click BusinessObjectModel.bom.
  2. Select the Attribute tool in the palette. Drag it over the witness class and drop it.
  3. Select the attribute you have just created. The Properties view for that attribute is displayed. In the Label and Name fields on the General tab, type zip.
  4. Note that by default the new attribute is assigned the type (or superclass) Text. To assign a different type to this attribute, click on the ellipsis icon:
  5. You could select Integer - Bom Privitive Types in this dialog, since a valid zip code is an integer. But in this case, leave the type as Text so that we can specify a pattern for the validation using a regular expression.
  6. Save the business object model and preview the forms for the Record fault claim details and Record no-fault claim details user tasks.
  7. Note that a new field appears on the forms in the Witness pane for the new zip attribute: