Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Incorporate Model Templates

Enterprise Architect has a number of Model Templates that can be added into a model, either on creation of the model, or at any time by right-clicking on a package in the Project Browser and selecting the Add | Add a New Model using Wizard... context menu option.

You can create your own model templates to include in your MDG Technology.

Firstly, you create a package that contains all sub-packages, diagrams, elements, notes and information links that you want to provide in the model template. See the Model Templates section and the EAExample.eap model for illustrations of what you might include, or create a model from a standard template and see what is generated. Your model template package must be self contained and not contain any dependencies or other links to elements outside the package.

After you create the model template as a package, you export it to XMI and then create a reference to the XMI file in the MTS file.

Open your MTS file in a text editor and copy and paste the following <ModelTemplates> block at the top level inside the <MDG.Selections> block:

<ModelTemplates>

  <Model name="Template Name"

         description="This is the description."

         location="MyTemplatePackage.xml"

         default="yes"

         icon = "34"

         filter= "Filter Name"/>

</ModelTemplates>

You can include as many <ModelTemplates> blocks as you have model templates. The attributes have the following meanings:

  • Model name: The name of the model template to show in the Select model(s) dialog, which displays when you create a new model or when you execute the Add a New Model using Wizard menu option.
  • description: The text to display in the Select model(s) dialog when the name is selected.
  • location: The path of the XML file that contains the XMI export of the model template package, relative to the location of the MDG Technology file. If the XMI file is in the same folder as the technology file then this just contains the file name.
  • default: Contains either yes to indicate that the model template is checked by default, or no to indicate that the model template is un-checked by default.
  • icon: Contains an index to Enterprise Architect's base icons list. To show the appropriate view icon, use one of the following values: 29 = Use Case, 30 = Dynamic; 31 = Class; 32 = Component; 33 = Deployment; 34 = Simple.
  • filter: If you have a large number of model templates, you can group them on the Select model(s) dialog by giving all the model templates in the same group the same filter name. The filter name given appears in the Select from: list box in the Select model(s) dialog.