Add a styled paragraph

We now want generate the comments of UML classes:

  1. Open the model product21.xmi.
  2. Select the type Class.
  3. Select the Class IdentifiedElement and show its children.

You can see the comments are linked to their class with the reference ownedComment. The doc template has to iterate on the ownedComment list and print the body of these comments:

...
Classes
[#foreach class in model.getInstances("Class")] Class
${class.name}

Description
[#foreach comment in class.ownedComment] ${comment.body} [/#foreach]
[/#foreach]

Save the doc template and relaunch the generation. Open the file result.xml, you see that the comments are now present:

Introduction
This document is generated using MDWorkbench.
Classes
Class IdentifiedElement
Description
An element that can be identified using an int

Class NamedElement
Description
An element that has a name

...

Related tasks
Relaunching a program