Create Toolbox Profiles
Within an MDG Technology you can create multiple Toolbox Profiles. Each Toolbox Profile contains definitions that determine what pages appear in the Diagram Toolbox when it is opened, either by selection from the search facilities in the Diagram Toolbox, or by opening or creating a diagram of the type that is linked to the Toolbox Profile.
Create a Toolbox Profile
In a Profile Package, create a Class diagram with an appropriate name by which you can refer to it later, such as MyClassDiagram.
|Create a Profile Package
Double-click on the diagram background to display the diagram 'Properties' dialog and, in the 'Notes' field, give the diagram an alias and a description in this format:
Alias=MyClass;Notes=Structural elements for Class diagrams;
On the diagram, create a Metaclass element with the name ToolboxPage.
|Add Stereotypes and Metaclasses
Create a Stereotype element for each of the Toolbox pages to create within your Toolbox, such as MyClassElements and MyClassRelationships.
Double-click on each element to display the 'Properties' dialog and, in the 'Alias' field, type the text to display in the title bar of the corresponding Toolbox page, such as My Classes or My Class Relationships.
In the 'Notes' field of each element, type the tool-tip for the corresponding Toolbox page; for example, 'Elements for Class Diagrams' or 'Relationships for Class Diagrams'.
Create an Extension connector between each Stereotype element and the ToolboxPage Metaclass element.
In each of the Stereotype elements, press and create an attribute for each Toolbox item in the page defined by that element.
The name of each attribute is the name of the element or connector to be dropped, including the element's namespace; for example, UML::Package, UML::Class and UML::Interface. You might not want to display names including text such as UML::Package or UML::Class in your Toolbox, so give the attributes an 'Initial Value' of, for example, Package or Class.
The Toolbox items display in the same sequence as their attributes in the element, so use the attribute ordering options in the 'Attributes' page of the Features window to define the order of icons in your Toolbox page.
In the name of an attribute for an element or connector from your own technology, use your Profile name as the namespace, and then follow the item name with the element or connector type that you are extending, in brackets (to identify to Enterprise Architect what type of object to create); for example, a SysML Block element would appear as:
Many elements and connectors can be extended for use in Toolboxes.
|Create and Manage Attributes Elements Used in Toolboxes Connectors Used in Toolboxes
To define a Toolbox item to drop a Design Pattern onto a diagram, name the attribute:
'MyTechnology' is the ID of the technology and 'MyPattern' is the name of the Pattern to drop; for example:
If you want to avoid displaying the 'Add Pattern' dialog, replace (UMLPattern) with (UMLPatternSilent).
To define a model-based Pattern in a custom Toolbox (such as the GoF Patterns), create an attribute with a name of the format:
Define any attributes you need to modify the display of the Toolbox pages, such as whether the Toolbox pages are minimized or displayed without item names (labels).
|Toolbox Page Attributes
To save the Toolbox profile, click on the background of the open diagram and select either of the ribbon options:
|Export a Profile
Toolbox Profile Errors
When a Diagram Toolbox defined in your MDG Technology is in use, certain error messages might be displayed. This table explains what those error messages mean.
Missing base type <name>
For example: 'Missing base type: 'SysML1.3::Block' does not extend 'UML::State'
The base type is either missing or does not correspond to the extended element type (in the example, SysML::Block actually extends UML::Class).
No profile found with id <name>
This error message could mean that the profile cannot be found, or that the MDG Technology containing the profile has been disabled (check using 'Specialize> Technologies > Manage').
No stereotype <name> found in profile <name>
For example: 'No stereotype 'ProxyPort' found in profile 'SysML 1.2'.
This message indicates that there is a mismatch between the stereotype required and the profile it is supposed to be in. In the example, SysML1.2 does not have ProxyPorts, so perhaps the stereotype should be 'FlowPort', or the profile 'SysML 1.3'.
Unknown/Illegal base type: <name>
There can be a number of reasons for this message being displayed. For example:
- When assigning an Alias for a Toolbox page, 'elements' is a reserved word; if the word 'elements' is used, it will not appear in the title bar of the corresponding Toolbox page
- Each Profile element incorporated into an MDG Toolbox page enables a context menu option to synchronize the Tagged Values and Constraints of all objects created from it
- The sequence of Toolbox pages in the Toolbox is determined by the sequence of their Stereotype elements in the Profile diagram or Profile Package; if you create and save the Profile from a:
- Diagram, the Toolbox page sequence is determined by the Z-order of the Stereotype elements
on the diagram - the lower (closer to 1) the Z-order number of the Stereotype element (the closer
it is to the 'surface' of the diagram), the further down the Toolbox its Toolbox page is placed;
if you change the Z-order of a Stereotype element in the diagram, it changes the position of the
element's page on the Toolbox
- Package in the Browser window, the Toolbox page sequence is determined by the list order of
the Stereotype elements in the Package - the Toolbox page for the first listed element is at the
top of the Toolbox; if you re-order the elements in the Browser window, you produce the same
re-ordering of pages in the Toolbox