Having created templates to extract information about the messages in the model, we need to create a generated file to contain and display them on the Preview tab of the diagram property sheet. We will define the file on the BasePackage metaclass, which is the common class for all packages and models, and will have it loop through all the communication diagrams in the model to evaluate the template description defined on the CommunicationDiagram metaclass.
- Right-click the Profile category, select Add Metaclasses to open the Metaclass Selection dialog, click the Modify Metaclass Filter tool, select Show Abstract Modeling Metaclasses, and click the PdCommon tab.
- Select BasePackage and click OK to add it to the extension file.
- Right-click the BasePackage category and select to create a file under the metaclass.
- Enter the following values for the file properties:
Field
|
Value
|
Name
|
Communications Textual Descriptions |
File name
|
%Name% Communication Description.txt |
Encoding
|
ANSI |
Use package hierarchy as file path
|
[unselected] |
- Enter the following code in the text box:
.foreach_item(CollaborationDiagrams)
%description%
.next(\n\n)
- Click Apply to save your changes, and then OK to close the resource editor.
- Click OK to close the List of Extensions.