In yesterday’s blog post, I described how to convert CamelCase object Codes into ‘Proper Case’ object Names, using a combination of GTL and VBScript in a model extension. This took advantage of the built-in conversion routines, which enable us to convert abbreviations into plain language, such as replacing “acct” with “account”.
I didn’t show you how to tell PowerDesigner where to look for those abbreviations, so that’s what I’m going to do now. The secret lies with the Naming Conventions in the Model Options. There are three ways to access the Model Options:
- near the bottom of the Tools menu
- right-click the model in the Browser
- right-click a blank area of a diagram
Click on the “Naming Conventions” section, then on the “Code to name” sub-tab, as shown below. You need to do two things:
- Select “Enable conversions”
- Choose from the drop-down list of conversion tables – in the example below, I’ve chosen one of my CSV files
The drop-down list of conversion tables will include entries from the following sources:
- if you have a repository, one entry for ‘glossary terms’ (these are the Terms in the PowerDesigner Glossary)
- CSV files that have been checked into the ‘Library’ folder in the repository
- CSV files in the target folder(s). Click on the folder icon to the right of the drop-down to change the target folders – the default folder is “C:\Program Files\SAP\PowerDesigner 16\Resource Files\Conversion Tables”, which contains a single sample, called “stdnames.csv”, so you’ll probably want to add at least one more folder to the list.
You can edit your conversion table directly, without using Excel – just click on the ‘Edit Selected Conversion Table’ button.
Each time you run the menu options I showed you yesterday, it will use the current conversion table. If, for example, you haven’t defined ‘BBC’ as an abbreviation, the code ‘BBCNews’ will be converted to ‘BBC News’. If you decide that ‘BBC’ should be converted to “British Broadcasting Corporation”, just add the following entry to your conversion table, and run the menu options again.
|British Broadcasting Corporation
Lastly, it’s worth pointing out that the Conversion table that you select on the Naming Conventions tab is used for every type of object, unless you select a different Conversion table in one of the object-specific sections. In this example, I’ve chosen a different Conversion table for Columns:
So, you could use different conversion tables for different types of object, if you want to.