General principles of template design
Template structure
The three types of MDA Modeler template (diagram, documentation and code) are all structured using navigation nodes and production nodes.
Navigation nodes are elements belonging to the metamodel referenced by the profile, which are used to browse the reference metamodel. An example of a navigation node would be the “Class” metaclass, which would browse all the classes belonging to a given package.
Production nodes vary according to the type of template being created. For further details on the different types of production node, please refer to the following sections in the current chapter of this user guide:
· for details on production nodes used by diagram templates, please see “Diagram templates”
· for details on production nodes used by documentation templates, please see “Documentation templates”
· for details on production nodes used by code templates, please see “Code templates”
Both navigation nodes and production nodes have a set of properties. For navigation nodes, these properties are the same whatever the metaclass and the template type. Production node properties, on the other hand, vary according to the production node concerned. Properties appear in the top right-hand zone of the template design window.
The template design window
For the three types of MDA Modeler template (diagram, documentation and code), the window used to create new templates is identical, except for the window title and certain icons appearing on the left-hand side of the window. Figure 108 shows the “Documentation template” window.

Figure 108. The “Documentation template” window
Key:
1. The icons on the top-left of the window are used to create and reference navigation nodes and external templates, as well as to create production nodes (the icons which appear here vary according to the type of template being created).
2. The zone on the top-right of the window displays the attributes of the element selected on the left (template, navigation node, production node, etc.), together with their values, where these exist.
3. This zone provides a description of the element selected either in the left-hand tree structure or in the table of attributes, together with information on how it can be used.
4. The “Documentation” zone is used to enter text for the selected element.
5. The “OK”, “Cancel” and “Apply” buttons are used respectively to confirm the information entered and close the window, to close the window without saving the information entered and to confirm the information entered and keep the window open.
6. The icon is used to launch the on-line help.
Template properties
Diagram templates, code templates and documentation templates have a number of common properties.
These properties, which are presented on the top-right of the template design window (Figure 109), are detailed below.

Figure 109. Properties common to the three types of MDA Modeler template
|
Property |
Description |
|
Metaclass |
This property is used to define the type of UML element on which it will be possible to run the template. For example, if the “Package” metaclass is selected, the template can only be run on packages. As a general rule, this property should not be modified. |
|
Version |
This property indicates the version of the template. It is not used during template execution. However, this version is displayed when a user selects a template to be applied. |
|
Creation date |
This property is used to indicate the date on which the template was created. This date cannot be modified by the user. |
|
Modification date |
This property indicates the date on which the last modification was made to the template. This date cannot be modified by the user, and is updated every time the template is saved (either by clicking on the “OK” or “Apply” buttons). |
|
Release notes |
This property indicates the release notes. It is not used during template execution, but only for documentation purposes. For example, release notes can contain a description of the various different versions of a template. |
|
Pre-operation |
This property is used to define the code evaluated before template execution is run. |
|
Post-operation |
This property is used to define the code evaluated after template execution has been run. |
Toolbar
|
Icon |
Description |
|
|
This icon is used to delete the selected node. |
|
|
This icon is used to destroy and store the selected node in the clipboard. |
|
|
This icon is used to store the selected node in the clipboard. |
|
|
This icon is used to create the node stored in the clipboard at the selected position. |
|
|
This icon is used to reorganize the template execution order, by moving the selected node up a level. This icon is only available if the node can be moved up. |
|
|
This icon is used to reorganize the template execution order, by moving the selected node down a level. This icon is only available if the node can be moved down. |