Chapter 4 Extending your Models with Profiles


Extended attribute properties

The following properties are available for extended attributes:

Property Description
Name Specifies the internal name of the attribute, which can be used for scripting.
Label Specifies the display name of the attribute, which will appear in the PowerDesigner interface.
Comment Provides additional information about the extended attribute.
Data type Specifies the form of the data to be held by the extended attribute, such as String, Font, Boolean, Object, or others.

You can create your own data types (see Creating an extended attribute type), or you can link one object to another by way of an extended attribute, by selecting the [Object] type (see Linking objects through extended attributes).
Computed Specifies that the extended attribute is calculated from other values using Get and/or Set VBScript methods. If an attribute is not computed, the value is stored in the object.

You can select from the following access types:

  • Read/Write (Get+Set methods) - read and write access to the extended attribute value is defined by VBScript Get and Set methods.
  • Read only (Get method) – read-only access is defined by a VBScript Get method.


This checkbox enables the display of Get Method Script, Set Method Script, and Global Script tabs, on which you must define the relevant scripts.

In the following example script, the FileGroup computed extended attribute gets and sets its value from the physical options of the table object:

Function %Get%(obj)
%Get% = obj.GetPhysicalOptionValue("on/<filegroup>")
End Function

Sub %Set%(obj, value)
obj.SetPhysicalOptionValue "on/<filegroup>", value
End Sub
Default value [if not "computed"] Specifies a default value for the extended attribute type. You can specify the value in any of the following ways:

  • Type the value directly in the list.
  • [predefined data types] Click the Ellipsis button to obtain a range of possible default values. For example, if the data type is set to Color, the Ellipsis button opens a palette window.
  • [user-defined data types] Select a value from the list.
Template [if not "computed"] Specifies that the extended attribute is treated as a GTL template and its code is replaced by model values during generation. For example, the string %Code%, will be replaced by the value of the code attribute of the relevant object.

If this checkbox is cleared, the extended attribute is treated literally during generation. For example, the string %Code%, will be generated as %Code%.
List of values Specifies a list of possible values for the extended attribute. You can enter static values in the list (separated by a semi-colon or by a carriage return) or generate them using a GTL template.

You can use the tools to the right of the list to create a GTL template or to select an existing template in the resource file. The template is evaluated each time the list is called.

For example, the following GTL template uses the foreach_item macro to iterate on the Storages collection (when the extended attribute is an object, the list of values must contain the OID of the object, then a tab, and then the name that will be displayed in the list, and ends with a carriage return):

.foreach_item (Model.Storages)
%ObjectID%\t %Name%
.next (\n)


The following template returns all the storages in the model:

.collection (Model.Storages)


If the extended attribute is based on an extended attribute type, the List of values box is unavailable because the values of the extended attribute type will be used.
Complete Specifies that all possible values for the extended attribute are defined in the list of values, from which the user must choose.
Edit method [if not "complete"] Specifies a method to override the default action associated with the tool or the Ellipsis button to the right of the extended attribute in the object property sheet. See the Table metaclass in the Profile category of the Oracle Version 10g DBMS resource file for an example of a custom edit method.
Object type [for [Object] data types only] Specifies the type of the object that the extended attribute will be (for example, User, Table, Class).
Object stereotype [for [Object] data types only] Specifies the stereotype that objects of this type must bear to be available in the extended attribute list.
Inverse collection name [for [Object] data types only, if not "computed"] Specifies the name under which the links to the object will be listed on the Dependencies tab of the target object.

An extended collection with the same name as the extended attribute, which handles these links, is automatically created for all non-computed extended attributes of the Object type, and is deleted when you delete the extended attribute, change its type, or select the Computed checkbox.
Physical option [for [Physical Option] data types only] Specifies the physical option with which the attribute is associated. Click the ellipsis to the right of this field to select a physical option. For more information, see Adding DBMS physical options to your forms

 


Copyright (C) 2008. Sybase Inc. All rights reserved.