Chapter 4 Managing Profiles


Calculated collection properties

When you create a calculated collection, you have to select the appropriate metaclass, stereotype or criterion in which to create the collection. This will determine the calculated collection scope. You also have to define the following properties:

Property Description
Name Name of the calculated collection. This name must be unique in the metaclass and should not be identical to the name of an existing collection or extended collection
Comment Additional information about the calculated collection
Target Type Defines the metaclass associated with the current metaclass, stereotype, or criteria. The list lets you select the type of object that can be stored in the collection, this list displays only metaclasses that can be directly instantiated in the current model or package like classes or tables, it also includes abstract metaclasses. You cannot select sub-objects like class attributes or table columns.

You can click the Select a Metaclass tool beside the Target Type box to display a list of models installed on your workstation and select a metaclass from another type of model.

Make sure you select a target type, otherwise the calculated collection definition is ignored
Target Stereotype Additional filter set on the extended collection. This box lists all the stereotypes defined in the current profile for the selected target type. You can also type a new stereotype in this box

The Calculated Collection Script tab is used to define the body of the calculated collection function.

The Global Script tab is used for sharing library functions and static attributes in the resource file.

You can also use the Global Script tab to declare global variables. But in this case, you must be aware that global variables are not reinitialized each time the collection is calculated. They keep their value until you modify the resource file, or until the end of the PowerDesigner session. This may cause errors especially when variables reference objects that can be modified or even deleted. Make sure you reinitialize the global variable if you do not want to keep the value from a previous run.

For more information on defining a script and using the Global Script tab, see the "Defining the script of a custom check" and "Using the global script" sections.

 


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