Attribute Wizard
For defining new attributes, the attribute wizard might be called from the attribute list, which can be activated by clicking the Attributes tab on the Members tab for the selected data type.
The attribute wizard cannot be used for updating attribute properties, which has to be done directly in the attribute editor form right of the list.
Attribute names have to be unique within the members defined for a data type and its base types. Attribute names are technical names and must not contain special characters or spaces except underscores. After filling in the attribute name, Next should be pressed in order to continue. When the attribute name is not correct or has already defined as member for the data type or one of its base types, an error will be displayed in the wizard's message area.
In order to choose the data type for the attribute, one of the elementary data types might be selected from the types displayed in the drop list. For selecting a complex (user-defined) data type, one may enter the type name directly in the Data type field or use enhanced find by pressing the Find button, which allows selecting a data type defined in the project or a system data type. When the data type entered does not yet exist, one may enter the new data type name in the field and press the New button. In this case, a sub wizard for defining new data type pops up ( Data Type Wizard ), which is described in chapter " Data Type Wizard" . For viewing the type definition for the selected type, the Details button might be used.
Depending on the data type selected, several data type specific properties might be changed in the Next step.
Size and dimension are, usually, initialized according to the type selected. In case of built-in data types, the size might be changed. For most data types, the size defines the number of significant characters to be stored for a value as the number of digits for numerical values or the length of strings in units, i.e. regardless on the coding type of the string. More detailed hints about using size for different data types are provided in the ODABA (base) documentation in "ODABA built-in data types".
In order to define multidimensional arrays, the dimension value has to be changed. Integer types support a precision, which defines the number of positions behind the decimal point.
In order to define attributes not to be stored into the database but to be calculated when being accessed, the Transient option has to be switched on. When defining transient attributes, the Next allows defining the computation rule for the attribute.
The data source definition step is shown only, when the attribute has been defined as transient attribute. There are, typically, two ways of computing values for transient attributes. One is the doAfterRead() handler for the data type. The other is defining a data source expression using OSI. When defining a data source via expression, the attribute value will be evaluated only, when accessing the attribute, which is more efficient than calculating the value in a read handler.
Note, that this step is not The Next step shows the summary for the attribute definition.
After confirming the wizard action with Finish , changes made on the current data type (and on its base type) are stored to the resource database. For the selected data type the ready and checked mark will be reset and the data type will be displayed orange in the class tree instead of green. Updated data types need to be checked before being used in the application. One may use the check button above the member list for checking the selected data type.
When defining an OSI expression for calculating a transient attribute, the expression is neither checked by the wizard nor by the daty type check. This may lead to run-time errors later on, when the expression is erroneous.