Example: JavaGenerated File and Templates

Templates contain GTL code used to generate text fragments from PowerDesigner property values, while generated files are used to assemble templates for generation as files or for previewing on the object property sheet Preview tab.

In this example, a generated file called Java Source is defined for classifiers. A file will be generated for each classifier in the model with a name derived from the %sourceFilename% template specified in the File name field, and containing the contents generated from the %source% template:



Note: If you position your cursor between the percent signs surrounding this or any other template name and press F12, you will either jump directly to the referenced template or, if several templates share the same name, to a Results dialog in which you select the template to navigate to.

The referenced template, source, contains GTL code, including references to further templates called %isSourceGenerated%, %sourceHeader%, %package%, and %imports%: