In a Standard Mode model, an Advanced Mode model, or an User Experience Mode model you can add attributes, variables, or parameters using a dialog box.
To add attributes, perform the following:
In the Class View window, right-click an element for which you want to add an attribute and then select Attribute.
Or
Right-click the element, point to Add, and then select Add New Item....
The Add New Item dialog box appears.
Select Attribute.
The Add New Attribute dialog box appears.
You can define a simple attribute, array attribute, or list attribute using this dialog box.
To define a simple attribute, perform the following:
In the Template box, optionally enter or browse by clicking the ellipsis button. In the Select Template for Attribute dialog box, select the class or type that you want this attribute to template to.
If left blank, the attribute will be created with Primitive = String and Length = 1.
In the Name box, enter an appropriate name for the attribute, or retain the default name.
Click OK.
To define an array attribute, perform the following
In the Template box, optionally enter or browse to the class or type that this attribute derives from.
If left blank, the attribute will be created with Primitive = String and Length = 1.
In the Name box, enter an appropriate name for the attribute, or retain the default name.
In the Multiplicity box, enter a valid Multiplicity value. For example, ‘5’, ‘2,2’ (for a two dimensional array). By default, Multiplicity field is set to 1.
Click OK.
To define a list attribute do as above and
In the Template box, enter or browse to the class or type that this attribute derives from.
In the Name box, enter an appropriate name for the attribute, or retain the default name.
Select the List check box.
Notes:
Template is required for a List definition.
If you select the List check box the Multiplicity field is disabled because it is not valid to have an array of lists.
Click OK.
Note: The Kind property of the List attribute displays List Attribute.
You can add more attributes by clicking Next . A message is displayed on the status line indicating that the previous attribute was added.
The default action is the Next button. If you press the <Enter> key on the keyboard after entering a Name, the Next button will be activated and the attribute will be added. Also, the dialog will remain open for you to add another attribute.
You can also define a variable or a parameter by using a dialog box similar to the Add New Attribute dialog box. When you right-click a method, point to Add, and select Variable or Parameter from the context menu the Add New Variable or Add New Parameter dialog box appears. The fields in this dialog box are similar to the Add New Attribute dialog box, except the title of the dialog box.