Chapter 4 Managing Profiles


Transformation properties

When you create a transformation, you have to select the appropriate metaclass in which to create it. This will determine the transformation scope. For example, if you want a transformation to apply to classes and interfaces, you should define it in the Classifier metaclass.

When you create a transformation, you have to define the following properties:

Property Description
Name Name of the transformation. Make sure you type understandable names in order to easily identify them in selection lists
Comment Additional information about the transformation used to explain the script

The Transformation Script tab is used to define the body of the transformation function. The function is written in VBScript.

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 transformation is executed. 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 at the beginning of a transformation 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.

The Dependencies tab displays a list of profiles in which the transformation is used.

Transformations can be used:

For more information on menus, see the "Defining Menus in a Profile"section.

 


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