Marking Attributes as Required or Optional

When an attribute has a multiplicity of 1, the associated control in the default form will be marked as required. A multiplicity of 0..1 indicates an optional value.

By default, the attributes in the business object model are created with a multiplicity of 0..1 (that is, there can be zero or one of them), which means that they are optional.

In the GenericClaim class, for example, the claim summary and claim amount fields are both optional fields on the form because their multiplicity values in the business object model are both 0..1. We will change those to required values on the form by changing their multiplicity to 1.

Procedure

  1. Within the GenericClaim class, click the claimSummary attribute to select it.
  2. In the General tab of the Properties view for the claimSummary attribute, notice that the Multiplicity field contains a value of 0..1. Change this value to 1.
  3. In the same way, change the multiplicity for the claimAmount attribute to 1.
  4. Save the business object model by clicking the Save icon, clicking File > Save, or typing the keyboard command Ctrl+S.
  5. Click the Notification of claim tab in the editor to see the business process. Right-click the user task Record no-fault claim details and click Form > Preview. Notice that the Claim Summary and Claim Amount fields are now marked with asterisks, indicating that they are required:

    Try deleting the default values in the Claim Summary and Claim Amount fields, and then clicking the Submit button. Error markers will appear notifying you that those fields are required.