You are going to define the generated file in order to list the messages of each communication diagram existing in your model. To do so, you have to define the generated file in the BasePackage metaclass. This metaclass is the common class for all packages and models, it owns objects, diagrams and other packages.
The generated file will contain the result of the evaluation of the template description defined on the CommunicationDiagram metaclass. The code of the generated file also contains a foreach_item macro in order to loop on the different communication diagrams of the model.