You are going to generate a textual description of the messages existing in the communication diagram. The description should provide for each diagram in the model, the name of the message sender, the name of the message and the name of the receiver.
You generate this description using templates and generated files, because by default PowerDesigner does not provide such a feature. Templates and generated files use the PowerDesigner Generation Template Language (GTL). Generated files evaluate templates defined on metaclasses and output the evaluation result in files.
For more information on GTL, see Customizing Generation with GTL.
To generate a textual description of the communication diagram message, you have to define templates on the following metaclasses:
Message: this metaclass contains details about the message sequence number and the message name, sender and receiver, this is why you define a template to evaluate the message sequence number and description in this metaclass
CommunicationDiagram: you define in this metaclass the templates that will sort the messages in the diagram and gather all message descriptions from the current diagram
For more information on the PowerDesigner metaclasses, see Resource Files and the Public Metamodel.
The generated file is defined on metaclass BasePackage in order to scan the entire model, that is to say the model itself and the packages it may contain. This is to make sure that all messages in the model and its packages are described in the generated file. There will be one generated file since metaclass BasePackage has only one instance.