Incorporate Model Templates
When a user creates a model within their project, they can choose the type of model to develop from a list of standard model templates. You can also develop custom model templates to add to this list via your MDG Technology.
Access Project Browser package context menu | Add a Model using Wizard...
Add custom model templates to MDG Technology
|
|
|
|
1
|
Create a package that contains all sub-packages, diagrams, elements, notes and information links that you want to provide in your model template.
See the EAExample.eap model for illustrations of what you might include, or create a model from a standard template and see what is generated.
As a model template, the package would be self contained and not contain any dependencies or other links to elements outside the package.
|
Model Wizard
|
2
|
Export your package to XMI.
|
Export to XMI
|
3
|
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"
isFramework="false"/>
</ModelTemplates>
You can include as many <ModelTemplates> blocks in your MTS file as you have model templates.
The attributes within a <ModelTemplates> block have the following meanings:
| • | Model name: The name of the model template to show in the Model Wizard, 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 Model Wizard 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 Model Wizard by giving all the model templates in the same group the same filter name; the filter name given appears in the list box in the Model Wizard |
| • | isFramework: Defines the possible uses of a model pattern; there are three possible values: |
| • | isFramework="true" - never strip GUIDs; the Pattern is intended as a re-usable package for any model |
| • | isFramework="optional" - prompt to strip GUIDs; the Pattern is intended as a re-usable package, but the user can choose |
| • | isFramework="false" - always strip GUIDs (the default, if not stated); the Pattern could be applied multiple times within the one model
|
|
Working with MTS Files
|
Learn more
The material ("material" includes all pages, documents and on-line graphics) on this web site is protected by copyright law. (C) 1998-2014 Sparx Systems Pty Ltd.