Extended Attribute Properties

You specify the properties for an extended attribute by selecting its entry in the resource editor.

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. You can choose from:
  • Boolean
  • Color
  • Date or Time
  • File or Path
  • Integer, Float, or Hex
  • Font, Font Name, Font Size, or Font Style
  • Object - Specify the Object type, Object stereotype (if appropriate), and Inverse collection name in the properties below. For more information, see Linking Objects Through Extended Attributes.
  • String (single line) or Text (multi-line)

To create your own data type, click the Create Extended Attribute Type tool to the right of the field (see Creating an Extended Attribute Type).

Computed

Specifies that the extended attribute is calculated from other values using VBScript on the Get Method Script, Set Method Script, and Global Script tabs. When you select this checkbox, you must choose between:
  • Read/Write (Get+Set methods)

  • Read only (Get method)

In the following example script, the FileGroup computed extended attribute gets its value from and sets the value of the filegroup physical option of the 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 attribute. You can specify the value in any of the following ways:
  • Enter the value directly in the list.

  • [predefined data types] Click the Ellipsis button to open a dialog listing possible 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 value of the attribute is to be evaluated as a GTL template at generation time. For example, if the value of the attribute is set to %Code%, it will be generated as the value of the code attribute of the relevant object.

By default (when this checkbox is not selected), the attribute is evaluated literally, and a value of %Code% will be generated as the string %Code%.

List of values

Specifies a list of possible values for the attribute in one of the following ways:
  • Enter a static list of semi-colon-delimited values directly in the field.

  • Use the tools to the right of the list to create or select a GTL template to generate the list dynamically.

    If the attribute type is Object, and you do not want to filter the list of available objects in any way, you can leave this field blank.

    To perform a simple filter of the list of objects, use the .collection macro (see .collection Macro). In the following example, only tables with the Generated attribute set to true will be available for selection:
    .collection(Model.Tables, %Generated%==true)
    For more complex filtering, use the foreach_item macro (see .foreach_item Macro):
    .foreach_item (Model.Tables)
       .if %Generated% 
       .// (or more complex criteria)
          %ObjectID%
       .endif
    .next (\n)

If the attribute is based on an extended attribute type (see Creating an Extended Attribute Type), this field is unavailable since the values of the extended attribute type will be used.

Complete

Specifies that all possible values for the attribute are defined in the List of values, and that the user may not enter any other value.

Edit method

[if not Complete] Specifies a method to override the default action associated with the tool to the right of the field.

This method is often used to apply a filter defined in the List of values field in the object picker. In the following example, only tables with the Generated attribute set to true will be available for selection:
Sub %Method%(obj)
   
   Dim Mdl
   Set Mdl = obj.Model
   
   Dim Sel
   Set Sel = Mdl.CreateSelection
   
   If not (Sel is nothing) Then
      Dim table
      For Each table in Mdl.Tables
          if table.generated then
              Sel.Objects.Add table
          end if
      Next

      ' Display the object picker on the selection
      Dim selObj
      set selObj = Sel.ShowObjectPicker
      If Not (selObj is Nothing) Then
         obj.SetExtendedAttribute "Storage-For-Each", selObj
       End If
      
      Sel.Delete
   End If
   
End Sub

Text format

[for Text data types only] Specifies the language contained within the text attribute. If you select any value other than plain Text, then an editor toolbar and (where appropriate) syntax coloring are provided in the associated form fields.

Object type

[for Object data types only] Specifies the type of the object that the attribute contains (for example, User, Table, Class).

Object stereotype

[for Object data types only] Specifies the stereotype that objects of this type must bear to be selectable.

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.