Chapter 4 Managing Profiles
The Template category contains template items. You can access any information in the model using variables. This information can be simple attributes (for example the name of a class or the data type of an attribute) or a collection of objects (for example list of attributes of a class) depending on the metaclass where you have defined the template.
You can use the PowerDesigner metamodel, together with the help file pdvbs10.chm to visualize metaclass interactions. This should also help you select the appropriate metaclass where to define a template.
You use the GTL to define a template. Templates are used in the generated files: during generation, each template is evaluated and replaced by its actual value in the generated file.
For more information on the GTL syntax, see the "Generation Reference Guide" chapter.
Templates can be created in the Shared category when they apply to all metaclasses. They can also be created at the metaclass level or for a given stereotype or criterion.
In the previous versions of PowerDesigner, you could bind the use of a particular template to the existence of a stereotype using the following syntax:
template name <<stereotype>>
In the current version of PowerDesigner, you create a template in a given stereotype to make sure this template is used only on metaclass instances with the stereotype.
You can use the Browse tool to find all templates of the same name. To do so, open a template, position the cursor on a template name in-between % characters, and click Browse (or F12). This opens a Result window that displays all templates prefixed by their metaclass name. You can double-click a template in the result window to locate its definition in the resource editor.
To create a template:
Copyright (C) 2005. Sybase Inc. All rights reserved. |