MagicDraw UserManual PDF
MagicDraw UserManual PDF
0 LTR SP2
User Manual
1 Plugin documentation 19
2 User Guide 19
2.1 MagicDraw getting started 20
2.1.1 Contents 20
2.1.2 User and product registration 20
2.1.3 Understanding the user interface 24
2.1.4 Most common shortcut keys 60
2.1.5 Assigning shortcut keys 62
2.1.6 Customizing environment options 64
2.1.7 Customizing and Selecting Perspective 66
2.1.8 Configuration files 72
2.1.9 Disabling inbound network activity 75
2.1.10 Improving performance 76
2.1.11 Support 83
2.1.12 News Reader 95
2.1.13 Creating path variables 97
2.1.14 Launchers 99
2.1.15 Special characters 101
2.2 Working with projects 103
2.2.1 Contents 103
2.2.2 Creating projects 103
2.2.3 Saving projects 111
2.2.4 Autosave 112
2.2.5 Opening projects 113
2.2.6 Importing data from other UML tools and formats 114
2.2.7 Exporting UML models 200
2.2.8 Creating and using project templates 201
2.2.9 Projects with file attachments 207
2.2.10 Setting project options 213
2.2.11 Searching 215
UAF Plugin4
UPDM 2 Plugin5
• MagicDraw 18.58
• MagicDraw 18.49
• MagicDraw 18. (see page 19)3 (see page 19)
• MagicDraw 18.2 (see page 19)
2 User Guide
Welcome! This user guide will walk you through the basics of using MagicDraw, including working with
projects, setting up the modeling environment, collaborating with the help of Teamwork Server (see page
1409)or Teamwork Cloud (see page 1320), generating reports, and more.
To meet the customer needs, special editions of the modeling tool are developed:
•
1 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
2 https://docs.nomagic.com/display/CST190SP2/Cameo+Simulation+Toolkit+Documentation
3 https://docs.nomagic.com/display/CRMP190SP2/Cameo+Requirements+Modeler+Plugin+Documentation
4 https://docs.nomagic.com/display/UAFP190SP2/UAF+Plugin+Documentation
5 https://docs.nomagic.com/display/UPDM2P190SP2/UPDM+2+Plugin+Documentation
6 https://docs.nomagic.com/display/EI190SP1/Excel+Import+Plugin+Documentation
7 https://docs.nomagic.com/display/CSVIP190/MagicDraw+CSV+Import+Documentation
8 https://docs.nomagic.com/display/MD185
9 http://docs.nomagic.com/display/MD190SP2?src=breadcrumbs-homepage
10 https://www.nomagic.com/products/magicdraw
11 https://www.nomagic.com/products/cameo-systems-modeler
12 https://www.nomagic.com/products/cameo-enterprise-architecture
2.1.1 Content
s
This section will help you get started if you are new to MagicDraw. You can get acquainted with the user
interface, learn how to register your product, customize the modeling environment and perform other
pre-modeling tasks.
Use the search box to find a specific topic or select one from the list below:
Contents
Do I have to register?
• You are not required to complete the online registration to use your modeling tool.
However, registration is recommended in order to receive the benefits available for a
registered user.
• Registration for owners of commercial licenses is mandatory!
To register a product
1. Start your modeling tool and click Help > Register in the main menu.
2. In the Registration dialog, provide the requested information. Some information may be
prefilled from the key owner profile.
3. Share your experience with the tool (optional).
4. Click Register to send data to the server, or click Register Later to complete the registration
later .
13 https://www.nomagic.com/
Privacy information
No Magic, Inc. respects your privacy. We will only use your personal information for
communications, management of your online account, and the products you register with
your account.
Use the login name and password you received upon confirming your registration to log in to your
profile at www.nomagic.com15, and get dedicated online support, evaluate new products and access
other professional services.
After 30 days from registration, or when a new license from the same licensed owner is applied, you will
be requested to confirm that you are the one using the software installation at your modeling tool
startup. Ensure all information is correct and click the Confirm button.
14 http://www.nomagic.com/
15 http://www.nomagic.com
Related pages
Contents
Issue Solution
Registration is requested at each startup. The Registration dialog opens each time your modeling
tool starts, until you register the product installation. Click
the Register Later button to close the Registration dialog.
Registration confirmation is requested at each If you do not click the registration confirmation link,
startup. installation will not be confirmed. You may request a new
confirmation email from the registration confirmation
message.
No email with a confirmation link is received. Your mail box spam or anti-virus filter may filter out the e-
mail with a confirmation link. Check your spam folder, or
request a new confirmation e-mail by clicking Help >
Register in the main menu.
The Registration dialog does not open at This may happen for a few reasons:
modeling tool startup.
• You registered less than 30 days ago.
• There are network limitations preventing a
modeling tool from checking your registration
status.
Note that registration is not necessary to use a modeling
tool.
Related pages
Contents
The user interface is where you will control your software installation. The MagicDraw window contains
the following:
https://www.youtube.com/watch?v=0B76lH-QtrM&
Related pages
Main menu
Contents
Menu Description
element
File Contains basic project management related commands, e.g., New Project (see page 104), Open
Project (see page 113), and Save Project (see page 111). Among other actions, this menu also allows
you to import data from external sources, export a project, or print diagrams (see page 593).
Edit Use this menu when working with diagrams on the Diagram pane. The Edit menu contains the
commands for selecting, cutting, copying and pasting (see page 485) symbols or entire diagrams,
and finding elements in the current project.
View Contains commands allowing you to zoom in or zoom out (see page 543) of a diagram, use and
customize a diagram grid (see page 544), manage diagram tabs (if you have several open diagrams)
and customize the toolbars (see page 27) of your modeling tool.
Layout Use this menu for managing the layout (see page 547) of the symbols on an active diagram. To
enable certain Layout menu commands, you must select more than one symbol.
Diagrams Allows you to create a new diagram (see page 450), access diagram wizards and history, and create a
custom diagram type (see page 1962).
Options Use this menu to specify project options (see page 213) and environment options (see page 64), select
or customize perspectives (see page 67), and choose the style for your modeling tool.
Tools Contains the set of commands allowing you to execute model transformations (see page 1088) for
converting models between different modeling domains, add hyperlinks to model elements,
generate reports (see page 1654), evaluate expressions (see page 1230) on the actual testing model,
generate code for the selected model data, create and organize macros (see page 2585), access the
DataHub plugin16 and more.
Analyze Use this menu to access the wizards of different types of diagrams (see page 1301), create
implementation matrices, analyze and show model dependencies, compare two project versions
(see page 1246), validate a project (see page 1261), display paths (see page 481) or related elements (see
page 476), and perform other model analysis related actions.
Collaborat Contains the commands for working with server projects (see page 1313).
e
Window Allows you to manage the layout of different windows in your modeling tool.
Help Among other actions, this menu allows opening online documentation, reporting an issue,
updating a modeling tool17 and plugins18, managing resources, accessing modeling tool related
information.
16 https://docs.nomagic.com/display/CDH190SP2
17 https://docs.nomagic.com/display/NMDOC/Updating+modeling+tool
18 https://docs.nomagic.com/display/NMDOC/Updating+plugins
Related pages
Toolbars
Contents
Toolbars help to speed up your work when performing commonly used tasks. Your modeling tool has
two types of toolbars:
• Main toolbars - contain commands for basic project related tasks and are located at the top of
the modeling tool window, right under the main menu.
• Diagram toolbars - contain commands for working with diagram symbols and are located at the
top of the diagram pane.
• In the main menu, click View, select either Main Toolbars or Diagram Toolbars, and in the
showed menu select/clear the check boxes of the toolbars that you want to show/hide.
• Right-click the desired toolbar area and in the shortcut menu select/clear the check boxes of the
toolbars that you want to show/hide.
Customizing toolbars
You can customize existing toolbars by adding or removing buttons, and also create new custom
toolbars.
3. In the Add Button dialog, select the desired button or command and click OK.
4. Click OK one more time to close the Customize Toolbars dialog.
A new button is added to the selected toolbar. To add more than one button, repeat steps 2 and 3 as
many times as you need.
After completing the above steps, the selected toolbar or button is removed from the respective toolbar
area or toolbar. Toolbars that have been removed do not appear in the menu for selecting which
toolbars you want to show.
Related pages
Model Browser
Contents
Model Browser provides a visual representation of the hierarchy of your model elements.
• Compressed – a plus sign next to an icon indicates that the icon is compressed. This is the
default setting. It means that the element contains other model elements. Click the plus sign to
expand the icon and view its subordinate items.
The Model Browser is a hierarchical navigation tool that allows you to manage your model data,
including packages, components, classes, all UML diagrams, extension mechanisms, and other data.
The Model Browser may be used as an alternative tool to the MagicDraw menus and toolbars. It is
easier to work with project diagrams and data elements using the Model Browser.
The Search Results tab is not displayed by default. It appears after you perform searching.
• Lock View tab represents locked elements of the server project.
The Lock View tab is not displayed by default. It can appear if you are working on a server
project. For more information, see Representation of locked elements (see page 1345).
Related pages
Contents
Model Browser is displayed when at least one project is open. By default, Model Browser is placed at
the left side of the main window. It is possible to move the Model Browser to any place on the
MagicDraw window. Also, all tabs can be viewed separately and you can set up the Model Browser
according to your needs by hiding the desired tabs.
• Using the Window menu, choose the Model Browser tab you want to close or open.
• From the Window menu, choose the Reset Windows Configuration command.
Containment tab
Contents
On this page
To open the Containment tab, do one of the following
You can change some Containment tab properties in the Environment Options dialog
(see page 64) the Browser options group.
Along with model elements that are created by the user, the root package Model may contain the
following default items:
• The Relations branch. This branch appears when at least one relationship is created in the
project. The Relations branch collects all relationships from the particular owner. For example, if
the Relations branch is in the root package Model, that means, all relationships from the root
package Model are listed in the Relations branch owned by the root package Model. The Relations
branch can exist in other elements which may have inner elements and relations among these
elements. For example, in packages, classes, and others.
• The UML Standard Profile package. This is a profile which is included to every MagicDraw
project. It contains a list of stereotypes, data types, and other elements from the UML 2
metamodel. By default, the UML Standard Profile is hidden. To display the UML Standard Profile,
click the Show Auxiliary Resources button. There can be more standard profiles (such as,
SysML, UPDM, Java, and others).
• The File View package. This package appears when at least one code engineering set is created.
The File View package contains components that are created on code reverse and represents
source files.
• The Hyperlinks branch. This branch appears when at least one hyperlink is added to the
particular element. The Hyperlinks branch contains the list of hyperlinks to the file, element/
symbol, or web page.
Code engineering sets
Code engineering sets can be considered a gateway between your source code and model data. Using
these sets, you can perform Java, C++, C#, IDL, CIL, CORBA IDL, EJB 2.0, and WSDL round-trip code
engineering, that is, code generation and reverse engineering.
• In the Containment tab toolbar, click the Options button, then click to select the Show
Code Engineering Sets check box.
In Code engineering sets branch, you can create a new code engineering set, generate code, and
perform other actions.
Collapse Selected Recursively Collapses only selected node and all subnodes in that
node.
Open in New Tab Opens the contents of the selected element in a new
tab of the Model Browser.
The same actions you may perform using the shortcut menu of the Containment tree.
Command Function
Create Relation > Creates a new relation to or from the selected element.
Outgoing / Incoming
Open in New Tree In the Model Browser, opens a new tab for the selected element.
Select in Structure Tree In the Model Browser, the Structure tab opens and the structured
classifier is selected.
Open in New Structure Tree In the Model Browser, opens a new Structure tab for the selected
structured classifier.
Specification Opens the element Specification window wherein you can specify
various element properties.
Related Elements Opens a list of functions available for the selected element.
Tools Opens a list with tools that are available for the selected element.
Depends on the selected element.
Stereotype Opens the drop down list, wherein you can apply an existing
stereotype, or create a new one.
Modules Opens the list with the commands for working with modules.
Generate Code Generates code for the selected item. Opens the Message Window
Framework with the information.
Check Syntax Checks syntax in the model according to the default code
engineering language. Opens the Message Window with the
information.
Reverse from Classpath This command is available in the class shortcut menu.
Related pages
Structure tab
Contents
This tab will appear in the Window menu only if the SysML plugin is installed.
The Structure browser allows you to browse for deep nested structures of the structure classifier in
your model. For example see the image below, the node: diameter : mm represents the property:
In the Structure tab, you can open any selected element in a new tree.
• Right-click the selected element, and in the shortcut menu, click Open in New Tree.
Related pages
Inheritance tab
Contents
The Inheritance tab represents classifiers, packages, data types, and stereotypes hierarchy within your
project. Inheritance according to the UML Specification is shown using the generalization relationship.
You can change some Inheritance tab properties in the Environment Options dialog (see page
64) the Browser options group.
Collapse Selected Recursively Collapses only selected node and all subnodes
in that node.
The same actions you may perform using the shortcut menu of the Inheritance tree.
You can work with elements in the Inheritance tree using the commands available from the selected
element's shortcut menu. The shortcut menu contains the following commands:
Command Function
New Specific Classifier Creates a new element that is connected with the
current element with the generalization relationship.
Related pages
Diagrams tab
Contents
Just diagrams grouped by types that are used in your project are listed in the Diagrams tab in the
Model
Browser, not all diagram types as it was in earlier versions.
You can change some Diagrams tab properties in the Environment Options dialog (see
page 64) the Browser options group.
Collapse Selected Recursively Collapses only selected node and all subnodes
in that node.
The same action you may perform using the shortcut menu of the Diagrams tree.
Command Function
Related pages
Contents
The Model Extensions tab contains all Stereotypes that are predefined and created manually in the
project. In this tree, you can create, review, copy/paste, and delete extension mechanisms.
• At the top of the Model Browser, click the Model Extensions tab.
• If the Model Extensions tab is hidden, from the Window menu, select Model Extensions
You can change some Model Extensions tab properties in the Environment Options
dialog (see page 64) the Browser options group.
Collapse Selected Recursively Collapses only selected node and all subnodes
in that node.
The same actions you may perform using the shortcut menu of the Model Extensions tree.
For more information about commands available from the shortcut menu in the Model
Browser, see Working with model elements in the Model Browser (see page 50).
Related pages
Contents
The Search Results tab is used to display search results. This tab opens only after performing the search
(see page 216) by pressing Ctrl+Shift+F, or by clicking Edit > Find.
The tab is not displayed when performing a Quick Find (see page 222).
Collapse Selected Recursively Collapses only selected node and all subnodes in that
node.
Save Search Results Saves as a smart package either the search options or
the search results.
The same actions you may perform using the shortcut menu of the Search Results tree. For
more information about commands available from the shortcut menu in the Model Browser,
see Working with model elements in the Model Browser (see page 50).
• Found in loaded diagrams – symbols that have been found in the diagram(s) are displayed in
this package.
• Found in model – elements that have been found in the model data are displayed in this
package.
Related pages
Contents
The Lock View tab is displayed only when working with server projects (see page 1313).
The Lock View tab is used to display what was locked in the project (locked elements, project structure,
symbol styles) and by which users. Next to the locked element, you can see the name of the user who
has locked it. Using the Filter by user list in the Lock View tab toolbar, you can see the elements, locked
by the particular user.
• At the top of the Model Browser, click the Lock View tab.
• If the Containment tab is hidden, from the Window menu, select Lock View.
The Locked Elements tab consists of the following two components:
Using the Filter by user list you can select to display only the elements locked by the particular user.
Command Function
Related pages
Contents
In the Model Browser you can do the various actions with model elements, such as, rename, cut, copy,
delete, and others. These actions are available from the particular model element shortcut menu. See
the list of the concrete actions in the following table.
Command Function
Related pages
Contents
The Quick properties panel has three tabs, as shown in the figure below:
Zoom tab
Contents
The Zoom tab enables you to preview a selected diagram. To select a diagram, go to the Containment
or Diagram tab. You can also use the Zoom tab to zoom in or out of the active diagram.
• In the Zoom tab, drag the blue square to the desired part of the diagram.
The selected diagram part will be displayed on the diagram pane.
• In the Zoom tab, on the blue square , click the Fit in Window button or press CTRL+W.
1. From the Options menu, select Environment. The Environment Options window opens (see
the figure above).
2. Select the Browser options group.
3. In the Browser category, select the Show Diagram Zoom Slider check box.
The Diagram Zoom Slider is displayed in the Zoom tab (see the figure above).
Related pages
Documentation tab
Contents
The Documentation tab shows information associated with a selected model element in the Model
Browser or on a diagram pane.
If there is no documentation for the selected element, the text area is empty.
• In the Documentation tab, click the text area and type the text.
Related pages
Properties tab
Contents
The Properties tab at the bottom of the Model Browser allows you to quickly access basic information
about a selected element or diagram.
When you click the Show Only Applied Stereotypes Tags button,
only the tabs with values are listed.
Language properties Contains the same data as the Language Properties property
group in the element's Specification window.
This tab is available only for the elements used for code
generation, that is, class, attribute, operation.
Related pages
• Compress a folder (.zip) with a set of desired images and place it in the MagicDraw installation
directory: \data\imagelibraries\commonsymbols.
Image formats
You can add images of the following formats: .gif, .jpg, .jpeg, .svg, .png, .wmf.
• Create an Image Library plugin. Follow up an example Writing plugins (see page 2075).
Using the Image Library tab, you can apply an image on symbol (see page 945).
Quick filter
You can search for images in the Whole hierarchy or Recently used tabs using one of the following
way:
For example, type "*Bank" if you want to find "Bank" somewhere in the hierarchy.
Contents
You can change the appearance of your modeling tool windows, dialogs and menus. The Look and Feel
menu allows you to personalize the user interface using a number of predefined styles and themes.
You can also create a custom theme with your favorite colors and fonts.
1. In the main menu of a modeling tool, select Options > Look and Feel.
2. Select the desired style from the list of available styles.
Deprecated styles
The use of styles listed under Look and Feel > Deprecated is discouraged as they are outdated
and only kept for compatibility purposes.
Important
• The selected style may not look exactly like the style in related operating systems.
• Depending on your operating system, some style options may be unavailable.
1. In the main menu of a modeling tool, select Options > Look and Feel > Metal.
2. In the same menu, select Options > Look and Feel > Look and Feel Themes > Custom.
3. In the open dialog, change the values of the desired style properties.
4. Click OK.
Related pages
Contents
The following table outlines the most commonly used shortcut keys:
Windows OS X
Select elements of the same type Alt+Left mouse button Alt+Left mouse button
Reverse path direction Draw the path while holding Draw the path while holding
down Alt down Alt
Related pages
• Assigning shortcut keys (see page 62)
Contents
Most commonly used commands in a modeling tool have shortcut keys (see page 60), allowing you to
access the commands quicker. However, you can assign custom shortcut keys to modeling tool
commands and change or remove already-existing shortcut keys.
1. From the main menu of a modeling tool, select Options > Environment. The Environment
Options dialog opens.
2. From the option group list on the left side of the dialog, select Keyboard.
3. Search for the command you need to assign a shortcut key to.
Usage information
• You can assign multiple shortcut keys to one command.
• If you enter a shortcut key that is already assigned to another command, a notification
appears under the Press new shortcut key box.
• If you assign a shortcut key that is already assigned to another command, the shortcut
key is automatically unassigned from that command and assigned to the new one.
Contents
You can customize the application environment according to your preferences via the Environment
Options dialog.
An option value can be simply changed by typing a new value, setting a value to true / false, or selecting
a value from the list. Click the Reset to Defaults button to restore default option values.
Changing options
In order to change a desired environment option, first of all you may need to find it. In this case, use
the quick filter (see page 888) in the dialog. Filtering is performed in the all available options, not only in
the selected option group.
For better understanding an option you can read its description that tells what is the effect of changing
the option value.
1. Make sure that the Show Description mode is turned on in the Environment Options dialog. To
turn the Show Description mode on or off, click the Show Description button on the tab toolbar.
Due to their growing numbers, many features may be configured for the standard or expert user. The
tool better satisfies the needs of different software development process roles by using Perspective.
• Full Featured perspective provides all features available in the modeling tool and installed
plugins.
• Quick Start perspective provides basic features dedicated to modelling with an interface that is
not overcrowded, making it quicker to learn. Code engineering, transformations, and
other advanced features are hidden yet easily reachable in expert mode.
• Software Architect perspective provides features primarily involved in designing
and implementing projects. It is a set of roles consisting of Software Architect, Designer,
Interface designer, and Database designer. This is the default modeling tool configuration.
All functionalities are available for expert mode.
• System Analyst perspective provides features primarily dedicated to obtaining requirements
and modeling the system. Analysis features are highlighted. Configuration is modeling oriented.
Code engineering, transformations and other features are hidden.
To set the perspective for the modeling tool environment
• Launch he program for the first time. The Startup dialog will appear with the ability to switch
between perspectives. Select the desired perspective from the list and click OK.
• From the Options menu, choose Perspectives > Perspectives. The Select Perspective dialog
opens. Select the desired perspective and click the Apply button.
• On the Perspectives toolbar, select the desired perspective from the list.
Customizing Perspectives
Perspective customization allows grouping of functional features into standard/expert
modes. Customization also allows the user to hide unnecessary commands, making a modeling tool
more convenient.
• Main menu
• Main toolbars
• Diagram toolbars
• Diagram modeling elements toolbar
• Smart manipulators
• Shortcut menu actions
• Create Diagram dialog
Each of these areas has a set of commands, which can be shown in the standard / expert mode or
hidden.
1. In the Customize Perspectives dialog, select the perspective and click the Edit button near the
selected area. The appropriate Customize dialog opens.
2. Expand tree sections and select radio buttons beside the items in the tree depending on
your choice for Standard and Expert, Expert only or Hidden modes.
3. Click OK when you are done.
To switch between Standard/Expert modes, do one of the following
• From the toolbar shortcut menu, select/clear the Expert Menu Mode or Expert Toolbar
Mode check box.
• From the diagram pallet shortcut menu, select/clear Expert Mode check box.
Element Description
Name
Expert Choose Expert mode only if you are an advanced user. All features and commands will be
loaded.
If you are a new user, you should not select Expert mode.The non-expert mode only loads the
basic and most important commands and features.
Customize Open the Customize Perspectives dialog to customize the selected perspective. You can
make your tool less complicated by hiding irrelevant features or commands.
For example, you can group functional features, show, or hide selected commands.
Import New The Open dialog appears. Select *.umd extension file
Perspective and click Open to import the perspective into the
modeling tool environment.
Export Selected The Save dialog opens. Type a name for the
created perspective and click Save to store it
Perspective
as *.umd extension file.
Edit Click the Edit button to open the Customize Main Menu dialog.
Change he commands mode by selecting radio buttons.
The name of this dialog depends on the area you select. For example, if you select Main Menu, the
dialog's name is Customize Main Menu.
• Standard and Expert. The selected element will be visible in the Standard as well as in the
Expert mode. The Standard mode is less complicated and is meant for standard users.
• Expert. The selected elements will be visible only in the Expert mode.
• Hidden. The selected element will not be shown in any mode.
To assign an element to the mode
1. Select an element.
2. Click the radio button under the desired mode.
Contents
On this page
This page covers all modeling tools that are developed by No Magic, Inc., that is
MagicDraw magicdraw
19 https://docs.nomagic.com/display/CEA190SP2/Cameo+Enterprise+Architecture+Documentation
20 https://docs.nomagic.com/display/CSM190SP2/Cameo+Systems+Modeler+Documentation
1. From the Help menu, select About <modeling tool name>. The About dialog opens.
2. Click the Environment tab.
3. Click the hyperlink next to Configuration Files. The folder containing modeling tool
configuration files opens.
You can also save configuration files in any of the following locations:
Note
The Common Application Data location on Windows Vista/7/8/10 is C:\ProgramData.
To store configuration files in the modeling tool installation directory or Common Application Data
location on Windows
1. Open the <modeling tool name>.properties file, which is located in <modeling tool installation
directory>\bin.
2. In the JAVA_ARGS line, change the -DLOCALCONFIG property value according to the following
table:
Important!
It is important to add the -DWINCONFIG=false parameter on Window OS, otherwise the
configuration files will not be stored at the modeling tool installation directory.
Note
If you have defined to store files in the modeling tool installation directory, files will not be
stored in the defined location.
Do either:
Or:
1. Go to the folder, where the configuration files are stored (see page 73). (see page 72)
2. Create a new file named <modeling tool properties file name> redirect. File names for each
modeling tool are listed in the following table:
Modeling tool File name
MagicDraw magicdrawredirect
Related pages
Contents
Useful information
If you disable inbound network activity, double-clicking a project file (.mdzip) opens the project
in a new modeling tool window.
1. Go to <modeling tool installation directory>\bin and open the properties file, e.g.,
magicdraw.properties.
2. In the JAVA_ARGS line, add the following argument:
-DDISABLEINBOUNDCON=true
Related pages
Contents
When working with very large models or a number of diagrams at a time, the modeling tool
performance may decrease. To increase efficiency, we suggest the following solutions:
• Increase memory allocation value (see page 80) (java heap size). If you want to make sure you have
a sufficient amount of memory allocated to your modeling tool, use the memory monitor (see page
78) to track memory usage.
• Increase an active validation period (see page 82) and/or do not keep unused diagrams open.
• Split a project into several separate project files, and load only the files that you work with. This
may help only if your project contains several parts with minimal dependencies between
them. For more information, see Project partitioning (see page 233).
Contents
Low-priority or routine tasks are moved to separate threads and are performed as background tasks.
These tasks do not stop a modeling tool from running, and you can work with your model as usual.
Background tasks are displayed in the Background Task Manager at the bottom right corner of the
modeling tool window. For example, when a search process is running, the progress bar is displayed in
the Background Task Manager, shown in the following figure.
If a background task runs for too long, you can cancel it as described below.
• Click in the Background Task Manager status bar to cancel the selected process. If you cancel
the last of several tasks (or only one existing process), the Background Task Manager is turned
off.
Memory monitor
Contents
When working with larger models, turn on the Memory Monitor to monitor memory used by a
modeling tool. The Memory Monitor shows currently used memory and the current Java heap size.
Typically, when you start working with a model, used memory increases because actions are stored in
the undo list, and opened diagrams are loaded.
The memory monitor bar showing currently used memory and the current Java heap size.
To turn on the Memory Monitor
The Memory Monitor bar appears in the bottom-right corner of the modeling tool window.
If a modeling tool uses all the Java heap size, you can try to recover enough memory for saving a project
with the Garbage Collector, but this may take some time.
• Click anywhere on the Memory Monitor bar and select Run Garbage Collector.
If you find it impossible to use the modeling tool and/or see the Out of Memory error, you should dump
memory heap to the .hprof file that is created in the defined location on the computer and then submit
this file to customer support (see page 83) for further assistance regarding the memory consumption
issue.
• Click anywhere on the Memory Monitor bar, select Dump Memory Heap, and then set the
desired name and location of the memory heap file. By default, the name of the file is generated
according to the current timestamp.
You must create a new file for the heap dump since the memory heap cannot be dumped to an
existing file.
Related pages
Memory allocation
Contents
If you receive an error message saying your modeling tool is out of memory, the application does not
have enough memory to operate. You can change the amount of allocated memory directly in the error
message dialog or by changing modeling tool properties.
The maximum theoretical heap limit for the 32-bit JVM is 4G. In practice, the limit can be much lower,
due to various additional constraints such as available swap, kernel address space usage, memory
fragmentation, and VM overhead.
• On most 32-bit Windows systems the maximum heap size ranges from 1.4G to 1.6G.
• On 32-bit Solaris kernels the address space is limited to 2G.
• On 64-bit operating systems running the 32-bit VM, the max heap size can be higher,
approaching 4G on many Solaris systems.
• On 64-bit VMs, the maximum Java heap size is limited only by the amount of physical memory
and swap space your system provides.
1. In the main menu of your modeling tool, go to Options > Environment. The Environment
Options dialog opens.
2. Expand the General options group on the left side of the dialog, and select the Memory Settings
category.
3. In the option specification area on the right side of the dialog, change the value of the Maximum
Heap Size or Thread Stack Size option.
1. Go to Environment Options > Display and find Notify about low memory option
• Set to true to show notifications about low memory.
• Set to false to disable notifications about low memory. Also, this notification can be
disabled, by clicking Do not show again option in the Low memory notification.
To change the amount of allocated memory in the modeling tool properties file
1. Go to <modeling tool installation directory>\bin and open the modeling tool properties file.
Contents
By default, an open model is periodically validated. An active validation period is the period of time
between subsequent validation occurrences. When an active validation period is short, it may have a
negative effect on the performance of your modeling tool, as it needs to constantly process model data.
If you notice that modeling tool performance has decreased, try setting a longer active validation period
or opening your model without loading its diagrams.
2.1.11 Support
Contents
FAQ
Before calling or registering an issue, please have a look in our FAQ section21. It is constantly updated
and may contain an answer to your question, or issue. If your questions are unanswered in this section,
then you have the option of the posting your question, or issue, in our Forum22 page. If you
are interested in reporting an issue, then please refer to our Reporting Issues (see page 86) page.
Nevertheless, please continue perusing this page to find out about all the support we provide for you.
Forum
Discuss and get answers about our modeling tools in the No Magic Community Forum23. It already has
thousands of publicly available posts. You are welcome to post your comments and questions there.
Previous Discussions
If you are interested in previous discussions from the newsgroups, you can find them in our
Forum24 as well as in the newsgroups with a read-only mode.
New User
If you are a new user, ask questions and get started on learning about UML and our modeling
tools in the New User25 section.
21 https://www.nomagic.com/support/faq
22 https://community.nomagic.com
23 https://community.nomagic.com
24 https://community.nomagic.com
25 https://community.nomagic.com/new-to-magicdraw-f18.html?sid=503891be74c4870fc7bea68e4e600338
26 https://community.nomagic.com/standards-methodologies-f19.html?sid=503891be74c4870fc7bea68e4e600338
27 https://community.nomagic.com/suggestions-f49.html
28 https://community.nomagic.com/viewforum.php
29 https://community.nomagic.com/magicdraw-f21.html?sid=503891be74c4870fc7bea68e4e600338
30 https://community.nomagic.com/other-f48.html
• Registered users with a valid No Magic Software Assurance contract31 (SA). SA provides you with
technical support, software upgrades and maintenance releases at no additional cost for a
contract period.
• Pre-sales users during the evaluation period.
• New customers for 30 days.
• Inquiries about registration, licensing and product updates.
More support includes:
Reporting Issues
Please refer to Reporting Issues (see page 86) to find instructions on the different ways to inform
us of issues you may encounter.
31 https://www.nomagic.com/support/sales-and-licensing/software-assurance-maintenance-contracts
32 mailto:[email protected]
33 mailto:[email protected]
34 https://www.nomagic.com/support/sales-and-licensing/software-assurance-maintenance-contracts
Full • Customer with SA35 • Professional online support with trouble ticket
Support • Customer with valid evaluation status tracking.
key. • Inquiries about No Magic software problems
and usage.
• Response within business hours, with 24 - 48
hours response time based on severity*.
• Reasonable No Magic efforts to provide a
usable work-around solution or to correct the
issue in an upcoming maintenance release or
update.
Attention
All requests for support must be submitted by accessing the JIRA request form directly from the
modeling tool (from the main menu, choose Help > Report an Issue)*** or directly through No
Magic Customer Support System37.
* Severity let us know the impact of the problem on business.
• Severity 1: Critical business impact or system down, this condition requires a solution.
• Severity 2: Significant business impact, this indicates the program is usable, but is
severely limited.
• Severity 3: Some business impact, this indicates the program is usable with less
significant features.
• Severity 4: Minimal business impact.
**VIP customers are usually our partner.
*** If your modeling tool stops responding, the executable tools can be used for analyzing and
submitting the status of the process. To report an issue using an executable file, start the
reportissue.exe file, located in <modeling tool installation directory>\bin.
Support Period
During the support period covered by our SA38, you can also report any software problems or
errors. If reported, and reproducible, issue in the software exists, and the issue significantly
impacts the usability of the software, No Magic agrees to make reasonable efforts to provide a
usable workaround solution or to correct the problem in an upcoming maintenance release or
update.
35 https://www.nomagic.com/support/sales-and-licensing/software-assurance-maintenance-contracts
36 https://www.nomagic.com/support/dedicated-support
37 https://www.magicdraw.com/main.php?
ts=customer_support&cmd_show=1&menu=customer_support_management
38 https://www.nomagic.com/support/sales-and-licensing/software-assurance-maintenance-contracts
The Long-Term Releases (LTR) are extremely reliable and rock-solid. No Magic provides guaranteed
support (including service packs and private patches) until the next Long-Term Release is released,
approximately every two years. Longer-term support, of up to five years, for a Long-Term Release, is
available for an additional charge. For more information about the Long-Term Releases, see http://
www.nomagic.com/support/long-term-releases.html39
Support for Feature Releases (FR) discontinues when the next Feature Release is released. Therefore,
bug fixes for old Feature Releases (FR) are unavailable.
Providing Patches
We support and provide patches only for the users who have Software Assurance contracts
(SA)40 on their purchased products, so please make sure that you are covered.
Public service packs are released primarily for the newest versions. As we understand that switching
from one version to another can take some time, in the case of significant issues, we provide service
packs, or private patches, for up to one-year-old versions, when applicable.
We always strongly recommend using the newest version because it contains all newest fixes, usability
features, new capabilities, and support for standards and technologies.
Related pages
Reporting Issues
Contents
On this page
39 https://www.nomagic.com/support/long-term-releases
40 https://www.nomagic.com/support/sales-and-licensing/software-assurance-maintenance-contracts
Need help? Send notifications of a problem, suggest improvements for our modeling tools, or ask about
new features directly from the modeling tool. Simply choose Help > Report an Issue from the main
menu. If the modeling tool stops responding, you can use the executable tools for analyzing and
submitting the status of the process. To report an issue using an executable file, start the reportissue.exe
file, located in <modeling tool installation directory>\bin.
These reports help us address issues in a timely manner, as well as speeding up maintenance releases
with fixes that are free of known defects.
41 https://support.nomagic.com/secure/CreateIssue!default.jspa
Email
If you supply the email address you used when registering at www.magicdraw.com42, you
will be able to track the status of your issue in our Online Customer Support System43. If
you used another email address, you will only receive email notifications of status
changes.
42 http://www.magicdraw.com
43 https://support.nomagic.com/secure/CreateIssue!default.jspa
5. In the Attachments tab, select files you would like to send together with your issue report:
• Attach log file - the log file will be sent with your issue report.
• Attach project file - the opened and last saved project file will be sent with your issue
report.
• Attach used projects - modules that have been used in the opened project file will be
sent with your issue report.
• Attach diagrams images - choose diagrams, whose images you would like to send with
your issue report. Also, specify the images format.
6. If you are a registered user, track your issue at https://support.nomagic.com45.
Autofill
If you are already registered, your personal information will be automatically filled in on the
Report an Issue dialog.
44 https://www.nomagic.com/support/sales-and-licensing/software-assurance-maintenance-contracts
45 https://support.nomagic.com/
The system allows you to include keywords in the email’s subject line. These keywords will enable us to
route the issue to the proper support organization more quickly and resolve the issue in a more timely
manner. They also allow the definition of many fields for the newly created issue (reporter, project,
priority, affected components, affected version).
Support Issues
Support Issues can only be reported or commented on from the email address registered in
your www.nomagic.com47 account.
• #PROJECT
• #SECURITY_LEVEL
46 mailto:[email protected]
47 http://www.nomagic.com/
This email sent from the registered user will create a support issue in the UPDM project. The
Issue’s component will be Documentation and Requirements Management and its severity will
be low.
Parameters
1. Parameters should be listed in the email subject line with a single space between them.
2. No commas should be used between parameters.
3. No spaces should be used in the body of the parameter.
4. If a parameter value contains spaces, you must replace each space with two underscore
characters. For instance, #COMPONENT=Test__Component associates the issue to Test
Component. If you specify an invalid component or none at all, the issue is associated to
No Component by default.
If an email has email addresses in either the CC: or the BCC: fields, they will be added to the support
issue as External Watchers. All watchers receive email notifications about any activity on the issue.
Support Issues
Support issues that are marked private are not viewable within the support system, even if you
are listed as an external watcher. Non-registered users also will be unable to see issues within
the support system.
Issue ID
It is important that the issue id (e.g. [MDUMLCS-2058]) exists in the subject line.
48 http://knowledgebase.nomagic.com/
To view internal errors you must open the Internal Errors dialog, using one of the three methods
outlined below:
Button Availability
The View and Submit Internal Errors buttons in the Help main menu and the red button at
the bottom of the status bar only exist if the Submit Errors dialog actually contains errors.
To submit an error
49 http://www.nomagic.com
1. From Options menu, select Environment. The Environment Options (see page 2215) dialog will
open.
2. Click on the General options group Internal Errors.
3. To allow automatic internal errors submission: in the Internal Errors options list, change the
Automatically Submit Internal Errors value to true.
Question dialog
If you set the Automatically Submit Internal Errors value to false in the Environment
Options dialog, the Question dialog shown below appears when closing the error notification
or before the Internal Errors dialog opens.
• Select Attach the log file check box to attach the log file for Submitting Internal Errors,
• To automatically submit internal errors to No Magic, click Yes.
To attach the log file when automatically submitting Internal Errors to No Magic
1. From the Options menu, select Environment. The Environment options dialog will open.
In the General options group, click Internal Errors.
2. To attach the log file, in the Internal Errors options list, change the Attach Log File Submitting
Internal Errors option value to true.
1. From the Options menu, select Environment. The Environment options dialog will open.
2. In the General options group, click Internal Errors.
3. In the Internal Errors options list change the Display Internal Errors option value to true to
display internal errors.
Related pages
Contents
A small envelope icon appears on the status bar at the bottom of the program window when new
information becomes available.. Click that icon to open the News Reader dialog.
Related pages
• Getting50 S51tarted52
• MagicDraw Editions53
Contents
The main purpose for the path variables feature is to give additional sharing flexibility. It enables you to
store paths in your project as named variables that can be easily adjusted on different machines.
1. In the main menu, go to Options > Environment. The Environment Options dialog (see page 64)
opens.
2. In the left part of the dialog expand the General element and select Path Variables.
3. In the Path Variables area click the Add button. The Path Variable dialog opens.
50 file:///Users/ancaandrei/Desktop/getting_started.html
51 file:///Users/ancaandrei/Desktop/getting_started.html
52 file:///Users/ancaandrei/Desktop/getting_started.html
53 file:///Users/ancaandrei/Desktop/editions.html
• In the Available forms list, select a path and click the Use Selected button.
If you have your own documentation running on the local server, you can define the path in the
documentation.server option.
2.1.14 Launchers
Contents
Launchers show which programs will be used for opening different file types in the application. Add
new, edit, or remove launchers and specify their properties (file extension, program path or name,
program arguments).
1. To edit Default launcher, click the button next to the Default Launcher or Default
Browser text boxes.
2. The Launcher Properties dialog appears.
3. You can change Launcher`s executable file and arguments.
1. Click the Add button, found below the Defined Launchers list.
2. The Launcher Properties dialog appears.
3. Specify the file extension, which will be opened with the specified launcher.
4. Type the name of the launcher in the text box, or browse to the location of the launcher by
clicking the button.
5. Specify external launcher arguments.
Extensions Type the extensions of the files which will be opened with the specified
launcher. You can define more than one extension. Separate them using
commas (i.e., html, xls, doc, cpp, h).
Launcher An executable file with which the extension file will be opened.
Arguments Arguments are required by the external launcher, so the modeling tool
provides the ability to pass some common arguments to the launcher:
• $f - a file name
• $md_dir - the modeling tool installation directory
• $prj_dir - the project directory (if the project is saved)
• $r - a row (used when opening Code Engineering object source
code file with "Edit Source" action)
• $c - a column (used when opening Code Engineering object
source code file with "Edit Source" action).
Related pages
The XML version 1.0 do not support some special characters, to fix this problem, our modeling
tool have mechanism that replaces certain characters in element names with underscore
symbol ( _ ). However, the only a small part of them is replaced. The most sensitive for special
characters are profile, stereotype and stereotype property names, please try to avoid special
characters and use ASCII letters, numbers.
2.2.1 Content
s
Basic concepts
The following table presents more in-depth descriptions of further material.
Concept Description
Used project A project having one or more shared packages. Used projects are
(up to 18.0 – Module) created for the purpose of decomposing projects into parts in order
to manage each part separately and/or reuse those parts in other projects.
Used project is a role that one project plays in the composition
of another project. It is not a type of project.
Each used project can be opened and modified separately.
Related pages
Contents
http://youtube.com/watch?v=0B76lH-QtrM
Related pages
Contents
All project information is stored in a single file that has the same name as the project itself.
To start a new project, first you must create a new workspace for it. You can select a project type from
the following domains:
4. Click the button to select the location to store the created project.
5. Click OK.
Related pages
Contents
On this page
Title
The project title is assigned as a value of the project Documentation property (see page 53).
Compatible With
Compatible With defines the compatibility range between two Standard/System profile
versions. Once specified, it helps to avoid read-only constraints in TWCloud projects when you
use earlier profile versions locally rather than those used in the server project.
When the Version of the Standard/System profile on your computer is earlier (e.g. 19.0 SP1)
than the Version of this profile on TWCloud (e.g. 19.0 SP3), but higher or equal to the value of
Compatible with (e.g. 19.0), you will still be able to edit TWCloud projects using the profile.
Advanced options
To use advanced options
Note
The Shared Packages tab is available for local projects only.
• The Used Projects tab shows the projects and standard/system profiles used in the open
project. Click the Open Project Usages button to open the Used Projects dialog (see page
242), where you can modify project usages.
• The Advanced tab shows project meta information. In this tab you can:
• Reset all project element IDs. All project elements have their own ID (a unique
identifier). While working with several related projects, you may receive a message
about duplicated element IDs. After clicking the Reset IDs button, new IDs will be
created for all project elements.
Note
Make sure the project you are resetting IDs for is not used in other projects.
• Reset the project ID. After clicking the Reset Project ID button, new IDs are created
for the project.
Confidential information
This file also contains names of main project and used projects. If they are confidential, you
should manually remove these names from the file.
2. Click on the right corner of the Statistics tab. The Select location dialog opens.
3. Select where the file should be saved and click the Save button.
4. When the statistics file is generated, you will get a success message.
Project detailed statistics file includes the following data:
• Diagrams count
• Size of diagrams
• Elements count
• Symbol styles count
• Symbol styles properties count
• Attached files count
• Size of Attached files
• Locked elements count (only for server projects)
• Smart packages count
• Longest flat list count (longest flat list of elements under one element's root. E.g. under a
package or classifier).
• Restricted dir size
• Local cache size
• Diagrams count by type
Related pages
Contents
You may need to manage several projects at the same time, and MagicDraw allows you to do that
easily. All open projects are held in separate workspaces. Different active projects may exchange data.
Entities from one project can be copied or moved to another.
• From File menu, select Switch Projects and then click the name of the project you want to
switch to.
• On the main toolbar, click and then select the name of the project you want to switch to.
• Select Close All Projects from the File menu. The Question message appears.
Yes The project you are currently closing will be saved (its name appears in the question). The dialog is
displayed again when the next project closes.
Yes To Save all projects without prompting. The Save dialog will not appear for each open project.
All
No To All All the projects will be closed without saving or further prompting.
• Use the Cut, Copy, and Paste commands from the Edit menu or the selected element's
shortcut menu, or the appropriate shortcut keys: Ctrl + X, Ctrl + C, Ctrl + V.
Rrelated pages
The native MagicDraw format is *.mdzip and *.mdxml. You can also save projects as *.xml and
*.xml.zip.
To save changes for later sessions, projects must be saved. While saving, you can edit the name of the
project and its file format.
1. From the File menu, select Save Project or Save Project As. Alternatively, you can click the Save
button on the main toolbar or press the shortcut keys Ctrl + S. The Save dialog opens.
2. Select the destination directory (where you want the project to be saved) and type the chosen file
name.
The default project saving location is set according to your operating system:
• Windows: My Documents/
• Linux: /home/<username>/
• OS X: Users/Documents/
• Packed MagicDraw File Format (*.mdzip) (default). *.mdzip is a MagicDraw native format. It
contains various parts of the project compressed. You should select it if you intend to work
with the project only in the MagicDraw environment.
• MagicDraw File Format (*.mdxml). You should choose it if you intend to analyze the
project's structure, xml, or for other purposes. You can open *.mdxml projects with other
UML tools as well.
• XML (*.xml). It is the same file format as *.mdxml, only that *.mdxml files can be opened
with MagicDraw or other UML tools, whereas *.xml files can only be opened with an XML
editor.
2.2.4 Autosave
After you stop working with MagicDraw, an idle time passes and the current project is saved to a special
file called the AutoRecovery file.
If the application is terminated normally, the AutoRecovery file is removed. If the application crashes,
the AutoRecovery file is kept. On startup, MagicDraw checks for an AutoRecovery file. If it exists,
MagicDraw suggests loading the project from this file.
To save an AutoRecovery file of the open project(s) when a system is not in use
• From the File menu, select Open Project. In the Open dialog, select the project and click Open.
• On the main toolbar, click the Open Project button.
• Drag the project from the open window of your file system to modeling tool. The project starts
immediately.
• Double-click the project file with the *.mdxml or *.mdzip extension. A new modeling tool window
opens.
To start modeling tool with the last project you worked on, select Options > Environment and
set Open Last Project on Startup to true.
XMI 2.4 / UML 2.4 is the main file format, used by MagicDraw for storing models. This format does not
specify how to store diagrams, so MagicDraw stores and opens diagram data in XMI extension sections.
Thus if you use MagicDraw to open an XMI file exported from another UML tool, only the model will be
opened, but not diagrams or views.
Accordingly, if you open a MagicDraw file in another UML tool, diagrams or views will not be opened in
that tool (unless the tool supports MagicDraw-specific file extensions).
You may open more than one project within the same MagicDraw window. A separate workspace will
be created for each opened project.
If you convert only the project and leave the used projects saved in an old format, you will not be able
The appropriate procedure should be applied in case your model is stored in a server project with
composite structure: firstly, the used projects should be migrated to Teamwork Server 17.0.1 or later,
and only then the main project should be migrated.
• Eclipse UML2 (v2.x, v3.x, v4.x, v5.x) XMI file. Select File > Import From > Eclipse UML2 (v2.x,
v3.x, v4.x, or v5.x) for this.
• Most of the model data from an Enterprise Architect 7.1, 7.5 or 8.0 file.
Enterprise Architect does not export 100% standard UML 2.1 XMI, and this causes some
data loss during the import.
• Model from an IBM® Rational Rose® Modeler file. You can use MagicDraw RConverter54 for this.
• UML diagrams from Microsoft Visio using XMI files.
Microsoft Visio 2007 and earlier requires extra add-ons for exporting UML model to XMI
files.
54 http://www.nomagic.com/products/magicdraw-addons/magicdraw-rconverter.html
Contents
The Enterprise Architect Import has the functionality to import UML models conforming to various XMI
versions (including XMI 2.1) from Sparx Systems Enterprise Architect (EA), a modeling and visualization
tool based on the UML 2.3 standard. EA has the ability to import and export XMI compliant models, so
you can use EA to import UML2.1(XMI2.1). However, XMI models exported from EA contain some XMI
conflicts and EA-specific data that do not conform to UML standards.
Enterprise Architect Import allows you to migrate XMI models from EA to a modeling tool flawlessly by
using an additional transformation process with a set of mapping rules.
The main purpose of Enterprise Architect Import is to help users who need to import models from EA
by managing conflicts that can cause problems while loading the XMI models in the modeling tool, as
well as transforming some EA-specific data into UML elements with stereotypes (see page 827).
Enterprise Architect Import supports Enterprise Architect Versions 7.1, 7.5, and 8.0 (most of the testing
procedures performed on EA 7.1.833 and EA 7.5.847). The feature helps you import and transform an
EA exported XMI using the UML2.1 (XMI2.1) option into a model file (*.mdxml).
In addition to the ability to import model elements, the feature also allows for the import of diagrams.
The feature supports:
• Class diagrams
• Package diagrams
• Object diagrams
• Component diagrams
• Deployment diagrams
• Use Case diagrams
• Activity diagrams
• Sequence diagrams
• Communication diagrams
• StateMachine diagrams
• CompositeStructure diagrams
• InteractionOverview diagrams
Related pages
Contents
Enterprise Architect Import (EA) will automatically load when you start a program. You can use it to
import UML 2.1 XMI 2.1 to your modeling tool.
1. On the main menu of the modeling tool, click File > Import From > Enterprise Architect
UML2.1 XMI 2.1 File. The Import Enterprise Architect Files dialog opens.
Note
Enterprise Architect Import supports the EA XMI files exported with the option
specified as: XMI Type = UML2.1(XMI 2.1).
Switch aggregation side To configure the aggregation switch-side. This option is recommended for XMI
files exported from EA 7.1.
Exclude EA specific data To exclude all EA-specific data from being imported (see Transforming EA
Specific Data (see page 119) to see a list of EA specific-data that can be
transformed into UML elements with stereotypes).
Open project after To load the output project file once the conversion process has been
conversion completed.
Generate conversion log To generate a conversion log and save it in the same folder as the output file.
The same conversion information will also be displayed on the Notification
Window.
Note
You can open the window by pressing Ctrl + M.
Related pages
Option Description
Contents
On this page
Note
You can access and specify the EA information in the Property dialog in EA.
To include EA-specific data in the transformation process, a set of stereotypes and tag definitions are
created as the EA Profile.
note Documentation
Changes
EA can create a Change and will export it as a Class (see page 633). The Class information will be
transformed into the «EAChange» tag values. See the following table for details.
note Documentation
Issues
note Documentation
Importing Diagrams
Enterprise Architect Import allows you to import diagrams. The imported diagram information includes:
Geometry Properties
The geometry properties imported to a UML model are:
Note
Other display properties can override geometry information. For example, if an imported
element width is shorter than the required width to display text on the element, the width will
be adjusted automatically.
Color Properties
Color properties will be imported along with the diagrams to a modeling tool developed by NoMagic.
Each color property has a different name in a modeling tool. The following table shows color properties
mapping.
Display Properties
Display properties in EA can be categorized into three groups: shape, link, and diagram. Only those
properties corresponding to MagicDraw will be imported. For example, the Show Diagram Details
property in EA will be imported as the Show Diagram Info property (see page 521) in a modeling tool
developed by NoMagic.
Special Transformation
An EA-exported XMI contains both non-standard UML elements and elements that can break the XMI
schema. To retain standard UML elements and keep the XMI schema intact, the Enterprise Architect
Import applies specific transformation rules. The following sections describe how each model element
is transformed, enabling you to import a complete XMI model conforming to UML standards.
This page describes all Use Case diagram (see page 290) elements.
Note
An Actor that has been converted to a Class with «EAActor» will not display some properties
(such as Fill Color) because the stereotype image will be shown instead.
Boundaries.
Related pages
On this page
EA activity.
Note
The EA Activity and CallBehaviorAction elements have similar characteristics in that you can
attach a control flow to it and others. EA has its own CallBehaviorAction element.
Additionally, any ObjectNode elements attached to the Activity element will be transformed into
InputPin elements and attached to the newly created CallBehaviorAction element.
Note
In MagicDraw, CEA, or CSM, every Activity diagram element must be placed inside an Activity
element that has the same name. However, this is not the case in EA.
Note
Object elements in MagicDraw, CEA, or CSM have their XMI types defined as uml:Central-
BufferNode. However, those in EA have their XMI types defined as uml:InstanceSpecification,
which do not belong to an Activity diagram.
Note
In MagicDraw, CEA, or CSM, an Object element (CentralBufferNode) is not allowed to contain
elements other than comments and hyperlinks.
Note
A MagicDraw (CAE or CSM) Fork/Join element (whose type is uml:ForkNode) can be used to
construct either a Fork and Join node in an Activity diagram. The JoinNode element (whose type
is uml:JoinNode) is allowed to be placed in the Activity diagram, but the element’s image will be
displayed as the Fork/Join element’s default image.
Activity Parameter
If you create an ActivityParameter element, MagicDraw (CEA or CSM) will automatically create an
ActivityParameterNode (see page 751)element to represent it. Every ActivityParameterNode element in EA
will be transformed into a Pin (see page 777)element.
Note
Usually, if you specify the parameter type of an ActivityParameter element as inout, two Pin
elements (InputPin and OutputPin elements) will be created for the element. Since EA will only
create one ActivityParameterNode element, this element will be transformed into an InputPin
element.
Exception Handler
The Exception Handler element in EA differs from the UML’s ExceptionHandler (see page 680). This EA
element will be transformed into a CallBehaviorAction element. Any ObjectNode element attached to it
will be transformed into an InputPin element and any InterruptFlow line will be transformed into an
ExceptionHandler line in MagicDraw, CEA, or CSM.
• InputPin
• OutputPin
• ObjectNode
• CentralBufferNode
• DataStoreNode
After completing the transformation, the following transformation message opens:
If two or more Swimlanes are nested together, then every element (except Swimlane element)
contained within either of them will be placed at the same level as the Swimlane topping the nested-
Swimlane-elements hierarchy.
Updated element <xmi:id>: Swimlane cannot contain some inner elements. The XMI
structure was fixed.
StructuredActivity
Four elements are classified as Structured Activity elements in EA:
• StructuredActivityNode element
• LoopNode element
• SequenceNode element
• ConditionalNode element
Most of the elements placed inside any StructuredActivityNode, LoopNode, SequenceNode, or
ConditionalNode elements in EA will stay in their original place.
• InputPin element
• OutputPin element
• ObjectNode element
• CentralBufferNode element
• DataStoreNode element
InterruptFlow.
ExpansionNode
An ExpansionNode is a Pin which can only be contained within an ExpansionRegion and will be
imported like any other Pin elements. However, if an ExpansionNode in EA is created inside another
element rather than an ExpansionRegion, that particular ExpansionNode will not be imported.
On this page
Endpoints
A Sequence Message whose head connected to an Endpoint and tail connected to a Lifeline line in EA
will be transformed into a Lost Message. The Endpoint element itself will be removed. Once the process
has been completed, the following transformation message will open:
Endpoint.
Anything else connected to an endpoint will also be removed, except the head of a Sequence Message.
For example, if the tail of a Sequence Message is connected to an endpoint, the Message will be
removed.
If the head of a Message is connected to an endpoint, but the tail is connected to anything other than a
Lifeline line, the Message will be removed. Once the process has been completed, the following
transformation message will open:
Removed element <xmi:id>: Invalid Message. Source and Target of the Mes- sage
are not connected to any Lifeline.
Delete Messages
A Sequence Message whose property Lifecycle is set to Delete (that causes the Lifeline targeted by the
Message to end at some range after the point of contact), will be transformed into a Delete Message.
The Lifeline connected to its head will end at the point of contact, and all Messages will be removed
Delete message.
Under certain circumstances, a Lifeline connected to the head of a Delete Message does not end at the
point of contact. Instead, an Activation will be created and started from the point of contact. The Lifeline
will then end at the end of the Activation. However, that Activation should not interact with any
Message.
Every Branch Message in EA will be transformed into a normal Message in MagicDraw, CEA, or CSM.
State Invariant.
Continuation.
After completing the transformation process, the following transformation message will open:
Order
A Message in EA has a Sequence Number that indicates the order of the message in the diagram. This
information can be found in the exported XMI file. Knowing it helps predict how Activations will be
created. The order starts from the top and goes downward, so the first Message in the diagram is the
one drawn at the top of the diagram. Its Sequence Number will be set to '1'.
Activation options.
Related pages
On this page
Exception Elements
Some of the elements that can be drawn in a Communication diagram using EA are not supported by
MagicDraw, CEA, or CSM. Consequently, their displaying parts will not be imported. These elements
include Package (see page 771), Activity (see page 296), Action (see page 596), DiagramFrame (see page 491), State
(see page 819), Interaction (see page 706), ExceptionHandler (see page 680), CentralBufferNode (see page 766),
InterruptibleActivityRegion (see page 822), MergeNode (see page 766), Trigger, ExpansionRegion (see page 756),
and InteractionFragment (see page 706).
On this page
Note
A SubMachine State is a State whose SubMachine property is set to a StateMachine.
Removed view <xmi:id>: The view represents element that does not support in
State Machine Diagram.
Object containing a State Machine element
In EA, an Object element can contain a State Machine element. After it has been imported to
MagicDraw, CEA, or CSM, the State Machine element placed inside an Object element will be removed
both from the Diagram pane and Containment tree. However, the Object element data will be
preserved. All of the Object element data will be placed at the closest owner package of the Object
element.
In the case of a Trigger element related to Transition, the data of the Trigger element will be placed
inside its parent Transition (see page 843). Each Trigger element will be given an event type, represented
by an Event element. After conversion, the Event will be placed at the closest owner package of the
Event (see page 677).
Trigger.
Self Transition
Most of the elements in a StateMachine diagram can have a self transition, except the Initial, Final, and
History elements. The self transition in these three elements will be removed from the Diagram pane,
but the data of the self transition will be preserved in the Containment tree.
Removed element
Any element which is not the element of a State Machine diagram (such as Class, Actor, Use-case, or
Action) drawn in the State Machine diagram will be removed from the Diagram pane. However, its data
will be preserved in the Containment tree.
Removed view <xmi:id>:The view represents element that does not support in
State Machine Diagram.
Related pages
On this page
Import elements
EA differs from MagicDraw, CEA, or CSM in the Composite Structure diagram's content elements design.
The table below shows the differences by focusing on the EA’s elements and how they will be
transformed or converted into a format MagicDraw, CEA, or CSM can correctly load and display. The
element names shown in the table are the same in both EA and MagicDraw, CEA, or CSM GUI. The
contents in the brackets ([…]) are the XMI element type references.
Interaction
Part [uml:Property]
A dummy Class will be named after the closest owner package of the Composite Structure diagram. The
Composite Structure diagram and all of the Composite Structure elements will be placed inside the
dummy Class element.
In MagicDraw, CEA, or CSM, the Property element data cannot have any elements. However, in EA, it can
have elements. Therefore, if you draw a Part element and it has an element inside it, that particular
element will be relocated to an element, which is the Part type.
If a Part is not nested to any element, the Part element will be exported from EA as a Class. The element
inside the Part will not be relocated. If that particular Part assigns a type to other elements, its type will
always be set to Class.
Part that Sets Type to Other Elements has Nested Element Inside Itself.
Port
In MagicDraw, CEA, or CSM, a Property element that can have a Port is the Property that sets type to a
Class, Component (see page 654), or Node (see page 750), and other elements cannot have a Port. However,
in EA, most of the elements can have a Port.
If a Port is created with an element that is not a Class, Component or Node, the Port will be removed
from the diagram view. However, its data will be preserved.
Removed view <xmi:id>: Invalid Port. Port can be added to Part that its type
is set to Class, Component and Node only.
Port whose type is set to other elements
You can set the type of Port element to another element (a Class, Actor, Component, or Usecase) by
right-clicking the Port element and selecting Advanced > Set Property Type > Select Property Type.
Collaboration use.
Collaboration containing other elements
Expose Interface
Expose Interfaces are the Provided and Required interfaces in MagicDraw, CEA, or CSM. You can draw a
Provided Interface or Required Interface in a Port only and set the type of the Port to another element
(an Actor, Use Case, or Class). You can create that particular Port on a Part element whose type is set to
a Class, Component, or Node only.
In MagicDraw, CEA, or CSM, some elements can be used as a Port type. These elements can have either
a Provided Interface or Required Interface, or both.
The following is a list of the Port's type elements with specific conditions:
Updated element <xmi:id>: Provided Interface conflicts with Port type. The
Port type is updated to an owner of Interface Realization.
If an Expose Interface is created with an element that is not a Port, the element will be removed both
from the Containment tree and diagram pane.
Package.
Assembly
In MagicDraw, CEA, or CSM, there is no Assembly line. It will be updated to a Connector (see page 655).
• Delegate
• Role Binding
• Represents
• Occurrence
• Nest
• Derive
• Import
• Instantiate
• Usage
• Realize
• Trace
The above relationships will be shown in the diagram view as Dependencies with a stereotype.
Removed relationships
If an Association, Direct Association, Aggregation, Composition, Generalization, or Specialization is
created in a Composite Structure diagram, it will be removed from the diagram view, but its data will be
preserved.
Transformation report
A report containing the conflicts solved during transformation, along with other transformation
information (such as special mapping and removal of some irrelevant data), is required to be provided
to the users.
• Removed view <xmi:id>: Invalid Port. Port can be added to Part that set
type to Class, Component, and Node only.
Related pages
On this page
1 N-ary Association Due to the difference between the EA exported XMI and MagicDraw, CEA or
CSM XMI, the view of N-ary association (see page 627) will not be imported.
2 Diagram Legend MagicDraw, CEA, or CSM does not have a similar element. Diagram legends will
not be imported.
3 Diagram Note The element most similar to Diagram Note is the MagicDraw, CEA and CSM
diagram information table (Option > Show diagram info). However, in EA it
will be mapped to the Option > Show diagram details. So Diagram Notes will
not be imported to MagicDraw, CEA or CSM.
4 Text size The size of text displayed in EA and MagicDraw, CEA, or CSM may vary. The text
size in EA is mostly larger.
5 Word wrap Due to size constraints in text displayed in element blocks, the result of word
wrap in EA and MagicDraw, CEA, and CSM is likely to be different.
6 Contact point The position of both ends of a link element cannot be mapped to MagicDraw,
between element and CEA, or CSM because the last segments of the link element in MagicDraw, CEA,
link or CSM always point to the center of connected elements.
7 Display alternative In EA, you can display an element in a diagram by using an alternative image.
image MagicDraw, CEA, or CSM will not import that particular image and will use a
default shape instead.
8 Link label position A Link element, such as an Association, (see page 618)has many labels, including
multiplicity and role name labels. MagicDraw, CEA, or CSM will not import the
position of these labels and will use a default position instead.
9 Pin position A Pin (see page 777)position in MagicDraw, CEA, or CSM may have been slightly
moved from its original position in EA. If the pin is placed at the corner of its
containing element, it will be shifted a little away from the corner (mostly in a
clockwise direction).
11 DataStoreNode inner A DataStoreNode element containing Activity Diagram related elements. Every
element element inside that particular DataStoreNode element will be removed. Only
the DataStoreNode element will remain.
12 Object inner element An Object element containing Activity Diagram related elements. Every
element inside that particular Object element will be removed. Only the Object
element will remain.
13 Lifeline position The Lifeline (see page 713)position in MagicDraw, CEA, or CSM will not correspond
to the original position in EA. The position is fixed.
14 Diagonal Sequence MagicDraw, CEA, and CSM do not support Diagonal Sequence Messages.
Message
15 Sequence Activation MagicDraw, CEA, and CSM do not support manipulating Sequence Activation
Options through Sequence Activation Options.
16 State contains A diagram element placed inside a State (see page 819)element will be removed.
diagram
18 Assembly Assembly relationships in EA are exported to XMI as Connectors. They will then
Relationship in be imported to MagicDraw, CEA, or CSM as Connectors (see page 655).
Composite Structure
diagram
19 Interaction elements MagicDraw, CEA, and CSM do not import Interaction elements displayed as a
as diagram frame diagram frame in an Interaction Overview (see page 307) diagram.
20 Message timing Duration Observation, and Timing Observation are not imported to
details MagicDraw, CEA, or CSM.
21 Concurrent State Adding and removing multiple Concurrent State Regions to and from
Regions in StateMachine in EA can cause the EA XMI to be incorrectly exported. If the EA
StateMachine exported XMI is in this state, the result of the StateMachine (see page 819)
imported to MagicDraw, CEA, or CSM cannot be determined.
The same problem also occurs if there are multiple Concurrent State Regions
with the same name.
22 Combined Fragment Adding and removing multiple Interaction Operands to and from Combined
Fragment in EA can cause the EA XMI to be incorrectly exported. The problem
can be fixed by importing the EA XMI back to a new project in EA and exporting
it back before importing it to MagicDraw, CEA, or CSM.
23 Problem occurs Importing EA XMI to MagicDraw, CEA, or CSM sometimes results in the
during conversion of following error message: “Problem occurred during conversion of Sequence
Sequence diagram diagram”. If this occurs, please try to import the XMI back to a new project in
(see page 291). EA and export it back again before importing it to MagicDraw, CEA, or CSM.
• UML XMI 2.4 file. You can export a project to file formats that are supported by MagicDraw.
• MagicDraw Native XML file. You can export a project to an .xml file format.
• EMF Ecore file. You can export either the whole project or selected packages to an .ecore file.
• MOF XMI file. You can export a project to an MOF (both CMOF and EMOF) XMI file.
• Eclipse UML2 (v1.x, v2.x, v3.x, v4.x, v5.x) XMI file. You can export a project to an Eclipse based
UML2 (v1.x / v2.x / v3.x / v4.x / v5.x) compatible XMI file.
To export a project
Exporting projects as Eclipse UML2 (v1.x / v2.x / v3.x / v4.x / v5.x) XMI files
The export of a MagicDraw model to an Eclipse based UML2 (v1.x / v2.x / v3.x / v4.x / v5.x) compatible
XMI file enables the interchange of the UML2 models for further manipulations and transformations
with the most popular MDA tools. You can also export your project as a template.
To export a project as an Eclipse UML2 (v1.x / v2.x / v3.x / v4.x / v5.x) XMI file
1. Open a project you want to export as an Eclipse UML2 (v1.x / v2.x / v3.x / v4.x / v5.x) XMI file.
2. On the File menu, click Export To and select one of the following command:
• Eclipse UML2 (v1.x) XMI file.
• Eclipse UML2 (v2.x) XMI file.
• Eclipse UML2 (v3.x) XMI file.
• Eclipse UML2 (v4.x) XMI file.
• Eclipse UML2 (v5.x) XMI file.
3. Specify a location for exported project files.
4. Click Export.
• A project exported as an Eclipse UML2 (v1.x) XMI file is saved with the .uml2 file
extension.
• A project exported as an Eclipse UML2 (v2.x / v3.x / v4.x / v5.x) XMI file is saved with
the .uml file extension.
3. In the property list, specify the desired property values. You can see descriptions of each
property in the description area below the property list.
Contents
Related pages
• According to the template name in the Export Template dialog, the .mdzip file will be
created in <MagicDraw installation folder>\templates. For example, type the name
LibraryTemplate to save file as LibraryTemplate.mdzip.
• As of MagicDraw 17.0.3, when creating a new project from template, you can clone the
custom used projects that exist in the template. Read more in Creating new projects
from templates (see page 205).
Each project template is saved in a separate folder in <MagicDraw installation directory>\templates. The
template folder should consist of the following files:
Folder name, MagicDraw project file name and .xml file name must be identical.
The easiest way to create a custom template is to copy and paste the Guide to UML
Diagrams Project folder with the different name and edit its inner files. This folder
comes with the default MagicDraw installation and is located in <MagicDraw installation
directory>\templates.
Contents
By default, the following templates are available in the New Project dialog: C#, C++, CIL, CORBA IDL,
Guide to UML Diagrams Project, Java, Metamodeling, RUP, Use Case modeling, WAE, and WSDL.
A new project created from the template will contain specific structure, model elements, and
stereotypes that were predefined in the template. As of version 17.0.3, when creating a new project
from the template, you can select to clone the custom used projects that exist in the template.
2. Expand the Other group and select the Project from Template icon.
3. Specify the new project name in the Name box.
4. Click the button to select the location in your file system to store the new project.
5. Select the template from the templates tree and click OK.
Other Cate Select the Other category to see the list of the available templates.
gory
Project from Template Icon Select the Project from Template icon to create a new project from a
template.
Name Text Type the name of the new project to create from a template.
box
Create directory for Chec Click the check box to create a new folder for the new project. The folder
project and related data k name will be the same as the specified project name.
box
Clone custom used Chec Click to clone used projects from template project. In the new project
projects k from template, the copies of the used projects will be created.
box
Prefix to name used Text Type the prefix for the name of each cloned used project. The default
projects box value is Cloned._ For example, if a used project of the template project is
named Requirements, then the name of the cloned used project in the
newly created project is Cloned_Requirements.
The text box is available only if the Clone custom used projects
check box is selected.
Select template List Select template from the list. The list represents the folders and files that
are located in <MagicDraw installation folder>\templates.
Template description Text The predefined template description is displayed. Note that this field is
area not editable.
You can also import the desired template into your project. Select File > Import From > Another
Project for this.
Related pages
Contents
You can attach any type of file from the local file system to your project.
Attached files are bundled with the project and remain attached after transferring the project, keeping
project references to these files not broken.
The contents of the attached file can be modified and the changes are instantly saved to the project.
Different versions of a server project can refer to different versions of the same attached file.
Contents
On this page
Attaching files
You can attach files in one of the following ways:
• • • Dragging the file icon to the diagram pane (see page 209)
• Dragging the file icon to the Containment tree (see page 209)
• Using a command from the shortcut menu of the element selected in the
Containment tree (see page 210)
Dragging the file icon to the diagram pane
To attach a file by dragging the file icon to the diagram pane
1. In the file system, select the icon of the file you need to attach.
2. Drag it to the diagram pane.
The shape of the newly created Attached File element appears on the diagram pane. The diagram
owner becomes the owner of the file as well.
Using a command from the shortcut menu of the element selected in the Containment tree
To attach a file by using a command from the shortcut menu of an element
1. In the Containment tree, right-click a possible owner for the file to be attached to.
2. In the shortcut menu, select Create Element > Attached File.
3. In the Select File to Attach dialog, select the file and click Attach.
A new Attached File element with its name in the edit mode appears in the Containment tree. If you do
not need to change the file name, press Enter. Otherwise, type a new name and then press Enter.
Regardless of the way used to create an Attached File element, it possesses the same default
properties, such as Attached At, Modified At, Size, Author, and File. You can see these
properties, their descriptions, and values in the Specification window of the Attached File
element. If you need to replace the attached file, you can do this using the File property value
editor.
Reattaching files
To reattach the file
1. In the Containment tree, select the attached file you need to replace.
2. Press Enter to open its Specification window.
3. In the Quick Filter box, type file.
4. Click the cell of the File property value, then click .
5. In the Select File to Attach dialog, select the new file to attach, and click Attach.
6. In the Specification window, click Close.
The file is reattached, and the Modified At property value of the appropriate Attached File element is
updated.
If you no longer need the attached file, you can simply remove it from the model just like any other
element. Select it in the Containment tree and press Delete. If you have its shape on the diagram, select
the shape and press Ctrl+D.
After closing the modified file, you can choose whether to save it in MagicDraw or not. Saving the latest
version of the file in MagicDraw updates the Modified At property value of the appropriate Attached
File element.
If the attached file is read-only, the changes made to it cannot be saved. To allow modifying the
file, do one of the following:
• If the file is attached to used project, change the accessibility mode of this used project
from read-only to read-write.
• If the file is attached to server project, lock the Attached File element for edit.
1. In the Containment tree, right-click the attached image file and select Copy Image URL.
2. On a diagram pane, draw a text box with the HTML mode on.
3. Open the Advanced HTML Editor dialog (see page 1024).
4. On the toolbar, click either
• Insert image button, then paste the URL into Picture source field.
• Insert attached image button, then find and select the attached image file in the list.
5. Click OK twice to close both the Picture Properties and Advanced HTML Editor dialogs.
The inserted image appears on the diagram. Now if you transfer the project to another computer, the
diagram continues displaying the image.
You can also insert images that are not yet attached to the project model. Read more about Inserting
images into HTML text (see page 1025).55
1. In the Containment tree, right-click the attached file and select Save File As .
2. Select the location in the local file system and click Save.
The file is saved in the local file system.
1. In the Containment tree (see page 32) select already attached file or attach a new one. How to
attach a file in the Containment tree >>56
Image formats
You can attach images of the following formats: .gif, .jpg, .jpeg, .svg, or .png.
2. Drag attached file element on the diagram pane (see page 24) (1 step in the figure below).
3. From the opened menu, select the Create Image Shape command (2 step in the figure below).
The image shape is created (3 step in the figure below).
55 http://docs.nomagic.com/display/MD190SP2/Inserting+an+image+into+HTML+text
56 https://docs.nomagic.com/display/MD190SP2/
Attaching%252C+reattaching%252C+and+detaching+files#Attaching,reattaching,anddetachingfiles-Attachingfiles
For the instructions how to create, edit, clone, import /export, or remove symbol
property styles, please refer to Style Engine.
For the instructions about setting the default element property values, please refer to
Default Property Values.
• Set general code generation or code reversing options as well as code formatting styles for
selected programming languages.
The Project Options dialog includes option groups, each designated for one of the above mentioned
features and containing lists of corresponding options. Groups are represented using the tree structure.
Changing options
In order to change a desired project option, first of all you need to find it in the Project Options dialog.
These options are grouped into categories to make it easier for you to locate them. Use the q (see page
888)uick filter (see page 888) to find find the desired option in the list. Filtering is performed in the all
available options, not only in the selected option group.
To make sure you selected the right option, first read its description and see if the effect of changing
the option value is what you expect to be done.
2.2.11 Searching
Contents
The search of the modeling tool is designed for search within model elements, as well as element
properties. You can also perform a quick search without defining any advanced options, or you can
replace any text quickly using Find and Replace type of search.
You can read more about types of search dialogs in the related pages.
The search is performed as a background task, therefore while searching, you may still read the model
and browse it. If you make changes in the model, the search stops and presents incomplete search
results in a Search Results tab of the Model Browser. You need to restart the search to get the full list
of results.
If there is a large number of search results to display (more than 1000), the following message appears.
Click Yes to continue searching, or click No to stop searching and correct the query.
Related pages
Find dialog
Contents
On this page
After completing the steps above, the search results are displayed in the Search Results tab of the
model browser.
Searching tips
• To search for textual information in an active diagram, click in the diagram toolbar or
press Ctrl+F.
• To quickly access your search results, add them to Favorites or save them as the contents
of a Smart Package.
Click to learn how to save search results as the content of a Smart Package
1. Click on the toolbar of the Search Results tab containing the search results you
want to add to a Smart Package.
2. From the open menu, select one of the following:
• Save Query as Smart Package if you want the content of a newly created
Smart Package to be dynamic. The content of the Smart Package will then be
updated according to your search. The specified search criteria will be saved as
the Query property value.
• Save Results as Smart Package if you want the content of a newly created
Smart Package to be static. In this case, your model is not queried, and new
elements meeting the specified search criteria are not automatically included
in the Smart Package.
3. In the open dialog, select the Package that will own the created Smart Package.
A new Smart Package containing all the search results from the Search Results tab is
created under the selected owner.
You may use wildcard characters (,?) in your search phrase. "" means
zero, one, or more characters. If your search phrase is "dd", all the
elements containing "dd" in their names can be found, e.g. "Address"
and "ThreadDeath". "?" means exactly one character. If your search
phrase is "?dd", only the elements with "dd" in their names, beginning
with the second character (e.g., "Address"), can be found.
"ThreadDeath" cannot be found in this case, because it contains more
than one character before the search phrase "dd". Be sure to check the
Match exactly command when using wildcard characters!
Properties Text box with The box is available only when the Options area is expanded. Click
, select the properties applicable to your search and specify
their values. The property list in the open dialog contains only the
properties of the element types selected in the Type box. Select at
least one element type to make the button available. Keep in mind
that the property list contains primitive value properties, e.g. string,
boolean, integer, and a non-primitive value property named Applied
Stereotype.
Clear Previous Check box Select to remove all previous search results from the Search
Results Results tab in the Model Browser.
Load diagrams and Check box Select to load all elements to be included in the search if the
auto-loadable used model has diagrams or used projects that are not loaded. If
projects the load mode of the used project is Manual load, the used
project will not be loaded and elements from it will not be
included in the search.
Include elements from Check box Select to include elements from standard/system profiles.
standard/system
profiles
Include elements from Check box Select to include additional elements from Smart packages if
additional content Smart packages fall into the search scope. By default, this
check box is not selected and elements from Smart packages
are excluded from search results. This enables you to avoid
search results being duplicated by results outside of Smart
packages.
Show results in new Check box Select to display the results of every subsequent search in a
window new Search Results tab of the Model Browser.
To find the elements with a specific stereotype and a certain phrase in their documentation
1. Open the Find dialog.
2. Click next to the Type box, select the element type you want to find (e.g, Actor) and
select the Include Subtypes check box.
3. Expand the Options area if it is not yet expanded.
57 http://xmi.id
• On the toolbar of the Containment, Diagrams, Inheritance, or Model Extensions tab, click
.
• On the main menu, click Edit > Quick Find.
• Press Ctrl + Alt + F.
• On the main toolbar, click the arrow nearby the button and then select Quick Find.
Search results are displayed in the drop-down list, which opens when you start typing the search
phrase. Click the element you need in this list or correct the search query to perform a new search. The
element will be selected in the Containment tree on the Model Browser as well as on the active
diagram, if the element has symbols on the active diagram.
The following table provides descriptions of the Quick Find dialog elements.
Search for Options group • Click Type to search only in types, that
is, classes, interfaces, use cases, and
others.
• Click Diagram to search only in
diagrams.
• Click Any Element to search in all
elements of your project.
Search By Name Text box with a drop-down Type a phrase to search for in element names.
list See the search results in the drop-down list.
Apply Filter (Ctrl+Space) Check box Click to clear the check box, if you need to
remove the search scope filter. If you clear the
Apply Filter check-box once, your selection is
remembered for the next time.
Find TODO
Command Find TODO performs a quick search for all To Do values.
You can specify To Do values in the element Specification window, the To Do property cell. You can use
the To Do property cell for adding the notes about the work you need to do. Then you can quickly find
the elements that have the To Do properties defined.
Results of this kind of search are displayed in the Search Results tab on the Model Browser.
• Names
• Documentation
• Tag values
• Text included to Notes
• Text included to Text Boxes
• Expressions
The following table provides descriptions of the Find and Replace dialog components.
Find What Text box with drop- down list Type or select from the list to search
the
value of the element to be replaced.
Replace With Text box with drop- down list Type or select from the list the value
of element that will replace the found
value.
Options area
Search in active diagram only Check box Select to search the symbols in the
active
diagram only. The check box is not
available,
if all diagrams are closed or if the
active diagram is empty.
Load diagrams and auto-loadable Check box Select to load all elements to be
used projects in read- write mode included
in the search if the model has
diagrams or
used projects that are not loaded.
Used project will not be loaded and
elements
from it will not be included into the
search,
if the load mode of that used project
is Manual load.
Include elements from standard/ Check box Select to include elements from
system profiles standard/system profiles.
You may see an error when trying to replace a value with an invalid one.
• For example, if the value type is boolean, you may replace values from true to false or
from false to true, but if you will try to replace the value true or false to other, for
example, to Motor, an error message will be displayed.
• You will not be allowed to change the Integer value to String when it is a part of the value.
For example, if you have the 120 value, trying to replace 20 with AB will cause an error.
Searching in diagrams
Contents
The Find in Diagram command enables you to search for textual information in all types of diagrams,
including tables, matrices and maps. Use this command to find a specific text phrase in a diagram and
navigate through the highlighted search results.
Searching tips
• You can search in several open diagrams at once. Typing a search phrase in a
subsequent diagram does not undo the search results in a previous diagram.
• When you press Ctrl+F with multiple open diagrams, the search starts in an active
diagram.
• To search for textual information in the whole model, click in the diagram search bar
and specify the search criteria in the Find dialog (see page 216).
After typing a search phrase, the search results are highlighted in yellow and the diagram or table
scrolls to the first search result (highlighted in orange), as shown below. Diagram symbols or table rows
that do not contain your search phrase are shaded. A diagram symbol is also shaded if the search
phrase is found in the symbol compartment.
2.2.12 Filtering
Contents
The modeling tool filtering mechanism allows filtering types of model elements in particular lists. For
example, you can filter the types of model elements that are displayed in the Model Browser, or you
can select them when searching.
To filter the types of the model elements that are displayed in the Containment tab (see page 32)
All elements in the Containment tab are displayed in hierarchical order. If you clear the Model
check box, no elements will be displayed in the Containment tab. The same is valid for all
element types – if you clear the check box next to the type of element that has inner elements
in the Model Browser, you won't be able to see these inner elements.
To filter the types of model elements when searching (see page 215)
1. From the Edit main menu, select Find. The Find dialog opens.
2. Next to the Type box, click . The Select Element Type (see page 1038) dialog opens.
• Read-only
• Read-write
The decision to use a project as read-only or read-write depends on the maturity of this project and
the organization ownership or responsibility rules for the projects using other projects. If the library in
the used project is complete (changes to it are not expected / likely / possible) it should be use in read-
only mode. If a project is developed by a separate team and this team is responsible for this project and
the project is reused in another project, it is recommended to use this project as read-only. This
prevents inadvertent changes in the project by another team.
In case a project is actively developed and evolves together with the projects that are using it, this
project can be used in read-write accessibility mode. In this case you must be careful and remember
that your changes to the used project will be reflected in other projects. Usage of Teamwork Server
might be advisable in this case. And, of course, there can be mixed usage situations - when a project is
used as read-only in some projects and as read-write in others.
Decomposing model
Contents
Model decomposition has a package level granularity. Smaller elements cannot be split into separate
projects. Basically, each project package could be partitioned into a separate projects, however this is
excessive.
The decision on how to split a model into parts should be made carefully. You should isolate model
parts which form logically complete pieces of a structure (e.g., a subsystem, code library, or profile) and
are not very dependent on each other.
When there are many one-way dependencies to some model part (e.g., parts A, B, C depend on a
part D, but part D does not depend on any of the parts A, B, C), this part is a good candidate for a
placement into a separate project.
When one big project is used to store all the modeling information (e.g., use case models, high
level architectural models, detailed implementation level class, sequence, state, and other
information), it may be useful to partition the models according to the modeling domains (i.e., use
cases in one used project, architectural models in another, implementation level models in yet
another). This allows unloading unnecessary used projects while working on one part (and improving
the performance), but still retain the relationships between domains and load used projects on
demand.
Avoid decomposing a model into parts which have circular dependencies. That is, A ↔ B or A →
B → C → A situations.
Usually programmers are very adept at splitting large code bases into libraries. The very same criteria
should be applied for splitting large models into separate projects.
Related pages
This functionality is available in Standard, Professional, Architect, and Enterprise editions only.
Using the Export Packages to New Project dialog, you can partition the model and save the content of
a selected package as a separate project. Once exported, the package and its containing elements are
read-only, and the project name is displayed in brackets next to the package name in the Model
Browser.
2. In the All data list, select the package you want to save as a separate project and click
the Add button. The package is added to the Selected packages list.
3. If needed, type a description of the exported packages in the Project Description box. This
description is displayed in the documentation of the package.
4. Click OK.
When dependencies are resolved, MagicDraw asks to specify the new project location and name.
Only packages can be exported to new projects. To export an element or diagram, you must
move it to a package and then export the package.
The shared packages are available only for Teamwork server or local projects. The Used Project
is alternative for shared packages in the Teamwork Cloud envirenment.
(see page 1378)
This functionality is available in Standard, Professional, Architect, and Enterprise editions only.
Not all contents of a used project are visible in the main project. The used project has a shared part and
the part that is not shared. Only contents of the shared part are visible in the main project. The concept
“shared” is similar to the public/private attributes of a class in programming languages (e.g., Java).
When a project is used in another project, all shared packages of the used project appear in that
project. Moreover, each shared package can have a different location in the Containment tree. Any
available package in a project can be used as a container for the shared package of the used project.
Additionally, each shared package can provide a “Preferred Path” that can be used as a hint where to
mount a package when it is used in other project. No “Preferred Path” means that the package will be
mounted directly under the root package Data. Profiles are typically mounted directly under the root
package Data, however this can be changed.
Shared package “util” from the used project can be mounted on the “com::company” path in
the main project in order to form the “com::company::util” path. The Preferred Path of the
Shared Package can be used in this case to serve as a hint for the suggested location where to
mount the package.
Used projects form a recursive data structure — the main project uses one or more other projects;
these projects in turn can use other projects; those other projects can use another set of projects etc.
All model pieces from these projects are gathered and connected into the integral model, which is
shown in the Model Browser when the main project is opened.
Contents
If you have a large project and, due to performance issues, some used projects are not loaded, you may
use indexing to work with the project smoothly. Indexing can be considered as an intermediate form of
work, falling between working with a fully loaded used project and working with a not-loaded used
project.
Proxy
A proxy is a lightweight surrogate that carries only the name and kind of the model element
information. These proxies appear in the place of the original used project elements, and are
dedicated to maintaining model integrity (so that there are no dangling ends of relationships,
types of properties do not disappear, and so on), while the used project is not accessible (for
example, you do not have permissions) or is not loaded.
When a used project is unloaded/not loaded in the project, only proxies of necessary elements are
shown in place of the used project. Using indexing allows you to show more proxy elements from the
unloaded project. These proxies can be used as normal model elements in the project using them
without loading the used project. Keeping the used project not loaded saves a considerable amount of
computer resources. If you ever need full information from that used project, you can load it at any
time.
A large software library is used in a project. Only certain classes are important for the main project:
some library classes are set as types of properties in the model classes, some model classes inherit
from the library classes, etc. In this case, the sub-elements of the library classes (their properties and
methods) are not important, and we can index classes in the library and keep it not loaded in the main
project. Indexing will still show all the classes in the main project from the library.
1. Open the used project (that is, not loaded) separately from the using project.
2. From the Options menu, select Project. The Project Options dialog opens.
4. Select the Common Indexing option. This enables indexing of the used project and determines
what information will be indexed.
5. When common indexing is chosen, classifiers and their inheritance relationships will be indexed.
If you want more elements to be indexed, select the Custom Indexing option and fine-tune
which element types (properties, methods, etc) should be indexed. The more elements you
select, the more elements will be accessible in the project using them as proxies. However, your
gains in performance from the used project unloading will also diminish. Thus, a balance is
needed when customizing the index. It is usually better to use the common indexing variant.
Click OK.
6. In the project using the indexed project, go to the options of the used indexed project (from the
main menu, select Options > Project Usages) and select the Use Index check box.
Related pages
Composing model
You can compose your model by using parts of models stored in other projects:
Contents
You can customize the Paths to used projects list and add your own paths by
creating path variables (see page 97).
3. Click the Next button.
Related pages
Importing models
1. In the Model Browser, select the package of this used project and open the shortcut menu.
2. Select Project Usages > Import.
All the elements of this used project are copied into the main project, and links to this used project are
removed from the main project. The unlinked project and its elements continue to exist in the file
system or server after the import.
• If the used project you want to import uses other projects, after the import these
projects become directly used in the main project.
• The Standard/System Profiles cannot be imported according to our tool policy.
If the model that you are importing also uses projects, these projects will be reused
directly in your project after the model import.
Contents
Use Index Select this check box to load indexed elements from the
used project that is not loaded. This option is available only if
the used project is not loaded. Using indexed elements in the
project increases the performance.
Packages this is the list of all shared packages of a used project and paths
for mounting these packages in the main project.
• Use the following commands:
Command Description
Use Project Click to select projects for usage in the open project and specify
the usage options. The Use Project (see page 239) wizard opens.
Remove > Remove with Click to remove the selected used project from the project. After
References removal, all the elements of the used project disappear from the
Containment tree, and all the references to these elements are
cleared from other model places.
Remove > Remove, keep Click to remove the selected used project and keep model
references references across it in the model. There are two cases when you
may need to remove the used project this way.
Case #1: You may need to replace a used project with the
equivalent project carrying the same elements (but with slightly
different content) and retaining all the references.
Case #2: You may need to refactor projects that are created with
earlier MagicDraw version than 17.0.3 and remove excessive
project usages. These versions of MagicDraw have only user-
defined project usages. Because of this, a project usually had
direct user defined usages to indirectly used projects besides the
indirect usages through directly used projects. So both “project
→ directly used project → indirectly used project” and “project
→ indirectly used project” usage paths were present. In this case
it may be advantageous to remove the surplus usage “project →
indirectly used project” by clicking the Remove, keep References
button.
Import Click to import the contents of the selected used project to the
main project. The Import button is available if the selected used
project:
Reload Click to reload the selected used project in the main project. This
button is available only when the selected used project is
loaded.
Unload Click to unload the selected used project from the main project
leaving only used elements loaded. It is recommended to unload
rarely used projects in order to reduce a memory usage while
working with large projects.
Open Project Click to open the selected used project for editing.
Options Click to open the Project Options dialog to manage styles and
element display settings of the selected used project. It allows to
change element styles in the used project even without opening
it.
3. Click OK .
Related pages
If you open a used project for editing, be sure to save any changes you make. The
modifications made appear after reloading the used project in the main project.
Contents
To increase modeling efficiency when working with very large projects, you can work with partially
loaded used projects. This may help decrease memory consumption.
You can unload a particular used project at any time when working with a large partitioned project.
• From the unloaded used project's shortcut menu, select Used Projects and then Load Used
Project.
When the used project is neither loaded nor unloaded, there can be some model elements left from the
used project. These elements are not editable and are characterized by a small M letter in the upper left
corner of their icon (see the following figure).
• Always load (default). In this mode, used projects are always loaded when you open the project.
They can be unloaded if necessary.
• Autoload. A used project is not loaded while the project using it is loaded. However, our
modeling tool monitors user activities in the project and tries to guess when you might want to
use the model piece from the unloaded used project. For example, if you search and find usages/
dependencies, reports, metrics, transformations, or code engineering actions with a scope that
touches the unloaded used project, our modeling tool will load that used project.
• Autoload with prompt. This mode differs from the Autoload mode in that our modeling tool
asks you before loading the used project.
• Manual load. A used project is not loaded while the project using it is loaded. It can be loaded
using the Load used project command (described above).
To change the used project loading mode
1. From the Options menu, select Used Projects. The Used Projects dialog opens.
2. In the used project's tree, select a used project.
3. In the Used Project Load Mode area, select the appropriate loading mode.
Related pages
Contents
Automated usages of other projects in the main project are the usages fully managed by our
modeling tool. For example, it can create, remove, and rearrange as necessary without user
intervention.
When modifying projects with complex composition, always keep the following condition in mind:
Whenever there are model level references from elements in resource A (either a used project or the main
project) to elements in resource B, there is a used project usage A → B.
In earlier versions of our modeling tool, you could see this condition in action when working with used
projects in read/write mode. Whenever you modified the contents of a used project so that it started to
refer to another used project, and then you attempted to save it, our modeling tool would add an
additional usage. You would then see the messages: “Used project B was directly attached to A” or “Mounts
were updated ...”.
However, in some cases, this system behavior caused undesirable consequences, as shown in the
following pages:
Contents
One of the problems caused by the old approach described in Automated project usages (see page
248), was in refactoring composite used projects (used projects composed of sub-used projects).
Whenever a composite used project was re-arranged by removing or re-importing sub-used projects, all
of the projects or used projects using this used project more often than not became affected.
Example 1
Consider a used project ElectricComponents with 3 sub-used projects: Capacitors, Inductances,
and Resistances. Consider another project RadioSet, which uses the used
project ElectricComponents.
Now, use several model elements from each sub-used project in the project RadioSet.
Old problematic behavior
Previous versions of our modeling tool would create these three direct user-defined usages:
RadioSet → Capacitors,
RadioSet → Inductances, and
RadioSet → Resistances.
Effectively, those versions were “freezing” the contents of the used project ElectricComponents.
If you tried to refactor the used project ElectricComponents by removing its sub-used projects
and re-importing their contents, the project RadioSet would be affected and start complaining
about the missing used projects.
No earlier version of our modeling tool could rearrange the user-defined usages for fear of
losing the user-specified used project composition data.
New behavior
As of version 17.0.3, a program creates automated used project usages instead of creating
user-defined ones. So when the used project ElectricComponents is refactored, it keeps the
same model elements but changes its structure. Furthermore, the automated usages in the
project RadioSet are automatically rearranged.
Complex Composition
If you already have projects with complex composition (having used projects or sub-
used projects) that are prepared in any earlier version, you may want to refactor your
used project structure to reap the benefits of this feature.
Related pages
Every automatically created usage must be backed by an existing user-defined used project usage. If it
is not backed, the automated used project usage must be explicitly confirmed by the user. The usage
cannot cause undesired effects in other projects while it is unconfirmed.
Automated used project usage A → B is called unconfirmed when there is no user-defined usage path
from A to B (neither direct user-defined usage A → B nor user-defined usage path of arbitrary length A
→ ... → X → B).
In ordinary circumstances, automated usages are not visible to the user. When the user modifies the
main project’s model and adds dependencies to used projects or sub-used projects, these usages are
proper. They are backed by the fact that the used project or sub-used project is attached to the project
in some way; thus, the user-defined usage path refers from the main project to the used project or sub-
used project.
Unconfirmed automated used project usages are caught by special automatic validation rules (see page
721). They are displayed in validation results as warnings or errors depending on the project
composition. The validation results prompt the user to remedy the situation by either confirming or
rejecting the usage.
Unconfirmed usages can occur in several cases. They are described as follows.
Case #1
When you edit a model part belonging to a used project with read/write permissions, an
additional model-level reference can be created either back to the project itself (cycle) or to
another used project.
These model-level usages may or may not be valid from the user point of view. Since the
creation of usages is very easy, you can inadvertently create undesired usages. On the other
hand, usages can be entirely benign. Our modeling tool cannot decide whether the usage is
good or bad. For example, creating references from the used project Implementation to
the used project Requirements is valid, while creating references in the opposite direction may
be invalid since requirements usually are standalone, and implementation refers to them.
Case #2
Reorganization or removal of sub-used projects may affect the projects or other used projects
using the used project. This happens only in cases when a new refactored used project does
not carry all of the contents that the old used project contained.
Consider a used project ElectricComponents with three sub-used projects: Capacitors,
Inductances, and Resistances. Also consider a project RadioSet, which uses the used
project ElectricComponents. Now let’s use one model element from each sub-used project in the
project RadioSet. As a result, the three automated usages
RadioSet → Capacitors,
RadioSet → Inductances, and
RadioSet → Resistances
will be created.
If the used project ElectricComponents was refactored by re-importing the sub-used
project Capacitors and Inductances and completely separating the sub-used
project Resistances, then when loading the project RadioSet, the automated
usages RadioSet → Capacitors and RadioSet → Inductances will be automatically
updated. However, the usage RadioSet → Resistors will remain unaddressed. It will appear as an
unconfirmed used project usage, and you will have to confirm it, i.e., explicitly attach the used
project Resistances to the project by creating the user-defined usage.
When you do not have granted “Read model” permission for a used project, this used project will not be
loaded in a project where it is being used. To maintain the model integrity and keep model references
that point to elements of “not accessible” used project, proxies are being displayed instead of
referenced not accessible elements. That means that you will be able to see only the following
information of these elements:
Contents
For the overview of automated project usages and situations when they can become unconfirmed, see
Controlling dependency creation between used projects (see page 250).
Unconfirmed project usages are caught by special automatic validation rules (see page 248) and displayed
as a warning or error validation result. The severity depends on the exact model composition situation,
but the solution methods are the same in both cases.
Model Usages
When there is an error level unconfirmed usage of some used project, then all the elements of
the used project, that are referenced from other model places are shown as Recovered
Elements (see page 255). These recovered elements are in turn flagged as errors. Hence single
unconfirmed usage can cause a lot of error validation results: one for the unconfirmed usage
itself (rule abbreviation - NCAMU) and one for each recovered element (rule abbreviation - REF).
In this situation, the unconfirmed usage result should be examined first, because solving it may
automatically solve all other results.
There are two ways to resolve an unconfirmed used project usage. The usage can be either confirmed
or rejected.
Example
In this case, you can better control the usage creation process. So if you need, for example, to
use not only a required used project but some other one that brings the required used project
as a part of it, be advised to confirm the usage manually.
For example, let’s say there are three unconfirmed usages from the project RadioSet to used
projects Capacitors, Inductances, and Resistances. Instead of confirming each usage, you can
create just one user-defined usage RadioSet → ElectricComponents, since the used project
ElectricComponents brings in Capacitors, Inductances, and Resistances as sub-used projects.
Important!
However, this is the case when you must be sure that the user-defined usage will be created in
the right place.
1. on the main menu, click Options > Used Projects . The Used Projects dialog (see page 242) opens.
2. Select a used project that is the usage target resource.
3. Click the Used project button. The Used Project wizard (see page 239) opens.
4. Follow the steps of the usual procedure (select a required used project and finish or continue to
the second wizard step to provide more configuration options for used project usage and then
finish).
Rejecting usages
If the usage A → B is not good according to the user policy, it must be rejected and removed.
• By using the specific command (for removing underlying model level references)
• Manually (by removing or redirecting underlying model level references to different elements)
Model Usages
Use this way to reject a model-level usage that, for example, was created inadvertently.
This command is very similar to the Clear Recovered Element Usages command.
In more complex cases, you may want to address each usage individually. Use dependency analysis
means to examine what dependencies are there and review them on a case-by-case basis (see
Analyzing usages and dependencies (see page 1145), Analyzing package dependencies (see page 1235),
Displaying related elements (see page 476), Dependency matrix (see page 309), and so forth).
When you need to explore your project composition in detail before attempting to resolve unconfirmed
usages, use the following commands for navigating:
Related pages
If you cannot see the recovered elements in the Active Validation Results panel, set the
Composition Inspection option to Advanced in the Project Options dialog (see page 213).
See, how to select the relevant level of project composition inspection (see page 261).
At times, you may decide to reference a different element rather than the recovered one in the model.
1. Do either:
• In the Model Browser, right-click an element that refers to the recovered element. From its
shortcut menu select Validation > Usage of Recovered Element > Use Another
Element.
• In the Active Validation Results panel, right-click an element that refers to the recovered
element and whose abbreviation is URE. From its shortcut menu select Use Another
Element.
2. In the element Selection dialog, select the element you want to use instead of the
recovered element.
3. Click OK. The reference is now pointing to the selected element. Also, it is no longer unresolved.
You can use the command for more than one element at a time.
Alternatively, you can replace all references from a particular recovered element to another one using
one operation.
1. Do either:
• In the Model Browser, right-click the recovered element and from its shortcut menu select
Validation > Usage of Recovered Element > Change Usages To.
• In the Active Validation Results panel, right-click the recovered element and from its
shortcut menu select Change Usages To.
2. In the element Selection dialog, select the element you want to use instead of the
recovered element.
3. Click OK. All the references are now pointing to another element. Also, they are no
longer decorated as unresolved.
Related pages
At times, a reference to some recovered element is no longer needed and can be removed.
• In the Model Browser, right-click an element that refers to the recovered element. From
its shortcut menu select Validation > Usage of Recovered Element > Clean Usage
of Recovered Element.
• In the Active Validation Results panel, right-click an element that refers to the
recovered element and whose abbreviation is URE. From its shortcut menu select Clean Usage
of Recovered Element.
The reference to the particular recovered element is removed.
You can use the command for more than one element at a time.
You can remove all unresolved references (including all used modules) of a recovered element in
one operation.
• In the Model Browser, right-click the recovered element. From its shortcut menu
select Validation > Usage of Recovered Element > Clean Usage of Recovered Element.
• In the Active Validation Results panel, right-click the recovered element. From its
shortcut menu select Clean Usage of Recovered Element.
All unresolved references to the particular recovered element are removed. As the
unresolved references are cleared, the recovered element is removed as well.
Unresolved references will not be removed from the referring elements,if they are stored in a
read-only module, are locked by another user, or still not locked.
Related pages
This is the case when a recovered element is depicted on diagrams of your project.
• On a diagram pane, select the symbol. On its smart manipulator toolbar click and then select
Symbol of Recovered Element > Remove Symbol, as shown in the following figure.
• On the diagram pane, select the symbol and press Delete.
• In the Active Validation Results panel, right-click the symbol and select Remove Symbol from
its shortcut menu.
The symbol of the recovered element is removed from the diagram.
You can use the Remove Symbol command for more than one symbol at a time. If the diagram
including the recovered element symbols is non-editable, belongs to the read-only module, is
locked by another user, or still not locked, the command will not be applied.
1. Select Options > Projects to open the Project Options dialog (see page 213).
2. In the option group list, select the General > Validation.
3. In the Validation options list under the Composition Inspection, set the Detect Illegal Model
References in Shared Projects property value to true.
4. Click OK when you are done.
1. Select Options > Projects to open the Project Options dialog (see page 213).
2. In the option group list, select the General > Validation.
3. In the Validation options list under the Composition Inspection, specify the Composition
inspection option value:
• Select Standard if you need the active validation to search for issues only in the project,
but not in the projects it uses.
• Select Advanced if you need the active validation to search for issues in the project as well
as in the projects it uses.
4. Click OK when you are done.
Contents
Example
The used project Tools has mounted a package of the used project ComponentLibrary, while the
used project MainBlocks has also mounted the same package ComponentsLibrary. As shown in
the following figure, the mount location conflict occurs because the project RadioReceiverProject
is using both the Tools and MainBlocks used projects at the same time.
You can solve the conflict in the Used Project dialog (see page 1378) by unifying the Mounted On value in
both projects.
You can solve the conflict in the Used Project dialog (see page 242) by unifying the required versions in
both projects.
You can resolve the cyclic dependency issues in the Used Project dialog (see page 242) or you can use
the project usage map (see page 1440).
Contents
MagicDraw allows export to/import from UML models from/to MOF (both CMOF and EMOF) XMI files.
MOF 2.0 and 2.4 (MOF 2.4.1 to be more specific) are supported.
For more information about the MOF domain model, see Meta Object Facility (MOF) Core
Specification for MOF 2.058 or MOF 2.4.159.
Related pages
Diagram data and model features available only in UML (behavioral models in particular)
cannot be exported.
1. From the main menu, select File > Export To > MOF XMI File > MOF Whole Model. The Select
Target File dialog opens (see the following figure).
2. Type the file name and select the location for the exported model.
3. On the right side of the dialog, select MOF Kind. The file type of the exported model changes
according to your selection.
4. Click to select or to clear selection from the Validate check box.
58 http://www.omg.org/spec/MOF/2.0/PDF/
59 http://www.omg.org/spec/MOF/2.4.1/PDF/
1. From the main menu, select File > Export To > MOF XMI File > MOF Selection.
2. In the Select Packages to Export dialog, select packages you want to export and click Add to
move them to the Selected list. Click OK when you are done.
3. Perform the further steps as described in the previous export procedure (starting from step #2).
Warnings about elements that were not exported (for example, diagrams, behavioral elements, or
other) are displayed upon completion of the validation process. Validation does not preclude the model
from being exported, the ineligible elements are simply skipped.
1. From the main menu, select File > Import From > MOF XMI File.
2. In the dialog, select the EMOF or CMOF file you want to import, and click Open. The file is
imported as a separate project.
Contents
Ecore model is a model type supported by Eclipse Modeling Framework (EMF). This model type can be
colloquially called the EMF model (even though EMF supports many types of models, e.g., UML models).
• Metamodeling purposes, where its expressive power is roughly similar to EMOF (and even slightly
higher than EMOF).
• Simple class modeling purposes, where Ecore model is used as a subset of UML.
Ecore models made using MagicDraw can be exported as Ecore models for the further processing
(generating model repositories, code or XML parsing and storing, etc.) with other EMF tools.
Related pages
Contents
You can use the following ways to create a project for Ecore modeling:
1. From the main menu, select File > New Project. The New Project dialog opens.
2. In the Other domain, select Project from Template.
3. Type a project name.
The Ecore profile can be applied only to existing UML or CMOF / EMOF projects.
1. From the main menu, select File > Use Project... The Use Project wizard opens.
2. Under Select a project to use, click From predefined location. The Paths to used projects list
appears.
3. Select <install root>\profiles. The content of the <install root>\profiles folder is listed bellow.
4. Select Ecore_Profile.xml in the list.
5. Click Next, if you want to change used projects usage settings.
If your Ecore model references some standard Ecore elements (such as standard data types (for
example, EShort) or standard metaclasses (for example, EStructuralFeature), you need to use the
standard Ecore library in your project.
1. From the main menu, select File > Use Project... The Use Project wizard opens.
2. Under Select a project to use, click From predefined location. The Paths to used projects list
appears.
3. Select <installroot>\modelLibraries. The content of the <install root>\modelLibraries folder is listed
bellow.
4. Select Ecore.mdzip in the list.
5. Click Next, if you want to change used projects usage settings.
6. Click Finish.
Ecore modeling
Ecore is even more similar to EMOF. You can export the same model to both Ecore and EMOF.
Ecore has two flavors of structural features, EAttribute and EReference, while UML has just one –
Property. Fortunately a differentiation between an attribute and a reference is unambiguous and
automatically resolved: the property, whose type is a data type is treated as EAttribute; the property,
whose type is a class is treated as EReference. Hence the user does not need to worry about this - he/
she can simply use properties.
There are no standalone Association and Generalization model elements in Ecore, but there is
analogous information in Ecore: two EReferences, pointing to each other by their opposite property is
equivalent to the association; the EClass::eSuperTypes property is equivalent to a generalization.
Hence it is possible and meaningful to draw associations and generalizations in your model for
exporting this information to Ecore.
Ecore generics (templates) are also supported. You can use the UML template support to model Ecore
generics. While the modeling is not trivial (and not one-to-one due to weak semantics of Ecore's
EGenericType), it is possible to model all cases of template types, even ones with complexly nested type
bounds like, for example, SortedList<T extends Comparable<? super T>>.
Your models can also contain any other UML elements, which are not present in Ecore. These elements
are simply skipped during the export to Ecore. A warning is given about these elements.
• Ecore attributes and references (modeled as the UML property) have the additional properties:
volatile (Volatile), transient (Transient), unsettable (Unsettable), and resolveProxies (Resolve
Annotation modeling
Ecore annotations are modeled as UML comments. For simple annotations no additional actions are
necessary.
However, Ecore annotations have more powerful semantic than UML comments – they can have an
internal substructure. In particular they can have an additional key-value map. For this additional
information, there is a special «EcoreAnnotation» stereotype, that can be applied on an annotating
comment. After applying the stereotype, the key-value map can be entered in a separate node of the
annotating comment Specification window. Key-value pairs are stored as internal subcomment
1. From the main menu, select File > Export To > EMF Ecore File > Ecore Whole Model. The Select
Target File dialog opens (see the following figure).
2. Type a file name and select a location for the exported model.
3. Click to select or to clear the Validate check box.
4. Click the Export button when you are finished.
1. From the main menu, select File > Export To > EMF Ecore File > Ecore Selection.
2. In the Select Packages to Export dialog, select packages you want to export and click OK when
you are done.
3. Perform the procedure To export a project to an Ecore file starting from the step #2.
Each used project used by the project must be exported to an Ecore file individually. For this you have
to open each used project as a project and then export it to an Ecore file.
Ecore references, crossing a resource boundary (when the element in one file references the element in
another file), are qualified-name-based, but not id-based as in case of CMOF, EMOF, or UML. Hence when
exporting a project with references to elements in other projects (used projects), the export tool must
know the full path of elements in the used project's Ecore file. This information cannot be determined
from UML model without additional information. For this the following approach is adopted:
1. Save the used project after the export. After a project is exported to an Ecore file, the
qualified names (paths) of the shared elements are recorded in special stereotypes
(«EcoreExportServiceInformation») / tags (ecoreExportPath) of the project's shared packages. The
side effect is that the project is modified during the export. To preserve this information for later
usage, you need to save the project after the export.
2. Export used projects before exporting the main project. When a project that references to
elements in one or more used projects is exported to an Ecore file, the export tool needs to know
these elements' paths, saved on the appropriate used project export to Ecore. If this information is
missing (e.g., in case the project is being exported before used projects are exported), the export
tool tries to guess the correct path of each element in the used project and gives warnings about
this. That is why used projects should be exported to Ecore before exporting the main project that
uses these used projects.
String EString
Boolean EBoolean
Integer EInt
UnlimitedNatural EInt
Real EReal
Standard data types from the MagicDraw profile are exported as Ecore types. The following table shows
which Ecore data type corresponds which UML data type.
boolean EBoolean
byte EByte
char EChar
date EDate
double EDouble
float EFloat
int EInt
real EReal
long ELong
short EShort
References to Ecore model elements (standard datatypes like EInt, metaclasses like EStructuralFeature),
defined in the standard Ecore library are exported as standardized Ecore references to Ecore
metamodel elements (the resource identifier part of the Href is http://www.eclipse.org/emf/2002/Ecore).
The validation process does not preclude the model from being exported. Unsuitable elements are
simply skipped.
You can run the Ecore validation on a model (project or used project) export to Ecore. All UML elements
that are not suitable for the Ecore, will be highlighted.
You can also run this validation suite at any time while you are developing an Ecore model.
1. From the main menu, select Analyze > Validation > Validate. The Validation dialog opens.
1. In the Eclipse environment, open the *.ecore file and save it as *.emof.
2. Use the Importing projects from MOF files60 procedure.
This way of importing Ecore files may cause some Ecore-specific model details that don't exist
in EMOF to be lost.
60 http://documentation.nomagic.com/display/MD190SP2/Importing+projects+from+MOF+files
Users will be warned on any intentional or unintentional attempt to modify profiles when:
There is a high probability that the latest version of MagicDraw or plugins won't work with earlier or
later profile versions and may cause unpredictable behavior or even model distortions. For example,
SysML plugin 16.5 requires SysML Profile 16.5, as it could malfunction when using SysML Profile 16.0 or
16.6.
To protect users from such inconveniences, every MagicDraw project stores information about profiles
or plugins versions that were used to create it and are required to load data correctly. Every standard
profile has a version number. Normally, it's the same as MagicDraw (or plugin) version number.
MagicDraw requires using corresponding profile and software versions. If you use plugins or profiles
that are obsolete, you will see a warning message. If you are missing certain plugins or profiles,
Resource Manager with selected resources to install is launched automatically, so you can install
missing resources in just few clicks.
If new versions of plugins are not purchased or you simply don't want to install it, but need to take a
look at the project content, warnings may be ignored and such project may be loaded. In this case,
proxy elements for missing profile elements will be created to retain missing references. Missing
custom diagrams will be loaded as regular UML diagrams or will be restricted for review.
Contents
The cross-version compatibility checking mechanism is implemented when a project with new feature
usages is loaded with an older version of the modeling tool. When you attempt to save or commit an
opened project with a tool version that is missing features, this mechanism will track the missing
features and show a warning message indicating possible consequences if you proceed.
Important
Features required, but missing, in an earlier tool version (for example 19.0) are memorized by
the cross-version compatibility checking mechanism. This process will continue with each SP
release (i.e., SP2 might have features that are missing in both SP1 and 19.0 GA).
Currently, the cross-version compatibility checking mechanism tracks feature usages of 19.0 SP1 and
19.0 SP2 versions that result in triggering a Missing features detected notification in earlier versions.
The following table shows tracked features, the version they appear in, and whether the project can be
committed/saved without any consequences.
Diagramming features
Forward compatibility tracks the following diagramming features introduced in 19.0 SP1:
This mechanism prevents unexpected changes after opening a project with version 19.0 SP1.
2.3 Diagrams
The following pages define the various types of diagrams and illustrate their uses in your projects.
(see page 289) (see page 290) (see page 291) (see page 296)
Class diagram (see page Use Case diagram (see page Sequence diagram (see Activity diagram (see page
289) 290) page 291) 296)
(see page 294) (see page 300) (see page 290) (see page 301)
State Machine diagram Component diagram (see Object diagram (see page Package diagram (see page
(see page 294) page 300) 290) 301)
(see page 301) (see page 291) (see page 296) (see page 290)
Several kinds of diagrams provide a visual notation for the concepts in each view.
The use case view usually is presented as a number of use cases (see page 847) and actors (see page
613) in Use Case diagrams (see page 290). Occasionally it is used in Activity (see page 296) and Sequence
diagrams (see page 291).
The use case view is central because the contents drive the development of the other views. It is also
used for project planning. Every single use case unit is deemed as a manageable unit during the project
execution.
Structural view
The structural view represents structural elements for implementing a solution for defined
requirements. It identifies all of the business entities and how these entities are related to each other.
Usually entities are represented as classifiers and their instances in Class (see page 289) and Object
diagrams (see page 290) in multiple abstraction levels. System decomposition to different layers can be
displayed using Package diagrams (see page 301). A Composite Structure diagram (see page 303) can be used
to represent the classifier inner structure. The system structural view artifacts are created by software
architects and represent the system implementation design solutions.
Implementation view
The implementation view describes the implementation artifacts of logical subsystems defined in the
structural view. It can include the intermediate artifacts used in a system construction (code files,
libraries, data files, etc.) This view defines dependencies between the implementation components and
their connections by the required and provided interfaces. Components and their relationships are
displayed on the Component diagram (see page 300). Inner parts of the component can be represented
with the Composite Structure diagrams (see page 303). The implementation view helps analyze system
parts and their dependencies in a higher component level.
Environment view
The environment view represents the physical arrangement of a system, such as computers and
devices (nodes) and how they are connected to each other. In contrast to the component view, the
deployment view is concerned with the physical structure of the system and the location of the
software modules (components) manifested by artifacts within the system.
Class diagram
Contents
Class diagram is a graphic representation of the static structural model. It shows classes (see page 633)
and interfaces (see page 708), along with their internal structure and relationships. The classes represent
types of objects that are handled in a system. A Class diagram does not show temporal information, it
describes only the classification. The instances of those types (objects) are instantiated only on the
runtime and are represented by an object and the interaction diagrams.
The classes can be related to each other in a number of ways: associated (connected to each other),
dependent (one class depends/uses another class), specialized (one class is a subtype of another class),
or packaged (grouped together as a unit – package). A Class diagram does not express anything specific
about the relationships of a given object, but it does abstractly describe the potential relationships of
one object with other objects.
A system typically has a number of Class diagrams – not all classes are inserted into a single Class
diagram. A class can have multiple levels of meaning and participate in several Class diagrams. A Class
diagram is the logical map of an existing or future source code.
Object diagram
Contents
The Object diagram displays instances of classifiers and links (instances of associations) between them.
Related pages
Contents
A use case is a description of the functionality (a specific usage of a system) that a system provides. The
use case descriptions can exist in a textual form (a simple table), where the Use Case diagram provides
additional information about the relationship between the use cases and the external users. The
diagram also allows a definition of the system's boundary.
The Use Cases (see page 847) are described only in terms of how they appear when viewed externally by
the user (a system's behavior as the user perceives it), and do not describe how the functionality is
provided inside the system. The Use Cases (see page 847) are not object-oriented, but they are included in
the UML to simplify the approach of the project's lifecycle – from the specification to the
implementation.
Related pages
Contents
The Communication diagram illustrates the various static connections between objects, and models
their interactions. It also presents a collaboration that contains a set of instances as well as their
required relationships given in a particular context, and includes an interaction that defines a set of
messages. These messages specify the interaction between the classifier roles within a collaboration
that will serve to achieve the desired result.
A Communication diagram is given in two different forms: at the instance level or at the specification
level.
Related pages
Sequence diagram
Contents
The Sequence diagram focuses on the Message (see page 723)interchange between various Lifelines (see
page 713).
A Sequence diagram shows the interaction information with an emphasis on the time sequence. The
diagram has two dimensions: the vertical axis representing time. and the horizontal axis representing
the participating objects. The time axis could be an actual reference point, by placing the time labels as
text boxes. The horizontal ordering of the objects is not significant to the operation, and you can
rearrange them as necessary.
Related pages
Contents
On this page
• Navigation. By double-clicking the activation bars (Behavior Execution Specifications) you can
navigate from a sequence diagram to other behavior diagrams.
• Time and Duration Constraints can be attached to Behavior and Action Execution Specifications.
This method of modeling is optional. By default, the modeling approach where activation bars
represent lifelines is used.
To switch to the new mode with activation bars representing UML Execution Specifications
• In the Sequence diagram palette, click the Enable Execution Specification Modeling button.
This action enables the new modeling mode for each Sequence diagram individually.
• When you switch to this modeling approach, you will not be able to return to previous
modeling method.
• If you open the Sequence Diagram with the activation bars representing UML Execution
Specifications with the modeling tool version 19.0, such diagram will be read-only.
After you have enabled the Execution Specification Modeling, the activation bars in Sequence diagram
represent:
• If the activation bar represents Behavior Execution Specification, the dropped behavior is set for
the behavior property of the Behavior Execution Specification.
• If the activation bar represents Action Execution Specification, the Action Execution
Specification is converted to the Behavior Execution Specification and then the dropped behavior
is set for the behavior property of the Behavior Execution Specification.
When you drag the action:
• If the activation bar represents Action Execution Specification, the dropped action is set for
the action property of the Action Execution Specification.
• If the activation bar represents Behavior Execution Specification, the Behavior Execution
Specification is converted to the Action Execution Specification and then dropped action is set for
the action property of the Action Execution Specification.
Once the behavior or action is set for the Execution Specification, you can easily navigate to the
diagrams of the set behavior or action.
Setting the Behavior Execution Specification behavior by adding an operation for the message
When you have an operation with a method, you can add that operation to the message and the
method is set as a behavior of the Behavior Execution Specification at the end of the message.
• If you click near the top of the activation bar, the constrainedElement will be set to the Execution
Specification of that bar, and firstEvent=true.
• If you click near the bottom of the activation bar, the constrainedElement will be set to the
Execution Specification of that bar, and firstEvent=false.
When you draw new Duration constraints in a Sequence diagram (from the diagram palette):
• If you click near the top of the activation bar, the constrainedElement[i] will be set to the
Execution Specification of that bar, and firstEvent[i]=true.
• If you click near the bottom of the activation bar, the constrainedElement[i] will be set to the
Execution Specification of that bar, and firstEvent[i]=false.
Related pages
Contents
The behavior of objects of a Class (see page 633)is defined in terms of States (see page 819) and Events (see
page 677), using a State Machine connected to the Class (see page 633) under a construction.
Objects that do not present a very pronounced reactive behavior can always be considered to stay in
the same state. In this case, their classes do not possess a State Machine.
State Machine diagrams (also called Statechart diagrams) represent the behavior of entities capable of
dynamic behavior by specifying their response to the receipt of event instances. Typically, State
Machine diagrams describe the behavior of Classes (see page 633), but the Statecharts can also describe
the behavior of other model entities. such as Use Cases (see page 847), Actors (see page 613), Subsystems (see
page 832), Operations (see page 645), or methods.
A State Machine diagram is a graph that represents a State Machine. States (see page 819) and various
other types of vertices (pseudostates) in the State Machine graph are rendered by the appropriate State
(see page 819) and Pseudo States (see page 814) symbols, while T (see page 843)ransitions (see page 843) are
The states are represented by the State (see page 819) symbols, while the Transitions (see page 843) are
represented by arrows connecting the state symbols.
The State diagram is concerned with internal object changes, as opposed to the external object
interaction in a Communication (see page 291). Do not attempt to draw them for all classes in the system;
they are only used for modeling a complex behavior. The State diagram shows all the possible states
that objects or collaborations may have, and the events that cause the state to change. For example, an
event can be another object sending a message that a specified time has elapsed, or that some
conditions have been fulfilled. A change of a State (see page 819) is called a Transition (see page 843). A
Transition may also have an action connected to it that specifies what should be done in connection
with the state transition.
• When creating a new State Machine diagram, right-click a State in the Containment tree, point
to Create Diagram, and then click State Machine Diagram.
Inner elements are displayed on the State Machine diagram pane automatically upon
creating the first diagram under the State element.
• When modifying a preexisting State Machine diagram, select a diagram pane or the State shape
and perform one of the following steps:
- From the shortcut menu, click Display > Display Inner Elements.
- On the diagram toolbar, click
Related pages
Contents
A Protocol State Machine is always defined in the context of a classifier. It specifies which Operations
(see page 645) of the classifier can be called, in which State (see page 819), and under which condition, thus
specifying the allowable call sequences on the classifier's operations.
The Protocol State Machine presents the possible and permitted Transitions (see page 843) on the
instances of its context classifier, together with the Operations (see page 645) that carry the Transitions (see
page 843).
In this manner, an instance lifecycle can be created for a classifier, by specifying the order in which the
Operations (see page 645) can be activated and the States (see page 819) through which the instance
progresses during its existence.
The Protocol State Machine diagram is created for use with the Protocol State Machine and the
Protocol Transitions.
Related pages
Activity diagram
Contents
On this page
Description
An activity diagram is a variation of a State Machine (see page 294). In the State Machine, the States (see
page 819) represent the performance of Actions (see page 596) or subactivities, while the Transitions (see page
843) are triggered by the completion of the Actions or subactivities. It represents a State Machine of a
Although Activity diagrams are often associated with interaction diagrams, they focus more on the work
performed by a system, rather than an object interaction. An Activity diagram captures Actions (see page
596) and displays their results.
A State diagram may also represent this sequencing of steps. However, given the procedural nature of
the implementation of the operations in which most events simply correspond to the end of the
preceding activity, it is not necessary to distinguish States (see page 819), activities, and Events (see page 677)
systematically, e.g. a State change and external events are less important inside the method. Therefore,
it is beneficial to have a simplified representation for directly displaying activities.
The Activity diagram provides a convenient way to describe complex algorithms, parallel operations,
and business processes. Together with the Communication (see page 291) and Sequence diagrams (see page
291), they are used to relate Use Cases (see page 847).
You can create a new activity diagram under the following elements: Action (see page 596),
Structured Activity Node (see page 750), Expansion Region (see page 756), Conditional Node (see page
757), Loop Node (see page 757), Sequence Node (see page 757).
• A Behavior (see page 629) is created together with the Call Behavior Action (see page 600). It inherits
the type of the Call Behavior Action owner.
• If a Call Behavior Action (see page 600) and its Behavior (see page 629) are not titled, type a name on
the Call Behavior Action shape on the diagram, and the typed name will be set as the Behavior's
name automatically.
Smart layout
Dynamic centerlines
The centerlines are displayed only when the center of the shape that was moved or newly drawn is
located near the center of a preexisting shape in the diagram. These lines help you to easily align
shapes when drawing a diagram.
When the center of the shape that was moved coincides with a center of any shape that is placed to its
right or left, a horizontal centerline appears. When the center of the shape is close to any center of a
shape that is located above or below it, a vertical centerline appears.
Diagram orientation
Example
If you have a vertical diagram orientation and shapes are not in the same centerline, the paths
will be connected from the lower border of the first shape to the upper border of the next
shape, adding break points:
If you have a horizontal diagram orientation, the paths will be connected from the side border
of the first shape to the next side border of the second shape, adding break points:
This is valid if the assigned Behavior is editable and does not have more usages, i.e. there is
not a Call Behavior Action that has a reference to this Behavior.
Inner elements are displayed on the Activity diagram pane automatically upon creating the first
diagram under the Activity element.
When modifying a previously created Activity diagram, select a diagram pane and do one of the
following:
- From the shortcut menu, click Display > Display Inner Elements.
- On the diagram toolbar click
,
• and select Display Inner Elements.
Related pages
Component diagram
Contents
A Component (see page 654) contains information about the logical Class (see page 633) or Classes that it
implements, thus creating a mapping from a logical view to a component view. Dependencies between
the Components makes it easy to analyze how a change in one component affects the others. The
Components may also be shown with any of the Interfaces (see page 708) that they expose. They, as with
almost any other model elements, can be grouped into Packages (see page 771), much like Classes or Use
Cases (see page 847).
The Component diagrams are used in the later phases of the software development, when there is a
need to divide up Classes among different Components. When working with the CASE facilities, the
Components are used for file-class mapping during code generation, reverse engineering, and round-
trip engineering operations.
As of MagicDraw 17.0.1, the Component diagram (or the Deployment diagram (see page 301))
replaces the Implementation diagram, which is no longer supported in UML standard. An
Implementation diagram created with earlier versions of MagicDraw, now opens as
• Deployment diagram, if Nodes were used in the Implementation diagram
• Component diagram, if Nodes were not used in the Implementation diagram
Customized diagrams that were based on the Implementation diagram are now based on the
Component diagram.
Related pages
Contents
Deployment diagrams show the physical layout of various hardware components (Nodes (see page 750))
that compose a system as well as the distribution of executable programs (software components) on
this hardware.
Deployment diagrams are crucial when dealing with distributed systems. You may show the actual
computers and devices (Nodes), along with the connections they have to each other, thus specifying a
system topology. Inside the Nodes, executable Components (see page 654) and objects are located in a
way that it shows where the software units are residing and on which Nodes they are executed. You
may also show dependencies between Components.
As of MagicDraw 17.0.1, the Deployment diagram (or the Component diagram (see page 300))
replaces the Implementation diagram, which is no longer supported in UML standard. An
Implementation diagram created with earlier versions of MagicDraw, now opens as
• Deployment diagram, if Nodes were used in the Implementation diagram
• Component diagram, if Nodes were not used in the Implementation diagram
Customized diagrams that were based on the Implementation diagram are now based on the
Component diagram.
Related pages
Package diagram
Contents
The Package diagram shows packages (see page 771) and dependencies (see page 668) between the
Packages.
The classes (see page 633) can be grouped into packages. The packages can be nested within other
packages. A Package, as an entity, may have all the relationships that can be drawn for a class. Those
relationships are derived from the classes or packages that are nested within two particular packages
(i.e., the relationship between packages reflects a set of relationships between classes placed in those
packages).
Related pages
Package
Model
Profile
Package Merge
Package Import
Element Import
Profile diagram
Contents
If the Class (see page 633), Data Type (see page 665), Primitive Type (see page 667), Enumeration (see page
666),Association (see page 618), Direct Association, Generalization (see page 691) are not available on
the diagram pallet, make sure you are working in the Expert mode.
Related pages
Contents
The Composite Structure diagram allows a decomposition and modeling of the internal structure of the
classifiers, such as classes (see page 633), components (see page 654), nodes (see page 750), and other elements
that are able to own other elements.
Realted pages
1. On the main menu (see page 24), select Project > Options.
2. In the Project Options dialog, find the Diagram Context option.
3. Select the Do Not Create value.
4. Click OK.
The automatic creation of diagram context element is turned off.
This means that when you create a new diagram for the element which cannot be the context of this
diagram (e.g. Package (see page 771)), the Select Diagram Context dialog will open automatically. It
allows you to select an existing element as a context, create a new context element by enabling
If you want to enable the automatic creation of a diagram context element, select the Create
Automatically value for the Diagram Context option.
If a classifier has an association connection with another classifier, the Association End in the classifier
is referenced as a property. In a Composite Structure diagram, a Part is representation of a property. So
the Part can represent the property that is an Association end too. If the Association End is composite,
parts are represented in a nested structure.
Ports are mapped automatically if particular rules are met. Otherwise, the Port Mapping dialog
appears.
• When the following properties of the Port of the original Part type are the same as the properties
of the Port of the new part type:
• Port type and name
The Port Mapping dialog
The Port Mapping dialog appears on changing a Part type when ports of the type cannot be mapped
automatically.
1 Lists the type of the Part from which you want to make a
replacement. Ports of the type are listed under the type.
You can also select multiple number of ports in the From box and drag onto a port in the
To box. The selected ports will be mapped with the Port.
You can also select multiple number of ports in the From box and drag onto the box:
"Drag port(s) here to create a new port". The selected number of ports will be created.
Contents
The Interaction Overview diagram focuses on the flow of control between Interactions. It is based on
Activity diagram (see page 296) notation. Interactions in the Interaction Overview diagram are represented
using the Interaction Use (see page 707) element.
Related pages
Contents
The pages below describe dependency matrices, relation maps and robustness diagrams, including
their purpose and how to create them.
Dependency Matrix
Contents
https://www.youtube.com/watch?v=7Utc3D2vU1I
This functionality is available in Standard, Professional, Architect, and Enterprise editions only.
The Dependency Matrix is a quick method for representing dependencies compactly. Diagrams,
UML elements, and extended UML elements serve as row and column entries. The cells in the matrix
show where these elements are associated (related).
• UML relationships
• BPML, SysML, UPDM, and other DSL relationships
• Semantic dependencies (dependencies through properties)
• Relationships through tags (tags allow for relating UML elements that cannot be represented on
the same diagram)
• Transitive relationships (through the OCL or meta chain)
Dependency matrices are useful for
1. In the Containment tree, select an element that can be the owner of the generic table.
2. Do one of the following:
• From the main menu, select Diagrams > Create Diagram. Type “depe” and press Enter.
• On the main toolbars, click the Create Diagram button. Type “depe” and press Enter.
• Press Ctrl+N. Type “depe” and press Enter.
• Right-click the element and from the shortcut menu select Create Diagram > Analysis
Diagrams > Dependency Matrix.
The newly dependency matrix opens on the right side of the application window.
3. Type the name of the matrix.
4. Select criteria (see page 310) for the matrix.
5. Click the Refresh button. The matrix is created.
You can also create dependency matrices using a custom dependency matrix type (see page 1970).
You can modify a Dependency Matrix after it is created. The Dependency Matrix usage and
modification features are described in
Selecting criteria
Contents
On this page
A lot of properties of the Dependency Matrix can be specified in the the matrix Specification window (see
page 882).
You can open the matrix Specification window (see page 882) in one of the following ways:
• From the matrix shortcut menu (see page 333)
• From the matrix toolbar (see page 330)
• Press Enter in the active matrix.
Do either:
• In the Model Browser (see page 29), select one or more elements which types you wish to see on
your matrix and drag them to the Row Element Type/Column Element Type box in the Criteria
area.
To display subtypes of selected element types, click to select the Include subtypes check
box.
You can select to show implied relationships that represent relationships between model elements
caused by aggregation and composition. When supertypes, aggregates or compositions have
relationships to dependent elements, the corresponding relationships are displayed for subtypes or
leaves.
3. In the relationship's Properties column, click the button to select properties of the
relationship. When you're done, click Close.
Do either:
• Select a direction from the Direction drop-down list in the Criteria area.
• Open the matrix Specification window (see page 882), click the Direction property value cell and
select what direction relationships you wish to see on your matrix. Click Close.
Do either:
• From the Show Elements drop-down list in the Criteria area, select
• With relations if you need to see only related elements from the selected scope.
• Without relations if you need to see only non-related elements from the selected scope.
• All if you need to see both related and non-related elements from the selected scope.
• Open the matrix Specification window (see page 882), click the Show Elements property value cell
and choose one of the preceding described values. Click Close.
Once criteria are specified, you can create the matrix. Click on the Dependency Matrix toolbar (see
page 330).
When a Dependency Matrix contains a large number of rows and/or columns, it may become difficult to
work with, as you need to scroll in order to see certain parts of it. In this case, you can select to exclude
cells (either rows or columns) that contain relationships and make your Dependency Matrix view more
compact.
1. From the Show Elements drop-down list in the Criteria area, select either
• Columns without relations – to show columns without relationships and all rows.
• Rows without relations – to show rows without relationships and all columns.
If you need to collect elements that are not necessarily owned by the same package, you can specify the
query in the Row/Column Query dialog, and see the results added to it immediately.
61 https://docs.nomagic.com/display/SYSMLP190SP2/Structure+tab
You can specify the colors and line styles to be used for representing the relationships in your
dependency matrices.
button next to Dependency Criteria in the Criteria area (see page 332).
2. Open the Style dialog by clicking the
4. When you've changed line colors and styles for all the relation criteria you needed to, click OK to
close the Dependency Criteria dialog.
Your selection is shown in the customized legend in the top left corner or above of the matrix. The
legend is displayed by default in all new projects, but if you don't want to see it all the time, simply click
the button in the Dependency Matrix toolbar (see page 330), then click Legend Location > Do Not
Display.
This page explains the content of the cell in the Dependency matrix. The following sections describe the
Dependency matrix areas and cell content:
• • Rows, columns, and cells in the Dependency matrix (see page 321)
• Representation of the dependencies in a cell (see page 321)
• Rows display elements specified in the Row Element Type box and Row Scope box of the
criteria area (see page 332).
• Columns display elements specified in the Column Element Type box and Column Scope box of
the criteria area (see page 332).
• Cells display dependencies between elements specified in the rows and columns. The content of
the cells depends on selected criteria in the Dependency Criteria box and the Direction box of
the criteria area (see page 332).
Tip
How to specify boxes in the criteria area of Dependency matrix > (see page 310)
The main areas of the Dependency matrix. The illustration displays concepts from the SysML Plugin.
Representation of the dependencies in a cell
The default representation of the dependencies in the cells includes the following:
• Arrowed diagonal. The direction of the arrow is from the client element to the supplier element.
Tip
You can specify the colors and line styles used to represent the relationships in your
dependency matrices. How to specify relationship line styles > (see page 317)
The model used in the figures of this page is the dependencyMatrixSample model. Download
dependencyMatrixSample.mdzip62.
62 https://docs.nomagic.com/download/attachments/42586363/dependencyMatrixSample.mdzip?
api=v2&modificationDate=1494945196318&version=1
2. From the shortcut menu, under Create New (Row To Column) or Create New (Column
To Row), select a relationship type you need to create.
If you have specified to display in the matrix, relationships with both directions, the shortcut
menu of the cell will look like the one in the following figure.
Thus make sure you have selected a relationship type with relevant direction.
• To select nonadjacent rows, select a single row, and then hold down the Ctrl key
while you click other rows that you want to select.
• To select adjacent rows, select a single row, and then hold down the Shift key while
you click other rows that you want to select
2. Do either:
After the manual rearrangement of rows, the sort order of the rows automatically changes to
Custom.
• To select nonadjacent columns, select a single column, and then hold down the Ctrl
key while you click other columns that you want to select.
• To select adjacent columns, select a single column, and then hold down the Shift
key while you click other columns that you want to select
2. Do either:
After the manual rearrangement of columns, the sort order of the columns automatically
changes to Custom.
The validation (see page 1261) results for relationships are visualized in matrices. Matrix cells are
highlighted whenever relationships violate validation rules. This feature is useful, for example, to check
which test cases for requirements verification fail, to check if dependencies are valid or up-to-date
when doing gap analysis.
See the detailed descriptions of the dependency matrix toolbar buttons in the following table.
Select in Containment Tree (Alt+B) Opens the Containment tab (see page 32) in the
Model Browser (see page 29) and select the current
diagram or symbol in the Containment tree.
Delete (Ctrl+D) Deletes the selected element from the matrix and
model.
Remove From Matrix (Delete) Removes the selected element from the matrix.
The selected element is not removed from the
model.
Fit in Window (Ctrl+W) Fits the matrix in the active window size.
Zoom 1:1 (Ctrl+Slash, Ctrl+NumPad /) Shows the actual size of the table.
Zoom Out (Ctrl+Minus, Ctrl+NumPad -) Reduces the matrix maintaining aspect ratio.
Percentage drop-down box Shows the ratio of size. Click to select the size
ratio from the percentage list or enter the value.
See the descriptions of the dependency matrix Criteria area in the following table.
Row Element Type Text box with Click the ... button to select an element type or
multiple element types to show in rows of the
dependency matrix.
Column Element Type Text box with Click the ... button to select an element or multiple
element types to show in columns of the
dependency matrix.
Row Scope Text box with Click the ... button to define a scope of the model
(packages/profiles) from which elements should be
displayed in rows of the dependency matrix.
Column Scope Text box with Click the ... button to define a scope of the model
(packages/profiles) from which elements should be
displayed in columns of the dependency matrix.
Dependency Criteria Text box with Click the ... button to define what relationships
between row and column elements you wish to
display in the dependency matrix cells.
Show Elements Drop-down list Select to show only related (by a selected
dependency criteria), only non-related, or all
elements.
Command Description
Specification (Enter) Opens the Specification window (see page 882) of a dependency
matrix.
Select in Containment Tree (Alt+B) Selects the dependency matrix in the Containment tree (see
page 32) of the Model Browser (see page 29).
Related Elements Allows selecting whether to create a Relation Map (see page 336)
for the matrix or search for model elements which depends on
the matrix or are used by the matrix.
Tools Opens a list of tools (see page 1044)that are available for the
matrix.
Show Tabs in Full Screen (F11) Shows a matrix in the full screen mode. Click Close Full
Screen to return to the previous view.
Close All Tabs But Current (Ctrl+Shift+F4) Closes all diagrams except an active one.
Select in Containment Tree Selects the element in the Containment tree (see page 32) of the Model
Browser (see page 29).
Related Elements Opens the dialog for defining options to search for specified usages or
dependencies of the selected element.
For more information, see Analyzing usages and dependencies (see
page 1145).
Refactor Converts or replaces (see page 905) the selected element to an element
indicated by the user.
Tools Opens a list of tools (see page 1044) that are available for the selected
element.
Up (Ctrl+Up Arrow) Moves selected rows (either grouped or non-grouped) up. The
command is available on the shortcut menu of one or more rows.
Down (Ctrl+Down Arrow) Moves selected rows (either grouped or non-grouped) down. The
command is available on the shortcut menu of one or more rows.
Left (Ctrl+Left Arrow) Moves selected columns (either grouped or non-grouped) left. The
command is available on the shortcut menu of one or more columns.
Right (Ctrl+Right Arrow) Moves selected columns (either grouped or non-grouped) right. The
command is available on the shortcut menu of one or more columns.
Sort Order Point to the command and select the order for sorting rows or
columns. It can be either Ascending or Descending. Selecting Custom
does not affect the order of rows/columns. The Custom order is
automatically selected after shifting at least one row or column to
from one place to another.
The sort order persists after changing the row or column owner's
display mode, which can be defined by the Row Owner Display
Mode or Column Owner Display Mode property in the
matrix Specification window (see page 882).
Remove from Matrix Removes the selected element from the matrix.
Delete Deletes the selected element from both the matrix and the model.
Relation Map
Contents
The main purpose of all relation maps is to review and analyze relations among the elements and
create new elements directly in the relation map. All modeling tools allow you to create the Relation
Map Diagram, which provides you with a rapid review, analysis, and creation of relationships among the
elements of the entire model. See the following figure.
You can create other predefined relation maps (Activity Decomposition, Structure
Decomposition, Instance, Requirement Containment, Requirement Derivation Maps) only if you
have the SysML Plugin63 installed. Learn more about predefined relation maps in SysML Plugin
>>64
1. Select an element, for which you need to create the relation map. This element is the context of
the relation map.
2. Do one of the following:
• From the main menu, select Diagrams > Create Diagram. Type “rel” and press Enter.
• On the main toolbars, click the Create Diagram button. Type “rel” and press Enter.
• Press Ctrl+N. Type “rel” and press Enter.
• On the Analyze menu, click Create Relation Map.
• Right-click the element and from the shortcut menu select Create Diagram >Analysis Diagrams
> Relation Map.
• Right-click the element and from the shortcut menu select Related Elements >Create Relation
Map.
The newly created relation map opens on the right side of the application window.
• The context of the relation map automatically becomes the owner of it when using any
of the last two approaches.
• When using other approaches, you can specify another element as the owner.
• The actions relevant for diagrams are valid for relation maps as well.
After creating a relation map, you need to specify criteria, layout, and depth for it.
• Right-click the diagram pane and from shortcut menu, select Specification, or click on the
Options toolbar and then select Specification. Change the property values in the Specification
window of the relation map.
63 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
64 https://docs.nomagic.com/display/SYSMLP190SP2/Predefined+Relation+Maps
You can choose whether you want to show or hide Context, Relation Criteria, Element Type,
and/or Scope. In the Relation Map Specification window, set the needed check-box to true or
false.
Context Text Click to select the main element from which the structure is started, that is,
box the context of the structure. You can change the context (see page 340).
with
Relation Criteria Text Click to select relation criteria that will be displayed on the relation map.
box
with You can select to show implied relationships (see page 310) – logical
relationships calculated from inherited or inner elements of the model
element in order to provide additional information.
Element Type Text Click to select element types that will be displayed on the relation map.
box
with Standard and custom subtypes of the selected element types can be
optionally included when displaying them on the relation map. For
example, if you want to display packages as well as profiles, models, smart
packages, and other custom subtypes of the Package, select this type and
then click to select Include Subtypes check box.
Scope Text Click to select packages from which the relation map structure will be
box shown.
with
• Radial.
Depth Spin Type or select the level of the relation map branches that will be
box automatically expanded.
• Drag the selected element from the Model Browser to the relation map.
• In the Criteria area, click the button next to the Context box and then select the element
in the Select Context Element dialog.
• If the Make Element as Context on Selection option is turned on, click any node to make it the
new context of the of the structure. To turn this option on, click on the toolbars and select
Make Element as Context on Selection.
To see the entire name of an element, move the pointer over the element name. A ToolTip
showing the entire name appears.
• Turn the Show Single Node Per Element option off in the , if you need to see separate
nodes of the same element representing every occurrence of the element in different branches
of the graph.
• Turn the Show Single Node Per Element option on in the , if you need to see only one
node of the element representing all occurrence of the element in the whole graph.
4. When you've changed line colors and styles for all the relation criteria you needed to, click OK to
close the Relation Criteria dialog.
The customized legend helps you identify relation criteria. When working with relation maps, the
button is clicked to select by default. If you don't want to see the legend all the time,
simply click the button to cancel the selection.
• Press Delete.
To remove an existing element from the model
• Press Ctrl+D.
To restore the layout of the manually suppressed/expanded branches, moved, removed and hidden
symbols
1. Select an element.
2. Do one of the following:
• From the selected element shortcut menu, select Create Related Element.
• Click or press Insert (or + I).
3. Select element type and relationship. If selected element type exists in the model, select an
appropriate element from the list to represent it in the relation map. How to open an existing
element list for the unnamed last element >> (see page 346)
The element is decomposed.
1. Select unnamed element.
2. Do one of the following:
- Click the left mouse button.
- Press Space.
An existing element list opens, if such elements already exist in the model.
Robustness diagram
Contents
Functionality Availability
This feature is available in Standard, Professional, Architect, and Enterprise editions.
The Robustness Analysis involves analyzing the narrative text of use cases, identifying a first-guess set
of objects that participate in those use cases and classifying the objects based on the roles they play.
• Boundary or Interface objects are what actors use in communicating with the system.
• Entity objects are mostly objects from the domain model.
Contents
Our modeling tool supports these extensions of UML diagrams, as well as various other types of
diagrams:
User Interface Modeling Content diagram (see Free Form diagram (see Networking diagram
diagram (see page 349) page 370) page 376) (see page 371)
Patterns
You can create various types of classes in every class diagram using a Pattern Wizard (see page 1119). It
contains GOF, Java, Junit, CORBA IDL, XML Schema, and WSDL design patterns. You can also create new
patterns and modifications of existing ones using Java code or JPython scripts.
Contents
A User Interface (UI) Modeling diagram makes it possible to build prototypes of user interfaces, connect
UI mockups with the whole Architectural model, export them as images, and create browsable reports
for presentations. In short, they help gather information faster and thus save time and money.
Related pages
Sample model
• Integrate GUI development with UML specifications. Since this is a new field with increased
design capability, it is easier to see the missing parts in UML or User Interface modeling.
• Enable business analysts to quickly gather requirements via permanent feedback from
prospective users, making it easier to obtain all the information needed.
• Create browsable User Interface prototypes/ GUI simulation/ Story-boarding. Several prototypes
can be connected via hyperlinks with one another and then be presented together in a report to
simulate the workflow of an application.
• Resolve flow issues. It is easier to think through a problem when a User-related Interface can be
changed quickly.
• Get "buy-in" from stakeholders. A visual representation of a particular User Interface can be
shown more rapidly.
• Run a usability test before full production so that potential errors in usability, like overfilled
screens or a usage too complicated, can be avoided.
• Test a series of interaction widgets. Consider, for example, that another text field or button
would be good on a screen. Since modifying a prototype is easy, it is much simpler to present
these suggestions to others.
Contents
• Click the User Interface Diagram button in the Diagram toolbar (see page 24).
• In the Model Browser (see page 29), click either the Package or the Model. From their shortcut
menu select Create Diagram > Other Diagrams > User Interface Modeling Diagram.
After loading a project and creating a diagram, you can add UI modeling elements to the diagram pane.
Related pages
Contents
On this Page:
This section presents basic information about User Interface Modeling in a modeling tool.
Modifying a table
As the following figure shows, the newly created table has two columns and two rows already added to
the table. Each row contains a number of cells equal to the number of columns.
1. Right-click the table in the Containment tree. From the shortcut menu,
select Create Element > Column. A new column is added to the table.
2. Type the title for the new column. With the new column, a new cell is added to each row of the
table.
1. Right-click a column of the table in the Containment tree. From the shortcut menu,
select Element Numbering. The Element Numbering dialog opens.
2. In the list on the right side of the dialog, select all columns and click Create. To select all columns,
click the first column in the list and then hold down the Shift key when selecting the last one.
4. Change the order of columns in the table by changing their positions in the list (see the following
figure). The Element Numbering (see page 1009)feature is to order the selected items.
• To move a column to the left, select the column and click the Decrease button.
• To move a column to the right, select the column and click the Increase button.
1. Right-click the table in the Containment tree. From the shortcut menu,
select Create Element > Row. A new row is added to the table.
2. Type the title for the new row.
1. Right-click a row of the table in the Containment tree. From the shortcut menu, select Element
Numbering. The Element Numbering dialog (see page 1009) opens.
2. In the list on the right side of the dialog, select all rows and click Create.
• To select all rows, click the first row in the list and then hold down the Shift key when
selecting the last one. All the rows become numbered.
3. Change the order of rows in the table by changing their positions in the list.
• To move a row up, select the row and click the Decrease button.
• To move a row down, select the row and click the Increase button.
1. Right-click the tree or a node in the Containment tree. From the shortcut menu, select Create
Element > Node or Leaf.
2. Type a name for the new node or leaf.
At a time, you can rearrange the order only of the same parent- node leaves and/or nodes.
1. Right-click a leaf or a node of the tree. From the shortcut menu select ElementNumbering.
The Element Numbering dialog (see page 1009) opens.
2. In the list on the right side of the dialog, select all leaves and/or nodes, and then click Create.
• To select all leaves and/or nodes, click the first leaf or node in the list and then hold down
the Shift key when selecting the last leaf or node in the list.
3. All the leaves and/or nodes become numbered.
4. Change the order of leaves and/or nodes in the tree by changing their positions in the list
appropriately.
• To move a leaf or a node/leaf up, select the row and click the Decrease button.
• To move a leaf or a node/leaf down, select the row and click the Increase button.
Nesting
Specifying elements
You can modify UI modeling elements by editing their properties in the following three ways:
This following instructions are for the text or title properties ONLY.
To edit the element properties on a diagram
To add an icon
Fill Color Sets the background color of the component to the chosen color;
property Use Fill Color must be marked.
Pen Color Sets the color of the border for components that have a color.
Case Studies for User Interface Modeling (see page 363) provides an example of how this feature works
and explains how to add hyperlinks and create browsable reports.
Contents
On this Page:
Case Study 1 - Modeling user interface for the Report Wizard dialog
This case study provides step-by-step instructions for modeling the Report Wizard dialog. If you are
already familiar with this case study, please review Case Study 2 - Slider Example (see page 366), or Case
Study 3 - User Interface Prototyping Example (see page 368)
1. Click the Frame button under the Containers toolbar and drag-drop it on the diagram pane. A
Frame component is created.
2. Name the Frame component by doing one of the following:
• Click the Frame shape on the diagram pane and type Report Wizard
• Open the Frame's Specification window (see page 882).
• Double-click the Frame shape on diagram pane.
• In the opened specification window, type Report Wizard in the Title field.
3. Clear the check box properties Maximize and Minimize in the Frame's Specification window.
4. Define an Icon for the Frame symbol:
a. In the Frame's Specification window, select the Custom option in the Icon property. The
Open dialog box opens.
b. Open <MagicDraw installation>\plugins\com.nomagic.magicdraw.uimodeling. Select
the nomagic.png image as the frame icon.
5. Under the Containers toolbar, drag and drop two Group Box elements in the Frame symbol.
Under the Other toolbar, drag and drop one Separator element in the Frame symbol.
a. Place one Group Box into the other Group Box. Double-click on the larger Group Box and
ensure Titled is set to true. In the Title field type Select Template.
Report Wizard Frame with two Group Boxes and one Separator
Step #4. Create a Tree
This User Interface model could now be exported as an image. The steps to do this are as follows:
Notation Formality
When setting the values of a slider it is important to note that there is no empty space between
0. For example, 0 represents a new line. When entering a value, it should look like this:
1. Add a hyperlink.
a. Open the model with the Login Dialog.
b. Select the OK button.
c. Click on the smart manipulator Hyperlinks/Go To and select Add Hyperlink in the popup
menu.
d. In the Edit Hyperlink dialog, select Element/Symbol and click the "..." button. Browse to
the Package Test Browser, select the User Interface diagram (see page 349) in it and confirm
two times with OK - a diagram symbol will appear next to the OK button. Double clicking
on the OK button will lead to the other diagram.
2. Now connect all the buttons in the other diagrams with hyperlinks. The diagram symbol appears
next to a component with a hyperlink.
Step #5 Create a browsable Report
Content diagram
Contents
Functionality Availability
This feature is available in Standard, Professional, Architect, and Enterprise editions.
The Content diagram is an extension of UML notation. The purpose of the Content diagram is to
generate or represent a project structure (diagrams) and relations between them. The Content table
works as a table of contents for a project. The Content Shape creates a table of contents of all diagrams
of the project.
All Content diagrams have their own specifications. You can specify their name, documentation, and
view the relationships in which they participate. You can also add stereotypes (see page 827), tagged
values (see page 836), and constraints (see page 657). For more information about diagrams creation,
read Creating Diagrams (see page 450).
Networking diagram
Contents
Functionality Availability
This feature is available in Standard, Professional, Architect, and Enterprise editions.
The Networking diagram provides a visual display of the network topology. The Networking
Profile contains stereotypes (see page 827) for the network description. Elements with icons can be drawn
on the diagram pane. The Networking diagram is commonly used to depict hardware nodes as well as
the connections between them.
WSDL diagram
Contents
Functionalities
This feature is available in Architect and Enterprise editions.
Contents
The CORBA IDL diagram facilitates the creation of CORBA IDL elements. The following patterns are also
available for CORBA IDL: Interface, Value Type, Type Definition, Sequence, Array, Fixed, Union,
Enumeration, Struct, and Exception. For more information about CORBA IDL usage in MagicDraw,
see MagicDraw Code Engineering UserGuide.pdf, chapter "CORBA IDL Mapping to UML".
You can select either the UML Interface or the UML Class as a base element for the CORBA
Interface. For more information about the CORBA IDL Interface implementation, see CORBA Interface
Implementation.
Related Pages:
Time diagram
Contents
Functionalities
This feature is available in Standard, Professional, Architect, and Enterprise editions.
A Time Diagram is an extension of UML notation. The time diagram is similar to a sequence diagram,
but the model elements of the time diagram have predefined stereotypes.
Contents
The Free Form diagram allows you to draw various geometrical shapes. The diagram also includes
shapes for drawing business flowcharts.
Related pages:
Contents
On this page
Introduction
You can use modeling tool tables to represent and modify information about the properties of model
elements and/or relationships between them. You can create four kind of tables: Generic Table,
Glossary Table, Metric Table, and Instance Table. The different purposes for each table are illustrated
below:
• Generic Table (see page 406) allows you to manage selected elements and their properties in a
single place. The example below is from a generic table.mdzip65 sample model.
• Glossary Table (see page 418) allows you to define specific term(s) and gives you the ability to reuse
the term(s) anywhere in your model. The example below is created only for this image and is not
saved in any of the sample models.
• Instance Table (see page 425) allows you to manage an Instance Specification of your model in
spreadsheet form. The example is from SpacecraftMassRollup.mdzip66 sample model.
65 https://docs.nomagic.com/download/attachments/42586363/generic%20table.mdzip?
api=v2&modificationDate=1508506693854&version=1
66 https://docs.nomagic.com/download/attachments/42586363/SpacecraftMassRollup.mdzip?
api=v2&modificationDate=1508506748322&version=1
Table areas
Before working with tables, you should understand the structure of all tables supported by MagicDraw.
All tables contain the following areas:
• Table toolbars allow you to quickly access the options for managing data in the table. Learn more
about table toolbars >> (see page 379)
• Criteria area allows you to define the elements that you want to display in the table, specify the
scope of the table, and filter necessary information in tables which contain large amount of data.
Learn more about Criteria area >> (see page 386)
• Grid displays data according to the defined criteria area (see page 386). You can modify the
displayed data in the grid by editing cells, removing, hiding, creating new, or selecting other
options from the table toolbar (see page 379). The grid consists of:
- Rows which appear along the side of the table, and are labeled using numbers starting
with 1. Each table row represents an element.
- Columns which appear along the top of the table, and are labeled using element
property names. Each table column represents element properties.
- Cells are the intersections of every row and column which represent element property
values.
67 https://docs.nomagic.com/download/attachments/42586363/MagicLibrary%20requirements.mdzip?
api=v2&modificationDate=1508506778567&version=1
Table toolbars
Contents
On this page
Important
If the table toolbars are not available in a server project, lock the table for editing. Make sure
you have the right to edit the model of this project.
Navigation toolbar
Alt+B Click the Containment tree (see page 32) to select the element of the selected
row.
Edit toolbar
Add New Insert Click to create a new element in the table. This element will also be added to
the model. If several element types are available, a shortcut menu with
available types will open. You will be able to select an element of the type you
> need.
Create
Note
• In Instance Table, expand and select Create to
add a new instance. If this button is not active, the
classifier is not specified for the instance table.
• In Metric Table, click Calculate Metrics and select
Add New Metric with Different Parameters to create a
new row with copied parameters.
Add Existing Ctrl+Insert Click to add an element from a model. The Select Element dialog (see page 994)
opens. Only elements of the type defined in a specific table will be listed.
Note
In Instance Table, expand to find this button.
Delete Ctrl+D Click to remove selected elements both from the table and the model.
Note
In Instance Table, expand to find this button.
Remove Ctrl+Delete Click to remove only selected elements from the table.
From Table
Note
In Instance Table, expand to find this button.
Layout toolbar
Click to expand or collapse rows when the Display Mode under the Options
button is selected as Compact tree or Complete tree.
Ctrl+Down Click to shift selected elements (either grouped or non-grouped) down a row.
Arrow The elements are automatically renumbered after moving.
Show N/A Click to change the set of columns to show on the table.
Columns /
Columns
Note
In Instance and Metric tables, this button is called Columns.
In Generic and Glossary tables, this button is called Show Columns.
Publish toolbar
N/A Click to export the contents of the table to an *.html, *.csv, or *.xlsx file.
Export
Note
In the Metric Table this button also allows you export to *.xlsm file.
Find in
Diagram
Find in Ctrl+F Click to open the search bar allowing to search for textual information in all
Diagram types of diagrams, including tables, matrices and maps. Use / to
navigate the search results.
View toolbar
N/A Click to update the contents of the table after specifying the scope.
Note
In the Instance Table, this button updates data after specifying the
smart package as the scope criteria.
Ctrl+NumP
ad/
Ctrl+Equals
N/A Click to show the size ratio. Click to select the size ratio from the percentage
list or enter the value.
Validation toolbar
N/A Click to validate the table against all validation rules stored in the model,
except those that are ignored.
Options toolbar
N/A Click to open the Options menu. Each table contains different options under
this button. Below are the meanings of all available options:
Other buttons
Edit toolbar
Instance Table > Delete with Alt+D Click to remove selected elements both from
Parts the table and the model.
Metric Table N/A Click to open the Calculate Metrics menu and
Calculate Metrics
then select the needed command (see page 434).
Layout toolbar
Other buttons
Glossary Table N/A Click to turn the glossary on/off in the project.
Related pages
Contents
The Criteria area appears below the table toolbars. If it is not displayed, click in the table toolbar
to expand it.
The following table describes the contents of the Criteria area according to different tables and
provides the references to procedures when trying to specify any box of this area.
Generic Table Element Click to open the Select Element • Create a Generic
Type Type dialog and select one or more types of Table without help
Glossary Table elements you need to display in the Generic of a wizard (see page
406)
table.
• Add or remove
element types (see
page 406)
Metric Table Metric Click to open the Select Metric • Create a Metric
Suite Suite dialog and select the metric suites you Table (see page 434)
want to use for calculating the metrics of
your model.
Instance Table Classifier Click to open the Select Classifier • Specify the classifier
(see page 425)
dialog and select one or more classifiers
whose instances you need to display in the
Instance Table.
All tables Scope Click to select one or more • Specify the scope
(optional packages, which contain the elements you for the table (see page
) need to display in the table. 388)
• Specify the Scope
Query (see page 388)
Click to open the Query dialog and
specify the criteria that define your scope.
All tables Filter Type the phrase by which the element • Filter table data (see
should be filtered. page 404)
• Save the filter
To open the menu with more filter options, criteria (see page 405)
click in the Filter box.
Related pages
Contents
Tables are diagrams which allow you to manage any amount of model data in a spreadsheet-like form.
It is much easier to analyze a group of data in one place, especially when you can create new elements,
add existing elements, edit their properties directly from the table, and paste data from the clipboard.
This allows you to sort and filter data, show, hide, reorder columns, and clear or edit individual cells.
Exporting tables into more commonly used file formats, such as .html, .csv, or .xlsx, makes it simple to
share them with stakeholders.
Important
Each table row represents an element. Each column represents element properties. The
column header and row number header are highlighted in grey when selecting single or
multiple cells.
The following procedures provide the basic tasks to get you started working with all modeling tool
tables:
Related pages
1. In the Criteria area of the table, click the ... button next to the Scope (optional) box.
2. In the Select Scope dialog, select one or more containers, such as packages or smart packages,
and add them to the Selected Elements list.
The Select Scope dialog is a modification of the element Selection dialog (see page 996).
3. Click OK.
The scope is defined, and the contents of the table are updated with the elements from the
selected scope. In the future, all elements created in that scope will automatically be added to
the table.
If the contents of the table have not been updated, try the following:
• Click on the View toolbar, in case a smart package is specified as the scope criteria.
• Make sure the specified scope contains elements specified in the Element Type box,
Metric Suite box, or Classifier box.
• Make sure at least one element is specified for the table.
Contents
Contents
On this page
Selecting cells
In all tables, you can select:
All changes made in the table are saved in the model. The procedure below describes how to enter a
value into an editable cell.
Data types
Only String, Boolean, Number, or Enumeration data types can be cleared from a cell.
The procedures below describes how to clear values from individual cells, from a block of cells, or from
entire table:
1. Select single or multiple cells in the table. How to select cells in the table > (see page 389)
2. Do one of the following:
• From the shortcut menu, select the Clear command (see the following figure).
Selected cells of String, Boolean, Number, or Enumeration data types become empty. The
following example demonstrates that the Documentation cell is empty after clearing, because its
data type is a String. The Is Abstract cell value also is cleared because the value type is Boolean.
1. Select the entire table. How to select cells in table > (see page 389)
2. Do one of the following:
- From the table shortcut menu, click the Clear command.
- Press Delete on the keyboard.
Press To move...
Contents
On this page
Data types
Only String, Boolean, Number, or Enumeration data types can be cleared from a cell.
Hiding a column
To hide a column
1. Select single or multiple cells, and from the shortcut menu, select Column > Hide.
2. Right-click the column header to open the shortcut menu, and select the Hide command.
Reordering columns
To reorder columns
• Click the column header and drag it to a desired place. Only the first column cannot be moved.
Using the Select Columns dialog, you can choose to display the properties of the
specified element type, as well as the properties that are subtypes of the specified
element type.
Additional information
- You can read more about it in Defining expressions (see page 2067), as the procedure for
custom columns and for derived properties is the same.
- You can also select to show implied relationships in the table. The procedure for
specifying which relationships to display in the table is the same as described
in Specifying dependency criterion (see page 310).
• On the Options toolbar, click and then select Show Detailed Column Name.
The group name (between brackets) to which the selected property belongs, and/or
the stereotype name (just before the property name), will be displayed in the column heading.
The following diagram shows three different columns with the same name for the
association element: Name, Name (Role of A), and Name (Role of B) and a column for the class
element with the stereotype «Teacher». Name (Tags). If the command Show Detailed Column
Name were not selected, there would be four columns with the same headings, i.e., Name.
Contents
On this page
Data types
Only String, Boolean, Number, or Enumeration data types can be cleared from a cell.
More information
Learn more about adding terms in Glossary Table > (see page 418)
Learn more about adding new elements in Generic Table > (see page 406)
More information
Learn more about filling the table with instances > (see page 425)
More information
Learn more about calculating new metrics with different parameter values > (see page 434)
1. Select the whole row or select one cell of the row you want to remove.
2. Do one of the following:
• Click the Remove From Table button on the table toolbar.
• Press Ctrl+Delete from keyboard.
Removing a row from the model
You can delete an element from the model when removing the row from a table.
1. Select the whole row or select one cell of the row you want to remove.
2. Do one of the following:
• Click the Delete button on the table toolbar.
• Press Ctrl+D from keyboard.
Sorting rows
You can change the order of rows in the following ways:
• Click the header of the column by which you want to sort the rows in the table. A small arrow
showing the automatic sort order appears on the column header. Clicking the header once sorts
the rows in ascending order. Clicking the header twice sorts the rows in descending order. All the
• Press Ctrl + click on the first column header you want to sort the rows in the table. Repeat this
action for the next column header you want to sort the rows in the table. A minimum of two
column headers should be selected to multi-sort rows. A small arrow with a number showing the
automatic multi-sort order appears on the column header. All the rows in the table are
automatically renumbered after multi-sorting.
Important
The hierarchy in the Instance table is displayed according to an instance value that is a slot
value of another Instance Specification. Composite instances are displayed.
The following rules should be satisfied for a successful copy-and-paste operation to modeling
tool tables:
To copy data from another resource and paste it to the modeling tool table
- The number of columns in that table should be the same as the number of columns in
the table.
- The data types of columns in the table must be compatible with the copied information.
2. Open the table where you want to paste the copied data.
to specify the Element Type (in Generic table), Classifier (in Instance table), or Metric Suite (in
Metric table).
4. In the table toolbar, click the Show Columns/Columns button and choose the columns that you
want to fill with the copied information.
If elements have an ID prefix in another resource, they are set automatically after the
copy-and-paste command only for pasted elements in the table. Manage ID prefixes in
the Element Numbering dialog (see page 1009).
1. Select the required cells in the modeling tool table. How to select cells > (see page 0)
2. Do one of the following:
- Press Ctrl+C (Cmd+C on OS X).
- In the main toolbar, select Edit > Copy.
The data is stored in the clipboard.
3. Open the other resource where you want to paste the data and select the first cell in the area you
want to paste what you copied (e.g. Excel spreadsheet).
4. Press Ctrl+V.
The contents of the cells are transferred to other resource.
The following rules should be satisfied for a successful copy-and-paste operation to modeling
tool tables:
1. Select the cells that contain the data you want to copy. How to select cells > (see page 0)
2. Do one of the following:
- Press Ctrl+C (Cmd+C on OS X).
- In the main toolbar, select Edit > Copy.
The data is stored in the clipboard.
3. Select a single or multiple cells where you want to paste what you copied.
4. Do one of the following:
- Press Ctrl+V (Cmd+V on OS X).
- In the main toolbar, select Edit > Paste.
The content of the cell(s) is duplicated in another cell(s).
You can search in the entire table by selecting the All option or select one or several
particular columns.
• Specify how the results should match your key words (4).
You can save the filter criteria for a particular table. The filter criteria will be saved even after reloading
the project or restarting modeling tool.
When exporting the table, only the filtered out columns and rows will be included in the result.
To export a table
Generic table
Contents
On this page
Description
Example
The Generic Table project sample allows you to read about the Generic Table feature and
analyze examples within that project sample.
To open the sample, do either:
• On the Welcome screen, select Samples > Diagrams > Generic table.
• Go to <MagicDraw installation directory>\samples\diagrams and open the generic
table.mdzip file.
All the examples given in this section are based on the data from this sample.
Related pages
1. Denote the name of the table and the owner package (MANDATORY).
2. Define element types that will be used in the table (MANDATORY).
3. Select elements corresponding to the element types (OPTIONAL).
4. Specify table columns (OPTIONAL). Columns represent element properties, so the table creation
could be finished without specifying columns.
You can modify the table after it is created.
This section describes several of the most popular ways of creating a generic table:
1. In the Containment tree (see page 32), select an element to be the owner of the Generic Table.
2. Do one of the following:
• From the main menu, select Diagrams > Create Diagram. Type “gen” and press Enter.
• On the main toolbars, click the Create Diagram button. Type “gen” and press Enter.
• Press Ctrl+N. Type “gen” and press Enter.
• Right-click the element and from the shortcut menu select Create
Diagram > Other Diagrams > Generic Table.
The newly created Generic Table opens on the right side of the application window.
3. Type the name of the table.
Select desired element types and/or stereotypes in the Select Element Types dialog.
The Element Type box in the Criteria area of the Generic Table will display the selected items.
This action is optional, so you can continue the creation without selecting any type or stereotype.
You will be able to modify selected element types when the Generic Table is created.
If you drag an element from the Containment tree (see page 32) to the table, the type of
this element will be automatically set as the Element Type box value.
• Create new elements directly from the table. How to craete new elements >> (see page 414)
• Copy and paste elements from another resource. How to paste elements >> (see page 416)
• Add existing elements to the table individually. How to add existing elements >> (see page
414)
4. Select elements.
Though you can select any element from the Model Browser (see page 29), only the
elements of selected types will be added into the Generic Table.
If the Generic Table creation wizard is opened from one or more elements’ shortcut
menu, the element or the set of elements will be added to the Selected list
automatically.
For more information about the element selection and dialog buttons, see Elements
multiple selection (see page 996).
Creating a Generic Table for a set of selected elements using the diagram creation wizard
Note that element types, elements, and columns of the Generic Table will be automatically selected
according to the set of selected elements.
Properties corresponding to the selected types will be added to the list of available
columns.
• To remove element types click to clear appropriate check boxes in the list.
Properties corresponding to the deselected types will be removed from the list of
available columns.
To add an element type, you can also drag a selected element to the Element Type box directly
from the Model Browser (see page 29).
• To select adjacent elements, select a single element and hold down the Shift key while
you click other elements.
• To select nonadjacent elements, select a single element and hold down the Ctrl key while
you click other elements.
The new value of the Element Type box replaces the old value.
At least one element type must be selected in the Element Type box before adding a new
element.
To create a new element
1. Click the Add New button on the Edit toolbar. If there is more than one element type selected, a
submenu with the list of available element types opens.
Only element types available to create in a possible diagram owner which contains the
Generic Table will be displayed on the submenu.
2. Select an element type. The element of the selected type will be added to the last row of
the table and to the model.
3. Name the new element in the table.
2. Select the element you want to add to the Generic Table. This element and its name will
be added to the table as the last row.
Use the Multiple Selectionmode to add more than one element at a time.
If you have not defined the element type before starting to add elements to the table, it is
automatically set after the first element is added to the table. The type of this element
becomes the value of the Element Type box.
To add an existing element, you can drag a selected element to the contents of the Generic
Table directly from the Model Browser (see page 29).
If you drag a container, for example, a package or a smart package, the Generic Table will
display its contents, but not the container itself.
The number of columns in that table should be the same as the number of columns in
the Generic Table.
The data types of columns in the Generic Table must be compatible with copied
information.
The following example demonstrates the main steps for pasting data in a Generic Table.
Contents
On this page
Description
The Glossary saves time by ensuring consistent usage of terminology in the organization. It improves
communication between team members, as terms are understood to have the same definitions and
usages everywhere they appear.
Each row in the table represents a term. A word, phrase, or any element of the model can be a term.
Words and phrases defined as terms are underlined. This enables you to identify terms in your model.
The word or phrase is underlined only if it completely matches the defined term. For example,
if you defined the word Project in your glossary, the word Projects would not be underlined
because it is plural.
Purpose
The Glossary Table allows you to:
Usage
The video below demonstrates how to use the glossary in MagicDraw when working with
Requirements.
https://www.youtube.com/watch?v=l6jGDDUTVXU
Example
The following figure illustrated the terms defined in The Glossary Table.
The figure below shows the term visibility on the diagram pane.
Related pages
Even if you mark only a part of a word, the wholewordwill be added to the glossary as a
term.
2. Open the Glossary Table where you want to paste the copied data.
• In the term's Specification window (see page 882), Synonym property specification cell, type the
synonyms for the term.
After terms are defined in the glossary, it is easy to use them in your project.
Inserting terms
To use term in your model
Information
Only capitalized terms are recognized as acronyms. Lowercase words are not interpreted as
acronyms.
To disable acronyms usage
Instance table
Contents
On this page
Description
Purpose
An Instance Table allows you to:
Example
1. In the Containment tree, select an element to be the owner of the Instance Table.
2. Do one of the following:
• From the main menu, select Diagrams > Create Diagram. Type “ins” and press Enter.
• On the main toolbars, click the Create Diagram button. Type “ins” and press Enter.
• Press Ctrl+N. Type “ins” and press Enter.
• Right-click the element and from the shortcut menu select Create
Diagram > Other Diagrams > Instance Table.
The newly created Instance Table opens on the right side of the application window.
1. In the Criteria area of the Instance Table, click the ... button next to the Classifier box. The Select
Classifier dialog opens.
2. Select one or more elements and add them to the Selected elements list. These are the elements
that can be selected:
• Classifier.
• Classifier that owns other classifiers. In this case, the classifier and all the classifiers owned
by it are specified as criteria.
• Package that contains classifiers. In this case, the contents of the package, but not the
package itself, are specified as criteria.
3. Click OK when you are done.
Once the classifier is specified, the following columns are displayed in the Instance Table (on the right of
the row number # column):
• Name which is up to display the names of the instances of the specified classifier.
• Columns corresponding to the Data type attributes of the specified classifier and named after
these attributes using sentence style capitalization. The columns are up to display the slot values
of the instances of the specified classifier.
You can show any column that corresponds to one of the following:
• Attribute of the classifier that is specified for the Instance Table (see page 429).
• Property of the instance of the specified classifier. (see page 429)
• Tag of a stereotype that can be applied on the instance of the specified classifier. (see page 429)
• Nested properties of the classifier that is specified for the Instance Table. (see page 430)
1. On the table toolbar, click the Columns button and then click to select the check boxes beside
the attributes you want to show.
All columns that you have chosen to display also appears on the menu of the Columns
button.
To specify nested columns, click the Create with Parts button, when creating a new
instance with parts (see page 0).
To create a new instance
The new instance can be created only if the classifier is already specified for the Instance
Table. Otherwisethe Create button is not available.
If there is more than the one classifier specified, from menuof the button, select a
classifier for which you need to create an instance.
The new instance is added to the Instance Table as the last row.
2. Type the instance name and specify slot values.
To add an existing instance
• You can drag a selected element to the contents of the Instance Table directly from
the Model Browser.
• To select adjacent elements, select a single element and then hold down the Shift
key while you click other elements.
• To select nonadjacent elements, select a single element and then hold down the
Ctrl key while you click other elements.
• The number of columns in that table should be the same as the number of
columns in the Instance Table.
• The data types of columns in the Instance Table must be compatible with copied
information.
2. Open the Instance Table where you want to paste the copied data.
3. Make sure the Classifier is specified in the Criteria area.
4. In the table toolbar, click the Columns button and choose columns of instance slot values that
you want to fill with copied information.
The new instance is simultaneously created in the model and set as the slot value. You can see
this instance in the Model Browser, where it is owned by the classifier, which is a type or a
subtype of the selected slot.
To remove an instance from the cell
1. Select the cell.
2. Click .
The instance is removed from the Instance Table, but not from the model.
Metric table
Contents
On this page
Description
To understand the material better, you need to be familiar with the following concepts.
Parameter definition A variable used for calculating metrics. It can be an element type
(including both relationship and DSL element types), a particular
element, data type, or data type value.
Validation-based metric definition The attribute of a Metric Suite specifying the validation rule for
calculating metrics according to the parameter values.
Actually, a metric suite is a class with the «MetricSuite» stereotype applied. Both parameter and metric
definitions are attributes of the metric suite.
Purpose
Calculated at regular intervals, metrics help track the evolution of the model development. One metric
is the result of a single calculation of a metric definition. The metrics of all the metric definitions of
the metric suite, together with relevant parameters, are stored in a single instance of the metric suite as
slot values. Use the Metric Table to analyze and manage the instances of the metric suite.
Related pages
1. In the Containment tree (see page 32), right-click the element for which you need to calculate the
metrics of a particular Metric Suite.
2. From the shortcut menu of the element, select Tools > Metrics > New Metric Table. The Create
Metric Table dialog opens.
4. Click OK.
Important
If you cannot see a particular Metric Suite in the Create Metric Table dialog, check the target
value of that Metric Suite (see page 1078). It is possible that the element selected in step 1 is not
the target of this Metric Suite.
The table of a particular metric suite is created for the selected element. It is already filled with data
(metrics calculated at the time you created the table). These metrics are actually stored in the Package
owned by the element for which they have been calculated. The name of the Package
is <element_name> Metrics, for example, HSUVModel Metrics.
If one or more metrics are not calculated, make sure the Metric Suite is specified correctly. Here
are some suggestions:
• Check the metric definition – the formula could be specified incorrectly.
• Check the parameter definition – the metric definition probably cannot access parameter
values.
This method of creating Metric Tables saves much time compared to the more common ways
of table (and even diagram) creation, as these methods for a Metric Table creation start with an empty
table. This requires further effort on your part to fill it (specify the metric suite, create an empty row,
define parameters, and then calculate the metrics).
Contents
1. In the Containment tree (see page 32), right-click the element whose Metric Table you need to
append.
2. On the shortcut menu of the element, click Tools > Metrics and then select the Metric Table
you need to append.
The selected Metric Table opens. Now you are ready to calculate new metrics.
To calculate new metrics
1. In the Metric Table, select the row. Below that, you need to add a row with newly
calculated metrics.
2. Do one of the following:
The new metrics are calculated and represented in the table below the selected row.
Recalculating metrics
To recalculate metrics
1. In the Metric Table, select the row whose metrics you need to recalculate.
2. Do one of the following:
• On the Edit toolbar, click and then select Recalculate from the
open menu.
• Right-click the selected row and then click Recalculate on the shortcut menu.
The new metrics are calculated and represented in the table, instead of the selected row.
1. In the Metric Table, select the row. Below that, you need to add a row for representing
newly calculated metrics.
2. Do one of the following:
• On the Edit toolbar, click and then select Add New Metric with
Different Parameters from the open menu.
• Right-click the selected row and then click Add New Metric with Different Parameters
on the shortcut menu.
3. A new row with copied parameters is added to the Metric table.
If the new row is empty, it might be that you haven’t selected any row. You may continue
the procedure.
The new metrics are calculated according to the specified parameter values.
Contents
On this page
Introduction
You can transfer data between Excel/CSV files and modeling tool tables. After sync, the data on Excel file
of selected sheet or CSV file matches the data in the modeling tool table. This mechanism is
bidirectional and ensures continuous work between Excel/CSV files and modeling tool tables. If you
don't have the ability to collaborate via the internet but you need to share information through Excel or
CSV files, you can use this feature,. The Excel/CSV file syncing is available in all tables of the modeling
tool by using the the Excel/CSV Sync button in the table toolbar. (see page 379)
68 https://docs.nomagic.com/download/attachments/42589368/
Obsolete%20Metrics%20Plugin%20User%20Guide.pdf?api=v2&modificationDate=1507895257728&version=1
You can link only one Excel/CSV file with the same modeling tool table.
You can link:
1. Make sure the Element Type or Classifier is selected in the Criteria area (see page 386).
2. Do one of the following:
• Drag the Excel or CSV file directly onto the modeling tool table.
Drag the Excel or CSV file directly onto the modeling tool table. Hold it down until the Tooltip
appears (long drag). Drop it, and select the Link Excel/CSV File or Attach and Link Excel/CSV
File command from the opened menu.
The Excel or CSV file is linked with the modeling tool table and ready to be synced.
If you select or drag another file (e.g. Vehicle Requirements.xlsx) on a modeling tool table that is
already linked with the file (e.g. Stakeholder Requirements.xlsx), the previous file
named Stakeholder Requirements.xlsx is replaced with the latest one Vehicle Requirements.xlsx.
Linking a new Excel/CSV file exported directly from the modeling tool table
To create a new Excel/CSV file from the modeling tool table and link it at the same time
• On the table toolbar, click , and select Excel/CSV File > Write To File. In the Save dialog,
select the location from your file system, and save the new Excel or CSV file to your computer.
The Excel or CSV file is exported, linked with the modeling tool table, and ready to be synced.
The file cannot be saved if a file with the same name and in the same location already
exists.
Sync data
Data can be synced bidirectionally by using two commands from the :
You can import data from a selected sheet in an Excel file or CSV file to a modeling tool table by using
the Read From File command. Read the following rules before using this command:
• The Read From File command is available only if the Excel/CSV file is linked with a modeling tool
table. How to link it >> (see page 441)
• After making any changes in the Excel or CSV file you must save them before using the Read
From File command. Otherwise, the changes will not be imported to the modeling tool table.
• The Excel or CSV file can be open while importing data from them.
• When syncing data from an Excel file, the Read From File command:
- Syncs only one sheet of the Excel file. By default, the first sheet is synced. You can change the
sheet number in the Excel/CSV Sync Options dialog (see page 445) > Mapping Options area (see page
448) > Sheet option.
- Syncs the first cell of the sheet filled with data. If the selected sheet is empty, it will sync from
the A1 cell. You can change the cell you want to start syncing from in the Excel/CSV Sync
Options dialog (see page 445) > Mapping Options area (see page 448) > First cell option.
• When syncing data from a CSV file, the Read From File command syncs the comma delimiter (,)
by default. You can change the delimiter in the Excel/CSV Sync Options dialog (see page 445)
> Mapping Options area (see page 448) > CSV delimiter option.
• You can indicate the heading titles of the Excel/CSV file; change this option in the Excel/CSV Sync
Options dialog (see page 445) > Mapping Options area (see page 448) > First row contains headings
check box.
• After sync, the deleted rows in the file are marked as obsolete in the modeling tool table. You can
change this behavior in the Excel/CSV Sync Options dialog (see page 445) > Sync Options area (see
page 448) > If rows in the file are deleted option.
• The columns of the Excel/CSV file and modeling tool table by default are mapped on the ordinal
position. You can create your own column mapping in the Excel/CSV Sync Options dialog (see
page 445) > Mapping area (see page 449).
You can export data from a modeling tool table to an Excel/CSV file by using the Write To File
command. Read the following rules before using this command:
• If the the file is not linked with the table, this command allows you to export a new Excel or CSV
file to your computer and create a reference automatically between the table and the exported
file. The file cannot be saved and linked with the table if a file with the same name and in the
same location already exists. You can use the Export button from the table toolbar (see page 379) to
export a table without creating a reference.
If the the file is linked with the table, this command transfers the data directly to your Excel/CSV file.
To open a linked Excel and/or CSV file directly from a modeling tool table
Related pages
Contents
On this page
The Select Excel/CSV file area contains the buttons described in the following table.
If rows in the file are deleted • Delete elements from the model - deletes the
same elements that were deleted in the file from
your model.
Sheet Select the Excel file sheet you want to sync. The first sheet is
selected by default.
It is available only for Excel files.
First cell Select the Excel file cell you want to start syncing from. The first
cell filled with data is read by default. If the selected sheet is
empty, it reads from the A1 cell.
It is available only for Excel files.
CSV delimiter Select the delimiter of the CSV file from the drop-down list. If you
want to specify the custom delimiter in the next box, select Other.
By default, the comma (,) is selected.
It is available only for CSV files.
First row contains headings check box Clear the check box if your Excel/CSV file does not contain
headings. The check box is selected by default.
Mapping area
The Mapping area allows you to manage mapping between modeling tool table columns and Excel/CSV
table columns by creating new mappings, re-mapping, or deleting them:
- To create a new map or re-map one by one, drag columns from the left tree/right tree onto
columns in the right tree/ left tree.
- To create a new map or re-map all columns in the ordinal position, click at the bottom of the
mapping area.
- To delete mapping one by one, select an appropriate map and click at the bottom of the
mapping area.
- To delete all mappings, click at the bottom of the mapping area.
If you do not define your own mapping - that is, the mapping area is empty - the columns by default are
mapped on the ordinal position.
The hashtag (#) column from the modeling tool table is not included in the mapping.
Related pages
2.4 Diagramming
When working with diagrams it is helpful to keep the following concepts in mind:
• A shape refers to the notation of a model element, such as a package, class, state, use
case, object, etc.
Diagram name and its context name synchronization (see page 491)
Contents
1. In the Model Browser, select the owner for the new diagram.
2. Do one of the following:
• Press Ctrl+N.
Press Esc or click outside the dialog to close the diagram creation dialog without creating
the diagram.
1. Open the Inner Elements property group in the Package’s, Profile’s, Model’s, or other element’s
Specification window.
2. Click the Create button. From the button's shortcut menu select Create Diagram, then choose
the new diagram type. The Specification window of the new diagram opens.
3. In the open window, type the diagram name and click Close.
Related pages
Contents
• Ability to analyze different aspects of the system (such as requirements, architecture, test cases,
or domain models) in separate tabs. Both backward and forward navigation are supported for
each aspect (tab) separately. Navigation does not open new tabs by default, which greatly helps
in limiting the number of open tabs.
• Ability to compare separate views of the system side-by-side. For example, business and IT
architectures can be displayed in two tabs side-by-side and analyzed by drilling down in their
hierarchies. Navigation deeper in the structures will not open new tabs, which allows smooth
analysis of the modeled system.
• Smooth work with multiple screens. Browsing in a tab of the second screen never opens
diagrams in the first screen, which means you stay in the same screen. New tabs open in the
same screen, to the right of the active one.
• Double-click the model element to which the diagram is assigned. The new diagram opens in the
same diagram tab.
To open a diagram from the content diagram (available in the Standart, Professional, Architect, and
Enterprise editions):
If the diagram is added to the table of contents or a shape of the diagram is drawn on the diagram
pane, do one of the following:
• Double-click the diagram shape. The diagram opens in the same diagram tab.
• On the diagram pane, right-click the diagram shape, and then click Open. The diagram opens in
the same diagram tab.
• On the diagram pane, right-click the diagram shape and then click Open in New Tab
• You can change the default diagram opening behavior in the Environment Options
dialog, the General options group, under the Navigation category.
• Press the Ctrl key when opening diagram, to turn on the opposite diagram opening
mode. For example, if by default opening in the same tab is active, by using the Ctrl key,
the diagram will open in the new tab and vice versa.
• To load all diagrams that have been created in the project, from the Diagrams menu,
select Load All Diagrams.
• In the General pane of the Environment Options dialog box, you can select a method
for loading diagrams while opening a project. Three options are available:
a) Load all Diagrams – loads all diagrams existing in the project.
b) Load Only Open Diagrams – loads only diagrams that were not closed in earlier
usages of the project.
c) Do not Load Diagrams – all diagrams are not loaded and closed after opening a
project.
To navigate backward and forward between diagrams in the same diagram tab, do one of the following
Contents
On this page
• Drag files from your file system onto an element in the Model Browser or a symbol on a diagram.
For example, you can drag a Class element from the Model Browser to the Type property
in the Operation Specification window. That Class element is assigned as the Operation
type in the Specification window.
• Drag any elements from the Specification window (see page 882) onto:
• An empty place on a diagram. In this case, the class symbol is created on the diagram.
• A shape on a diagram. In this case, a new attribute is created.
• An element in the Model Browser. In this case, a new model element is created.
• Drag a property to create an association (see page 618):
• Drag a property from the classifier (for example, class, component,
subsystem) compartment to a diagram pane.
• Drag a property from the Model Browser (see page 29) to a diagram pane.
In both cases, an association (see page 618)is drawn from the classifier (see page
633)to a property's type. The property itself is set as an association end. If the
classifier symbol is not present on the diagram, it is added as a result of the
created association.
If selected model elements are not compatible with an open diagram, you will not be allowed to
drag those model elements.
Dragging in diagrams
You can drag-and-drop relationships to a diagram. The path for the relationship with shapes at the end
of the path and the path between the shapes (if the shapes at the end of the path are already
represented on the diagram) is created.
You can also drag-and-drop model elements to a note or a text box symbol in a diagram to add a
hyperlink to that element.
• Drag an operation (see page 645) from the Model Browser (see page 29) to a Message (see page 723) in a
Sequence diagram. The Message becomes a Call Message once the operation is assigned.
The Lifeline (see page 713) type must have or inherit this Operation.
• Drag an Activity, Interaction (see page 706), or a State Machine onto an Activity diagram to create a
Call Behavior Action (see page 600).
• Drag a Signal onto an Activity diagram to create a Send Signal Action (see page 605).
• Drag a Signal onto a Send Signal Action to set or change the Signal.
• Drag a Signal onto an Accept Event Action (see page 597) to set or change the Signal.
Once the Signal is assigned to the Accept Event Action, the Signal Event for the diagram
and the Trigger for the action will be created automatically.
Display Related Elements Opens the Display Related Elements All diagrams
dialog in which you can specify the
relation type(s), their direction, scope,
depth, and other options. All specified
criteria define which elements and
relations will be displayed on the diagram
pane of the selected element. Read more
> (see page 476)
Hide All Ports Hides all ports of the selected shape(s) or Class, Composite Structure,
diagram frame. Read more > (see page 459) Component, Package,
Deployment, Object diagrams
Display Pins Opens the Select Pins dialog from where Activity diagram
you can select the exact pins you want to
display on the selected shape. Read more
> (see page 777)
Display Parameter Nodes Opens the Select Parameters dialog Activity diagram
from where you can select exactly which
Activity Parameter Nodes you want to
display on the frame of the Activity
Diagram. Read more > (see page 751)
Display Expansion Nodes Displays the input or output Expansion Activity diagram
Nodes on the Expansion Region border.
Read more > (see page 756)
Display Points Opens the Select Points dialog in State Machine diagram
which you can select which Connection
Point References you want to display on a
submachine State shape. Read more >
(see page 824)
Display Messages Opens the Select Messages dialog from Communication diagram
where you can select which messages of
the selected connector you want to
display. Read more > (see page 742)
Contents
You can display ports, properties, and deep nested properties that have already been created in all
structure diagrams69. This functionality is driven by stereotypes, which allow you to display properties
on which stereotypes (see page 827) have been applied. If you have applied your own stereotypes (see page
827) for the elements (e.g., electrical, mechanical, optical), you can use those stereotypes when selecting
the properties you want to display on the diagram pane.
Note
For more information about how to create custom stereotypes and apply them, see UML
Profiling and DSL Guide (see page 1951).
69 https://docs.nomagic.com/download/attachments/42590148/uml_diagrams.png?
api=v2&modificationDate=1476892380940&version=1
• Preview all Parts (see page 776), Ports (see page 781), and other properties in one place.
• Manually or automatically select required Parts (see page 776), Ports (see page 781), and other
properties you want to display.
• Manually or automatically choose deeply nested (see page 304) Parts (see page 776), Ports (see page 781),
and other properties you want to display.
• Define layout options for Parts (see page 776).
• Specify layout options for Ports (see page 781).
The Display Parts/Ports dialog consists of the following areas:
• Dialog toolbar allows you to show or hide additional information about listed elements.
• Element tree displays all owned internal structure of context Class (see page 633).
• Panel is a context-sensitive area that depends on the selected property from the Element tree. It
allows you to batch select Parts (see page 776)/Ports (see page 781) in the Element tree. You can select
all, clear all, or choose only properties by type, stereotype, or aspect.
• Options area allows you to choose the layout of the selected parts and Ports (see page 781)when
they appear in the diagram.
toolbar, click
and choose Display Parts/Ports.
- Right-click either a diagram frame or single/multiple element shapes, and select Display
> Display Parts/Ports.
70 https://docs.nomagic.com/download/attachments/42590148/uml_diagrams.png?
api=v2&modificationDate=1476892380940&version=1
Warning
If some check boxes are inactive in the element list, those elements are already displayed
in the diagram.
• Use the element tree located on the left side of the dialog:
- Manually select individual check boxes one by one.
- Select recursively nested elements by holding down the Shift key while selecting the
corresponding check box for the element.
Example 1
All properties (socket1, socket2, socket3, powerIn) of the Ee Property are selected
recursively by holding down the Shift key while selecting the corresponding check box
from the element tree in the Display Parts/Ports dialog.
All ports (socket1, socket2, socket3, powerIn) of the Ee Property are selected in the
element tree by using the Select Ports group in the context-sensitive panel of the
Display Parts/Ports dialog.
These commands under the Display button and shortcut menu are comprised of elements that are still
not displayed on the diagram according to their:
• Metatypes.
• Stereotypes.
• Types stereotypes.
The following procedures will show you how to:
• How to display Ports, Properties using the Display button. (see page 465)
• How to display Ports, Properties using the shortcut menu. (see page 465)
• How to hide Ports. (see page 466)
To display Ports, Properties using the Display button
Important
If nothing is selected on the diagram pane, the Display Ports command group will
contain commands that allow you to display two levels of structure: ports are displayed
on the diagram frame and on the first level parts.
- All Properties that are available to display are listed under the Display Properties
command group.
After selecting the required command from the Display button, the appropriate properties are
displayed on the diagram pane.
To display Ports, Properties using the shortcut menu
Important
If nothing is selected on the diagram pane, the Display Ports command group allows
you to display two levels of structure: ports are displayed on the diagram frame and on
the first level parts.
- All Properties that are available to display are listed under the Display Properties
command group.
After selecting the required command from the Display command menu, the appropriate
properties, Ports are displayed onto the diagram pane.
To hide Ports
• Select either a diagram pane or any number of element shapes, and, on the diagram toolbar,
Warning
If the Hide All Ports command doesn't appear, the selection or diagram doesn't contain
any Ports (see page 781)that can be hidden.
71 https://docs.nomagic.com/download/attachments/42590148/uml_diagrams.png?
api=v2&modificationDate=1476892380940&version=1
• How to create a Property shape and how to display all its Ports when dragging the Class element.
(see page 468)
• How to display a Property shape and all its Ports by dragging the Property element. (see page 470)
You can create a new Property by dragging the Class (see page 633)element from the Model Browser (see
page 29)to the Composite Structure diagram (see page 303) pane. The newly created Property will be typed
by the dragged Class (see page 633) and displayed on the diagram pane. If this Class (see page 633) has Ports
(see page 781) defined, you can display them by using the long drag, and selecting an appropriate option
from the opened menu (see Example 3).
• Drag a single or a multiple Class element from the Model Browser onto the diagram pane.
• Drag a single or a multiple Class element from the Model Browser onto the diagram pane, and
hold it down until the Tooltip appears (long drag). Drop it, and, from the opened menu, select the
Create Property Symbol command.
The new Property is created in the model, and displayed on the diagram pane. The newly created
Property is typed by the dragged Class automatically.
To create and display a Property and display all its Ports by dragging a Class element
• Drag a single or a multiple Class element from the Model Browser onto the diagram pane, and
hold it down until the Tooltip appears (long drag).
• Drop it, and, from the opened menu, select the Create Property Symbol and Display All Ports
command.
The new Property is created in the model, and displayed with all its Ports on the diagram pane.
The newly created Property is typed by the dragged Class automatically.
Example 3
After selecting the Create Property Symbol and Display All Ports command, and dragging (long
drag) the Class element to Internal Structure of Workplace diagram pane, it creates a new Property
typed by a Duplex Power Outlet Class and displays all Ports on it.
You can display a Property shape by dragging a Property element from the Model Browser to the
Composite Structure diagram (see page 303) pane. If this property has Ports (see page 781) defined, you can
display them by using the long drag, and selecting an appropriate option from the opened menu (see
Example 4).
• Drag a single or a multiple Property element from the Model Browser onto the diagram pane.
• Drag a single or a multiple Property element from the Model Browser onto the diagram pane,
and hold it down until the Tooltip appears (long drag). Drop it, and, from the opened menu, select
the Create Property Symbol command.
The Property shape is displayed on the diagram pane.
• Drag a single or a multiple Property element from the Model Browser onto the diagram pane,
and hold it down until the Tooltip appears (long drag).
• Drop it, and, from the opened menu, select the Create Property Symbol and Display All Ports
command.
The Property shape is displayed with all its Ports on that shape.
Example 4
After selecting the Create Property Symbol and Display All Ports command, and dragging (long
drag) the Property element to Internal Structure of Workplace diagram, it displays Property shape and
all Ports on it.
The example below shows the p1 Port both before and after displaying its type properties. The
properties displayed on the Port shape are the Pressure Status Flow Property and the suspensionSensor
Part Property, which are the properties of the selected Port type iSuspension Block. After display of
properties has been selected, compartments are automatically enabled for the p1 Port.
• The Composite structure diagram sample model that comes with MagicDraw. To open this
sample do one of the following: download composite structure diagram.mdzip72 or find in
modeling tool <modeling tool installation directory>\samples\diagrams\composite structure
diagram.mdzip.
• The Vehicle parts under ports sample model which is available only with SysML Plugin73. To
open this sample download Vehicle parts under ports.mdzip74.
Contents
You can represent the internal structure of the structured classifier on the diagram pane in all
diagrams. The internal structure of the selected shape can be represented only if the selected element
contains its own internal structure. For example, in a Composite Structure diagram on a Part (see page
776) shape or in a Class diagram (see page 289) on a Class (see page 633) shape, you can display its ports (see
page 781), parts, and connectors.
The following procedure will guide show you how to display the internal structure of a selected
classifier.
1. On the diagram pane, select the classifier shape in which you want to display the internal
structure.
2. Do one of the following:
- Open the selected shape's shortcut menu, click Display > Display Internal Structure, select
the name of the classifier, and then select a diagram containing the internal structure.
- On the diagram toolbar click , choose the Display Internal Structure command, select
the name of the classifier, and then select a diagram containing the internal structure.
After those steps are completed, the internal structure is displayed inside the selected classifier
(see figure below).
72 https://docs.nomagic.com/download/attachments/42586363/composite%20structure%20diagram.mdzip?
api=v2&modificationDate=1478089178031&version=1
73 https://docs.nomagic.com/display/SYSMLP185/SysML+Plugin+Documentation
74 https://docs.nomagic.com/download/attachments/42586363/Vehicle%20parts%20under%20ports.mdzip?
api=v2&modificationDate=1490011099593&version=1
The model used in the figures of this page is the Composite structure diagram sample model that
comes with MagicDraw. To open this sample do one of the following:
Contents
When trying to extend your model or visualize additional elements on the diagram pane, you can
represent symbols that are related to a selected symbol via relationships.This functionality allows for
displaying shapes and paths among those shapes which have already been created in the model.
75 https://docs.nomagic.com/download/attachments/42586363/composite%20structure%20diagram.mdzip?
api=v2&modificationDate=1478089178031&version=1
• Element box (1) shows the name of the selected element shape of which you are going to display
its related elements.
• Relations area (2) lists all relationship types which connect the selected element shape with other
elements.
• Expand Relations area (3) allows you to select the direction of the relationships which you want to
display on the diagram pane.
• Scope area (4) allows you to select the search scope of the elements related to the selected
element.
• Depth area (5) allows you to specify the search range for the selected relationships.
• Always create new symbols option (6) allows you to create a symbol even if a related element
already has a symbol in the diagram.
• Layout related elements option (7) lays out new symbols by using the default diagram layout.
The following procedure will guide you through using the Display Related Elements command and
dialog when you want to represent all related elements via selected relationship types of the selected
Important
The Display Related Elements dialog cannot be opened if the selected element
shape or diagram doesn't contain any related elements.
Example 1
A quicker way to display related elements of the selected shape is to use its shortcut
menu, and select Display > Display Related Elements. The example below
demonstrates the shortcut menu of the Class named Shipment. It is showing the need
to display related elements of the Shipment Class in the Product Shipment object
diagram.
Note
The position of the selected element shape can be changed after selecting the Layout
related elements check box.
Example 2
If you want to layout related elements after the display, but don't want to create new symbols
which are already displayed in the Product Shipment object diagram.
6. Click OK.
According to the specified relationship type, scope, depth, direction, layout, and creation options,
all related elements of the selected shape are represented as shapes and paths on the diagram
pane.
Example 3
Related pages
The model used in the figures of this page is the Inventory Control System sample model that comes
with MagicDraw. To open this sample do one of the following:
Displaying paths
Contents
76 https://docs.nomagic.com/download/attachments/42586363/Inventory%20Control%20System.mdzip?
api=v2&modificationDate=1478093857390&version=1
• Displaying paths only between selected element shapes. (see page 482)
• Displaying all existing paths among the shapes. (see page 482)
The Display In-Between Paths command is available only when two or more
shapes are selected.
The existing paths between selected element shapes are displayed on the diagram pane.
Warning
The paths won't be displayed if:
- The selected shape doesn't have any relationships with the shapes displayed on the
diagram.
- All paths are already displayed on the diagram pane.
Paths to self also will not be displayed.
If you want to visualize how the Workplace Class is related with other shapes displayed on
the diagram pane, you can do so easily by using the Display All Paths command. One way
to reach this command is from the shortcut menu of the selected shape (see the figure
below).
After selecting the Display All Paths command, all paths between the Workplace Class and
other shapes on the diagram pane are displayed (see the figure below). The diagram
shows that the Room consists of between one and an arbitrary number of Workplaces. The
Workplace consists of Electric Extension and Works Station. Also, the Workplace can contain
Duplex Power Outlet, External HDD2, Digital Camera, and External_HDD.
Warning
The paths won't be displayed if:
- The selected shape doesn't have any relationships with the shapes displayed on the
diagram.
- All paths are already displayed on the diagram pane.
Related pages
The model used in the figures of this page is the Composite structure diagram sample model that
comes with MagicDraw. To open this sample do one of the following:
Contents
Modeling tools support all common copying/cutting and pasting functions, as well as advanced copying
and pasting functions. You can copy and paste objects from one project to another. You can find these
options in the Edit menu.
Wind Mac
ows OS
Copy Copies the URL of the selected project element or element symbol to the clipboard
URL (the project element and the element symbol have different URLs). To copy the URL
of an element, select Copy URL from the element shortcut menu in the Containment
tree. To copy the URL of an element symbol, select the the symbol and click Edit >
Copy URL.
You can use URLs to open any elements by clicking the Open Element from URL
command. The element is then highlighted in the Containment tree or in a diagram.
Activating the URL in another application allows you to start MagicDraw, open a
project (if possible), and select any elements. You can paste URLs from the clipboard
to any MagicDraw diagram. Hyperlinks can also hold URLs of any model elements.
Copy Ctrl+S ⌘⇧B Copies the selected shapes to the clipboard. If no shapes are selected, the active
as hift+B diagram is copied. The .bmp image format provides the best image quality. The
BMP image files of this format are typically not compressed, resulting in a large file.
Imag
e
77 http://docs.nomagic.com/download/attachments/9906189/composite%20structure%20diagram.mdzip?
version=1&modificationDate=1478089178031&api=v2
Copy Ctrl+S ⌘⇧E Copies the selected shapes to the clipboard. If no shapes are selected, the active
as hift+E diagram is copied. The .emf format image files are smaller, so using this format
EMF reduces network traffic. Additionally, the .emf format supports language specific
Imag symbols.
e
EMF does not support gradient fill. Because icons of the modeling tool are
stored in the SVG format, it may be exported incorrectly.
To render SVG icons as raster images in EMF, on the main menu, click
Options > Environment > General > Image Export and set the Render SVG
Icons as Raster Images in EMF option to true.
Copy Ctrl+S ⌘⇧J Copies the selected shapes to the clipboard. If no shapes are selected, the active
as hift+J diagram is copied. The .jpg format produces relatively small file sizes, but when
JPG compressing, the .jpg image file loses data, which results in lower quality. Thus, this
Imag format is suitable for final distribution of images, but is not recommended if images
e are to be edited.
Copy Ctrl+S ⌘⇧P Copies the selected shapes to the clipboard. If no shapes are selected, the active
as hift+P diagram is copied. The .png format is best suited for storing images during the editing
PNG process because of its lossless compression. Compared to the .jpg format, the .png
Imag excels when the image has large areas of uniform color. It also works well in online
e viewing applications, such as web browsers.
Windows Mac OS
Paste with New Ctrl+E ⌘E Pastes one or more copied model elements by creating
Data new model elements. Use this command when copying or
cutting owned symbols from one shape to another in a
diagram.
Paste Style Ctrl+Shift+V ⌘⇧V Pastes symbol properties to the selected symbol. You can
copy and paste symbol properties of more than one
symbol at the same time. Symbol properties are pasted
according to the element type. For example, on a class
symbol, the class symbol properties are pasted, and on a
package symbol, the package symbol properties are
pasted, etc.
Contents
2. Select New Horizontal Group or New Vertical Group to split diagram pane and have more than
one diagram opened at the same time.
You can change the Show Tabs in Full Screen shortcut key in the Environment Options
dialog, Keyboard option group.
You can turn off the diagram full screen mode in the same way as turning it on.
The main toolbar is hidden when the diagram full screen mode is turned on. To display the main
toolbar, set the Hide Toolbars in the Full Screen Mode property to false in the Environment Options
dialog, General pane, Display option group.
The diagram toolbar is displayed when the diagram full screen mode is turned on. Right-click the
diagram toolbar to manage it.
Related pages
Contents
• Right - Click on the diagram's window and click on Specification in the drop down menu.
Related pages
There are multiple ways to bring up the dialog, so do one of the following:
Contents
The diagram name and its context name are synchronized automatically.
Create an Activity diagram. Type a name for the Activity diagram, for example, Receive. The
name of the Activity automatically changes to Receive. And conversely - change the name of the
Activity and the Activity diagram name will be changed automatically. This is synchronization of
a diagram name and its context name:
Synchronization works in the following cases:
• Activity and Activity diagram inside.
• Interaction and Communication or Sequence diagram inside.
• (Protocol) State Machine and (Protocol) State Machine diagram inside.
• Class and all available inner diagrams inside.
• In the Environment options dialog, General > Editing options group, cancel the selection of the
Synchronize the diagram name with its contextname option.
Related pages
Contents
All UML diagrams have the content area that is restricted by the diagram frame as it is stated in UML
specification. The diagram frame is primarily used in cases where the diagrammed element has
graphical border elements (like ports for classes and components, entry/exit points on state machines).
By default the diagram frame is displayed on the new diagram pane. The frame is a rectangle in all
diagrams, except state machine and activity. State machine and activity diagram frames have rounded
corners.
• Right-click the diagram and on the shortcut menu, cancel the selection of the Show
Diagram Frame.
• Open the Diagram Properties dialog and set the Show Diagram Frame property to false.
To change the diagram frame properties, do one of the following
• In the Project Options dialog > Symbol styles > Diagram > Diagram Frame options group, change
the desired options.
• In the Diagram Properties dialog > Diagram Frame property group, change the properties.
To hide the icon on the diagram frame
• In the Diagram Properties dialog, change the Show Stereotypes property value to Text.
When a new diagram is created, the diagram stereotype icon is displayed on the diagram frame header
by default, though you can change it to the context stereotype icon.
• In the Diagram Properties dialog > Diagram Frame property group, change the Use
Stereotype property value to Context.
There is a possibility to show the abbreviation of a diagram type instead of the full diagram type in the
diagram frame header.
• In the Diagram Properties dialog > Diagram Frame property group, select the Show
Abbreviated Type check box.
The abbreviated diagram types are listed in the following table.
Use Case uc
Communication comm
Sequence sd
Activity sct
Composite Structure cs
Related pages
Contents
You can change the representation of the diagram shape by changing the diagram stereotype display
mode.
You can also select wether to show or hide the diagram constraints or tagged values on the diagram
shape.
To show diagram stereotype constraints and tagged values on the diagram shape
The Use Stereotype property takes effect only in case the Show Stereotypes property value is
Text and Icon or Icon.
There is a possibility to show the abbreviation (see page 491)of a diagram type instead of the full diagram
type on the diagram shape.
• From the diagram shape shortcut menu, open the Symbol Properties dialog (see page 943) and
select the Show Abbreviated Type check box.
Contents
You can also learn about overviewing diagrams while analyzing the Diagram overview sample.
To open the sample, do one of the following:
• On the Welcome screen, select Samples and then in the Product Features section click
Diagram overview.
• Go to <MagicDraw installation directory>\samples\product features and open the diagram
overview.mdzip file.
As of version 17.0 you can overview other diagrams, including dependency matrices, tables, and
relation maps, on a diagram pane. Use the diagram overview shape in order to do that.
Read and learn how to use the diagram overview shape in the following sections:
How to...
This section gives some remarks that can be useful when struggling to arrange sizes of your diagram
overview shapes.
Solution
• For both diagram overview shapes set the Fit Content to the Shape Area property value to
false.
• For both diagram overview shapes set the Autosize property value to false.
• Make both diagram overview shapes of preferred size.
• Make both diagram overview shapes of the same height (or width) by dragging corners of the
shape areas.
• Set the Fit Content to the Shape Area property value to true for this diagram overview shape.
• Set the desired shape content size by dragging corners of the shape area.
• Set the Fit Content to the Shape Area property value to false for this diagram overview shape.
If you want to reset the shape sizes to ratio zoom 1:1, do one of the following:
• Set for the diagram overview shape the Autosize property value to true.
• Make the diagram overview shape of the preferred size.
Related pages
Contents
You can use one of the following ways to create a diagram overview shape:
• Drag the diagram shape from the Model Browser and change it into the diagram overview
shape afterwards. This way created diagram overview shape shows the full content of the
corresponding diagram and is updated automatically according to all changes made in this
diagram.
• Use the Diagram Overview button that is located in the diagram pallet. This way
created diagram overview shape shows the full content of the corresponding diagram and is
updated automatically according to all changes made in this diagram.
• Paste a copied part of the diagram’s content using a special command from the main
menu. This way created diagram overview shape shows any copied part of the corresponding
diagram’s content and is updated automatically according only to the changes made in this copied
part. Note that this way cannot be used for dependency matrices, tables, and relation maps, as it
To create a diagram overview shape by dragging it to the diagram pane
1. Open a diagram wherein you want to create the diagram overview shape.
2. In the Model Browser (see page 29) select a diagram you want to overview.
3. Drag the diagram shape to the open diagram pane.
If you cannot drag the diagram shape to the open diagram pane when working with a
teamwork project, make sure you have the right to edit model of this project and then try
to lock for edit this diagram.
4. Make the diagram shape show the full content of the corresponding diagram by doing one of the
following:
• Right-click the diagram shape and from the shortcut menu select Symbol Properties (see
page 943). In the open dialog, set the Show Diagram Overview Content property value
• Click the diagram shape and on the smart manipulator toolbar select the button.
The diagram shape will be changed to the diagram overview shape that shows the full
content of the corresponding diagram.
1. Open a diagram wherein you want to create the diagram overview shape.
2. On the diagram pallet, click the Diagram Overview button that is located within the Common
buttons group. The Select Diagram dialog is open.
If the diagram pallet is inactive within a teamwork project, make sure you have the right
to edit model of this project and then try to lock for edit this diagram.
3. Select a diagram for which you want create a diagram overview shape and click OK.
4. Click a free space of the diagram pane.
To create a diagram overview shape by pasting any part of diagram’s content
The content will be updated automatically according to the changes made in the copied
part of the corresponding diagram only.
Related pages
Contents
Once the diagram overview shape is created, you can modify its content: add more element shapes or
remove no more needed ones by using the Compartment Edit dialog.
• From the diagram overview shape shortcut menu, select Edit Compartments.
• Select the diagram overview shape, click the “...” Compartments button and from the menu,
select Edit Compartments.
To modify the content of the diagram over view shape
1. In the Compartment Edit dialog, use the >, >>, <, and << buttons to move the items among the
Hidden and Selected lists.
2. Click OK when you are finished.
Related pages
2.4.13 Legends
Contents
A Legend is a model element allowing to define the styles of diagram symbols and table rows. It helps
you to visually group model elements according to specified criteria. Use Legends to increase the
readability of diagram and table contents by highlighting important information, e.g., specific element
property values or statuses. In Addition, the styles applied to model elements are dynamically updated
For more information about working with Legends, see the following pages:
Contents
On this page
You can create a Legend right in a diagram or table where you want to use it. After creating a Legend,
you also have to create its Legend Items (see page 503). If you want Legend Items to be created and
specified for you, create Legends automatically (see page 515).
After creating a Legend, use the smart manipulator on the Legend shape to create Legend Items (see
page 503).
In a table, a Legend is displayed as a bar right above the table. After creating a Legend in a table, the
Specification window of the newly created Legend opens allowing you to create Legend Items (see page
503).
The model used in the figures of this page is the Legends sample model that comes with SysML plugin.
To open this model do one of the following:
• Download legends.mdzip78.
• Open the model from the <modeling tool installation directory>\samples\SysML directory.
Related pages
Contents
On this page
78 https://docs.nomagic.com/download/attachments/42586363/legends.mdzip?
api=v2&modificationDate=1488812669828&version=1
1. In a diagram, select the shape of the Legend for which you want to create a Legend Item.
2. Click the smart manipulator on the top right corner of the Legend shape, highlighted in the figure
below.
3. In the Specification window (see page 882) of the newly created Legend Item, specify its properties
(see page 506).
4. Close the Specification window.
The newly created Legend Item is displayed in the Legend shape and applied to diagram symbols
according to the properties you specified in the Applied To property group (see page 511).
1. Open the Specification window of the Legend for which you want to create a Legend Item by
doing one of the following:
• In a symbol diagram, double-click the shape of the desired Legend.
• In a table, hover the mouse pointer over the desired Legend, click and select
Specification.
2. Click the Legend Items group on the left side the Specification window.
3. Click the Create button.
4. In the open Specification window of the newly created Legend Item, specify its properties (see page
506).
5. Close the Specification window.
The newly created Legend Item is displayed in the Legend and applied to diagram symbols or table
rows according to the properties you specified in Applied To property group (see page 511).
The Legend Item management area is displayed on the right side of the Specification window. The
following table explains how to use the buttons found there to create and modify Legend Items.
Button Description
name
Up Select a Legend Item and click the button to move the Legend Item one position up in the list.
Down Select a Legend Item and click the button to move the Legend Item one position down in the list.
Create Click the button to create a Legend Item. The Specification window of the newly created Legend
Item opens automatically, allowing you to specify its properties.
Clone Select a Legend Item and click the button to create its copy. The Specification window of the newly
created Legend Item clone opens automatically, allowing you to modify its properties. By default,
the clone inherits all property values of the Legend Item from which it was cloned.
Delete Select a Legend Item and click the button to remove it.
Related pages
Contents
On this page
• Fill color
• Text color
• Shape or path line color, style and width
• Icon and icon position on shape or path
Table adornment
If you specify Legend Item adornment for the Legend that is applied to a table, you should only
specify the Fill Color property. Other adornment properties, e.g., Icon, Pen Color or Line Style,
are not applied to table rows.
You can specify the adornment properties of a Legend Item in the Adornment Properties dialog.
Example
Specifying Icon
When specifying the Icon property:
• Click to select an image from the Image Library of your modeling tool.
• Click to select a custom image from the local file system.
• Click to specify the URL of an image.
If you followed the above steps, you have a Requirements Diagram with the Status and Risk Legends
applied to it. The Legend Items of both Legends do not conflict when applied to the same shape, as
shown below.
Related pages
On this page
Important
You can specify either the Specific Elements or the Elements by Condition property of a
Legend Item, but not both.
Example
Let's say that you want to apply a Legend Item to all requirements that have a high risk level. The
quickest way to do it is to create a Property Test operation. Follow the steps bellow to analyze this
specific use case and define the Elements by Condition property for the Legend Item:
1. Open the Specification window of a Legend Item, select the specification cell of the Elements by
Condition property, and click .
2. In the Element by Condition dialog, click next to the Element Type box.
3. In the Select Element Type dialog, select the Requirement type, and click OK.
4. In the Property Test operation specification area of the Elements by Condition dialog, select the
risk property and set its value to High.
Default options
By default, the Language is set to StructuredExpression, and the Property Test
operation is selected in the Elements by Condition dialog.
Adorned Properties
The Adorned Properties property of a Legend Item is only effective if you use the Legend in a
table.
Example
Let's say you have a Requirements Table with three columns: Name, Text and Risk., and you want to
apply two legends in that table: Risk and Status. When you create or use a Legend in a table, Legend
Item adornments are normally applied to enitre table rows. So in this case, you also have to specify
certain element properties (table columns) to which Legend Items of each Legend should be applied. To
reproduce this spesific use case, follow these steps:
1. Create a Requirement Table with the Name, Text and Risk columns.
2. In the table, create a Legend (see page 501) to indicate the risk level of Requirements and name the
Legend Risk.
3. Create and define the Legend Items for the Risk Legend by completing the following steps:
a. Create three Legend Items (see page 503) indicating three possible Requirement risk levels
and name them High, Medium, and Low.
b. Open the Specification window of the first Legend Item.
c. Specify the Legend Item adornment by selecting the desired Fill Color.
d. Specify the Elements by Condition property (see page 511) by creating a Property Test
operation and selecting the Risk property value the Legend Item represents.
e. Specify Adorned Properties property by selecting the Risk property as its value.
f. Repeat the steps from b. to e. with the rest of the Legend Items.
4. In the same table, create a legend intended to show the status of Requirements and name the
Legend Status.
5. Create and define the Legend Items for the Status Legend by completing the following steps:
a. Create four Legend Items indicating four possible Requirement status values and name
them Closed, Approved, Disapproved and In Progress.
b. Open the Specification window of the first Legend Item.
c. Specify the Legend Item adornment by selecting the desired Fill Color.
d. Specify the Elements by Condition property by creating a Property Test operation and
selecting the Status property value the Legend Item represents.
e. Specify Adorned Properties property by selecting the Name and Text properties as its
values.
f. Repeat the steps from b. to e. with the rest of the Legend Items.
After following the above steps, you have a Requirements Table with the Status and Risk Legends
applied to it. The Legend Items of both Legends do not conflict because they are applied to different
columns of the table, as shown below.
Contents
You can create Legends automatically by extracting them from model elements. When you create a
Legend automatically, main Legend properties, such as Name and Legend Items, are specified for you.
The property values of an automatically created Legend are extracted from the stereotype tags of the
selected element. If you want to create and specify Legend Items by yourself, create Legends manually
(see page 501).
Alternative methods
You can also access the Extract Legends command by right-clicking the actual element
in the model browser. But in this case, you have to apply the Legend to desired diagrams
by yourself.
3. In the Select Tags dialog select the stereotype tag from which you want to generate a Legend.
You can also select multiple tags to generate multiple legends at once.
4. Click OK.
The Legend is automatically displayed and applied to the diagram. The name of the selected tag is used
as the Legend name, and every possible tag value creates an individual Legend Item.
Example
Let's say that you want to extract the Legend identifying different Risk property values of Requirements
in your model. To do this, complete the following steps:
1. Open the Requirement Diagram in which you want to create the Legend identifying different
Requirement risk values.
2. Right-click the shape of any Requiremenn and select Tools > Extract Legends.
3. In the Select Tags dialog select the risk tag of the «extendedRequirement», as highlighted in the
figure below.
4. Click OK.
The Risk Legend is automatically displayed and applied in the Requirements Diagram. The name of the
tag is used as the Legend name, and every possible Risk property value creates an individual Legend
Item.
The model used in the figures of this page is the Legends sample model that comes with SysML plugin.
To open this model do one of the following:
• Download legends.mdzip79.
• Open the model from the <modeling tool installation directory>\samples\SysML directory.
Related pages
79 https://docs.nomagic.com/download/attachments/42586363/legends.mdzip?
api=v2&modificationDate=1488812669828&version=1
Contents
On this page
The actions described above remove a Legend from an open diagram or table and Legend Item
adornments are no longer applied to the relevant diagram shapes or table rows.
Example
Let's say that you want to apply the adornments of a Legend to all Requirement Diagrams and one
specific Requirement Table of your model. To do this, follow these steps:
After completing the above steps, the Legend adornments are applied to all Requirement Diagrams and
the selected Requirement Table. By specifying the Diagrams by Condition property, you also ensure
that the Legend adornments will be automatically applied to newly created Requirement Diagrams as
well, because they meet the defined condition.
Related pages
Contents
On the diagram, you can display a table containing various diagram details: its name, author, status, the
dates it was created and modified, etc. By default, the Diagram info table is displayed at the right top
corner of the diagram frame, but you can drag and drop it to any other position on the diagram.
• Diagram name
• Author
• Creation date
• Modification date
• Last Modified by
• Other available tag definitions
To show the table containing the diagram information
Diagram Elements
Diagram elements are not converted.
1. Select one or more, of the same type, diagrams in the Model Browser (see page 29) (Containment or
Diagram tree).
80 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Block+Definition+Diagram
Contents
https://www.youtube.com/watch?v=9tPfgYQLNd0
1. On the diagram pallet, under the Tools category, click the Sticky button or press Z.
2. From the diagram pallet, select an element button.
3. Click the diagram pane. With each click, the new element of the same type is drawn.
• In the Specification window (see page 882), Name property specification cell, type the element
name.
• Type the symbol name directly on the selected symbol on the diagram pane.
• In the Model Browser (see page 29), select an element and name it.
To draw several symbols for one element, do one of the following
• In the Model Browser (see page 29), select an element and drag it to the diagram pane. Repeat it if
needed.
• On the diagram pane, select a symbol, copy and then paste by pressing Ctrl+C and Ctrl+V.
To resize selected shapes to a preferred size automatically
• Click the shape and then click the Make Preferred Size smart manipulator.
Note that the smart manipulator is always displayed on any of the visible borders. Just select
the shape, and the manipulator appears at the right of the shape’s horizontal border or at the
bottom of the vertical shape’s border.
• In the Symbol Properties dialog > Text Vertical Position, select one of the following:
• Top
• Center
• Bottom
The model elements will be removed from the model with all their data.
To delete selected symbols, do one of the following
Contents
The difference between relationship and paths (see page 2188) is that a relationship is a link between
model elements while the path is a representation of the relationship on a diagram.
You can learn how to work with paths and relationships in the following pages:
Related pages
Creating a relationship
You can create the relationships between shapes in one of the following ways:
• When drawing a new path the optimal route is chosen automatically (path avoids
other shapes).
• When drawing a path between two elements, those shapes are bordered with a
red or blue rectangle. The red highlight indicates that the path can not be drawn
between these shapes. The blue highlight allows a path to be drawn. You can
disable this highlighting in the Environment Options dialog under the Diagram
node by setting the Show Manipulation Highlighting property value to false. For
more information, see Customizing environment options (see page 64).
• To draw a path faster use smart manipulator toolbar (see page 536).
1. In the Model Browser (see page 29), diagram pane, or table right-click an element.
2. Choose Create Relation > Outgoing / Incoming and select the desired relationship type. The
Create New <relation name> To / From dialog opens.
3. Do one or more of the following:
• In the Model Browser, click the element to / from which you want to create a relationship.
• On a diagram, click and element to / from which you want to create a relationship.
• In the Create New <relation name> To / From dialog, click . In the opened
Create New <relation name> To / From dialog, choose the element to / from which you
want to create a relationship.
If you do not know the exact location of the needed element, you can search for it
in this step.
4. Click OK.
The multiple selection works in one area at a time. For example, diagram pane, table, matrix, relation
map, or Model Browser. If you need to select elements from several locations, you need to pin your
current selection.
The Pinned Selection area show the elements you choose to pin from the Active Selection. This is
needed when you want to select elements from different locations (for example, you need to select
elements from different diagrams, or from the diagram and Model Browser). In this case, you should
pin each selection.
Removing a relationship
To remove a relationship from the diagram pane
• Right-click a path(s) on the diagram pane and select Reset Labels Positions or Remove Break
Points.
• Select a path(s) on the diagram pane and on the diagram toolbar, click , , or .
• Select a path(s) on the diagram pane and on the Edit menu click Paths, and then choose one of
the following:
• Path Style to select one of the path styles - rectilinear, oblique, or bezier.
• Change Path Style (shortcut keys Ctrl+L) to change the path style to rectilinear, oblique, or
bezier.
• Reset Labels Positions to reset the changed path labels position to default.
• Remove Break Points to remove all angles of the path.
Routing paths
To route paths using the Route Paths Rectilinearly button, do either
• Select a path on the diagram pane and on the smart manipulator toolbar, click . The selected
path is routed rectilinearly.
• Select a shape on the diagram pane and on the smart manipulator toolbar, click . All the
paths that are connected to the shape are routed rectilinearly.
• Horizontal Line - specifies that line jumps appear only on horizontal line.
• Vertical Line - specifies that line jumps appear only on vertical line.
The line jump changes are applied for the current diagram only. How to change line jumps for
the whole project, see Formatting symbols (see page 943).
This functionality is available in the State Machine (see page 294) and Activity (see page 296)
diagrams.
In the State and Activity diagrams you can split a path into two paths, by dropping a shape on it. This is
valid for Transition/ Control Flow/ Object Flow relationships and allowed to connect with these path
elements.
For example: Password read transition is drawn from Read Name State to Verification
State. If you want to insert the Read password State before the Password read Transition,
drop the Read password State on the Transition and in the Split Transition dialog, choose
the Before Transition button.
• After Transition button. The shape is inserted before path. It means, the existing path is created,
then the dropped element symbol is drawn, and then a new path is drawn.
In the Split Transition dialog, select the Remember my choice check box and the next time
the shape will be inserted before or after the path, depending on your selection made this
time.
Path compartments
Contents
Use the Compartment Edit dialog to control the list of elements and properties visible in
compartments on paths (see page 2188).
1. Open the Compartment Edit dialog. How to > (see page 533)
2. In the Compartment Edit dialog, select the tab for the items you want to show or hide.
3. Do the following:
- Move items from the Hidden area to the Selected area to display them in path compartments.
- Move items from the Selected area to the Hidden area to hide them in path compartments.
When you edit compartments of more than one path at once, the Compartment Edit dialog works
with the following rules:
• If you select multiple paths of the same element, the Compartment Edit dialog is the same as
for a single path, but changes are applied for all selected paths after clicking OK.
• If you select multiple paths of different elements, the Compartment Edit dialog shows a union
of compartments and their items.
• If you select multiple paths but at least one of them hides the common compartment item while
another shows it, the Compartment Edit dialog displays that item in italics in the Element
Properties tab > Selected area. If you move the conflicting item to the Hidden area, it becomes
non-italicized and changes are applied for both paths after clicking OK.
Contents
https://www.youtube.com/watch?v=dptM-r2LIwg
Smart manipulation is a feature designed to make modeling with MagicDraw diagrams easier. Use
smart manipulation to display or suppress compartments, create elements, set an auto-size option,
reset a label position on a path, and draw relationships with most commonly used elements.
MagicDraw offers varying smart
mechanisms depending on the shapes involved.
Related pages
Smart manipulators
Small buttons are displayed on the borders of a symbol on the diagram pane.
In the smart manipulator toolbar, buttons are divided into standard and extra modes. You can toggle
between these two modes by clicking the Expand button - the arrow symbol - located at the bottom of
every smart manipulator toolbar. Your choice will be remembered for all elements.
Use the smart manipulator toolbar to perform simple actions and create new elements quickly.
1. From the selected element's smart manipulator toolbar, select the relationship that you want to
draw.
Create a class symbol. In the class smart manipulator toolbar, select the Directed
Association relationship for drawing. The drawing of this Directed Association
relationship is initiated and the mouse cursor displays a class icon. Click the left mouse
button. The element displayed on the mouse cursor is created together with the
relationship.
2. Right-click the mouse button and select the element from the list to be created at the end of the
relationship you are drawing.
• To create a path breakpoint use the following keyboard combination: Ctrl key + Mouse
click.
• To cancel the drawing of an element, press Esc.
1. Select the element with an incorrect ownership on the diagram pane (it is highlighted in red). The
smart manipulator toolbar appears.
2. Click the red button at the top of the smart manipulator toolbar. The menu with the possible
problem solving solutions appears.
1. From the Options menu, select Environment. The Environment Options dialog opens.
2. In the Diagram options group, Smart Manipulators category, click to cancel the selection of the
Show Smart Manipulators check box.
3. Click OK.
2.4.19 Compartments
Contents
The compartment is area on the shape or next to the shape that is dedicated for the specific type of
information.
• Compartment boxes. For example, the class shape has compartments which puts attributes,
operations, signals into boxes.
• You can hide compartments by suppressing them or expand the hidden compartments
to see their data.
• Compartment names are displayed by default. However, you can hide them by changing
their visibility settings either in the Symbol Properties dialog or the Project Options
dialog. Each compartment has its own property for visibility settings (for example, Show
Attributes Compartment Name).
• Stereotypes (or stereotypes compartment) are displayed above the element name.
• Constraints (or constraints compartment) are displayed under the element name.
• By default, tagged values are displayed under the element name or you can select to
display tagged values in the compartment box.
• Element Properties are displayed in the compartment box.
• Compartments that are displayed next to the element name, next to the shape. For example, an
Actor has a compartment for element properties, a compartment for stereotypes, behaviors, and
others.
• Compartments on paths that are displayed next to the path label. For example, a compartment
for element properties, a compartment for stereotypes, and others.
Related pages
• On the diagram, select a shape and click the Create Element smart manipulator. Then in the
menu, select the element that you want to create.
• On the diagram, select a shape. Then next to the particular compartment, click the Create
<element name> smart manipulator.
• On the diagram, click the shape and click the Compartments smart manipulator. Then select or or
cancel the selection of the particular compartment, for example, Attributes, Operations.
The Compartments smart manipulator exists on shapes that have the compartment
boxes. For example, pins, initial nodes do not have the Compartments smart
manipulator.
• On the diagram, right-click the shape and select Symbol Properties. Then select or cancel the
selection of the Suppress <compartment name> check box.
You can also display or hide the element specification properties, such as Name, Is Active, Owner, To Do
in the Compartment Edit dialog under the Element Properties tab.
• Select shape and click the Compartments smart manipulator. On the menu, click the arrow to
expand and then select Edit Compartments.
• Right-click a single or any number of shapes or classifier compartments (e.g. Properties,
Operations, Receptions, Ports, and etc.) and from the shortcut menu, select Edit Compartments.
• On the Note shape, click the Edit Element Properties smart manipulator.
Contents
• Drawing a shape from another shape using a path from smart manipulator. The size of the new
shape is the same as the size of the shape from which you draw a path. Note that this is valid if
the source shape is not large, for example, if it is not more than 3 times larger than the new
shape.
• Inserting a new shape into the flow in the activity or state diagram. The size of the newly inserted
shape is the same as the size of the existing shape.
Related pages
Contents
To select a shape
• Press and hold the Alt key, and click one shape
• Select a shape on the diagram pane and holding down Shift, select as many shapes as you need.
• Drag the cursor diagonally across the area you wish to select.
• Drag the cursor diagonally across the area you wish to select.
This is a simple and fast way to select a group of shapes on the diagram.
1. Partial coverage. Symbols which are only partly covered with the rectangular selector are
selected.
2. Complete coverage. Only those symbols that are fully covered by the rectangular selector are
selected.
To change the group selection mode from Partial coverage to Complete coverage mode and vice versa
• Press Ctrl and drag the cursor diagonally across the area you want to select.
To change the group selection mode for the whole project, do one of the following
• In the main diagram toolbar, click the Complete coverage mode for group selection button.
• In the Environment Options dialog, Diagram > Symbols Manipulation group, change the
property of the Group selection mode option.
Related pages
Contents
You can copy the text or images to a diagram. The copied text or image is pasted into a text box or an
image shape. MagicDraw supports the HTML and plain text, and images of gif, jpg, svg, and png image
file types. This copy and paste functionality allows you to drag and drop data from other applications,
for example, web browsers.
Contents
You can now drag an image to any elements in a diagram as nested a element.
2.4.24 Zooming
Contents
Zooming allows to select a particular part of a diagram, zoom in, and make changes while working with
a finer level of detail. You can also gain an overview of a diagram by zooming out.
The Diagram Zoom Slider, located in the right bottom of the modeling tool helps you with the zooming
options. You can hide the slider if you do not need it.
• From the diagram shortcut menu, select Fit in Window (shortcut keys Ctrl+W). The same is valid
from the View menu.
• At the right bottom of the modeling tool, click the Fit to Window button.
• In the Model Browser > Zoom tab, click Fit to Window.
• In the main menu, click View and select Zoom Out (shortcut keys Ctrl+NumPad - or scroll).
• At the right bottom of the modeling tool, click the Zoom Out button.
• In the main menu, click View and select Zoom 1:1 (shortcut keys Ctrl+NumPad /).
• At the right bottom of the modeling tool, click the Zoom 1:1 button.
• Select the shapes and from the View menu, select Zoom to Selection (shortcut keys
Ctrl+NumPad *).
• In the Environment Options dialog, Diagram options group, change the Zoom Step Size
property. The maximum number is 1.0 (you can zoom a diagram twice.)
You can also zoom the diagram in or out using the zoom tab (see page 52) in the Model Browser.
Related pages
Contents
The grid helps to arrange diagram symbols on the diagram pane. By default, the grid is not visible.
• From the main menu, select View > Grid > Show Grid.
• From the diagram shortcut menu, select Grid and select Snap Paths to Grid. The same is valid
from the View menu.
To snap the shapes to gridlines
• From the diagram shortcut menu, select Grid and select Snap Shapes to Grid. The same is valid
from View menu.
To change the grid size
1. From the diagram shortcut menu, select Grid > Grid Size. The Grid Size dialog opens.
1. From the Options menu, select Environment. The Environment Options dialog opens.
2. From the Grid Style drop-down list, select one of the following styles:
• Dense
• Sparse (default)
Related pages
Contents
This feature allows for rearranging element symbols on a diagram easily. Pusher moves a group of
symbols towards the pushing direction thus creating an empty space for adding new symbols to a
diagram.
Magnet works in the opposite way. It moves the selected group of symbols to an empty space on a
diagram.
Now you do not need to select separate symbols on a diagram to move them to another location. Just
click the Pusher or Magnet button on the diagram palette and move the whole group of symbols
toward the direction you need.
2.4.27 Layout
Contents
The diagram layout engine is available in Standard, Professional, Architect, and Enterprise
editions.
It is easy to manage simple or complex diagrams using the automated layout features that optimize
diagram layout.
MagicDraw automatically layouts symbols on diagrams when displaying related elements, creating
diagrams by using wizards, when creating related diagrams.
You can layout diagrams quickly by using the Quick Diagram layout. The quick layout is a recommended
type of layout, and it is specific for each diagram.
The layout mechanism is built on various layout tools. There are 2 groups of layout tools: general layout
tools and specific diagram layout tools. These are the general layout tools:
• Orthogonal Layout
• Hierarchic Layout
• Organic Layout
• Tree Layout
• Circular Layout
• Oblique Path Router
• Rectilinear Path Router
These layout tools are provided by yFiles layout tool component. You can arrange each diagram (except
Sequence diagram) by using any of the following general layout tools:
If labels are at their default position, reset labels position functionality is not available.
For a nicer representation of labels in a diagram, the label positions are reset to default automatically if:
• Select a label and begin to move it. The dashed line shows the deviation from the default
position. This helps to show the current label's owner.
When the label is not in its default position, you may indicate it by the icon on the bottom right
corner, which appears after selecting the label's owner.
• Hierarchic Layout.
• Class Diagram Layout.
• Composite Diagram Layout.
• Activity Diagram Layout.
• State Machine Diagram Layout.
• Business Process Diagram Layout.
• Ordered Hierarchic Layout.
In order to do this, you must specify the Label consideration mode (Full, Partial, or None) in the
Diagram Layout Options dialog.
1. From the diagram toolbar, expand and select Layout Options command.
2. On the left side of the dialog, select one of the following layout style:
- Under the General Layout group, select Hierarchic Layout.
- Under the Specialized Layout group, select any layout style:
• Class Diagram Layout.
• Composite Diagram Layout.
• Activity Diagram Layout.
• State Machine Diagram Layout.
• Business Process Diagram Layout.
• Ordered Hierarchic Layout.
3. On the right side of the dialog, find the Label consideration option.
4. Click on the value of this option and select one of the following modes:
• None - does not consider any labels, does not increase the shape size.
• Partial - considers only the center path labels, does not increase shape sizes by labels.
• Full - considers all labels, creates additional space for them and increases the shape sizes.
5. Click the Layout button.
6. Click OK.
Contents
On this page
1. In an open diagram, select one or several labels that you want to rotate.
2. Do one of the following:
• In the diagram toolbar, click to change the label orientation from horizontal to vertical
or vice versa.
• In the diagram toolbar, click the arrow next to and from the menu select the desired
label orientation option: Horizontal, Vertical, or Automatic.
The labels are rotated to the selected position. If you select the Automatic label orientation option,
labels are rotated according to the position of shapes or paths they are on.
1. In an open diagram, select the path or shape on which you want to rotate labels.
2. Do one of the following:
The labels on the shape or path are rotated to the selected position. If you select the Automatic label
orientation option, labels are rotated according to the position of the shape or path.
The labels of newly created symbols in the diagrams of a project will be displayed according to your
selected property values.
Contents
You can save an image as an active diagram, selected symbols, or selected diagrams.
Diagrams and symbols that were created in the model can be saved as images in the following formats:
To save an image
1. Open the diagram you want to save as an image. If you want to save only particular symbols,
select them on the diagram.
2. On the main menu, select File > Save as Image. The Save As Image dialog (see page 553) opens.
3. In the dialog:
• Select whether to save an Active diagram, Selected symbols, or Selected diagrams.
Selected diagrams
Selected diagrams allow you to search for a particular diagram (see page 996) in
your model.
Related pages
Contents
The view of the Save As Image dialog when the Selected diagrams option button is selected.
Active diagram Option button Select to save as image the currently active
diagram. The active diagram name is displayed in
brackets next to the option button name.
Selected symbols Option button Select to save as image specific symbols that are
selected in the diagram. The option is active only
if one or multiple symbols are selected in the
diagram.
Selected diagrams Option button Select the option in order to save as image the
selected diagrams in the model tree or diagram
list.
Select diagrams Text box The text box is available only if the Selected
diagrams option button is selected.
Image File / Working Text box Select the working directory in which the image
Directory will be saved.
Options Button Click to open the Properties dialog (see page 556)
where you can specify image export properties,
such as image resolution and exported image
size. The properties provided in the Properties
dialog depend on the selected image format.
Overwrite existing files Check box Select to overwrite already saved image files.
Rrelated pages
Contents
In the Properties dialog, you can specify image export properties specific to the image format selected
in the S (see page 553)ave (see page 553) A (see page 553)s (see page 553) Image (see page 553) dialog. For example, if
the selected image format is .jpg, or .jpeg, the Properties dialog allows you to specify JPEG compression
quality, image resolution (DPI), and exported image size.
Related pages:
Contents
The layout templates functionality, which is driven by <<layoutTemplate>> stereotype, assists you in
creating well-formed diagrams. It allows you to define Class appearance once, and reuse it later when
creating Parts typed by that Class and Ports in different diagrams. Parts (see page 776) and their Ports are
represented identically as part's type Class (see page 633) whose layout and style is defined in the layout
template diagram. Often, Port position reflects its physical location in the system, so it is beneficial
to maintain the same appearance of Parts, layout, and style of Ports throughout the whole model. In
the figure below, the appearance of the Modem Card Block is the same in two different diagrams, SysML
Block Defiition diagram81 and SysML Internal Block diagram82.
Additional information
You can reuse layout templates in other projects by exporting packages to new projects. (see
page 235)
81 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Block+Definition+Diagram
82 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Internal+Block+Diagram
To define a layout template in the Class Diagram and apply it to other diagrams:
1. Define the appearance of Class, layout, and style of its Ports in the Class diagram. (see page 559)
2. Set that Class diagram as the layout template. (see page 560)
3. Apply the layout template to other diagrams. (see page 565)
To derive a layout template for the Composite Structure Diagram and apply it to other diagrams:
1. Specify whether layout templates are created as Class Diagrams or Composite Structure
Diagrams. (see page 563)
2. Create a layout template from a Part Property in the Composite Structure Diagram. (see page 562)
3. Apply the layout template to other diagrams. (see page 565)
Important
Only one Class shape with its Ports can be defined in one layout template diagram.
Related pages
The sample models used in the figure of this page are Modem Cable that comes with SysML Plugin84.
To open those samples properly you need to install the SysML plugin85 in the MagicDraw and download
Modem Cable Layout Templates.mdzip86.
Contents
If you want to reuse the style and layout of Class with its Ports in another diagram, you need to define
the appearance of the Class, the style, and position of its Ports in the Class diagram. It means that you
define a new layout template. When defining the appearance of the Class, you can change its color,
font, size, layout, and other style properties. To do this, follow the procedure below.
Important
Only one Class shape with its Ports can be defined in one layout template diagram.
1. Create the Class diagram. How to create diagrams > (see page 450)
2. Create a new or represent an existing Class with its Ports on the diagram pane.
3. Specify the appearance of all shapes by using the Symbol Properties dialog (see page
943) and diagram toolbar (see page 24).
4. Set the positions of Ports on Class shape manually.
The appearance of Class and its Ports shapes are defined (see the figure below).
83 https://docs.nomagic.com/display/MD190SP2/Stop+using+Class+diagram+as+a+layout+template
84 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
85 https://docs.nomagic.com/display/NMDOC/Installing+plugins
86 https://docs.nomagic.com/download/attachments/42586363/Modem%20Cable%20Layout%20Templates.mdzip?
api=v2&modificationDate=1481817717837&version=1
Sample model
The sample models used in the figure of this page are Modem Cable that comes with SysML Plugin87.
To open those samples properly you need to install the SysML plugin88 in the MagicDraw and download
Modem Cable Layout Templates.mdzip89.
Contents
87 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
88 https://docs.nomagic.com/display/NMDOC/Installing+plugins
89 https://docs.nomagic.com/download/attachments/9915051/Modem%20Cable%20Layout%20Templates.mdzip?
api=v2&modificationDate=1481817717837&version=1
1. Open the Class Diagram that you want to set as layout template.
2. Do one of the following:
• Right click the diagram and select Display > Layout Template > Use as Layout Template.
• Ensure that nothing is selected on the diagram pane (see page 24), then in the diagram
toolbar, click and select Layout Template > Use as Layout Template.
The «layoutTemplate» stereotype appears on the diagram header (see the figure below).
Sample model
The sample models used in the figure of this page are Modem Cable that comes with SysML Plugin90.
To open those samples properly you need to install the SysML plugin91 in the MagicDraw and download
Modem Cable Layout Templates.mdzip92.
90 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
91 https://docs.nomagic.com/display/NMDOC/Installing+plugins
92 https://docs.nomagic.com/download/attachments/9915051/Modem%20Cable%20Layout%20Templates.mdzip?
api=v2&modificationDate=1481817717837&version=1
1. Create a Composite Structure Diagram with Part Properties and their Ports or open an existing
one.
2. Right click the Part Property the the layout of which you want to reuse and select Display >
Layout Template > Create Template.
A layout template is created as the Class or Composite Structure Diagram depending on the layout
template creation mode (see page 563) (see the figure below).
Creating a layout template from the SysML Internal Block Diagram (Composite
Structure Diagram in a UML project).
1. In the main menu of your modeling tool, select Options > Project.
2. On the left side of the Project Options dialog, expand the General node and select the General
option group.
3. Click the specification cell of the Layout Template Creation Mode option on the left side of the
dialog and select one of the following values as shown below:
• Usage - if you want to create layout templates as Composite Structure Diagrams.
The «layoutTemplate» stereotype disappears from the header of the diagram, and it can no longer be
applied as a layout template.
Contents
If you want to use the layout template in another diagram (usually the Composite Structure diagram),
the following conditions must be met beforehand:
• The Part must be typed by the Class or subtype of Class in the Composite Structure diagram.
• The appearance of the Part type Class or subtype of Class must be defined in the Class diagram.
• That Class diagram must be set as the layout template.
You can apply layout templates directly from the diagram toolbar or shape's shortcut menu by using
the Apply Template command. This command provides different suggestions in the following
situations:
• Apply Template without drop-down arrow appears when only one layout template is available
for the selected element.
• Apply Template with drop-down arrow appears when multiple layout templates are available for
the selected element. The multiple layout templates are listed according to the following rules:
If you set the default layout template, it is always the first on the list, and other templates are listed
alphabetically. Click to learn how to set the default layout template (see page 570). If you have not set the
default layout template, all layout templates are listed alphabetically.
To apply a layout template to the Part Property displayed in the Composite Structure Diagram
To apply a layout template when creating a new Part Property in the Composite Structure diagram
• Drag the Class that is the type of the Part Property you want to create on the diagram pane
and do one of the following:
• Drop the Class.
• Hold down the mouse button until the tooltip appears (long drag), then release the
mouse button and select the Create Property Symbol and Apply Default
Template command.
1. Select the Class shape or another classifier shape that has the layout template defined.
2. Do one of the following:
• Right click the shape and select Display > Layout Template > Apply Template. Then
select the name of the desired layout template if you can apply more than one template.
• In the diagram toolbar, click and select Layout Template > Apply Template. Then
select the name of the desired layout template if you can apply more than one template.
The example below illustrates how the appearance of Ports defined in the Air Transfer System layout
template is applied to the Internal Block Diagram of the Air Transfer System Block.
The layout template applied on the Air Transfer System Internal Block Diagram frame.
Sample model
• Revert the Apply Template command by using the Undo button from the main toolbar (see page
24), or press Ctrl+Z.
• Delete the shape and display it again by using the Display Parts/Ports dialog. (see page
459) Ensure that the Use Layout Template check box is clear.
Contents
You can represent the same Class with a different appearance according to the context of Class usage
in the Composite Structure diagram. To accomplish this, define multiple diagrams for the same Class
element with different names, and set them as layout templates. The diagram names identify the
differences between layout templates and simplify layout template selection when applying it.
The procedures below explain how to create and apply multiple layout templates.
1. Create the Class diagram with a name that identifies the layout template name.
2. Define the appearance of Class and its Ports shapes in the Class diagram. How to define the
layout template >> (see page 559)
3. Set that Class diagram as the layout template. How to set the Class diagram as layout template
>> (see page 560)
4. Repeat steps 1, 2, and 3 until you have the required number of layout templates of the same
Class element.
5. Apply multiple layout templates to other diagrams. How to apply layout template >> (see page 565)
93 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
94 https://docs.nomagic.com/display/NMDOC/Installing+plugins
95 https://docs.nomagic.com/download/attachments/9915051/Modem%20Cable%20Layout%20Templates.mdzip?
api=v2&modificationDate=1481817717837&version=1
Two different layout templates of the Modem Card Block can be found as selection when
applying it in any Internal Block Diagram. The illustration displays concepts from SysML Plugin.
The sample models used in the figure of this page are Modem Cable that comes with SysML Plugin96.
To open those samples properly you need to install the SysML plugin97 in the MagicDraw and download
Modem Cable Layout Templates.mdzip98.
Contents
If you have a commonly used layout template, you can set it as the default. The default layout template
will always be the first and separated by a line when trying to apply or open the layout templates. Only
one layout template can be set as the default. The procedures below explain how to:
96 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
97 https://docs.nomagic.com/display/NMDOC/Installing+plugins
98 https://docs.nomagic.com/download/attachments/9915051/Modem%20Cable%20Layout%20Templates.mdzip?
api=v2&modificationDate=1481817717837&version=1
6. Click Close.
The layout template diagram is now set as the default layout.
1. Open the Specification window (see page 882) of the default layout template diagram.
2. Select the Tags property group.
4. Click Close.
5. Open the layout diagram template that you want to be the default template.
6. Repeat all steps of the previous procedure (see page 570).
Sample model
The sample models used in the figure of this page are Modem Cable that comes with SysML Plugin99.
To open those samples properly you need to install the SysML plugin100 in the MagicDraw and
download Modem Cable Layout Templates.mdzip101.
• Open Template without drop-down arrow appears when only one layout template is available
for the selected element.
• Open Template with drop-down arrow appears when multiple layout templates are available for
the selected element. The multiple layout templates are listed according to the following rules:
• If you set the default layout template, it is always the first in the list, and other templates
are listed alphabetically. Click to learn how to set the default layout template. (see page 570)
• If you haven't set the default layout template, all layout templates are listed alphabetically.
• Right click the Part Property or Class shape and select Display > Layout Template > Open
Template. Then select the name of the desired layout template if more than one template is
available.
• Select the Part Property or Class shape, click , and select Layout Template > Open
Template. Then select the name of the desired layout template if more than one template is
available.
99 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
100 https://docs.nomagic.com/display/NMDOC/Installing+plugins
101 https://docs.nomagic.com/download/attachments/9915051/Modem%20Cable%20Layout%20Templates.mdzip?
api=v2&modificationDate=1481817717837&version=1
Contents
The Class Diagram that is used as as a layout template can have a specific diagram aspect (see page
575) defined. In other words, the layout template can only be used in another diagram with the same
aspect. In the example below, the Control System Block Definition Diagram is a layout template with
the electrical aspect defined, so the Control System layout template can only be used in the electrical view
of the system. In this case, the Control System layout template is used in the Climate Hardware Internal
Block Diagram that is defined as electrical. This layout template can't be applied in the diagram with a
different aspect defined, e.g., Communication.
Usage of a layout template with aspect. The illustration displays concepts from SysML Plugin.
Sample model
The sample models used in the figure of this page is Diagram Aspects that comes with SysML
Plugin102. To open those samples properly you need to install the SysML plugin103 in the MagicDraw
Contents
Diagram aspects allows you to create the different views, e.g. electrical, mechanical, optical, for the
same system structure.The aspects functionality is driven by stereotypes, which allows you to use
predefined aspects (only included in SysML Plugin105 or other customizations) or custom aspects for
diagrams. This enables you to:
104 https://docs.nomagic.com/download/attachments/9915051/diagram%20aspects.mdzip?
api=v2&modificationDate=1483357535810&version=1
105 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
You can represent different views of the same diagram by using different aspects. The procedures
below describe how to:
Related pages
The model used in the figures of this page is the Diagram aspects sample models that comes with
SysML Plugin106. To open this sample properly you need to install the SysML plugin107 in the MagicDraw
and:
• Download diagram aspects.mdzip108.
• Find in the modeling tool: <modeling tool installation directory>\samples\SysML\diagram
aspects.mdzip.
• To create a new aspect diagram (see page 581): in the Create Diagram dialog (see page 450) under the
Aspect Diagrams group.
• To apply aspect for a diagram (see page 583): in the diagram shortcut menu under the Aspect
command group.
106 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
107 https://docs.nomagic.com/display/NMDOC/Installing+plugins
108 https://docs.nomagic.com/download/attachments/42586363/diagram%20aspects.mdzip?
api=v2&modificationDate=1483357535810&version=1
Information
If you have SysML Plugin109 installed, you can see predefined aspects in the List tab by
clearing the Apply Filter check box in the Select Stereotype dialog. How to install SysML
Plugin >>110
6. Click OK.
All aspects added into Ignored Aspect option value are no longer visible when trying to create a new
aspect diagram or to apply it to a pre-existing diagram. To see them again in the model, you must
remove them from the Ignored Aspect option value.
Contents
There are predefined aspects that are only included in SysML Plugin111 or other customizations. The
predefined diagram aspects are the following: <<optical>>, <<mechanical>>, <<electrical>>,
<<software>>, <<conceptual>>, and <<logical>>. The procedure below explains how to find them in
your project. You can use predefined aspects in your project, or you can create custom aspects. How to
create custom aspects >> (see page 579)
109 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
110 https://docs.nomagic.com/display/NMDOC/Installing+plugins
111 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
The model used in the figures of this page is the Diagram aspects sample models that comes with
SysML Plugin112. To open this sample properly you need to install the SysML plugin113 in the MagicDraw
and:
• Download diagram aspects.mdzip114.
• Find in the modeling tool: <modeling tool installation directory>\samples\SysML\diagram
aspects.mdzip.
Contents
You can define your own diagram aspects that you want to use in the project. You can create custom
aspects in the same way you create a new stereotype (see page 827). The procedures below describe how
to create a custom diagram aspect, e.g., Air, in two different ways:
112 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
113 https://docs.nomagic.com/display/NMDOC/Installing+plugins
114 https://docs.nomagic.com/download/attachments/42586363/diagram%20aspects.mdzip?
api=v2&modificationDate=1483357535810&version=1
The creation of the new diagram aspect on the Profile Diagram pane.
1. In the Containment tree, select either a Profile or Package. (see page 771)
2. From its shortcut menu, click the Create Element button.
3. In the Create Element dialog, select Stereotype, and type its name, e.g., Air.
4. Open its Specification window, select the All properties mode, and find the Base Classifier
property.
5. Select the value cell of the Base Classifier property, click the Edit button.
6. In the Select Stereotype dialog, clear the Apply Filter check box.
7. In the Tree tab, expand packages UML Standard Profile > MagicDraw Profile, and double click to
select the aspect Stereotype.
8. Click OK and Close.
The new aspect is created, and can be used in the project.
Sample model
The model used in the figures of this page is the Diagram aspects sample models that comes with
SysML Plugin115. To open this sample properly you need to install the SysML plugin116 in the MagicDraw
and:
• Download diagram aspects.mdzip117.
• Find in the modeling tool: <modeling tool installation directory>\samples\SysML\diagram
aspects.mdzip.
Contents
• The custom aspects are created in the project. How to create a custom aspect >> (see page 579)
If you have SysML Plugin118 installed, the predefined aspect diagrams already exist in
your project. Predefined diagram aspects >> (see page 578)
• The Use Aspects option is enabled. How to enable the diagram aspects option >> (see page 577)
115 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
116 https://docs.nomagic.com/display/NMDOC/Installing+plugins
117 https://docs.nomagic.com/download/attachments/42586363/diagram%20aspects.mdzip?
api=v2&modificationDate=1483357535810&version=1
118 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
119 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
120 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Internal+Block+Diagram
The model used in the figures of this page is the Diagram aspects sample models that comes with
SysML Plugin121. To open this sample properly you need to install the SysML plugin122 in the MagicDraw
and:
• Download diagram aspects.mdzip123.
• Find in the modeling tool: <modeling tool installation directory>\samples\SysML\diagram
aspects.mdzip.
Contents
You can apply custom or predefined aspects for preexisting diagrams. It is possible to apply multiple
aspects for one diagram. The aspects can be applied for all diagrams except Activity (see page 296), State
Machine (see page 294), and Sequence (see page 291) diagrams. The procedure below describes how to
apply/remove an aspect for a diagram.
• From the diagram shortcut menu, point to Aspect, and choose an appropriate aspect from the
list.
121 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
122 https://docs.nomagic.com/display/NMDOC/Installing+plugins
123 https://docs.nomagic.com/download/attachments/42586363/diagram%20aspects.mdzip?
api=v2&modificationDate=1483357535810&version=1
The model used in the figures of this page is the Diagram aspects sample models that comes with
SysML Plugin124. To open this sample properly you need to install the SysML plugin125 in the MagicDraw
and:
• Download diagram aspects.mdzip126.
• Find in the modeling tool: <modeling tool installation directory>\samples\SysML\diagram
aspects.mdzip.
124 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
125 https://docs.nomagic.com/display/NMDOC/Installing+plugins
126 https://docs.nomagic.com/download/attachments/42586363/diagram%20aspects.mdzip?
api=v2&modificationDate=1483357535810&version=1
Contents
When elements have an internal structure, the rake icon (see page 951) appears on the element shape. If
those elements belong to an aspect diagram, the rake icon navigates to the same aspect internal
structure of the selected element. If there is no internal diagram of the same aspect, then any diagram
of another aspect or diagram without aspect is opened.
The figure below demonstrates the electrical Internal Block diagram of the Climate Control Hardware. The
rake icon on the part typed by Control System Block indicates that it contains an inner structure. There
are four Internal Block diagrams for the Control System in the model. Although, after double-clicking on
that part shape typed by Control System Block, the rake icon navigates exactly to the electrical Internal
Block diagram of the Control System.
The model used in the figures of this page is the Diagram aspects sample models that comes with
SysML Plugin127. To open this sample properly you need to install the SysML plugin128 in the MagicDraw
and:
• Download diagram aspects.mdzip129.
• Find in the modeling tool: <modeling tool installation directory>\samples\SysML\diagram
aspects.mdzip.
Contents
You can select Parts (see page 776) and/or Ports (see page 781) by aspects when displaying them (see page 459)
in a Composite Structure diagram (see page 303). Aspects are used when choosing which Parts and/or
Ports you want to display on the diagram pane (see page 24).
All aspects that you have created in your project are collected, and can be used in the following ways:
• In the Display Parts/Ports dialog > context-sensitive Panel. If you are modifying a pre-existing
diagram with an applied aspect(s), only the matching parts/ports are pre-selected in the Display
Parts/Ports dialog.
127 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
128 https://docs.nomagic.com/display/NMDOC/Installing+plugins
129 https://docs.nomagic.com/download/attachments/42586363/diagram%20aspects.mdzip?
api=v2&modificationDate=1483357535810&version=1
Sample model
The model used in the figures of this page is the Diagram aspects sample models that comes with
SysML Plugin130. To open this sample properly you need to install the SysML plugin131 in the MagicDraw
and:
• Download diagram aspects.mdzip132.
• Find in the modeling tool: <modeling tool installation directory>\samples\SysML\diagram
aspects.mdzip.
Contents
On this page
130 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
131 https://docs.nomagic.com/display/NMDOC/Installing+plugins
132 https://docs.nomagic.com/download/attachments/42586363/diagram%20aspects.mdzip?
api=v2&modificationDate=1483357535810&version=1
• Right-click the diagram on the diagram pane or in the model browser and from the menu select
Complete.
• The «complete» stereotype is applied to a diagram. This way you can easily indicate complete
diagrams in the model browser without opening them.
• Auto-resizing of shapes and auto-displaying of labels is suspended. This means that the diagram
layout is not automatically changed when the model content changes.
Alternative
You can suspend auto-resizing of shapes and auto-displaying of labels in a diagram without
marking it as complete in one of the following ways:
• To suspend auto-resizing of shapes and auto-displaying of labels for individual symbols,
open the Symbol Properties dialog (see page 943) of a symbol or a group of symbols, and
set the Suspend Auto-Resizing of Shapes and/or Suspend Auto-Displaying of Labels
properties to true.
• To suspend auto-resizing of shapes and auto-displaying of labels for all the diagram
symbols, open the Diagram Properties dialog (see page 490) of a diagram, and set the
Suspend Auto-Resizing of Shapes and/or Suspend Auto-Displaying of Labels
properties to true.
To update shapes
• Click on the shape toolbar and select Resize to Fit Content.
To update paths
If you select No in step 2, all diagram symbols are automatically resized to fit suspended content,
and you can continue working on the diagram as usual. If you select Yes, auto-resizing of shapes and
auto-displaying of labels in the diagram are still suspended, even though the diagram is not complete.
When you specify project options listed in step 3, they are applied to all diagrams that are marked as
complete after specification.
2.4.32 Printing
With MagicDraw you can print:
• Active diagram
• Any diagram(s)
• All open diagrams
• Selected symbols of active diagram
You can specify the printing options or preview pages by using the following dialogs:
• Print Dialog
• Print Options Dialog
• Print Preview Window
To print an active diagram
1. From the File main menu, select Print. The Print dialog opens.
2. In the Print what area, choose Selected diagram(s). The Select Diagram dialog opens.
3. Select diagram(s) you want to print.
4. Click OK.
5. Click Print.
To print all open diagrams
1. From the File main menu, select the Print command. The Print dialog opens.
2. In the Print what area, select All open diagram(s).
3. Click Print.
To print selected symbols of active diagram
Related pages
• Diagramming
(see page 449)
Print dialog
To open the Print dialog, do one of the following
In the model, a model element is stored in the Model Browser and its symbol or path (for relationships)
is represented on the diagram pane, as shown below.
2.5.2 Action
Contents
An Action is a named element that is the fundamental unit of an executable functionality. The execution
of an Action represents some transformations or processing in the modeled system, be it a computer
system or otherwise. An Action execution represents the run-time Behavior (see page 629)of executing an
Action within a specific Behavior execution. As the Action is an abstract Class (see page 633), all Action
executions will be the executions of a specific kind of Action. When the Action will be executed and what
its actual inputs will be determined by the concrete Action and the Behaviors in which it is used.
• On a diagram, select the Action and press Delete. Then, in the opened message, click Yes.
• On a diagram, from the Action shortcut menu, select Refactor and then Remove.
• Flows can be joined only if the removed Action has one incoming and one outgoing
Control Flows.
• You can select more than one Action to remove only if the selected part has one
incoming and one outgoing Control Flow.
• In the Environment Options dialog (see page 64), in the Diagram options group, under the
Editing category, you can select one of the Join Control Flows option values: Ask to join
control flows, Yes, or No.
An Action can be specified by changing its property values in the Action Specification window (see page
882). Each property is described in the description area on this window.
Related pages
Contents
On this page
Accept Event Action The Order Cancel Request Accept Event Action is connected
to Cancel Order with the Exception Handler relationship.
Rotated Accept Event Action The symbol of Accept Event Action is rotated.
Accept Time Event Action The Time Event is connected to the Call Behavior Action.
Assigning signals
To assign a Signal to an Accept Event Action, at least one Signal element should exist in the
project.
• In the Activity diagram panel, select the Time Event button, and then click the diagram pane.
2. Click the Rotate State button on the upper-right side of the shape. The name of the Accept
Event Action will appear on the opposite side of the shape.
You can specify for an Accept Event Action, whether there is a single Output Pin for the Event or
multiple Output Pins for the attributes of the Event.
1. Select the Accept Event Action, and open its Specification window (see page 882).
2. Select or clear the Is Unmarshall check box. If the value is set to:
• false, then there is a single Output Pin for the Event, and a real-world instance of the Signal
is placed on this Output Pin.
• true, then there are multiple Output Pins for the attributes of the Event, and feature values
of the Signal instance are placed on the corresponding Output Pins.
Related pages
Contents
On this page
Description
The Call Behavior Action invokes a Behavior (see page 629) directly rather than invoking a behavioral
feature that, in turn, causes the Behavior. The argument values of the Action are available to the
execution of the invoked Behavior. The execution of the Call Behavior Action waits until the execution of
the invoked Behavior is completed and a result is returned on its Output Pin. In particular, the invoked
Behavior can be an Activity.
Type the “:” colon, then press Ctrl+Space or Ctrl+Backspace and then, in the opened list, select
the Behavior.
• Drag a Behavior from the Containment tree (see page 32) onto the Call Behavior Action shape on
the diagram. The Behavior is assigned to the Call Behavior Action.
• Double click the Call Behavior Action with the assigned Behavior - the Behavior
Specification window (see page 882) opens, or, if the assigned Behavior is a diagram, the
diagram opens in the same diagram tab.
• The rake icon (see page 951) is displayed on the shape if the Call Behavior Action refers
to another Activity diagram. The rake icon is not shown by default, therefore, you need to
set the Show Rake Icon property value to true in the Symbol Properties dialog (see page
943).
• A parameter is created automatically for each newly created Pin on the Call Behavior
Action. The parameter’s name, type, direction, and multiplicity are synchronized with the
Pin name, type, direction, and multiplicity.
Note that a parameter for a pin is created automatically if:
• the Call Behavior Action has the Behavior assigned.
• the Behavior is editable.
• the Behavior has only one usage, and it is not used in another project (in server
projects).
• On the Activity diagram (see page 296), click the Call Behavior Action shape, and then, on the smart
manipulator toolbar, click .The new Activity diagram opens in the same diagram tab.
• On the Activity diagram, right-click the Call Behavior Action shape, point to Create Diagram,
and then point to a diagram type.
Changing the Name Display Mode on the Call Behavior Action symbol
To change the Name Display Mode on the Call Behavior Action symbol
• Right-click the Call Behavior Action and select the Symbol Properties command.
• In the Symbol Properties dialog (see page 943), find the Name Display Mode property.
• Select one of the following value:
- Show Action Name (default only for UPDM projects) - to show action name.
- Show Behavior Name to show behavior name.
- Show Both - to show action and behavior names.
- Show Both or Behavior Name (default) - to show only the behavior name if the action name is
not specified, or if the action name matches the behavior name.
• Click Close.
The selected name is shown on the Call Behavior Action symbol.
Related pages
Contents
The Call Operation Action transmits an operation call request to the target object, where it can cause
the invocation of an associated Behavior (see page 629).
You can display an Action name and/or name of the Operation (see page 645) on the Call Operation Action
shape. For example, if you have two Call Operation Action elements calling the same Operation, you
can specify their names to distinguish the Actions from each other.
The Call Operation Action with the getOrder In this example, the Call Operation Action has been
operation assigned for the getOrder operation whose type is the
OrdersDB class.
The Call Operation Action named Get In this example, the Call Operation Action is named Get
supplementary order supplementary order. It has been assigned for getOrder
operation whose type is the OrdersDB class.
The Call Operation Action with the hidden The classified name of an operation is hidden from the
classified name Call Operation Action shape.
To assign an Operation for the Call Operation Action, do one of the following
• On the diagram, right-click the Call Operation Action, and, on the shortcut menu, click
Select Operation. In the opened Select Operation dialog (see page 994), select an Operation you
need to assign to the element, or click the Creation Mode button to create a new Operation.
Click OK when you are finished.
• In the Call Operation Action Specification window (see page 882), click to select the Operation
property specification cell, and click button . In the opened Select Operation dialog (see page
994), select the Operation you need to assign to the element, or click the Creation Mode button
to create a new Operation. Click OK then you are finished.
MagicDraw allows you to display the Operation name and Class (see page 633)of the Operation on the Call
Operation Action shape.
When the Operation is assigned to the Call Operation Action, there are two name/operation display
options available:
Description Example
If the Call Operation Action is not named, or the name of the Call Operation
Action is the same as the assigned Operation name, the name of the Class is
displayed under the Operation name.
If the Call Operation Action name differs from the assigned Operation name, then
<class of the operation>::<operation name> is displayed under the Call Operation
Action name.
To show / hide the Operation name and Class of the Operation from the Call Operation Action shape
• Open the Call Operation Action Symbol Properties dialog (see page 943), and set the Show
Qualified Name for Operation property value to true / false.
Related pages
Opaque Action
Contents
The Opaque Action is introduced for implementation-specific actions, or for use as a temporary
placeholder before other actions are chosen.
There is an additional property named Body and Language in the Specification window (see page 882) of
an Opaque Action.
Contents
The Send Signal Action creates a signal instance from its inputs and transmits it to the target object,
where it can cause the start of a State Machine (see page 819) transition or the execution of an Activity.
The argument values are available to the execution of associated Behaviors (see page 629). The requester
continues the execution immediately. Any reply Message (see page 723) is ignored and is not transmitted
to the requester. If the input is already a Signal instance, use the Send Signal Action.
Assigning signals
To assign a Signal to a Send Signal Action, you can use any of the following:
• the Send Signal Action's (see page 606) Specification window (see page 882)
• the drag-and-drop operation (see page 0)
• the Send Signal Action's shortcut menu (see page 607)
• type the Send Signal Action name (see page 608)
1. Open the Specification window (see page 882) for the Send Signal Action.
2. In the Signal property value cell, do any of the following
• Click the button. The Select Signal dialog opens. Select the Signal from the list, or
create a new one (see page 998).
1. Select the Send Signal Action shape, click on it to activate the name edit mode.
2. Do one of the following:
- if you want to use an existing Signal from the model, start typing an appropriate Signal name,
and select it from the opened list.
- if you want to create a new Signal in the model, type its name and press Enter.
Related pages
Contents
1. In the Activity diagram toolbar, right-click or expand the Action button. The menu opens.
2. Select the Any Action command. The Select Action Metaclass dialog opens.
You can create and apply a duration constraint on an Action that states that the output must occur
after delay from the input.
1. Select an Action and create the input and output Pins (see page 777) to specify the Events (see page
677).
2. Create a duration constraint for the Action using one of the following way:
• From the diagram palette:
i. In the diagram palette, under the Common category, expand the Constraint
command, and select the Duration Constraint, Time Constraint, or Constraint
button, and create it directly on the action shape.
• In the Specification window:
a. In the Call Behavior Action (see page 600) Specification window (see page 882), click the
Constraints group.
b. Click the Apply button. The Select Constraint dialog opens.
c. Select the constraint storage place, and click the Create button. In the opened menu,
select the Duration Constraint command. The Duration Constraint Specification
window opens.
3. Specify a duration interval. Type the minimum and maximum duration to hold the Activity in the
Min and Max property specification cells, e.g., 0 sec and 30 sec.
4. Assign the Events for the input and output pins:
a. In the opened Duration Constraint Specification window, click the Specification property
specification cell, and click the Show Shortcut Menu button . The following shortcut
menu opens:
Related pages
2.5.3 Activity
Contents
An Activity is a parameterized Behavior (see page 629) represented as a coordinated flow of Actions (see
page 596). An Activity specifies the coordination of executions of subordinate behaviors, using a control
and data flow model. The subordinate behaviors coordinated by these models may be initiated because
other behaviors in the model finish executing, objects and data become available, or events occur
external to the flow. The flow of execution is modeled as activity nodes connected by activity edges.
An Activity can be specified by changing its property values in the Activity Specification window (see page
882). Each property is described in the description area on this window.
Proper Function
ty
Name
Read If true, this activity must not make any changes to variables outside the activity or to objects. (This is
Only an assertion, not an executable property. It may be used by an execution engine to optimize model
execution. If the assertion is violated by the action, then the model is not formed correctly.) The
default is false (an activity may make non-local changes).
Single If true, all invocations of the activity are handled by the same execution.
Executi
on
In the Activity Specification window (see page 882), choose Variables (see page 612) from the property group
list.
Related pages
To create a Variable
An Activity Final Node can be specified by changing its property values in the Activity Final
Node Specification window (see page 882). Each property is described in the description area on this
window.
2.5.5 Actor
Contents
Actors represent roles played by human users, external hardware, and other subjects. An Actor does
not necessarily represent a specific physical entity but merely a particular “role” of some entities that is
You can format the actor symbol properties in the Symbol Properties dialog (see page 943).
An Actor can be specified by changing its property values in the Actor Specification window (see page 882).
Each property is described in the description area on this window.
Actors can be represented in other diagrams, such as Sequence (see page 291) or Activity diagrams (see
page 296).
• Actors can be depicted as (see page 614) Lifelines (see page 713) in a Sequence diagram. (see page 614)
• Actors can be depicted as (see page 614) Swimlane (see page 832) headers in an Activity diagram (see
page 614).
To create a Swimlanes (see page 832) header for an Actor in an Activity diagram
Related pages
2.5.6 Anchor
Contents
Use an Anchor to relate an element to a note (see page 759) or comment (see page 651). By default, a newly
created Anchor links an element with a note.
1. On the diagram pane, select an anchor and open its shortcut menu.
2. Select Symbol Properties.
3. Select the Path Style proeprty, then choose one of the following path style: Rectilinear,
Oblique, or Bezier.
Related pages
2.5.7 Artifact
Contents
To describe how an artifact is created, the model draws a Manifestations (see page 722) relationship,
between the artifact and the elements used in its construction. All artifact manifestations are listed in
the Artifact Specification window (see page 882), Manifestations pane. In this pane you may add new
manifestations.
To be used, an artifact must be deployed, meaning, it must be placed in a location where it may be
stored and used. The target of the deployment may be a node, such as an execution environment or a
device, a property, or an instance specification. The relationship between the location and the artifact is
defined by the deployment (see page 616) relationship.
Related pages
Deployment
Contents
1. In the Component (see page 300) (or Deployment (see page 301)) diagram toolbar, click the Artifact (see
page 616) button group to access the drop-down menu.
2. In the opened list, select Deployment Specification and draw it on your diagram pane.
Related pages
2.5.8 Association
Contents
In the Class diagrams (see page 289), an Association represents the semantic relationship between two or
more classifiers which specifies connections between their instances. An Association relationship is the
most general of all relationships and the most semantically weak.
In the Use Case diagrams (see page 290), an Association represents the participation of an Actor (see page
613)in a Use Case (see page 847), for example, when instances of an Actor and instances of a Use Case
communicate with each other. This is the only relationship between Actors and Use Cases. Sometimes
an association relationship is called communication Association.
The communication path is a subclass of an Association. It specifies the relationship between nodes by
defining the number of nodes that may be connected (multiplicity), and the nature of the connection,
via the name of the path or a stereotype.
Related pages
Contents
An association (see page 618) is a relationship between two classes. It is represented by a solid line.
Though associations are bi-directional by default, they can also be unidirectional, where one class
knows about the other class and the relationship but the other class does not. Sometimes an
association links a class to itself. This association is called a recursive (reflexive) association. One
example of this association is an employee who is managed by a manager who is also himself an
employee.
1. Select Association.
2. Click a class (Employee in this example) and hover over the class until you see a rectangle shape.
Click the class again to create a recursive association.
Association Properties
You can specify association properties in the association Specification window (see page 882). The
description of each property appears in the same window. The description area of the Specification
window presents the descriptions.
The Direction Arrow is a graphical representation most often used in top level domain class diagrams. It
helps to read a diagram and explains diagram semantics, and has no meaning in a model.
Usually, you would use the Direction Arrow on a diagram where navigability is not yet defined. Direction
Arrows are usually displayed for named associations. When you create more detailed diagrams with
specified navigability, direction arrows and association names are not usually displayed in these types
of diagrams.
As shown in the following figure, User and Account Classes are connected with the Association. A
navigation arrow can be displayed to either side depending on the Association name. If the association
name is belongs to, the Direction Arrow should point from the Account to the User. If Association name
is has, the Direction Arrow should point from the User to the Account.
In the Class diagram (see page 289), you can add Attributes (see page 639) to an Association using an
Association Class (see page 627). The Association Class is a simple Class (see page 633)with a dashed line
connected to the Association.
Related pages
Association End
Contents
On this page
An Association End is the connection between lines depicting an Association and the shape.
The following properties of the association end can be specified: name, association end type,
visibility, multiplicity, qualifier, aggregation kind.
Qualifier
A qualifier is an attribute or a list of attributes whose values serve to partition the set of instances
associated with an instance across an Association. Qualifiers are attributes of an Association. It is
represented as a small rectangle attached to the End of an Association path between the final path
segment and the symbol of the classifier that it connects to. The qualifier rectangle is part of the
Association path, not part of the classifier. The qualifier rectangle drags with the path segments. The
qualifier is attached to the source end of the Association.
• On the diagram, select the Association End and move it to the other target. The Association
is connected to the other target and the type of the Association End (that is, property) is changed.
• In the Containment tree (see page 32), select the property which represents the Association End and
drag it onto the available classifier (the Association target). If the Association is represented on
the diagram pane, the Association is redrawn (connected) to the changed target automatically.
• In the property (that is, the Association End) Specification window (see page 882), change the Type
property value.
To define the Association End visibility
• Open the shortcut menu of a selected Association End and click a desired multiplicity.
• Open Association’s shortcut menu, point to one of a desired Association End (Role of
<class name>), and then click the desired multiplicity value.
• Open the Association Specification window and, from the Multiplicity list, select or type
the multiplicity value for the desired Association End.
• Perform the following steps:
a. Open the Association End Specification window.
b. In the Multiplicity property value cell, type or select from the list a multiplicity value.
• Edit directly on the diagram pane:
a. Select multiplicity area and press F2 to switch it to edit mode.
b. Press Ctrl + Spacebar or Ctrl + Backspace to see available suggestions.
Choose one of the suggestions or type the multiplicity value.
• Open the shortcut menu of a selected Association End and click Edit Name. The Association End
is marked for editing. Type or edit the name directly on the diagram pane.
• Open the Association’s shortcut menu, point to one of a desired Association End (Role
of <class name> ), and then click Edit Name. The Association End is marked for editing. Type or
edit the name directly on the diagram pane.
• Perform the following steps:
a. Open the selected Association End Specification window.
Existing qualifiers are also displayed in the property group list under the
Qualifiers group. Click the selected qualifier to open its Specification window, and
define qualifier properties there.
• Open Association’s shortcut menu, point to one of a desired Association End (Role of
<class name> ), and then select one of the following:
• None. No aggregation is assigned to the selected Association End.
• Shared.
• Composite.
1. From the Class shortcut menu, select Symbol Properties or press Alt+Enter. The
Symbol Properties dialog (see page 943) opens.
2. In the Attribute category, click the Show Association End as Attributes property value cell.
3. Click one of the following display modes:
• All. Properties and Association paths will be displayed on the Class shape.
• Without Association Symbol. If an Association symbol is deleted, the property will be
displayed on the Class shape.
• Do Not Show. Neither property, nor Association path will be displayed on the Class shape.
An Association End is defined as a property. It has attribute properties defined in the Specification
window.
1. Select the shape on which you want to display Association Ends as Ports and open its Symbol
Properties dialog (see page 943):
• Right-click a shape to open the shortcut menu, and click Symbol Properties.
• Press Alt+Enter.
2. In the Symbol Properties dialog, at the right-top corner, click to expand the menu and
select the All mode.
3. Under the Ports category, click the Show Association Ends as Ports property cell and select All.
You can specify Association End properties in the Association End Specification window. In the same
window, you can find the description of each property. Descriptions are presented in the description
area of the Specification window.
Association navigability
The Association navigability indicates whether it is possible to traverse an Association within an
expression of a classifier to obtain the object or a set of objects associated with instances. The
navigability is shown as an arrow that can be attached to the end of the path to indicate that the
navigation is supported toward the classifier attached to the arrow.
By default, an Association is navigable on both sides and its navigability is not visible.
A role indicates the role played by the Class in terms of an Association. The role name is placed at the
Association End, near the Class playing that role. The role name at the implementation level maps to
the reference name of the opposite Class. Roles can have visibility (public, package, protected, and
private).
• Open the Association End Specification window, turn on the Expert property display mode,
and do one of the following:
• Set the Navigable property value to true to mark the Association End as navigable.
• Set the Navigable property value to false to mark the Association End as not navigable.
• From the Association shortcut menu, select Role of <class name> and then do one of
the following:
• Select Navigable to mark the Association End as navigable.
• Click to clear Navigable to mark the Association End as not navigable.
• Open the Association End shortcut menu and do one of the following:
• Select Navigable to mark the Association End as navigable.
• Click to clear Navigable to mark the Association End as not navigable.
To display the Association navigability
In MagicDraw, the dot notation is not enabled by default. Please pay attention to this before
making decisions about the Association End ownership just from the model representation on
a diagram.
1. On the Options menu, click Project. The Project Options dialog (see page 213) opens.
2. In the General options list, select General and set the Enable Dot Notation for Associations
value to true.
According to the UML 2.4.1 specification, the Association Ends owned by Classes and Associations
is navigable. This improved functionality allows a proper management of the navigableOwnedEnd
property for Associations:
• On the Association End shortcut menu, click Owned By and then select the desired owner.
• In the Association End Specification window, click the Owned By property value cell and
then select the desired owner from the list.
• From the Association shortcut menu, select the role of the desired Association End, click Owned
By and then select the desired owner.
• In the Association Specification window, click the Owned By property value cell of the role
with the desired Association End and then select the desired owner from the list.
Related pages
Association Class
Contents
An Association Class is a model element with both Association (see page 618)and Class (see page 633)
properties. You can look at an Association Class as an Association that also has Class properties, or as a
Class that also has Association properties. Additionally, it connects a set of classifiers and defines a set
of features belonging only to the relationship and not to any of the classifiers.
You can edit element property values (see page 890) in the Specification window (see page 882).
3. On the diagram pane, click the first Class shape (path source).
4. Drag the path to the second Class (path destination) and drop it there.
If you need to model a relationship among several classes, you should use the N-ary Association. The N-
ary association is drawn as a big diamond with all associations attached to its points. Every involved
Class can have a role name and multiplicity.
When you specify communication paths, you can define the number of nodes that can be connected at
each end. You can also use labels to identify the type of protocol or network that is used in the
communication.
2.5.9 Behavior
A Behavior describes how the states of objects changes over time.
• To specify an Entry, Do, and Exit activities (see page 820) of a State (see page 819).
• To specify an Effect (see page 845) of a Transition (see page 843).
The Behaviors are displayed in the compartments of the following elements:
Related Pages
Related Diagrams
Assigning Behaviors
See references on how to assign the behavior for the following elements:
See the following procedures, on how to assign the behavior for the rest of the elements,
There are two ways to create and assign behaviors, so do one of the following:
b. Click the Create button and then from the menu, select the behavior type.
If the Specification property is defined already, then the Create Operation button is
unavailable.
Related pages
Related diagrams
1. On the Options menu, click Environment. The Environment Options dialog opens.
2. In General options, Editing category, set the Create behavior diagram when the behavior
type is selected for transition effect or state activities value to false (the default value is true).
More information
For more information about the Specification window usage, see Specification window (see page
882).
Related pages
Related diagrams
2.5.10 Class
A Class is drawn as a solid-outline rectangle with three compartments separated by horizontal lines.
The top name compartment holds the Class name and other general properties of the Class (including
stereotype (see page 827)); the middle list compartment holds a list of properties; the bottom list
compartment holds a list of operations. The property and operation compartments are optional, and
you can suppress (see page 538) them.
A Class is a descriptor for a set of objects with similar structures, behaviors, and relationships. The
model is concerned with describing the intention of the Class, which are the rules that define it. The
run-time execution provides its extension that are its instances (see page 704).
A Class represents a concept within the system being modeled. It has a data structure, Behavior (see page
629), and relationships to other elements. The name of a Class has a scope within the package in which
it is declared, and the name must be unique, among Class names, within its Package (see page 771).
Related Pages
A general information about working with shapes is provided in Diagramming (see page 449).
You can specify Class properties in the Class's Specification window. In the same window, you can find
the description of each property. Descriptions are presented in the description area at the bottom of
the Specification window.
More information
• For more information about the Specification window, take a look at the page
Specification window (see page 882).
• For more information about specifying property values, peruse through the page Editing
Property Values (see page 890).
1. Double-click the selected Class or select Specification from the Class's shortcut menu. The Class's
Specification window opens.
2. Click the Inner Elements tab and then click the Create button or press Insert.
3. Select the element you wish to add from the list. Click the selected element.
4. The corresponding Specification window opens. Define the Class, Use Case or Interface, and
click OK.
• From the Class's shortcut menu, select Tools and then Create Setters/Getters.
More Information
For a detailed description, read Creating Setters and Getters (see page 1111).
To show members (attributes and operations) on the classifier shape according to the visibility
1. On the diagram pane, right-click the Class shape and then from the class's shortcut menu, select
the Symbol Properties.
2. In the Symbol Properties dialog, change the Show Members property; the options are All, Only
Public, or Not Private.
Related References
Related Pages
In the Browser, you can see the created Class with the Composite Structure diagram inside it. The Class
is linked with the diagram. It means that after double-clicking the diagram, or the Browser, the
Composite Structure diagram will opened.
Hyperlinks
For more information about hyperlinks, peruse Defining Hyperlinks (see page 970).
The names of the Class and the Composite Structure diagram are synchronized. Type a name for the
Class, for example, Library Book, and the name of the diagram is automatically changed to Library Book
and vice versa. This is synchronization of a diagram name and its context name.
Related References
Related Pages
Design Patterns
You can create and edit the design patterns for the selected Class (see page 633). A detailed description of
templates can be found in the Design Patterns of Reusable Object-Oriented Software.
1. From the Class's shortcut menu, select Tools, and then select Apply Pattern.
2. The Pattern Wizard dialog opens. For a detailed description of this dialog, read Pattern (see page
1119) Wiz (see page 1119)ard (see page 1119).
3. Select the design pattern you want to apply and select the desired options. Click OK.
Related References
Related Pages
1. On the left side of your model, find the available options under the Class diagram (see page 289)
toolbar and click on Class.
2. You will see an arrow for a drop-down menu which you can click if you wish to create a different
kind of Class element.
3. In any case, either
a. Click on the element and then click anywhere on your diagram pane, or
b. Drag and drop, the element you clicked on, anywhere on your diagram pane.
At this point, you should have a Class element in your Class diagram, as shown in figure below.
Related References
Related Pages
Attribute
An attribute is a named property of a Class (see page 633) that describes a range of values that can be held
by the instances of that Class. You can specify attribute properties in the attribute's Specification
window. Specifying attribute properties include changing the name, defining the type, converting the
attribute to a port, etc. In the same window, you can find the description of each property. Descriptions
are presented in the description area of the Specification window at the bottom of the Specification
window.
More information
• For more information about the Specification window usage, see Specification window
(see page 882).
• For more information about specifying property values, see Editing Property Values (see
page 890).
There are quite a few ways to create a new attribute, so do one of the following:
Attribute Name
The attribute's name must be unique in the Class scope. Nevertheless, do one of the following
instructions to change the attribute's name.
Warning
Illegal characters for attribute names are ( ) [ ] { } ! @ # % ; ', ; : ' " ?
• Click on the Class block, double-click on the Attribute, and on the Attribute Specification window,
change the name and click Close.
Attribute Type
Attribute Type
The attribute's type can be any of these: Class, Interface, or Primitive Class, such as int or
double. You are allowed to define the attribute's type.
Colon
Type the colon ":" , press Ctrl+Space or Ctrl+Backspace, and then in the open list, select the
type.
• In the Containment tree (see page 662), select an element and drag it to the Attribute on the
diagram.
Attribute Visibility
Visibility Function
Name
Package '~' An attribute can be accessed by elements from the same package.
Protected An attribute can be accessed from the inside of the selected class and classes derived from that
'#' class.
Private '-' An attribute can be accessed only from inside of that class.
Visibility
The attribute visibility is shown at the attribute signature.
• Type '+', '~', '-', or '#' visibility marks just before an Attribute name directly on a diagram.
• Open the Attribute Specification window. From the Visibility drop-down list, select the desired
item: public, package, protected, or private.
Attribute Scope
Attribute Multiplicity
Attribute Changeability
The attribute changeability controls the access by operations on the class on the opposite end.
Name Function
When true - the value can not be altered after the object is instantiated
and its values initialized. No additional values can be added to a set.
Converting an Attribute
Keep in mind a few things about an attribute when converting it to an association:
• the attribute has to have a type specified, and
• the attribute is not a member end of some association.
Logitics
You can move attributes back to the class by dragging and dropping them on the class shape.
To convert to a port
Related Pages
Operation
Entries in the operation compartment are strings that show the operations defined on classes as well as
those that are supplied by the classes. An operation is a service that can be requested to perform by an
instance of the class. It has a name and a list of arguments.
Usually, class attributes are accessed through the operations. The operations are used to perform
specific actions, such as system calls, utility functions, and queries. The operation signature provides all
information needed to use that operation.
You can specify operation properties (see page 890) in the operation Specification window (see page 882). In
the same window, you can find the description of each property. Descriptions are presented in the
description area of the Specification window.
• On the diagram, select the class and click Create Element > Operation.
• In the class Specification window > Operations property group, click the Create button.
• In the Containment tree, from the class shortcut menu, select Create Element > Operation.
• On the diagram, select the class and press the Ctrl+Alt+O.
To define the type of an operation, do one of the following
• Select an operation, type ":" and then the type. If you add a non-existent type, a new class is
created for that type.
After typing the ":", press Ctrl+Space or Ctrl+Backspace to get a list of suggested types.
• In the Operation Specification window, the Type property, select the operation type.
To quickly create a behavior or a diagram for an operation
1. From the operation shortcut menu, select Create Method and either Behavior, or Diagram.
Related References
Related Pages
Parameter
The Parameter Specification window defines an operation argument.
You can specify parameter (see page 890) properties in the parameter Specification window (see page 882),
which also contains descriptions.
1. In the Operation Specification window, click on the Properties list, and select Expert mode.
More properties for the operation are displayed.
2. In the Type Modifier property specification cell, select one of the following:
• & - one class has a reference to another model element.
• * - one class has a pointer to another model element.
• [] - one class has an array of other model elements.
To define an operation as abstract, static, or query
1. In the Operation Specification window, click on the Properties list, and select Expert mode.
More properties for the operation are displayed.
2. In the General property group, select one or all of the following
• Is Abstract: the operation does not have an implementation; one must be supplied by a
descendant.
• Is Static: the values returned by the parameter have no duplicates.
• Is Query: does not change the state of the system.
To set the operation visibility
• In the Operation Specification window, click on the Visibility property specification cell, and
select one of the following:
Related Pages
2.5.11 Collaboration
A Collaboration describes the structure of elements that implement a certain behavior. In the
Collaboration, the elements are the properties connected with the connectors (see page 655).
In this example, you can see the Loan Collaboration. The Collaboration contains two properties -
CatcherInTheRye and Adele. These are the properties (attributes) and the LibraryItem and
AudioRecord are the types of each property. The CatcherInTheRye and Adele are connected with the
connector relationship.
More Information
For more information on how to assign a behavior to a Collaboration Use, read Assigning
Behavior diagrams automatically (see page 632).
1. Create a Collaboration symbol in a Class diagram (see page 289), you may name it
Loan, for example.
2. On the Class diagram, select the Collaboration, right-click on it to open its shortcut menu (see page
2022). Select the Symbol Properties command.
3. In the Symbol Properties dialog, click to clear the Suppress Structure check box. Click Close.
4. On the diagram pane, or in the Model Browser, select the element and drag-and-drop it to the
Collaboration symbol on the diagram pane.
5. The new property is created. The type of the property is the element that was dragged and
dropped.
6. To create a connector between properties, expand the Composite Structure diagram (see page 303)
pallet and click the button.
7. Draw the connector relationship between properties.
8. Now you have the structure represented in the Collaboration.
Collaboration properties
You can format collaboration symbol properties in the Symbol Properties dialog.
You can specify collaboration properties in the collaboration Specification window. In the same window,
you can find the description of each property. Descriptions are presented in the description area of the
Specification window.
More Information
For more information about the Specification window usage, see Specification window (see page
882).
For more information about specifying property values, see Editing property values (see page 890).
Related Diagrams
Related Procedures
Related Refrences
Collaboration Use
A Collaboration Use represents the implementation of a pattern described by a Collaboration (see page
647) in a specific situation. In this context, role binding (see page 668) means that the roles in the
Model Tip
These instructions will work best if you have a Composite Structure diagram (see page 303)
created already.
Before assigning a Collaboration to a Collaboration Use, you must have a Collaboration created in your
model.
Collaboration
Read Collaboration (see page 647) on how to create a Collaboration in your model.
Creation Mode button to create a new Collaboration. Click OK when you are
done.
• On the Composite Structure diagram pane, create a Collaboration Use, then click the
Collaboration Use shape, and then on the smart manipulator toolbar, click the symbol. Select
a Collaboration. Press Enter or click anywhere on the diagram pane. The Collaboration is now
created and assigned.
• On the Composite Structure diagram pane, create a Collaboration Use, then click the
Collaboration Use shape, and then press Ctrl+T. Type the name of the new Collaboration and
press Enter, or click anywhere on the diagram pane. The Collaboration is now created and
assigned.
• On the Composite Structure diagram pane, create a Collaboration Use, then click the
Collaboration Use shape, after that click the name area. Type the “:” colon and then type the
You can format Collaboration Use symbol properties in the Symbol Properties dialog.
Formatting Symbols
For more information about symbol representation properties, see Formatting symbols (see page
943).
You can specify Collaboration Use properties in the Collaboration Use's Specification window. In the
same window, you can find the description of each property. Descriptions are presented in the
description area of the Specification window.
Related Diagrams
2.5.12 Comment
A Comment is a UML element used to specify various remarks of an element in the model. In the
diagram pallet, the Comment command appears under the Note command. You can display text in the
Comment as plain or HTML text.
You can specify a Comment in the Comment's Specification window (see page 882), which also displays the
description of each Comment property in the description area of the Specification window.
1. Open the Specification window of the selected element in the Model Browser (see page 29), or the
symbol in the diagram pane.
2. Expand the Documentation/Hyperlinks property group and select Comment.
3. In the Comment pane, click the Create button. The Comment's Specification window opens.
4. Type the Comment content as the Body property value.
5. To view the Comment symbol on the diagram pane, select the created Comment in
Comment's Specification window property group list on the left of the Specification window and
drag it on the diagram pane.
6. The Comment symbol is created on the diagram pane.
• On the diagram pane, select the Comment symbol. Click the button that appears on the lower-
left corner of the shape:
• Open the selected Comment's shortcut menu133 and select or click to clear the HTML Text
command.
HTML text
You can edit the HTML text in the comment using the HTML editor (see page 1018).
Retrieve Documentation
You can enable the Retrieve Documentation option only if you already have documentation
in the Comment's Specification window. Read the first set of instructions on this page to see
how to create the comment in the element's Specification window.
Edit
You can edit element documentation directly on the Comment symbol.
Display Properties
You can also display owner and stereotype on the Comment symbol.
133 https://docs.nomagic.com/display/CDH190/DH+Links+panel+shortcut+menu+and+Sync+Status+icons
Related Pages
2.5.13 Component
A Component represents all kinds of elements that make up the system. A Component can always
be considered as an autonomous unit within a system or subsystem. It is a module having the following
features:
• A Component is a replaceable and independent part of the system performing a specific action.
• A Component acts in a context of a well-defined architecture.
• Components interact among each other using Interfaces (see page 708).
Components provides compartments for listing its provided and required Interfaces, realizations, and
artifacts.
To show/hide the interfaces, realizations, and artifacts on the Component’s shape, do one of the
following
• On the diagram, right-click the Component’s shape and then from the shortcut menu,
select Symbol Properties. In the Symbol Properties dialog (see page 943), set the
Suppress Interfaces, Suppress Realizations, or Suppress Artifacts property values to true or
false.
• On the diagram, click the Component’s shape and then click the Compartments button . Then
in the menu, click to select or clear the Interfaces, Realizations, or Artifacts check box.
Related Pages
2.5.15 Connector
Contents
On this page
Each connector can be attached to two or more connectable elements, each representing a set of
instances.
You can specify connector and connector end properties in the connector and connector end
Specification window. In the same window, you can find the description of each property. Descriptions
are presented in the description area of the Specification window (see page 882).
The menu appears if a new Port can be created on the Part or the Part has hidden Ports.
3. Select one of the following command:
• None - if you want to connect connector straight to the part.
• On a port in the list. Hidden ports of the part are listed. The selected port will be represented on
the diagram and the connector will be connected to it.
• New Port - to create a new port with the same name, type and multiplicity as the port from
which the connector is drawn.
You can draw a connector to a Port too and the menu appears. As a result, the nested Port is
created.
2.5.16 Constraint
A Constraint represents additional semantic information attached to the constrained elements. It is an
assertion that indicates a restriction that must be satisfied by a correct design of the system. The
constrained elements are those elements required to evaluate the constraint specification. In addition,
A Constraint is represented as a linguistic, enclosed in braces ({}), statement in some formal (OCL, C++,
and other), or a natural language. There are 14 standard constraints in UML such as association, global,
and parameter. You can also define your own constraints.
• Time Constraint. It specifies the combination of min and max timing interval values.
• Duration Constraint. It defines a value specification that indicates the temporal distance between
two time instants.
• Constraint. It represents an additional semantic information attached to the constrained
elements.
• Constraint Link (see page 660). It is a graphical representation of a constraint element.
Related pages
To see the constraint expression, make sure the Show Constraint value is set to true, in the
Symbol Properties dialog (see page 943).
• In the Containment Tree, from the element shortcut menu, select Create Element > Constraint.
• In the Specification window (see page 882), select the Inner Elements property group and click the
Create button (select Constraint from the list, if needed). Specify the constraint in the constraint
Specification window (see page 882).
• In the Specification window (see page 882), select the Constraints property group and click the
Create button. In the menu, select a duration, interaction, time, or simple constraint. The
constraint Specification window (see page 882) is displayed.
• In the diagram pallet, under the Common category, expand the Constraint command and select
the Duration Constraint, Time Constraint, or Constraint button and create it directly on the action
shape.
1. In the chosen element's Specification window (see page 882), select the Constraints property group
and click the Apply button. The Select Constraint dialog opens.
2. Select a constraint or create a new one.
3. Click OK when you are done.
Related Pages
Constraint Link
A Constraint Link is a graphical representation of a constraint element. The Constraint Link is shown on
the diagram pane as a dashed arrow from one shape to another. You can assign a particular constraint
to the Constraint Link. The constraint assigned to the Constraint Link is labeled in braces: {} . See an
example of the constraint representation in the following figure.
On the Constraint Link, you can display the constraint direction arrow. The direction of the arrow
represents a relevant information within the constraint. The client (the tail of the arrow) is mapped to
the first position and the supplier (arrowhead) is mapped to the second position in the constraint.
You can format (see page 943)the constraint symbol properties in the Symbol Properties dialog (see page
943).
1. In the Class, Use Case, Sequence, or Activity diagram palette (see page 24), under the Common
category, expand the Constraint command and select the Constraint Link.
2. Draw a Constraint Link between desired shapes.
To add a constraint expression to the Constraint Link
• From the Constraint Link shortcut menu, choose the Select Constraint and do one of the
following:
• Select Create Constraint to create a new constraint.
• Choose a constraint from the list.
To display a Constraint Link direction arrow
1. Select the Constraint Link and from the shortcut menu, select Show Arrow.
The direction of the Constraint Link will be displayed. See an example in the following figure.
Related Pages
2.5.17 Containment
Contents
Example of package nesting (on the left) and package nesting using containment
relationship (on the right)
In the example above, the Containment end with a circle plus symbol shows a containing element.
The User package is a contained element and the Domain package is a containing element: the
owner of the User package is the Domain package.
You can format containment symbol properties in the Symbol Properties dialog (see page 943).
Related pages
Containment Tree
Contents
You can create the Containment tree when drawing more than one Containment relationship.
134 https://docs.nomagic.com/display/SYSMLP185/Nesting+Requirements
135 https://docs.nomagic.com/display/MD190SP2/Model+elements
1. Draw a Containment path from each contained element to the containing element.
2. Now, do one of the following:
• Through the diagram pane.
a. Select the Containment relationship.
b. Click and hold the little square (the end of the Containment path) next to the Containment
end with the circle plus symbol.
c. Drag and drop the selected Containment end on the other Containment path.
d. While dragging, the Containment path turns blue, indicating an allowable connection.
Containment paths merge together.
1. Right-click the Containment tree's end with the circle plus symbol pointing to a containing
element.
• Select the containment path you want to remove from the tree. Open its shortcut menu and click
the Remove From Tree command. The contained element is added to the containing element
separately.
You can specify a Control flow by changing its property values in the Control flow Specification window
(see page 882). Each property is described in the description area on this window.
A Control flow can have guards (constraints that provide fine-grained control over the firing of the
Control Flow). To specify guards, choose the Guard box in the Control Flow dialog box.
MagicDraw provides the following predefined data types: boolean, byte, char, date, double, float, int,
Integer, Real, long, short, void, and String.
You can also create Enumeration (see page 666)or Primitive (see page 667)Data Types.
• From the Browser (see page 29), select New from the Class (see page 633) or Create Element from the
Package (see page 771), Subsystem (see page 832), or Model (see page 748) shortcut menu, and then
select Data Type, Enumeration, or Primitive.
Related pages
Related Pages
Enumeration
Enumeration defines a kind of data type whose range is a list of predefined values called Enumeration
Literals. An Enumeration can contain Operations, but they must be pure functions (this is the rule for all
data type elements).
An Enumeration can be specified by changing its property values in the Enumeration Specification
window (see page 882). Each property is described in the description area on this window.
Enumeration Literals
Enumeration Literal defines an element of the run-time extension of an Enumeration data type. It has
no relevant substructure, therefore, it is atomic.
• Select the Enumeration shape, click the Create Element button , and then select Enumeration
Literal.
• In the Containment tree, right-click the Enumeration and select Create Element > Enumeration
Literal.
Enumeration Attributes
To create an Attribute for the Enumeration, do one of the following
• Select the Enumeration shape, click the Create Element button , and then select Property.
• In the Containment tree, right-click the Enumeration and select Create Element > Property.
As you can see, the Attribute is by default read-only.
Primitive
A Primitive defines a predefined Data Type (see page 665) without possessing any relevant UML
substructure; that is, it has no UML parts. A Primitive data type can have an algebra as well as
operations defined outside of UML (for example, mathematically). The Primitive data types used in UML
include Integer, Unlimited Integer, Real, and String.
Related Pages
Contents
A Decision Node in an Activity diagram (see page 296) is used much like a choice or junction (see page 817)
point in the State diagrams (see page 294). Decision nodes allow you to separate the Activity Edges. Merge
nodes allow you to combine the Activity Edges together.
Decision Nodes are created using guard conditions. They help protect Activity Edges that depend on
guard conditions.
1. The symbol used for the Decision Node is a large diamond shape. It can have one or two
incoming Activity Edges, and at least one outgoing Activity Edge
2. The symbol used for the Merge Node is a large diamond shape. It can have exactly one outgoing
Activity Edge but may have multiple incoming Activity Edges.
2.5.21 Dependency
Contents
A dependency is a relationship signifying that a model element137 requires other model elements for its
specification or implementation. The client element is either semantically or structurally dependent on
the definition of the supplier element(s).
A dependency is shown as a dashed arrow between classes or packages. The client element (at the tail
of the arrow) depends on the supplier element (at the arrowhead). You can label the arrow with an
optional stereotype and an individual name.
136 https://docs.nomagic.com/display/MD190SP2/Model+elements
137 https://docs.nomagic.com/display/MD190SP2/Model+elements
Related pages
Element Import
Access
An Access relationship shows that elements can only be accessed from a package, and it cannot be
referenced.
Deployment
3. Click the Deployment button and draw a deployment link from the node to
the artifact.
• On the diagram pane, select the node instance symbol, then click the Compartments button
(usually it is displayed on the top left corner of the symbol). In the opened menu, select
the Deployed Elements.
• On the diagram pane, right-click the node instance and from the shortcut menu,
select Symbol Properties. Then in the Symbol Properties dialog, set the Suppress
Deployed Elements property value to false.
On this page
Package import
In UML, package import is defined as a directed relationship between an importing namespace and a
package whose members are imported into that namespace. The visibility of a package import is either
public or private. The predefined keywords are «import» for a public package import, and «access» for a
private package import.
A package import is displayed as a dashed arrow with an open arrowhead aiming from the importing
namespace towards the imported package.
Package import applies to an entire package, and all the model elements of the target package are
imported into the source namespace. The source package can access subpackages and their imported
There are more useful filters (see page 998) you can use for the same purpose.
1. Right-click the package to which you want to restrict your type selection, and
select Refactor > Convert To > Model.
2. Select a typed element nested in that model, and specify its type.
3. Apply Filter By Package Imports to only list the elements that belong to the same abstraction
level.
1. Go to Analyze > Validation > Validate.
2. In the Validation dialog, select UML correctness constraints from the Validation Suite drop-
down list.
3. Click Validate.
4. In the Validation Results panel, right-click the element you want to change or unset type for,
and select Change Type, Unset Type, or Create Package Import Relationship accordingly.
On this page
Abstraction
An Abstraction is a Dependency (see page 668) relationship that relates two elements or sets of elements
that represent the same concept at different levels of abstraction or from different viewpoints.
Set the Abstraction symbol properties in the Symbol Properties dialog (see page 943).
2.5.22 Device
A Device is a physical computational resource, such as a piece of hardware (a desktop computer,
processor, or server), or a human work unit (a department or team). A device is commonly composed of
other devices. Composition may be modeled by placing the contained device in the node icon
representing the containing device.
A Device can be specified by changing its property values in the Device Specification window (see page
882). Each property is described in the description area on this window.
2.5.23 Event
An event is the specification of some occurrence that may potentially trigger effects by an object, that is,
an event shows what should happen to change a particular state (see page 819)in a system. There are the
following event types:
Activity diagram (see page 296) To specify an event type for the Accept Event Action (see page
597).
State Machine diagram (see page 294) To specify a event type for the transition (see page 843), or
transition to self.
Protocol State Machine diagram (see page 296) To specify an event type for the protocol transition, or protocol
transition to self.
When specifying an event type for a transition, you can type the command straight on the transition
path (see page 844) on the diagram pane. The same assignment is valid for a transition to self, protocol
transition, and protocol transition to self.
Event types, their functions, samples, and command syntax are described in the following table.
A relative time trigger is specified with the keyword “after” followed by an expression that evaluates to a
time value, such as “after (5 seconds).” An absolute time trigger is specified with the keyword “at”
followed by an expression that evaluates to a time value, such as “Jan. 1, 2012, Noon.”
You can change the time expression by changing the Is Relative property value.
1. Open the selected Transition (see page 843)Specification window (see page 882) or Accept Event Action
(see page 597)Specification window having the TimeEvent type assigned.
2. In the Trigger category, do one of the following:
If you do not see the Event Type property, click the button + near the Trigger category to
expand its content.
• To specify the event occurrence at the absolute time, set Is Relative property value
to false.The time event is specified as absolute, and the command syntax changes from at
() to after ().
• To specify the event occurrence at the relative time, set Is Relative property value to
true.The time event is specified as relative, and the command syntax changes from after()
to at ().
Signal Event
A signal may be sent as the action of a state in a state machine or as a message in an interaction.
A signal is a named object sent asynchronously by one object and received by another.
In the Signal Specification window (see page 882), you can modify the current element and add various
specifications to it.
Contents
The Exception Handler may be drawn from an Output Pin to an Input Pin or from an Action (see page 596)
to an Input Pin, as shown in the figure below.
Related pages
The Execution Environment dialog box contains the following specific panes:
138 https://docs.nomagic.com/display/MD190SP2/Model+elements
In the preceding example, the Penalize for Overdue Use Case extends the Register Item Return Use Case.
The Register Item Return Use Case owns the Return Violation extension point.
You can format the extend symbol properties in the Symbol Properties (see page 943) dialog.
You can specify Extend properties in the Extend Specification window (see page 882). You can find the
description of each property In the same window. Descriptions are presented in the description area of
the Specification window.
Related pages
2.5.27 Extension
An Extension is used to indicate that the Properties (see page 2214) of a Metaclass (see page 748) are
extended through a Stereotype (see page 827), and provides the flexibility to add (and later remove)
stereotypes to a Class (see page 633).
An Extension is a kind of Association (see page 618). One end of the Extension is an ordinary Property that
ties the Extension to a Class. The other end is an ExtensionEnd tying the Extension to a stereotype that
extends the Class.
You can specify an Extension by changing its property values in the Extension Specification window (see
page 882). Each property is described in the description area on this window.
You can format the Extension symbol properties in the Symbol Properties dialog (see page 683).
2.5.29 Fragment
A fragment is an abstract notion of the most general interaction unit. It is a piece of an interaction.
Each interaction fragment is conceptually similar to an interaction by itself.
Our modeling tool represents twelve kinds of fragments: Alternatives, Loop, Option, Parallel, Break,
Negative, Critical Region, Consider, Ignore, Weak Sequencing, Strict Sequencing, and Assertion.
Related References
Related Pages
Alternative Fragment
Our modeling tool represents twelve kinds of fragments: Alternatives, Loop, Option, Parallel, Break,
Negative, Critical Region, Consider, Ignore, Weak Sequencing, Strict Sequencing, and Assertion.
Combined Fragment
Contents
Our modeling tool represents twelve kinds of fragments: Alternatives, Loop, Option, Parallel, Break,
Negative, Critical Region, Consider, Ignore, Weak Sequencing, Strict Sequencing, and Assertion.
The UML Combined Fragment element allows the expressions of interaction fragments to be defined in
the Sequence diagram (see page 291). The Combined Fragments provide a means to define particular
conditions and subprocesses for any sections of lifelines in the Sequence diagram by specifying an area
where the conditions or subprocesses apply. Using the Combined Fragment, a fragment of a Sequence
diagram can be separated.
Related Pages
2.5.31 Gate
MagicDraw allows for displaying the messages (see page 723)when leaving or entering a sequence
diagram (see page 291), interaction use (see page 707), or combined fragment (see page 686). The Gate is a
connection point for representing a message (see page 723) from the outside to the current sequence
diagram (see page 291), interaction use (see page 707), or combined fragment (see page 686).
• For passing and returning arguments to InteractionUse (see page 707), which calls some Interaction.
• For displaying “exceptions“ as messages (see page 723) that stops an interaction execution and
leaves it.
• For “calling“ sequence blocks represented as CombinedFragments (see page 686).
Gate has no notation. Gates are created as message (see page 723) ends when drawing messages (see page
723) to/from a diagram frame, an interaction use (see page 707), or a combined fragment (see page 686).
• Draw a call, send, create, or delete a message (see page 723) from the diagram frame.
• Draw a reply message (see page 723) to the diagram frame.
• Draw a call, send, create, or delete a message (see page 723) from the combined fragment (see page
686) (inside combined fragment (see page 686)).
• You can view the created gates of message (see page 723) in the Message Specification
window (see page 882). In the Send Event (see page 677)list box you can see a formal gate. The
Receive Event (see page 677)lists the actual gate.
• The Gate uses text from the message (see page 723) as an identification name. For example,
a message name or a message operation.
To draw create an actual gate of the formal gate, do one of the following
• Draw a call, send, create, or delete a message (see page 723) to the interaction use (see page 707),
which refers to the diagram with the formal gates. The Select Formal Gate dialog opens.
• Draw a reply message (see page 723) from the interaction use (see page 707), which refers to the
diagram with the formal gates. The Select Formal Gate dialog opens.
• Draw a call, send, create, or delete a message (see page 723) to the combined fragment (see page 686)
(outside combined fragment (see page 686)). The Select Formal Gate dialog appears.
You can also view the formal and actual gates in the gates Interaction Specification window (see
page 882),
Interaction Use dialog, Combined Fragment dialog, and the Actual Gates and Formal
Gates panes.
The Select Formal Gates command is available only if there are formal gates.
Related pages
The formal gate and actual gate usage in the sequence diagram
See the following figure where the getBalance message is drawn from the diagram frame to the
theirBank lifeline. The getBalance message has a gate.
See the following figure where the actual gate is presented. The Balance Lookup interaction use refers
to the Balance Lookup sequence diagram. The getBalance message (see the 2nd message) has selected
the formal gate and automatically repeats the data of the getBalance message from the Balance Lookup
diagram.
2.5.32 Generalization
A generalization is a taxonomic relationship between a more general classifier and a more specific
classifier. Each instance of the specific classifier is also an indirect instance of the general classifier.
Thus, the specific classifier inherits the features of the more general classifier.
You can format the generalization symbol properties in the Symbol Properties dialog (see page 943).
Related pages
Sample Model
You can see a generalization relationship sample in <MagicDraw installation
directory>\samples\case studies\Magic Library.mdzip.
Generalization tree
Usually the general element has more than one specific elements and sometimes specific elements
may have their specific elements - the diagram with these generalizations may become messy. To
display the generalization relationships and specific elements orderly, the generalization tree can be
created.
• Select the generalization element and from its shortcut menu select Refactor > Make Sub
Tree.
• Select all elements you want to add to the tree and, on the diagram toolbar, click the Quick
Diagram Layout (Ctrl + Q) button and select one of the tree form layout.
• Right click any relationship in the generalization tree. On the opened shortcut menu,
click Ungroup tree.
• Select the end of a concrete generalization relationship and drag it to other element.
Generalization set
A generalization set is a packageable element whose instances define collections of subsets
of generalization relationships. Each generalization set defines a particular set of generalization
relationships that describe the way which a general classifier may be divided using specific subtypes.
You can format the generalization symbol properties in the Symbol Properties dialog. For more
information on how to open the generalization set's Symbol Properties dialog, scroll down to read on
how to open the generalization set's Symbol Properties dialog (see page 699).
More Information
For more information about symbol representation properties, see Formatting symbols (see page
943).
You can specify generalization set properties in the Generalization Set's Specification window. For more
information on how to open the Generalization Set's Specification window, scroll down to read on how
to open that Specification window (see page 698). In the same window, you can find the description of
each Generalization Set property in the description area of the Specification Window.
More Information
For more information about the Specification window usage, see Specification window (see page
882).
For more information about specifying property values, see Editing property values (see page 890).
Note
For a generalization set, use the name of a selected generalization set (not the relationship
path) to open the Symbol Properties dialog or Specification window.
Related Pages
For more information about working with the elements Selection dialog, see Selecting
elements (see page 994).
3. Select a generalization set owner and click the Create button. If this command is unavailable,
turn on the Creation Mode.
4. In the opened list, click Generalization Set. The Generalization Set Specification window opens.
5. Type the generalization set name and set other properties you need. Click Close when you are
done.
6. The created generalization set is displayed in the model tree or list and in the Selected elements
area of the Select Generalization Set dialog.
Selected Elements
In the Generalization Set property value cell, several generalization sets can be listed, but only
the first generalization set name is displayed on the diagram pane near the generalization.
1. On the diagram pane, select a generalization and open its shortcut menu.
2. In the shortcut menu, click Generalization Set. The Select Generalization Set dialog opens.
3. If it's already there, select the generalization. Otherwise, click the Create Generalization
Set button.
4. The Select Owner dialog opens.
5. In the dialog, select an existing or create a new generalization set owner and click OK when you
are done.
6. The Generalization Specification window opens. Type the generalization set name and set other
properties you need.
7. Click Close when you are done.
1. Select one generalization, then hold down the Shift key and select the other
generalizations you desire.
2. While hovering your mouse over one of the generalizations, right click to show the
shortcut menu and select Generalization Set.
3. Repeat steps 2-7 from the aforementioned set of instructions.
For more information about working with the elements Selection dialog, read Selecting
elements (see page 994).
1. On the diagram pane, select a generalization and open its shortcut menu
2. Click Generalization Set. In the opened Select Generalization Set dialog, select the
generalization set you need. If you do not see your desired Generalized Set then you can can
create a new generalization set (see page 696) from the dialog.
You can select generalizations that belong to other sets. Selecting such a generalization
removes it from the previous set and adds it to the current one.
• On the diagram pane, double click on the generalization set name revealing the Generalization
Set Specification window.
• Invoking the Generalization Set Specification window from the diagram pane shortcut menu
a. On the diagram pane, right click the generalization set name revealing its shortcut menu.
b. Select the Specification command opening the Generalization Set Specification window.
• Opening the Generalization Set Specification window from the Generalization Specification
window.
a. Open the Generalization Specification window by double-clicking on the Generalization
arrow.
b. In the Generalization Specification window, select the Generalization Set property cell.
c. Select the generalization set you desire.
d. Right-click to open the generalization set shortcut menu. Select Open Specification.
• On the diagram pane, select the generalization set name and from its shortcut menu, select
Symbol Properties. The Symbol Properties dialog opens.
1. Select a general element on the diagram pane and invoke its shortcut menu.
2. Click Refactor > Make Generalization Set Tree.
2.5.33 Include
The Include relationship is used when there are common parts of the behavior among two or more Use
Cases. Each common part is then extracted to a separate Use Case, to be included by all base Use Cases
having this part in common. The Include relationship is represented by a base Use Case to an inclusion
Use Case.
An Include relationship between Use Cases indicates that an instance of the including Use Case also
contains the behavior as specified by the included Use Case.
1. Create two or more Use Cases by dragging and dropping the Use Case element
onto your diagram pane.
2. Click on the Include relationship and connect it between two Use Cases.
3. The result should look like the aforementioned example.
More Information
For more information about symbol representation properties, see Formatting symbols (see page
943).
You can specify a comment in the Include Specification Window. In the same window, you can find the
description of each Include property in the description area of the Specification Window.
More Information
For more information about the Specification window usage, see Specification window (see page
882).
For more information about specifying property values, see Editing property values (see page 890).
Related Pages
Contents
An Information Flow specifies that one or more information items circulate from its sources to its
targets. Information flows require an “information channel” for transmitting information items from the
source to the destination.
An information channel is represented in various ways, depending on the nature of its sources and
targets. It can be represented by connectors, links, associations, or dependencies. For example, if the
source and destination are parts in composite structure diagrams such as a collaboration, the
information channel is likely to be represented by a connector between them. Or, if the source and
target are objects (which are a kind of Instance Specification), they can be represented by a link that
joins the two, and so on. The Information Flow and the information item notation are added. You can
draw them using the Information Flows toolbar in the Class diagram (see page 289) or Composite
Structure diagram (see page 303).
1. Create Classes (see page 633) (Parts (see page 776)) and an Association (see page 618) (Connector (see page
655)) relationship between them.
Make sure the properties enabling display of Conveyed Information on the relationships
are selected.
To display Conveyed Information
a. Right-click the Association (Connector) and choose the Symbol Properties (see page 943)
command.
b. In the open dialog, change the properties display mode (see page 887) to Expert or All.
c. Set the Show Conveyed Information A and Show Conveyed Information B check
boxes to true.
Conveyed information
One Information Flow may have several Conveyed Information items.
Related pages
Contents
The Information Flows (see page 701) package provides mechanisms for specifying the exchange of
information between entities in a system at a high level of abstraction (see page 1163). Information Flows
describe the circulation of information in a system in a general manner. They do not specify the nature
of the information or the mechanisms by which this information is conveyed (message passing, signal,
common data store, parameter of operation, etc.). Also, they do not specify sequences or any control
conditions. It is intended that representation and realization links (see page 717) will be able to specify
which model element implements the specified information flow, and how the information will be
conveyed. while modeling in detail.
An Information Item is an abstraction of all information that can be exchanged between objects. It is a
kind of classifier (see page 475) intended to represent information in a very abstract way, one which
cannot be instantiated.
• Open the relationship Specification window (see page 882). Select the Conveyed
Information property group and click the Add button.
3. The New Conveyed Information dialog opens. Click next to the Conveyed
Information text box.
4. The Select Conveyed Information (see page 994) dialog opens. Click the Creation Mode button to
enable the creation of new elements.
5. Select the package where you want to create a new element.
6. Click the Create button and select Information Item element in the list.
7. The Specification window of the newly created element opens. Type the element name and
specify other properties according to your needs.
8. After you finish, close all the dialogs one by one. The Information Item element is created.
Related pages
You can specify an Initial node by changing its property values in the Initial node Specification window
(see page 882). Each property is described in the description area on this window.
You can format Initial Node symbol properties in the Symbol Properties dialog (see page 943).
2.5.37 Instance
An instance specification specifies the existence of an entity in a modeled system and completely or
partially describes the entity.
• The classification of an entity by one or more classifiers of which the entity is an instance. If
the only classifier specified is abstract, then the instance specification only partially describes
the entity.
In the Component (or Deployment) diagram Node Instance, Component Instance, Artifact Instance
elements are the same Instance Specification elements with an assigned component, node or artifact.
The instances are shown using a rectangle by underlining the name string of an instance element. The
instance of an actor (see page 613)is shown as an actor “stick man” figure with the actor’s name below the
symbol.
You can specify instance properties in the instance Specification window (see page 882). In the same
window, you can find the description of each property. Descriptions are presented in the description
area of the Specification window. If you need to handle a huge amount of instance specifications,
use instance table (see page 704).
• On the diagram, click an instance shape, and then on the smart manipulator toolbar, click .
In the open list, select the classifier.
• On the diagram, click an instance shape, and then press Ctrl+T. In the open list, select
the classifier.
• On the diagram, click an instance shape, then click the name area. Type the “:” and then type the
classifier name. Press Enter or click anywhere on the diagram. The classifier is created and
assigned.
Type the “:” colon, then press Ctrl+Space or Ctrl+Backspace and then in the open list,
select the classifier.
• In the Containment tree, select a classifier and drag it to the instance shape.
Use the Node Instance button to create the Instance Specification with assigned Node and the Node
Instance will have a Node shape.
Drag-and-drop feature is available only if Instance Specification classifiers are compatible with
Property type and if Property is editable.
• None
• Name
• Qualified name
Related Pages
2.5.38 Interaction
An Interaction is a unit of Behavior (see page 629) focusing on the observable exchange of information
between connectable elements, a specialization of Interaction Fragment and of Behavior.
Interaction operand
An Interaction operand represents an Interaction with an optional guard expression. The Interaction
operand is executed only if the guard expression tests true at runtime. The object that starts the
interaction requires all the information necessary to make the decision about whether to proceed. The
absence of any guard condition means that the interaction is always executed.
In the Interaction operand Specification window (see page 882), you can modify the current element and
add various specifications to it.
Interaction Use
Interactions are units of behavior of an enclosing Classifier. They focus on the passing of information
with Messages between the Connectable Elements of the Classifier.
You can specify interaction use properties (see page 890) in the Specification window (see page 882). In the
same window, you can find the description of each property. Descriptions are presented in the
description area of the Specification window (see page 882).
• Open the Specification window (see page 882) of the interaction use and click the cell of the Refers
To property value. Then click and in the open dialog, select the element. Click OK when you
are done.
• On the diagram, right-click the interaction use shape, and then point to Refers To. Then select an
element you wish to refere to.
• On the diagram, click an interaction use shape, and then press Ctrl+T. Then select an element
you wish to refere to.
• On the diagram, click an interaction use shape, and then on the smart manipulator toolbar, click
. Then select an element you wish to refere to.
• In the Containment tree, select an element and drag it to the interaction use shape.
The rake icon is displayed on the shape if the interaction use refers to another sequence
diagram. The rake icon is not shown by default therefore you need to set the Show Rake Icon
(see page 951) property value to true in the Symbol Properties (see page 943) dialog.
Related Pages
2.5.39 Interface
An interface is a specifier for the externally-visible operations of a class, component, or other
classifiers (including subsystems) without a specification of the internal structure. Each interface often
specifies only a limited part of the behavior of an actual class.
The set of interfaces realized by a classifier is its provided interfaces, which represent the obligations
that instances of that classifier have to their clients. They describe the services that the instances of that
classifier offer to their clients.
You can specify interface properties (see page 890) in the interface Specification window (see page 882). In
the same window, you can find the description of each property. Descriptions are presented in the
description area of the Specification window (see page 882).
Related pages
Related Pages
The interfaces may also be used to specify required interfaces, which are specified by a usage
dependency between the classifier and the corresponding interfaces. Required interfaces specify
services that a classifier needs in order to perform its function and fulfill its own obligations to its
clients.
A provided interface is shown using the "lollipop" notation attached to the port, and a required
interface is shown using the "fork" notation attached to the port (see the following figure).
Lollipop and fork symbols in the Composite Structure diagram are implemented as small attachments
to a Port symbol similar to name a label. It is not the same as the independent stand alone notation of
the interface, it is only part of the port symbol. It is important for Composite Structure diagrams in
which real Interfaces (as Classifiers) cannot be used. It is an optional notation as a port does not display
provided or required interfaces by default.
1. Select the port shape that has the provided/required interfaces you want to display.
2. Do one of the following:
- From the port shortcut menu, select Display > Display Provided/Required Interfaces.
- On the diagram toolbar, click
Ports can provide or require many interfaces, therefore, you can choose which ones to display or hide.
Use the Edit Compartment dialog to manage the visibility of these interfaces.
The required and provided interfaces may optionally be organized through ports.
To add and manage the provided and required interfaces quickly, in the Component
Specification window, select the Provided/Required Interfaces property group.
A classifier that implements an interface specifies instances conforming to the interface and its
ancestors. A classifier may implement a number of interfaces.
In the Interface realization Specification window (see page 882), you can modify the current element and
add various specifications to it.
To open the Interface Realization dialog box, choose the Specification command from the Realization
shortcut menu.
In the Interface Realization Specification window (see page 882), the Implementing Classifier property
references the classifier that realizes the Interface to which it points.
Specify the Internal Transition in the Transition's Specification window (see page 882).
139 https://docs.nomagic.com/display/CST190/Classifier+Behavior+property
In your project, if you have a State Machine diagram (see page 294) created, do the following:
1. Double-click the State or select Specification from the State's shortcut menu. The State's
Specification Window opens.
2. Click the Internal Transitions group.
3. Click the Create button. The Transition's Specification window opens.
4. Specify an Internal Transition.
5. Click Close.
Related Pages
Specify the Interruptible Activity Region in the Interruptible Activity Region Specification window (see page
882).
2.5.43 Lifeline
Contents
A lifeline represents an individual participant in the Interaction. The lifeline represents only one
interacting entity, symbolized by a rectangle.
• In the lifeline Specification window, in the Type property value, click the ... button, and in the
open dialog, select the type. When you are finished, click OK.
• On the diagram, from the lifeline shortcut menu, select Type. In the open list, select the type.
• On the diagram, click a lifeline, and then, on the smart manipulator toolbar, click . In the open
list, select the type.
• On the diagram, click a lifeline, and then press Ctrl+T. In the open list, select the type.
• On the diagram, select a lifeline, and in the name area, type the “:” and the name of the type.
Press Enter or click anywhere on the diagram. The type is created and assigned.
Type the “:”, press Ctrl+Space, or Ctrl+Backspace. In the open list, select the type.
• In the Containment tree, select an element and drag it to the lifeline shape.
• On the diagram, right-click the lifeline. From the shortcut menu, select the Show Classifier check
box.
Displaying lifelines
You can display lifelines on the Sequence or Communication diagram in the following ways:
There are two situations in which you can use the Display Lifelines dialog to automatically display
lifelines:
2. In the opened Display Lifelines dialog, select the lifelines you want to display, and click OK.
Selected lifelines are displayed on the diagram pane.
3. In the dialog, select the lifelines you want to display, and click OK.
Selected lifelines are displayed on the diagram pane.
Related pages
The models used in the figures of this page is the Communication diagram and Sequence diagram
sample models that comes with MagicDraw. To open this sample do one of the following:
• Download:
- communication diagram.mdzip140.
- sequence diagram.mdzip141.
• Find in modeling tool:
- <modeling tool installation directory>\samples\diagrams\communication diagram.mdzip.
- <modeling tool installation directory>\samples\diagrams\sequence diagram.mdzip.
140 https://docs.nomagic.com/download/attachments/42586363/communication%20diagram.mdzip?
api=v2&modificationDate=1479988632454&version=1
141 https://docs.nomagic.com/download/attachments/42586363/sequence%20diagram.mdzip?
api=v2&modificationDate=1479988618002&version=1
(Insert Screenshot)
With our modeling tool, you can display on diagrams the following:
• Links created between Instance specifications (the Display Paths (see page 481) command on the
Instance specification shortcut menu).
• Instance specifications at the other end of a Link (the Display Related Elements (see page 476)
command on the Instance specification shortcut menu).
Related Pages
Related References
1. In the Object diagram's diagram pane, create two Instance shapes by dragging and dropping the
element onto the diagram pane. Select any Classifier you would like.
2. Draw a Link between the two Instance shapes. The Select Associations dialog opens.
3. In the Select Association dialog, select the appropriate associations then click OK.
4. The Create Slots dialog opens.
6. Click OK.
1. In the window, click Options > Environment. The Environment Options dialog opens.
2. In the General options group, under the Editing subgroup, set the Automatically Create Slots
in Link option value to true.
1. Right-click on a Link. Select Symbol Properties. The Symbol Properties dialog opens.
2. Deselect the Suppress Slots check box, so it says false.
Edit Compartment
You can select to display or hide an individual slot in the Compartment Edit dialog.
To open the Compartment Edit dialog
• Select the link on a diagram pane and on its shortcut menu, click Edit
Compartment > Slots.
1. On a diagram pane, select an end of a Link and move it to the other target.
2. The Link is connected to the other target.
Related Pages
Related References
The Instance Specification type mismatch validation rule allows for updating slot values when referenced
association end types are incompatible with connected instance specification types.
The Missing slots on links validation rule are more useful than migrating projects from the MagicDraw
17.0.2 version or earlier. The validation rule detects links that have related associations but do not have
slots created in them. For each incorrect link, the warning is displayed. To resolve the warning, there is
the Create slots for this link resolution action. After choosing that action, slots are created in the link.
The validation rule is available only if the Automatically Create Slots in Link option is set to
true in the Environment Options dialog.
Related Pages
2.5.45 Manifestations
Contents
An artifact embodies or manifests a number of model elements. It owns the manifestations, each
representing the utilization of a packageable element.
To create the manifestations, simply draw the Manifestation link from an artifact to a component.
• On the diagram pane, select the component shape, click the Compartments button, and from the
list, select Artifacts.
• In the component Symbol Properties dialog, cancel the selection of the Suppress Artifacts
check box.
• Model Elements142
• Component diagram (see page 300)
• Specification Window (see page 882)
• Artifact (see page 616)
• Compartment (see page 537)
2.5.46 Message
Contents
A Message defines a particular communication between Lifelines (see page 713) of an Interaction (see page
707), such as raising a Signal, invoking an Operation (see page 645), or creating or destroying an Instance.
Messages specify the kind of communication, the sender, and the receiver.
A Message is represented by arrows between the lifelines. The style of the Message line and arrowhead
reflect the types of the Message.
142 https://docs.nomagic.com/display/MD190SP2/Model+elements
You can see the description of a selected property in the description area of the Specification window
(see page 882). To see descriptions, be sure the Show Description option is selected.
Message sorts
asynchCall Asynchronous means that the caller continues immediately after the call.
asynchCall Messages do not have reply Messages.
asynchSignal The Message was generated by an asynchronous send Action. The argument of
the Message must correspond to the attributes of the Signal.
createMessage The Message designates the creation of another Lifeline object. No other
Messages on a given Lifeline in an Interaction operand may appear above a
Lifeline.
Message syntax
The Message name is displayed on the message path on the diagram pane. The syntax of the message
name is as follows:
<messageident> ::= [<attribute> '='] <signal or operation name> ['(' [<argument> [','
Example
v=fo(P1="a", P2=True):12
Contents
You can assign Operations (see page 645)only to Call (synchronous and asynchronous) Messages. Only
one Operation can be assigned to a Message.
• Assign an Operation to a Message in the Message Specification window (see page 882):
1. Draw a call Message between two Lifelines (see page 713)or select an existing Message on a
diagram pane.
2. Open the Message Specification window.
3. Click the Signature (operation) property value cell and then select an Operation in the drop-
down list.
• If the Signature (operation) drop-down list is empty, check if the Lifeline the
current Message is drawn to has a type assigned, and if this type has a specified
Operation.
• In the Signature (operation) drop-down list, both Operations and signals of your
project are listed. Make sure you have selected an Operation. If you assign a signal
to a call Message, the Message will automatically be converted to a send Message.
Names of operation parameters are displayed in message signature by default. However, you
can change this behavior by opening the Symbol Properties dialog (right-click a Message and
select Symbol Properties) and setting the Show Attribute/Parameter Names property to
true to display them or false to hide them.
You can create a new Operation only if the Lifeline the Message is drawn to has a type
assigned.
1. Draw a Call Message between two Lifelines or select an existing Message on a diagram pane.
2. Do one of the following:
• Click the Create New Operation According to This Message button (a small green circle
at the end of the Message name) and define the Operation property values in the
Operation Specification window.
• On the Message shortcut menu, click Operation and then click the Create Operation
button. Select the owner and click OK. In the Operation Specification window, define the
Operation and click Close.
• Type an Operation name right on a Message on the diagram.
Contents
Message syntax
The whole Message name should be written according to Message syntax rules (see page 723).
In the preceding example, you can see that the following appears on the Message name:
getUserAddress(city=”Allen”, street=”700 Central Expy S”, No=”110”). After you click the Create
New Operation (this message button ), the new getUserAddress Operation will be created. The
following Message arguments will be created - Allen, 700 Central Expy S, and 110, together with the
corresponding parameters - city, street, No.
The Lifeline that the call Message is connected to must have a type specified.The
preceding figure shows that the Address type is assigned to the second Lifeline.
2. On the diagram pane, on the message, type the message name according to the syntax rules (see
page 723).
3. After you have typed the Message name, exit the edit mode by clicking on the diagram pane.
Note that a new Operation is created only after you click the Create New Operation
according to this message button . If you do not click this button, the Message label
will be treated as a Message name.
If the syntax is written incorrectly, the Message Parsing window (see page 0) opens.
Parsing rules
The following table describes Message name samples and parsing results:
Create a new Operation login () Click the Create New The new operation is
Operation according to created: login ()
this message button .
1. The Operation is
referenced in the
Message
Specification
window (see page
882), the Signature
(operation)
property cell.
2. For the Lifeline
type, the login
operation is
created.
After click on the Create New Operation according to this message button
, a new Operation is always created. A new Operation is created even
if an Operation with the
same name already exists.
Create a new Operation login (“John”) Click the Create New The new operation is
with an argument Operation according to created: login
this message button . (unnamed1=”John”)
1. The Operation is
referenced in the
Message
Specification
window (see page
882), the Signature
(operation)
property cell.
2. In the message
Specification
window > the
Arguments
property group, the
following argument
is created: John.
3. For the Lifeline
type, the login
Operation is
created.
4. The login
Operation’s
parameter is
created and
synchronized (see
page 1027) with the
message argument.
Create a new Operation login Click the Create New The new operation is
with a parameter and an (username=”John”) Operation according to created: login
argument this message button . (username=”John”)
1. The Operation is
referenced in the
Message
Specification
window (see page
882), the Signature
(operation)
property cell.
2. In the Message
Specification
window > the
Arguments
property group, the
following argument
is created: John.
3. For the Lifeline
type, the login
operation is
created.
4. The login
operation’s
parameter is
created and
synchronized (see
page 1027) with the
Message argument.
Create a new Operation login () : true Click the Create New The new operation is
with a return parameter Operation according to created: login () : true
this message button .
1. The Operation is
listed in the
Message
Specification
window (see page
882), the Signature
(operation)
property cell.
2. In the Message
Specification
window > the
Arguments
property group the
following argument
is created: true.
3. For the classifier
assigned to the
Lifeline, the login
Operation is
created, together
with the parameter.
4. The login
Operation’s
parameter with the
return direction is
created. The
Operation’s
parameter is
synchronized (see
page 1027) with the
Message argument.
Create a new Operation status = login () Click the Create New The new operation is
for the Message together Operation according to created: status = login ()
with a reply Message this message button .
1. The Operation is
listed in the
message
Specification
window (see page
882), the Signature
(operation)
property cell.
2. In the Message
Specification
window > the Reply
message property
cell, the replay
Message is created.
(The Replay
message property
cell is displayed in
Expert mode only.)
3. The status argument is
created in the replay
Message.
Create a new argument Before was: Exit the Message label edit A new argument is
for the Message mode by clicking the created and the Message
login (username=John) diagram pane. is highlighted with yellow
color; that is, the
If this is valid, the Add the validation warning
argument is argument 1282: appears informing you
added straight that a parameter is
from the login (username=John, missing and the Message
Message label for 1284) argument is not
the already- synchronized with the
existing operation parameter.
Operation.
Update the argument Before was: Exit the message label The argument is updated.
edit mode by clicking the
login (John) diagram pane.
login (Joseph)
If the Message syntax is incorrect, you will receive the following notification message at the bottom
right corner of the MagicDraw window.
Related pages
Contents
You can assign a Signal only to Send or Call (synchronous or asynchronous) Messages. Only one Signal
can be assigned to a Message.
• Click the Message to type the Message name on the diagram. A Signal is automatically created
with the same name as Message name.
1. Draw a Send Message between two Lifelines or select an existing one on a diagram pane.
2. Open the Message Specification window.
3. Click the Signature (signal) property value cell and then select a Signal in the drop-down list.
Names of signal attributes are displayed in the message signature by default. However, you can
change this behavior by opening the Symbol Properties dialog (right-click a Message and
select Symbol Properties) and setting the Show Attribute/Parameter Names property to
true to display them or false to hide them.
Related pages
Contents
Assigning a Signal reception to a Message is very similar to the procedure of assigning an Operation to
a Message (see page 726).
These two conditions must be satisfied when creating a new Signal reception:
• At least one Signal must exist in your project.
• A possible Signal reception receiver (an activation to which the Message points) must
have a type assigned.
1. Draw a send Message between the Lifelines (see page 713) or select an existing one on a diagram
pane.
• From the Message shortcut menu, select the Create New Signal Reception
(the command with the small red circle icon, as shown above). Define Signal
reception property values in the Signal reception Specification window (see page 882). The
default name of the Signal reception is the name of the Message for which the Signal
reception is being created.
Related pages
Contents
Messages allow displaying an interaction between objects. A Message is labeled with either the
message name or the assigned Operation (see page 645)(signal) name and its arguments.
In the example above, you can see the Message card inserted that is drawn from the diagram frame
border to the Lifeline controller. The Message authorize is created from the Lifeline controller to the
diagram frame.
For a Message to be correct, its receive end should be known. However, we never know who
will connect to the gate from the outside. Thus, we are using the reply Message when creating
the Message from the Lifeline to the diagram frame (see Message authorize in the figure).
• A parallel execution of operations that belong to a single Class (see page 633).
• Callback messages.
The nested activation can be created between at least two messages that point to the same activation.
Ensure that you have at least two messages pointing to the same activation in your model.
1. Select any subsequent Message.
2. Do one of the following:
• From the Message shortcut menu, select Create Nested Activation.
• On the Message smart manipulator toolbar, click the Create Nested Activation button.
The Message will be connected to the nested activation.
A non-active Lifeline is one that has a non-active Class as a type assigned. The non-active Class
is the one whose Is Active property is set to false. This property is available in the Expert mode.
The figure below shows the creation of a simple nested activation, described in the procedure To create
a nested activation (see page 740).
An active Lifeline is one that has an active Class as a type assigned. The active Class is the one
whose Is Active property is set to true. This property is available in the Expert mode.
1. Select a Lifeline and from its shortcut menu, select Show Entire Activation. All activations of the
selected Lifeline become all-in-one.
2. Create an outgoing Message or select an existing Message pointed to an active object. Be
sure this is not the first one for the outgoing activation.
3. From the Message shortcut menu, select Create Nested Activation.
Related pages
Contents
Messages in Communication diagrams (see page 291) can only be depicted on connectors; thus, you
should draw a connector before assigning a Message to it.
1. On the diagram palette, click the button corresponding to the desired Message type.
A Message flow has two directions: right and left. Choose one of them by clicking the
associated button on the diagram palette.
1. From the diagram shortcut menu, select Numbering > Change Numbering.
2. Increase, decrease, and / or change the level of numbering in the Change
Communication Numbering dialog.
If the Edit button is inactive, remove the automatic advanced numbering (see page 743) of
Messages.
• Messages are assigned to connectors. How to assign a message to connector > (see page 742)
• The lifeline shapes are already displayed on the diagram pane. How to display lifelines > (see page
713)
• The paths between lifelines are displayed on the diagram pane. How to display paths > (see page
481)
To display messages
,
and select Display Messages.
Related pages
The model used in the figures of this page is the Communication diagram sample model that comes
with MagicDraw. To open this sample do one of the following:
Contents
143 https://docs.nomagic.com/download/attachments/42586363/communication%20diagram.mdzip?
api=v2&modificationDate=1479988632454&version=1
All of the sequence numbers with the same prefix form a sequence. The numerical predecessor is the
one in which the final term is one less. That is, number 6.4 is the predecessor of 6.5, where the number
“6” is an activator (see the example in the following figure).
Make sure the Use Advanced Numbering is selected (see page 742).
• From the Message shortcut menu, select Show Predecessors.
• In the Message Symbol Properties dialog (see page 943), set Show Predecessors to true.
Make sure the Use Advanced Numbering is selected (see page 742).
1. From the Message shortcut menu, select Activator.
2. Select the activator you want to assign to the selected Message. Numbering of the selected
Message and subsequent Messages decreases by one level. The first level number is the number
of an activator Message (see the following figure).
Related pages
2.5.48 Metaclass
The abstract syntax of UML is specified using a UML model called the UML metamodel. Classes in a
metamodel are called metaclasses. The detailed descriptions of each metaclass are provided in the
UML specification.pdf144.
The metaclass icon in the Model Browser (see page 29) is . Its shape is displayed with <metaclass>
stereotype.
All metaclasses in our modeling tools are stored in the Auxiliary Resources, expand the UML
Standard Profile Package > UML 2 Metamodel Package.
• In the Model Browser (see page 29), click and enable the Show Auxiliary Resources option.
2.5.49 Model
A model contains a (hierarchical) set of elements that describes the physical system being modeled. It
can also contain a set of elements that represent the environment of the system (typically Actors (see
144 https://docs.nomagic.com/download/attachments/42586959/UML%20specification.pdf?
api=v2&modificationDate=1504698722367&version=1
A model is presented as a package (see page 771)with a small triangle in the upper right corner of the
large rectangle. The triangle can be shown in the tab.
The model is defined as a package; that is, it has package properties in the Model Specification window
(see page 882), as shown below.
Related Pages
You can specify Node properties in the Node Specification window, where you can also read
descriptions of each property. Descriptions are presented in the description area of the Specification
window.
Related References
Related Pages
Specify the Structured Activity Node element in the Structured Activity Node Specification window (see
page 882).
To open the Structured Activity Node dialog box, in the Activity diagram draw a Structured Activity Node
element. From its shortcut menu, choose Specification.
A variable defined in the scope of the structured activity node. It has no value and may not be accessed
outside the node.
Contents
On this page
Description
Activity Parameter Nodes are object nodes at the beginning and end of the flows that are used to
accept inputs and provide outputs from activities.
1. In the Activity diagram palette, click the arrow next to the Object Node button to expand the list,
then select Activity Parameter Node.
2. Click the Activity diagram frame. The Activity Parameter Node is created, and its shortcut menu
opens.
3. Select Edit New Parameter to specify the parameter. The Parameter dialog opens.
4. Specify the parameter, and click Close.
When creating an Activity Parameter Node on a diagram frame, click on the diagram frame to open the
menu. In the menu, the following Activity Parameter Nodes are listed:
If a parameter with an inout direction is selected for the Activity Parameter Node creation, then two
Activity Parameter Nodes are created on the diagram frame.
You can also create an Activity Parameter Node by drawing an Object Flow directly to or from
the Activity diagram frame.
To specify Activity Parameter Node type by using the Specify Type button
1. Right-click the Activity Parameter Node and select the Specification command.
2. In the Specification window (see page 882), select the Type property value cell.
3. Do one of the following:
- Select an existing element from the list.
- Click and in the Select Element dialog do the following:
- Select an existing elements from the Tree or List tab.
- create new element by switching on the Creation Mode and clicking the Create button.
4. Click Close.
The type is specified for a Activity Parameter Node.
1. Right-click the Activity Parameter Node on the diagram, and select Specification.
2. In the Parameter property group, click to expand the Direction options drop-down menu.
3. Select the preferred direction, and click Close.
2. In the opened Select Parameters dialog, select the parameters that you want to display, and
click OK.
Selected Activity Parameter Nodes are displayed on the frame of the Activity diagram.
If you want all Activity Parameter Nodes to be displayed automatically when creating a
new Activity diagram, go to Options > Project on the main menu, and set the Display All
Activity Parameter Nodes in Diagrams option to true.
To display Activity Parameter Nodes on the frame in the pre-existing Activity diagram
3. In the dialog, select the parameters that you want to display, and click OK.
The selected Activity Parameter Nodes are displayed on the frame of the Activity diagram.
1. Right-click the Activity Parameter Node on the diagram, and select Symbol Properties.
2. In the Symbol Properties dialog, click to select or clear the Show Direction check box to display
or hide the direction.
3. Click Close.
• You can see the direction of the parameter displayed in the Containment tree before
choosing the parameter name.
• If an Activity Parameter Node is associated with the parameter of an inout direction,
then the direction to the Activity Parameter Node is set according to the connected flows.
If an outgoing flow is connected to the newly created Activity Parameter Node, then this
Activity Parameter Node is set as an input node, and the 'in' parameter direction is used.
Related pages
The model used in the figures of this page is the Activity diagram sample model that comes with
MagicDraw. To open this sample do one of the following:
You can create those elements using the diagram palette (see page 24):
145 https://docs.nomagic.com/download/attachments/42586363/activity%20diagram.mdzip?
api=v2&modificationDate=1479890703683&version=1
• The Input and Output Expansion Nodes are located under the Object Node button group.
1. Select the Expansion Region shape of the Expansion Nodes you want to display.
2. Perform one of the following steps:
- From the shortcut menu, select Display > Display Expansion Nodes.
- On the diagram toolbar, click
Related Pages
Loop Node
A loop node is a constructed activity node representing a loop with setup, test, and body sections.
Each section is a well-nested subregion of an activity whose nodes follow any predecessors of the loop
and precede any successors of the loop. The test section may precede or follow the body section. The
setup section is executed once on entry to the loop, and the test and body sections are executed
repeatedly until the test produces a false value. The results of the final execution of the test or body are
available after execution of the loop is completed.
When the sequence node is enabled, its executable nodes are executed in the order specified. When
combined with flows, actions must also satisfy their control and data flow inputs before starting
execution.
Conditional Node
A conditional node is a structured activity node representing an exclusive choice among a number of
alternatives.
A conditional node consists of one or more clauses, each consisting of a test section and a body section.
When the conditional node begins execution, the test sections of the clauses are executed.
• If one or more test sections yield a true value, one of the corresponding body sections will be
executed.
• If more than one test section yields a true value, only one body section will be executed.
You can format Data store node symbol properties in the Symbol Properties dialog (see page 943).
You can specify a Data store node by changing its property values in the Data store node Specification
window (see page 882). Each property is described in the description area on this window.
2.5.51 Note
Contents
A note is a graphical symbol containing textual information. It is used to add any explanatory
information needed for your element or diagram. A note is usually connected to the element symbol
using an anchor line, as shown below.
You can format the note symbol properties in the Symbol Properties dialog (see page 943).
The Note anchored to the diagram frame (see page 491) can represent the information of the diagram
context element (for example, Activity (see page 610) or State Machine (see page 813)).
To switch the note text between HTML and Plain text modes
• On the diagram pane, select the note symbol and click either HTML or Plain button.
You can edit the HTML text in the note using the HTML editor (see page 1018).
You can choose which element properties, constraints, or tagged values to display on the note symbol
by editing an appropriate compartment.
2. Move elements between Hidden and Selected lists using the >, <, >>, or << buttons. Only items
from the selected list will be displayed in the compartment on the note’s symbol.
3. Click OK after you are done.
• Select one or more elements in the Containment tree and drag them to the note symbol on the
diagram pane.
After the hyperlinks on the note are created, the text format of the note changes to HTML.
Realted pages
Contents
You can view Object Flows that are connected via Pins in the Action's Specification window (see
page 882),
as well as the Display Related Elements and Display Paths commands are available
from the Action's shortcut menu.
• When drawing an Object Flow, our modeling tool automatically selects Output or Input Pins,
creates a new Pin, under certain conditions, or you can choose a Pin from the list of options. For
example, a list of available options to select input Pins opens when drawing Object Flow to the
Action that has more than one hidden Input Pin.
• From an Object Flow shortcut menu on a diagram pane, select Refactor and then select Split
Object Flow.
• The Split Object Flow command splits Object Flow into two connectors that are marked
with an A letter.
• Double-click the connector to select the other connector on the diagram pane.
• Splitting of object flows helps to navigate in a complicated diagram.
• For more information about Refactoring, read Refactoring (see page 905).
1. In the Model Browser (see page 29), select a type of a Central Buffer Node, and drag it to an Object
Flow path on a diagram pane.
2. Wait for a few seconds and drop it.
3. Select the Split the flow command.
Related pages
Contents
An Object Node is an Activity node indicating that an instance of a particular classifier, possibly in a
particular State, may be available at a particular point in the Activity. It can be used in a variety of ways
(depending on where the objects are flowing from and to), as described in the semantics section.
More Information
For more information about working with symbols, please see Diagramming (see page 449).
As UML2 does not support generic Object Node, our modeling tool creates the particular
Central Buffer Node element.
You can specify Object Node properties in the Central Buffer Node Specification window (see page 882).
You can find the description of each property (see page 890) in the same window. Descriptions are
presented in the description area of the Specification window.
1. Double-click the Object Node or select Specification from the shape's shortcut menu.
The Central Buffer Node Specification window opens.
2. Select the classifier you wish to assign to an Object Node from the Type drop-down list.
1. Click the button in the Central Buffer Node Specification window, In State value property. The
Select Elements (see page 994) dialog opens.
2. Select a State from the existing model elements, or click Create to create a new one. The State
Specification window opens. Specify a new state, to be assigned to an Object Node.
Related pages
1. In the Containment tree, select a package and from the shortcut menu, select Create Element >
Opaque Behavior.
2. Enter a name for the new opaque behavior.
3. In the Specification window (see page 882) of the opaque behavior, click the cell of the Body and
Language property value, and then click . The Body and Language dialog opens.
4. From the Language drop-down list, select a language.
5. In the Body area, define the expression (see page 1187).
1. In the State or Transition shape shortcut menu, select Symbol Properties (see page 943).
2. In the Opaque Behavior Display Mode property value cell, select either Body or Name.
• In the Containment tree, select the opaque behavior and drag it to the diagram pane.
Related References
Related Pages
1. In the Specification window (see page 882) of the opaque behavior, Parameters property group,
click the Create button. The Specification window (see page 882) of the new parameters opens.
2. Enter a name of the new parameter.
3. Specify the multiplicity of the parameter: either select a value from the drop-down list or type a
new one.
In this case, only the upper bound of the multiplicity is important. For example, the
multiplicity [0..1] has the same meaning as the multiplicity [1].
4. Specify the type of the parameter: either select a value from the drop-down list or create a new
one by typing directly in the cell.
Available types:
• Built-in UML primitives (Integer, Real, String, and so forth)
• UML element types
• Java classes (java.io.File, java.util.Properties, and so forth)
5. If the multiplicity upper bound is 1, you may skip this step. Otherwise, specify the following:
• Whether the arguments are unique.
• Whether the arguments are ordered.
If you do not see the Is Unique and Is Ordered properties, select All from the
Properties drop-down list in the upper right of the Specification window (see page
882).
How to access the arguments and other values from script body of the opaque
behavior?
The following instructions applies to BeanShell, Groovy, JRuby, JavaScript, and Jython scripts
only.
To access an argument from a script body, you should refer to the corresponding parameter name.
The following instructions applies to BeanShell, Groovy, JRuby, JavaScript, and Jython scripts
only.
Limitations in Jython make it so returning a value from the multi-statement Jython script is not
straightforward. Instead of:
<statement1>
...
<statement n>
<expression returning result>
<statement1>
...
<statement n>
result.set(<expression returning result>)
The following instructions applies to BeanShell, Groovy, JRuby, JavaScript, and Jython scripts
only.
The script can call MagicDraw Open API (see page 2072).
More complex model access operations are available in ModelHelper and StereotypesHelper.
On this page:
• How many parameters can an opaque behavior have? (see page 768)
• How to create a parameter for the opaque behavior? (see page 769)
• How to access the arguments and other values from script body of the opaque behavior?
(see page 769)
• How many statements can a script have? (see page 769)
• What MagicDraw functionality can a script use? (see page 770)
Related Pages
2.5.55 Package
A package groups classes and other model elements together. All types of UML model elements can be
organized into packages. Each diagram must be owned by one package and the packages themselves
can be nested within other packages. Subsystems and models are special kinds of packages.
Related References
Related Pages
You can conveniently import packages (see page 673) to find the elements you're looking for in the
type selection list.
• From the selected package shortcut menu, choose Show Inner Elements List.
The rake icon is displayed on the shape if the package refers to another package diagrams.
The rake icon isn’t shown by default, therefore, you need to set the Show Rake Icon (see page 951)
property value to true in the Symbol Properties (see page 943) dialog.
Related Pages
Package Merge
A package merge is a directed relationship between two packages indicating that the contents of the
two packages are to be combined. It is very similar to a Generalization (see page 691), in that the source
element conceptually adds the characteristics of the target element to its own characteristics, resulting
in an element that combines the characteristics of both.
Specify the Package Merge in the Package Merge Specification window (see page 882).
2.5.56 Part
Contents
On this page
Creating a part
To create a part, do one of the following
• In the Composite Structure diagram pallet, select Part and click on the diagram.
• In the Containment tree, select an element, which can be defined as a part type, and drag it to
the composite structure diagram.
Creating a new composite structure diagram for the type of the part
To create a new composite structure diagram for the type of the part, do one of the following
• Select a part and from the smart manipulator toolbar, choose the New Composite Structure
Diagram button.
• From the part shape’s shortcut menu, select Create Diagram and then diagram from the list. This
accelerates the creation of composite structure diagram (the Create Diagram menu item is
available only if the type is specified for the part).
• On a diagram pane, draw a new part and in the opened Select Type list, select a type.
The Select Type list is not displayed if the Type Selection Mode is disabled. How to turn
on the Type Selection Mode >> (see page 999)
When creating a port on a part, if a part does not have a specified type, a new type for the part
is created automatically.
The rake icon is displayed on the shape if the interaction use refers to another composite
structure diagram. The rake icon is not shown by default therefore you need to set the Show
Rake Icon (see page 951) property value to true in the Symbol Properties (see page 943) dialog.
Related pages
2.5.57 Pin
Contents
On this page
• Input Pin. An input pin is a pin that holds input values to be consumed by an action.
• Output Pin.
• Value Pin.
• Action Input Pin.
• When a new action is created that must have mandatory Pins, they are automatically
added to that action on the diagram pane, as well as in the Containment tree.
• As of MagicDraw 17.0.4 version, the Pins Displaying validation (see page 1261)suite has been
introduced. It includes the Action Containing Hidden Pins validation rule that detects all
hidden pins for the concrete action symbol.
• When deleting the last Pin symbol from the diagram, the Pin element is deleted from the
project. This is valid when the Display All Pins in Diagrams option value is true.
• For a send signal action, a Pin is created, but the symbol of the Pin is not represented on
the diagram pane.
• You can navigate to the associated parameter from the Pin shortcut menu. From the Pin
shortcut menu, select Go To and choose a parameter.
You can format the pin symbol properties in the Symbol Properties dialog (see page 943).
You can specify pin properties (see page 890) in the pin Specification window (see page 882). In the
Specification window (see page 882), you can find the description of each property, which are located in
the description area of the Specification window. (see page 882)
Assigning Pins
To assign Pins for an action on the diagram pane
To assign Pins for an action in the action Specification window (see page 882)
1. In the action Specification window (see page 882), in Pins property group, select one of the
following:
Displaying Pins
To display Pins on shapes
1. On the diagram pane, select any number of shapes on which you want to display Pins.
2. Open the Select Pins dialog by performing one of the following steps:
- From the shortcut menu, select Display > Display Pins.
- On the diagram toolbar, click
If you want all Pins to be displayed automatically when creating a new Activity diagram, go to
Options > Project on the main menu, and set the Display All Pins in Diagrams option to true.
If you have an element displayed as an image, you can connect a Pin to that element with no
gaps.
Converting a Pin
To convert an input Pin to an output Pin and vice versa
1. From the Pin shortcut menu, select Refactor > Convert To.
2. From the opened list, select one of the following:
• Input Pin (Output Pin)
• Action Input Pin
• Value Pin
• From the Pin shortcut menu, select Go To, and choose a parameter.
Related pages
2.5.58 Port
Contents
On this page
Description
A port is a property of a classifier that specifies a distinct interaction point between that classifier and
its environment, or between the (behavior of the) classifier and its internal parts. Ports are connected to
the properties of the classifier by connectors through which requests can be made to invoke the
behavioral features of the classifier.
A Port can specify the services a classifier provides (offers) to its environment as well as the services
that a classifier expects (requires) from its environment. It has the ability to specify that any requests
arriving at this port are handled.
The Class model element and Component model elements can have any number of Ports.
Creating Port
To create a port, do one of the following
1. From the diagram pallet, select port and on the diagram pane, click the element.
2. Select an element and from the smart manipulator toolbar, choose the Port button.
3. In the element Specification window (see page 882), Port property group, click the Create button.
If you have an element displayed as image, you can connect a port to that element with no
gaps.
• On a diagram, select a port and press Ctrl+T (press Cmd+T for MAC OS X). Select a type from the
list.
• On a diagram, select a port and in the smart manipulator toolbar, click the Specify Type button.
Select a type from the list.
• In the port Specification window (see page 882), Type property specification cell, select a type.
• Select a port, and from the shortcut menu, choose Show Type.
• In the port Symbol Properties dialog (see page 943), set the Show Type property to true.
1. Right-click the shape, select Display > Display Parts/Ports. The Display Parts/Ports dialog
opens.
• The port type near the port symbol is displayed if port has referenced type, but has no
name.
• The port type near the port symbol is not displayed if type is provided or required
interface and the interface is displayed on the diagram.
• When a part symbol is created, all its ports are displayed on the diagram.
1. Select an element and from the smart manipulator toolbar, choose the Connector button.
2. Click the composite structure diagram frame. The port is created and the Select Port list is
displayed.
3. Select one of the following:
• A hidden port or a nested port of the composite structure diagram.
• New Port - click to create a port on a diagram frame, with the same name, type and
multiplicity, as it is set on the source part or port.
• Nested Port - click to create a new nested port.
The Nested Port is available only when creating a connector from the nested port
to the diagram frame.
• You can also quickly create a port on the composite structure diagram frame when
drawing a connector straight from a composite structure diagram frame.
• If a connector is created from a port with the defined type, then only compatible hidden
ports are listed in the Select Port list.
• If a connector is created from a port that has interfaces, then ports that have compatible
interfaces are listed in the Select Port list.
In the Compartment Edit dialog, you can select which ports to display in the ports'
compartment.
1. Right-click the Port shape and select the Symbol Properties command.
2. In the Symbol Properties dialog (see page 943), select the All property display mode.
3. Find the Position of Labels property and select on of the following value:
- Outside to show the label outside the Port shape.
- Name and Type Labels Inside to show only the name and type inside the Port shape.
- Inside Enclosing Shape to show the label outside the Port shape but inside enclosing shape on
which boundary the port is created.
1. In the Port Specification window (see page 882), Provided/Required Interfaces property group,
click the Add button.
2. Select to either provided or required interface.
3. In the case, when the port type is not specified, the Select Port Type dialog is displayed. Select
one of the following options:
• Set provided interface as a port type (available only when creating a provided interface).
The provided interface will be specified as the port type.
• Create "dummy" port type automatically. Create a “dummy” port type and relations
between the type and interface.
• Select or create a port type manually. The Select Port Type dialog will open, to allow you
to select or create a Port.
4. In the element Selection dialog, select or create an interface and click OK.
• From the port's shortcut menu, select Refactor > Convert To > Association.
• In the port's compartment, select a port and drag it out of the shape.
You can convert a port to an association, only if the port type is specified and a port is not a
member of any association end.
• In the Symbol Properties dialog (see page 943), click to select the Show Port property.
If you cannot find the Show Port property in the Symbol Properties dialog (see page 943), change
the properties display mode to Expert or All.
Related pages
2.5.59 Profile
Contents
A Profile is a kind of a package that extends a reference metamodel. The primary extension construct is
a stereotype. Stereotypes are defined as a part of profiles.
Each profile contains a set of stereotypes. Profiles are defined as separate modules. Profiles are loaded
on demand, that is when you start or open your project only profiles used in that project are loaded.
Profiles are defined using the UML extensibility mechanisms that allow modelers to customize UML for
specific domains, for example, for software development processes. The mechanism of the profile is
similar to the functionality of modules.
The program comes with some predefined profiles: UML Standard Profile, DDL, EDOC, and other. All
profiles are stored in <modeling tool installation directory>\profiles.
Profile Properties
The profile is defined as a package (see page 771), that is, it has package properties.
You can specify profile properties in the profile's Specification window (see page 882). You can also find
descriptions of each property (see page 890) in this window. Descriptions are provided in the description
area below the property list.
Creating Profiles
You can create a profile in one of the following ways:
• Using the package / model / profile shortcut menu (see page 788)
• Using the profile diagram pallet (see page 789)
• Using the package diagram pallet (see page 789)
• Using the class diagram pallet (see page 789)
1. Either create a new Profile diagram (see page 302) or open an existing one.
2. On the diagram pallet, click the Profile button.
3. Click a free space on the diagram pane to see the created Profile.
1. Either create a new Package diagram (see page 301) or open an existing one.
2. On the diagram pallet, click the Package arrow to see more buttons.
3. Click the Profile button.
4. Click a free space of the diagram pane to see the created Profile.
1. Either create a new Class diagram (see page 289) or open an existing one.
2. On the Class diagram pallet, do one of the following:
• Expand the Profile Diagram button group and click the Profile button.
• Expand the Package Diagram button group, click the Package arrow to see more buttons,
and then click the Profile button.
3. Click a free space of the diagram pane to see the created Profile.
Related pages
• Model Elements146
• Stereotype (see page 827)
• Package (see page 771)
• Working with Profiles (see page 1952)
146 https://docs.nomagic.com/display/MD190SP2/Model+elements
Specify the Profile Application element, in the Specification (see page 882) dialog.
2.5.61 Realization
Contents
The Realization is a specialized abstraction (see page 1163) relationship between two sets of Classes, one
represents a specification (the supplier), and the other represents an implementation of the latter (the
client). The Realization can be used to model stepwise refinement, optimizations, transformations,
templates, model synthesis, framework composition, and so forth.
The Realization relationship is drawn as a dashed line with a solid triangular arrowhead (a “dashed
generalization symbol”). The client (the one at the tail of the arrow) supports at least all of the
operations defined in the supplier (the one at the arrowhead), but not necessarily the data structure of
the supplier (Attributes (see page 639) and Associations (see page 618)).
More Information
For more information about working with symbols, see Diagramming (see page 449).
The Realization paths can be grouped in a tree. This feature makes the appearance of the diagram
more structural and understandable.
Realization Types
In our modeling tool, you will find three kinds of Realization relationships:
• Interface Realization. A dashed line with a solid triangular arrowhead. An Interface
Realization is a specialized Realization relationship between a Classifier and an Interface.
This relationship signifies that the realizing classifier conforms to the contract specified
by the Interface.
• Realization. A solid line that represents a relationship between a classifier (see page 475)
and an interface (see page 708).
• Substitution. A dashed line with an arrowhead and «substitute» stereotype. A
Substitution is a relationship between two classifiers. It signifies that the Substituting
classifier complies with the contract specified by the contract classifier. This implies that
instances of the Substituting classifier are runtime substitutable where instances of the
contract classifier are expected.
• The realizing classifiers are a set of Realizations owned by the Component. The Realizations
reference the Classifiers of which the Component (see page 654) is an abstraction (i.e., that realize
its behavior).
1. Drag the classifier shape to the Component (see page 654) shape.
2. Select a classifier or Component and select Related Elements from its shortcut menu, then
select the Display Paths command.
3. The Realization relationship will be displayed on the diagram pane.
Related pages
2.5.62 Reception
Contents
147 https://docs.nomagic.com/display/MD190SP2/Model+elements
You can specify Reception properties in the Reception Specification window (see page 882). You can find
the description of each property in the same window. Descriptions are presented in the description
area of the Specification window.
• In the Class's Specification window, click the Signal Receptions property group and then click the
Create button. Select the signal and click OK. The Signal Reception's Specification window opens.
• In the Containment tree, right-click a Class and from its shortcut menu, select Create Element
and then Signal Reception. Select the signal and click OK. Type the name for the new signal
reception.
• On the diagram pane, click the Class, and then click the Create Element smart manipulator. At
the bottom of the menu, click the arrow to expand the menu and then click the Signal Reception
command. Select the signal and click OK.
• On the diagram pane, click the Class, then press the Ctrl+Alt+R shortcut keys. Then, select the
signal and click OK.
• On the diagram pane, click the Class shape, and then click the Create Signal Reception smart
manipulator.
Signal Reception
Note that the signal reception compartment is suppressed by default.
• Drag the signal from the Containment tree or the diagram to the Class shape on the diagram
pane.
• Create a signal reception. The Select Signal dialog opens. Select an existing or create a new signal
for the signal reception.
• In the Signal Reception's Specification window, select a signal in the Signal drop-down menu. You
can also click the “..." button. In the Select Element dialog, select a signal or click the Create
button to create a new one.
1. On the diagram pane, click on a symbol, then click the Compartments button.
2. On the menu, click to select the Signal Receptions check box. The signal receptions
compartment is displayed on the shape.
3. On the diagram pane, click a shape, then click the Compartments button. On the menu, click
the Edit Compartments command.
4. In the Compartment Edit dialog, click the Signal Receptions tab.
1. On the diagram pane, right-click the shape. From its shortcut menu, select the Symbol
Properties command.
2. In the Symbol Properties dialog, under the Signal Receptions group, click to change the Signal
Receptions Sort Mode property.
Related pages
Contents
This is a custom element used to store a report template file (.mrzip) attached to the project.
In contrast to the report templates stored in the local report templates folder (<modeling tool
configuration files directory (see page 72)>\data\reports), a report template attached to the project as this
specific type of model element is not lost when you open the project on another computer. It is safely
transferred within the project (either local or server).
1. From the main menu, select Tools > Report Wizard. The Report Wizard dialog (see page 1470)
opens.
2. Select the report template you want to attach to the project and click the Attach button. The
selected report template is duplicated, and the duplicate is attached to the open project. It is
visible in the Containment tree (see page 32) directly under the root package. As the following figure
shows, in the Report Wizard dialog it as marked with the “[Attached to Project]” tag.
• Right-click the attached report template in the Containment tree. From the shortcut menu select
Generate Report. The Report Wizard dialog opens with the attached report template already
selected. Proceed to the subsequent steps of the wizard.
• Right-click the namespace (for example, a Package) in the Containment tree. From the shortcut
menu select Generate Report. Then select the appropriate report templates category and click
the attached report template.
The “[Attached]” tag helps to identify attached to project report templates on this menu.
• From the main menu, select Tools > Report Wizard. In the Report Wizard dialog, select the
report template and proceed to the subsequent steps of the wizard.
• From the main menu, select Tools > Report Wizard. The Report Wizard dialog opens.
• Select the report template you want to extract to the local report templates folder and click
the Extract button.
• If a message asking to confirm the update of already existing report template appears,
click Yes.
The report template appears in the local report templates folder and can be opened for edit. It
also remains attached to the open project.
Related pages
2.5.64 Slot
A Slot specifies that an entity modeled by an Instance (see page 704) specification has a value or values for
a specific structural feature. Values of each Attribute (see page 639) have specific type and are allocated in
the slots of the instance or associated with that instance.
You can modify the current element and add various specifications to it in the element dialog box: click
on the property group Tags, select the tag with the assigned value and click Edit Value to open the
Slot Specification window (see page 882).
1. On diagram draw two Class (see page 633) shapes - A and B Classes.
2. Draw Association (see page 618) with roles between them.
3. Draw two Instance shapes. Define Class A as classifier of the first Instance and Class B as
classifier of the second Instance.
4. Draw Link between Instances. The Select Association dialog will open.
5. Association which is drawn between Classes will be automatically selected in the Select
Association dialog. Click OK.
6. The Create Slots dialog will open. Select Association ends. Ends of Association which is drawn
between class A and Class B will be selected automatically in the Create Slots dialog. Click OK.
Slots for Instance will be created.
Contents
There are two ways an element can be included in the smart package:
You can create a smart package named My Bookmarks and add frequently used elements
to it.
• Automatically - the element meets the set of criteria defined by the user.
You can create a smart package named Requirements v5 with the criteria “all elements of
type Requirement under the package Business requirements, having tag version=5”.
• Easily browse, navigate, list, and discover these elements in the Containment tree.
• Narrow the scope in both the Find dialog and the element Selection dialog.
• Define dynamic row and column scopes in dependency matrices.
Concepts
To better understand this material, please read through the following concepts.
Static contents
A collection of manually included elements.
Dynamic contents
A collection of elements automatically calculated according to the set of criteria specified by the user.
Performance contents
In the Smart Package Specification window (see page 882), you can take advantage of a new property,
Use In Selection Dialogs, which allows you to work better with your smart packages. Previously, smart
packages slowed down the opening of Selection dialog boxes. Use In Selection Dialogs allows users to
exclude the smart package from the calculation of elements to display in Selection dialog boxes (e.g.
Select Elements (see page 994)).
• From the shortcut menu of an element. The newly created smart package is empty.
• From the search results (by saving either the search options or the search results as a smart
package). The newly created smart package has either dynamic or static contents.
1. In the Containment tree, right-click the element. The shortcut menu opens.
1. Open the Find dialog, define search options, and perform the search. The search results are
displayed in the Search Results tab on the Model Browser.
For more information about defining search options and analyzing the search results,
refer to the Find dialog (see page 216) and Search Results tab (see page 46).
2. On the toolbar of the Search Results tab, click and select one of the following commands:
• Save Query as Smart Package to create a new smart package with dynamic contents. The
search options will be saved as the Query property value.
• Save Results as Smart Package to create a new smart package with static contents. The
search results will be saved as values of the Additional Elements property.
3. In the dialog, select an owner of the new smart package and click OK.
4. In the Containment tree, type a name for the new smart package.
5. Press Enter to finish.
The new smart package is created, and you can proceed to managing its contents (see page 800) and
reviewing its specific properties (see page 803).
• Manually - the user selects to include the particular element. Manually included elements
constitute the static contents.
• Automatically - the element meets the set of criteria defined by the user. Automatically included
elements constitute the dynamic contents.
The membership in the smart package is not the UML ownership association. The owner of the
element will not change after the element is included in the smart package.
Do either:
• In the Containment tree, select an element and drag it to the smart package.
See the element included into the contents of the smart package. The element becomes a value
of the Additional Elements property as well.
• Open the Specification window of the smart package and click the cell of the Additional
Elements property value. Then click and in the open dialog, select one or more elements.
Click OK when you are done. See the element(s) included in the contents of the smart package.
To include elements into a smart package automatically
For instructions about defining criteria in the Query dialog, refer to Specifying Criteria for
Querying Model.
You can select to show implied relationships (see page 310) (logical relationships calculated
from inherited or inner elements of the model element) to provide additional
information.
5. Close the Specification window. See the contents of the smart package updated with elements
that meet the defined set of criteria.
If the contents of the smart package are not updated, select View > Refresh from the
main menu.
Do either:
• In the Containment tree, under the smart package, right-click the element. From the shortcut
menu, select Delete from Contents or press Delete.
• Open the Specification window of the smart package and click the cell of the Excluded Elements
property value. Then click and in the open dialog, select one or more elements. Click OK
when you are done.
• Open the Specification window of the smart package and click the cell of the Additional
Elements property value. Then click and in the open dialog, unselect one or more elements.
Click OK when you are done.
• In the Containment tree, right-click the smart package with dynamic contents and from the
shortcut menu select Freeze Contents.
See that there are no changes visible in the Containment tree. Open the Specification window of
the smart package to see that the values of both the Query property and the Excluded
Elements property have passed into empty, and the value of the Additional Elements property
stores the new list of elements.
The contents of the smart package will no longer be automatically updated after relevant
changes in the model.
1. In the Containment tree, right-click the smart package with dynamic contents and from the
shortcut menu select Snapshot Contents. The element Selection dialog opens.
2. In the dialog, select an owner of the new smart package and click OK.
See the new smart package created under the selected owner in the Containment tree with the
name Snapshot of <smart package name>, for example, Snapshot of My Bookmarks. The contents of
the snapshot equal the contents of the smart package, but the list of elements is static.
Related Pages
Property Description
Query Stores a set of criteria for automatic inclusion of elements into the
contents of the smart package.
Additional Elements Stores the list of the elements manually included into the contents
of the smart package.
Excluded Elements Stores the list of the elements excluded from the contents of the
smart package.
The case study uses the sample project use case diagram.mdzip, which can be found in
<MagicDraw installation folder>\samples\diagrams.
For example, we have a lot of use cases owned by different system boundaries in the project.
We need all these use cases to be in a single package, except for several particular ones. Also, we need
all newly created use cases to be automatically included into this package.
In this case, the smart packages feature is very useful. We will create a smart package with dynamic
contents to gather all use cases in the model, then demonstrate how it manages further changes in the
model. Finally, we will create a snapshot of the smart package to have a static list of use cases as a
milestone of the model development.
2. Define the criteria for gathering the contents of the smart package. Specify the search options to
find all use case type elements from the root package Data.
4. Exclude use cases Change password and Change system settings from the contents. See the
contents of the smart package shortened.
5. Open the Specification window of the smart package and see the excluded use cases in the cell of
the Excluded Elements property value.
6. Drag use cases Change password and Change system settings to the smart package. See them in
the contents of the smart package again.
7. Open the Specification window of the smart package again and see these manually included use
cases in the cell of the Additional Elements property value. Elements excluded from the
contents appear in it after being manually added.
9. Create a snapshot of the smart package All Use Cases to have a static list of use cases as a
milestone of the model development.
10. Expand the contents of the snapshot and see that it equals the contents of the smart package All
Use Cases.
The case study uses the sample project hybrid sport utility vehicle.mdzip, which can be found in
<MagicDraw installation folder>\samples\SysML, if the SysML plugin is installed.
Here is another case where the smart package feature is very helpful: we need to have all unsatisfied
requirements in a separate package. Also, we need requirements to automatically disappear from this
package after becoming satisfied.
We will create a smart package with dynamic contents to gather all the unsatisfied requirements in the
model and a dependency matrix for performing the requirements coverage analysis. Then we will
demonstrate how both the smart package and the dependency matrix reflect the transition of a
requirement to satisfy.
SysML::Requirements::Requirement::allInstances()->select(r|not
r.supplierDependency->exists(d|d.oclIsKindOf(SysML::Satisfy)))
5. On the dependency matrix, create a Satisfy relationship between the block BrakePedal and the
requirement Braking.
Now study the case that illustrates the efficient management of the complex system configurations with
the help of smart packages. We have a library (static package) of system components, which we need to
see in several different views of the model, that is, catalogs, according to their characteristics. Using the
catalogs will not extend the scope of the model, since they do not require duplication of the elements.
We will create two dynamic system configuration catalogs, that is, smart packages with dynamic
contents, to gather the servers from the library TI Hardware according to the configuration version
defined in a tag value of their specification.
3. Define criteria for gathering the contents of the smart package Servers in TI12 Catalog. Specify
search options to find in the package TI Hardware, all block type elements with tag value Used
In=TI12.
4. Define criteria for gathering the contents of the smart package Servers in TI14 Catalog. Specify
search options to find in the package TI Hardware, all block type elements with tag value Used
The block SUN FIRE T1000 appears in both TI12 Catalog and TI14 Catalog, since it has both
tag values Used In=TI12 and Used In=TI14.
6. Also, you can add a block to a smart package manually. Just drag the block to the smart package.
Contents
When working with large projects, smart packages can sometimes cause performance issues. They can
influence the time of a search, commit, and derived properties related operations. However, there is a
way to identify which smart packages or properties cause the problem by getting notifications about
their evaluation time.
To get notifications about the evaluation time of smart package content and derived properties
1. Go to <modeling tool installation directory>/bin and open the properties file of your modeling tool.
2. Enter the md.expression.evaluation.duration.notification.threshold Java argument and define the
threshold time in seconds for getting notifications, e.g.:
-Dmd.expression.evaluation.duration.notification.threshold=30
Note
The default value of the md.expression.evaluation.duration.notification.threshold argument
is 60 seconds. If you add the argument to the properties file of your modeling tool but do
not define its value, the default value is used.
• Click Do not show this message again when a new notification appears on the right side of a
modeling tool window.
This action disables notifications about the evaluation time of both smart package content and derived
properties.
Tip
You can increase the performance of your modeling tool by following these recommendations:
• Avoid using smart packages with Find queries, especially if they are used to find common
elements (e.g., Class, Package, Block, etc.).
• Avoid using smart packages with Find queries which have wide scope.
• Avoid nesting smart packages, i.e., using one smart package as the part of another smart
package's content.
Performance contents
In the Smart Package Specification window (see page 811), you can take advantage of a new property,
Use In Selection Dialogs, which allows you to work better with your smart packages. Previously, smart
packages slowed down the opening of Selection dialog boxes. Use In Selection Dialogs allows users to
Related pages
State machines consist of State (see page 819), Transitions and Pseudo States (see page 814). A state
represents a significant and persistent condition of a block. A block will remain in a given state until
triggered to transition to another state. When the triggering event occurs, the state machine will
transition to another state within the region based on the triggers and guard condition specified for the
Specify the State Machine element in the State Machine Specification window (see page 882).
Pseudo States
The Pseudo state is typically used to connect multiple transitions into more complex state transition's
paths. For example, by combining a transition entering a fork pseudo state with a set of transitions
exiting the fork pseudo state, we get a compound transition that leads to a set of orthogonal target
states.
You can specify pseudo state properties (see page 890) in the pseudo state Specification window (see page
882). In the same window, you can find the description of each property. Descriptions are presented in
the description area of the Specification window.
Related Pages
Related pages
Initial state
Every object belongs to a particular state as soon as it is created. So, it is useful to explicitly show that
particular state. A solid filled circle represents the initial state of an object. There can only be one initial
state for an object. The initial state denotes the starting place for a transition, the target of which is a
composite state.
Related Pages
Related pages
Related Pages
Related pages
Terminate
Entering a terminate pseudo state implies that the execution of the state machine by means of its
context object is terminated. The state machine does not exit any states nor does it perform any exit
actions other than those associated with the transition leading to the terminate pseudo state.
Related Pages
Related pages
Entry Point
An entry point connection point reference as the target of a transition implies that the target of the
transition is the entry point pseudo state as defined in the submachine of the submachine state. As a
result, the regions of the submachine state machine are entered at the corresponding entry point
pseudo states.
Related pages
Exit Point
An exit point connection point reference as the source of a transition implies that the source of the
transition is the exit point pseudo state as defined in the submachine of the submachine state that has
the exit point connection point defined. When a region of the submachine state machine has reached
the corresponding exit points, the submachine state exits at this exit point.
Related Pages
Related pages
Deep History
The Deep History represents the most recent active configuration of the composite state that directly
contains this pseudo state; e.g. the state configuration that was active when the composite state was
last exited. A composite state can have at most one deep history vertex.
Related Pages
Related pages
Related Pages
Related pages
Junction
The junction vertices are semantic-free vertices that are used to chain multiple transitions together.
They are used to construct the compound transition paths between states. For example, a junction can
be used to combine multiple incoming transitions into a single outgoing transition representing a
shared transition path (this is known as merge). Conversely, it can be used to split an incoming
transition into multiple outgoing transition segments with different guard conditions.
Related Pages
Related pages
Choice
The choice vertices, when reached, result in the dynamic evaluation of the guards or the triggers of its
outgoing transitions. This realizes a dynamic conditional branch. It allows splitting of transitions into
multiple outgoing paths such that the decision on which path to take may be a function of the results of
prior actions performed in the same run-to-completion step.
Related pages
Contents
The fork vertices are used to split an incoming transition into two or more transitions terminating on
the orthogonal target vertices (i.e., vertices in different regions of composite state). The segments going
out of a fork vertex must not have guards or triggers.
The join vertices are used to merge several transitions emanating from the source vertices in different
orthogonal regions. The transitions entering a join vertex cannot have guards or triggers.
1. A Fork Node can have exactly one incoming Activity Edge (or Transition), though it may have
multiple outgoing Activity Edges (or Transitions).
2. A Join Node can have exactly one outgoing Activity Edge (or Transition) but may have multiple
incoming Activity Edges (or Transitions).
The Fork and Join are represented by the same symbol. Although, you can set the Use different Fork/
Join and Decision/Merge notations project option (see page 2133) to draw different notations for the
Fork and Join.
State
A State is a condition during the lifetime of an object or an interaction during which the object meets
certain conditions, performs an action, or waits for an event. The State is defined by the concepts of
duration and stability. An object can not be in an unknown or undefined State. A State may have two
compartments to provide more information about that State:
• The first compartment is the name compartment, it contains the State name, for example:
running, going up.
• The second compartment is the activity compartment, it contains the events and actions of the
State.
You can specify State properties in the State Specification window. In the same window, you can find the
description of each property. Descriptions are presented in the description area of the Specification
window
Simple State
A simple State is a State without any regions, internal Vertices or Transitions.
Composite State
You can create a composite State by converting a simple State (see page 0).
A composite State either contains one region or is decomposed into two or more orthogonal regions.
Each region has a set of mutually exclusive disjoint subvertices and a set of transitions. A given State
may only be decomposed in one of these two ways.
Any State enclosed within a region of the composite State is called a subState of that composite State. It
is called a direct subState when it is not contained by any other State; otherwise it is referred to as an
indirect subState.
Each region of the composite State may have an initial pseudoState and a final State. A transition to the
enclosing State represents a transition to the initial pseudoState in each region.
You can specify composite State properties in the State Specification window. In the same window, you
can find the description of each property. Descriptions are presented in the description area of the
Specification window.
Orthogonal State
An orthogonal State is a composite State with at least 2 regions.
The submachine State is semantically equivalent to a composite State. The regions of the submachine
State machine are the regions of the composite State. The entry, exit, behavior actions, and internal
transitions, are defined as part of the State. The submachine State is a decomposition mechanism that
allows factoring of the common behaviors and their reuse.
You can specify submachine properties in the State Specification window. In the same window, you can
find the description of each property. Descriptions are presented in the description area of the
Specification window.
On this page
Related Pages
Related References
If you do not see the Behavior Type property, click the + button near the Entry, Do
Activity, or Exit category to expand its content.
3. According to the selected behavior type, the Behavior Element value is defined automatically.
Additional properties Name and Owned Diagram appears. Specify these properties if it is
needed.
4. Click the Close button after you have defined desired properties.
If a behavior of an Activity, Interaction, Protocol State Machine, or State Machine type is assigned to an
Entry, Exit, or Do activity, a diagram for that behavior is created automatically.
Related Pages
Managing regions
To create a region
• In the Containment tree, right-click the State, select Create Element, and then click Region.
• On the diagram, right-click the State, then select the Add New Region.
• On the diagram, select the State symbol and click the Create Region button .
• In the State Specification window, click the Inner Elements property group, then click Create and
select Region. Specify the region and click Close or Back.
To remove a region
• In the Containment tree or on the diagram, select the State, and drag it to the State's region.
Related pages
• Drag a vertex on a simple State symbol. A region is created and the simple State is converted to a
composite State.
• Add two regions to the State. Read more about creating regions (see page 0).
Related Pages
Related pages
1. On the State diagram palette, click the Connection Point Reference button.
2. Click the shape of the submachine State. The Select Entry/Exit Point dialog opens.
3. Select entry point to define the entry into the submachine State, or exit point to define the exit
from the submachine State. The Connection Point Reference is drawn on the submachine State
with a defined entry or exit point.
• Open the Connection Point Reference dialog. The Entry or Exit properties display the defined
entries.
• Right-click the Connection Point Reference shape, and, on the shortcut menu ,click Select Entry/
Exit Point.
In the Select Entry/Exit Point dialog, only the entry and exit points that are created at the
same State Machine as the submachine State are listed. If there are no entry/exit points at the
same State machine, the Select Entry/Exit Point dialog is not opened when drawing the
Connection Point Reference.
1. Select the submachine State shape of the Connection Point References you want to display.
2. Open the Select Points dialog by performing one of the following steps:
• From the shortcut menu, select Display > Display Points.
• On the diagram toolbar, click
Selected Connection Point References are displayed on the submachine State shape.
Related Pages
Related pages
State Invariant
• Double-click the State to open the State Specification window and in the State Invariant
property value cell, type a condition and press Enter.
• Near the State Invariant property value cell, click the ... button. The Edit State Invariant dialog
opens. Type the condition and close the dialog.
The State Invariant is displayed in square brackets on the State shape:
Related pages
2.5.67 Stereotype
Contents
A stereotype defines how an existing metaclass may be extended. It enables the use of a platform, a
domain specific terminology, or a notation in place of, or in addition with, the ones used for the
extended metaclass. Similar to a class, a stereotype may have properties which may be referred to as
tag definitions. When a stereotype is applied to a model element, the values of the properties may be
referred to as tagged values. A stereotype can extend any model element from the reference
metamodel (any UML model element). For example in UML, States, Transitions, Activities, Use cases,
Components, Attributes, Dependencies, etc. can all be extended with the stereotypes. The stereotypes
are created as separate model elements and can be drawn in almost all diagrams. You can specify
stereotype properties (see page 890) in the stereotype Specification window (see page 882). In the same
window, you can find the description of each property. Descriptions are presented in the description
area of the Specification window (see page 882).
Stereotype notation in diagrams use the guillemets instead of symbols «» (see the following figure).
However, when editing elements in a diagram, you can still enter the stereotype names between the «»
symbols.
Creating a stereotype
To create a stereotype, do one of the following
• Open or create the Profile Diagram (see page 302). On the diagram pallet (see page 24), click the
Stereotype button and place it on the diagram pane.
• In the Containment tree, select a Profile, and from the shortcut menu, select Create Element >
Stereotype.
Applying a stereotype
• In the corresponding element's Specification window (see page 882), click the Applied Stereotype
property specification cell, then click , and select stereotypes from the open list. After you have
selected, click Apply.
• In the element's shortcut menu, select Stereotype and select a stereotype that you wish to
apply. Click Apply when you are done.
• On the diagram pane, select an element and in that element's name area, type the stereotype
name between brackets « ». The element's name comes after the stereotype.
If you want to name the element Books and assign it the «table» stereotype, in the
element's name area type the following: «table» Books. The name completion for the
stereotypes works in the name editing mode, press Ctrl+Spacebar or Ctrl+Backspace to
get a list of available stereotypes.
You can change the order of the stereotypes applied to the element. The symbol style of the first
stereotype in the list will be applied to the element.
Displaying the stereotype icon instead of the shape on the diagram pane
To display the stereotype icon instead of the shape on the diagram pane
1. Select the shape on the diagram and click the Compartments smart manipulator (see page 538).
2. Click to expand the menu and select Suppress All.
• In the stereotype Specification window (see page 882), right-click the Icon property specification cell
and select Open Specification. The Image specification window opens wherein you can see and
specify image properties.
If a symbol has several stereotypes applied, you can change the order of stereotypes for visual
purposes.
1. Right-click the symbol to open the shortcut menu, click Stereotype. The Select Stereotype
dialog opens.
2. Click the Order button. The Order Stereotypes dialog opens.
3. Select a stereotype and click Up or Down buttons to change the order of the stereotypes.
1. Click the shape, and then, click buttons to suppress all the compartments (see page 538).
2. Click the shape and then click the Compartments button (see page 538). From the menu, click the
Stereotypes and then select a desired display mode that are described in the following table:
* To display the image of a stereotype instead of the element shape, all element compartments should
be suppressed.
Related pages
Sample model
We recommend to analyze usage of stereotypes in the sample model UML Extensions that comes with
MagicDraw. To open this sample do one of the following:
2.5.68 Substitution
A substitution is a relationship between two Classifiers (see page 427). In these cases, the substituting
Classifier complies with the contract specified by the contract classifier. Instances of the substituting
Classifier are runtime substitutable where instances of the contract classifier are expected.
Specify the Substitution element in the Substitution Specification window (see page 882).
You can see which elements the Substitution is drawn between in the Substitution dialog, Source and
Target boxes.
You can format the Substitution symbol properties in the Symbol Properties dialog (see page 943).
148 https://docs.nomagic.com/download/attachments/42586363/UML%20Extensions.mdzip?
api=v2&modificationDate=1478279809765&version=1
To draw a subsystem
• On the Use Case diagram pallet, click the Subsystem button, and then click the diagram pane.
Related Pages
2.5.70 Swimlanes
Contents
Actions and subactivities can be organized into Swimlanes in the Activity diagrams. Swimlanes are used
to organize responsibility for actions and subactivities according to class. They often correspond to the
organizational units in a business model.
Swimlanes limit and provide a view of the behaviors invoked in the activities. They consist of one or
more partitions and can be vertical or horizontal.
An Activity diagram can be visually divided into Swimlanes, each separated from the neighboring
Swimlanes by vertical or horizontal solid lines on both sides. Each Swimlane represents a responsibility
for part of the overall activity, and may eventually be implemented by one or more objects. The relative
ordering of the Swimlanes has no semantic significance, but can indicate some affinity. Each action is
assigned to one Swimlane. Transitions can cross lanes. The routing of a transition path is non-essential.
You can customize Swimlane representation by changing its symbol property values. Press Alt + Enter to
open the appropriate dialog. Each property is described in the description area on this dialog.
To create a Swimlane
1. On the Activity diagram palette, click the Vertical Swimlanes button and then click an empty
space on the diagram pane.
You can also create a Swimlane by dragging one or more properties, Actors, Classes, or
Instance Specifications from the Containment tree to the Activity diagram pane. Partitions for
each element are created as well.
• Open the Specification window of the Swimlane and click the cell of the Represents property
value. Then click and select the element. Click OK when you are done.
• From the Containment tree, drag the representative element to the partition on the diagram.
• On the diagram, right-click the Swimlane, select Insert Swimlane and then Insert Vertical
Swimlane or Insert Horizontal Swimlane.
• If a Swimlane is already drawn in the Activity diagram, drawing an action (or any other element)
highlights the Swimlane in blue. This means the action shape depends on the Swimlane symbol.
If the model elements depend on a Swimlane symbol, they are deleted if the Swimlane
symbol is deleted.
• Drag any of the Swimlanes in the direction where you want it to be.
• Click the heading of any Swimlane and use the displayed control arrow to move the Swimlane
left, right, up or down.
2.5.71 Tag
Just like a class, a stereotype (see page 827)can have properties, which can be referred to as tag
definitions. When a stereotype (see page 827)is applied to a model element, the values of the properties
may be referred to as tagged values.
The tag definitions are used to define new meta attributes of the extended metaclass, they are used as
regular class attributes.
• additional information that does not come with UML, for example Precondition for Use Cases.
• management data about the state and progress of the project such as author, status, and
tested.
• language specific data for code generation tools.
A tagged value consists of two parts: name and value (example: Author = Joe).
Type of the property can be a standard UML data type or another user defined
Stereotype. Regular classes should not be used as types of tag definition.
Related References
Related Pages
• In the element Specification window (see page 882), Tags property group, select an available tag
definition and click the Create Value button.
• In the Containment tree, select an element and drag it to the Specification window tag value area.
To create default tag values
1. In the stereotype's Specification window, expand the Tag Definitions property group and select
the tag definition.
2. Assign a value for the Default Value property.
3. Create an element and assign a stereotype for this element. The element will have tags with
assigned default values.
1. In the main menu, select Tools > Set Empty Tags to Defaults. The Select Package dialog opens.
2. Select the scope of elements to which you want to set the default tag values.
3. In the opened dialog, click Yes. Now, the element with stereotype tags has been assigned default
values.
The following conditions are required to set the default tag values
• The element should have an assigned stereotype with a specified default value property.
• The tag definition, to which you want to assign a default value, should contain no value.
The default tag values are not set when the stereotype property (tag definition) multiplicity is
equal to 0, 0..1, 0..*, *.
Related Pages
2.5.72 Template
Contents
Use a Template to define concrete types for elements without concrete types. You can create a
template and then use it as many times as you need. Moreover, when you have elements of the same
structure (or with the same parameters) but with different values, the template you use can easily
define parameters for each element. You can apply template parametrization to classifiers, packages,
and operations. Most often. template parametrization is used for classes and interfaces. Templates are
often used in code engineering (Java, C#, and other programming languages).
• A parameterized element (an element with defined template parameters). The parameterized
element can also be called a template element.
• An actual element (an element for which a template is applied, an element with actual values).
The actual element can also be called a templateable element.
• A template binding relationship (a relationship from the actual element to the parameterized
element).
• A template parameter substitution (used to define actual parameters of the actual element that
substitutes formal template parameters). Template parameter substitutions are created on the
template binding relationship.
The GeneralArray class and its template parameters create a template of the general array of undefined
types. You can use this template in other concrete arrays as many times as you need.
To create an array of addresses, you would create the AddressArray class. Alone (without a template),
the AddressArray class would have undefined types. A template binding is created from the AddressArray
class to the GeneralArray class. Now the template binding connection points to the GeneralArray
template class.
The template binding specifies template parameter substitutions, the actual values of parameters for
the address array. In the example, we created the following actual values of the AdressArray class: the
array size having the value 3 and the array of the Address type.
The output of these definitions results in the AddressArray class having the attribute
AddressArray::contents : Address [0..3].
Attributes for the actual element classes should be created manually. In the example, the
AddressArray::contents : Address [0..3] attribute is not created automatically - you must create this
attribute manually. Use these optional solutions to create these attributes in your model or
not.
You can format template parameter symbol properties in the Symbol Properties dialog (see page 943).
You can specify template parameter properties in the Template Parameter Specification window (see
page 882) and template binding properties in the Template Binding Specification window. In the
Related pages
• Model elements149
• Auxiliary Diagram Symbols (see page 869)
• Diagramming (see page 449)
Contents
This section demonstrates how to create a template and how to use it.
Follow these instructions from the first step consistently. If you do not, and if you do not define the
template parameter, you will not be able to draw a template binding relationship. You can omit optional
procedures only.
Precondition
Let’s assume you already have an element to which you want to apply a template. This element
is an actual element. The actual element can be a classifier, package, or operation.
To create and apply a template to an actual element, see the following procedures:
To create a template
1. Create or select a template element for which you will create template parameters.
2. Open the element's Specification window (see page 882).
3. Change the property display mode to All, if it is not changed already. The Template Parameters
property group appears in the property group list.
4. Click the Template Parameters property group.
149 https://docs.nomagic.com/display/MD190SP2/Model+elements
6. In the Model tree, select an existing or create a new type of the template parameter.
Template Parameter
If you do not want to specify the concrete template parameter type, you can select the
Class type (the Class from the UML metamodel). When the Class type is specified, type is
not displayed on the diagram pane. Only the name of the template parameter is
represented.
If you need to select one of the UML metamodel elements, such as Class, be sure to clear
the Hide Uncommon Elements and Exclude Used Projects commands (as in the
preceding figure). For more information, read Searching for elements in the Element
Selection dialog (see page 996).
7. Click OK. The template parameter is created. The name of the template parameter is defined
automatically by compounding the T letter and the name of the template parameter type - T<type
name>. For example, TInteger. You can change the name of the template parameter if you need
More Information
For more information about symbol representation properties, see Formatting Symbols
(see page 943).
Value Specification
To assign a particular value of the value specification, you must specify a Value
Specification first and then type its particular value in the Actual value cell. For more
information about Value Specification, read Value Specification (see page 868).
After the template is created, you can apply it to the actual element. The following procedures describe
how to apply the template to the actual element.
1. Bind the actual element to the template element. In the diagram pallet, click the Template
Binding button or click the B shortcut key and draw a template binding relationship from the
actual element to the template element.
2. Define a template binding substitution. Open the Template Binding Specification window and
click the Template Binding Substitutions property group.
3. To add a new template binding substitution, click the Create button. The Select Template
Parameter dialog opens, listing the template parameters of the element to which the template
4. Select one or more template parameters to add as template parameter substitutions. Click OK to
return to the Template Binding Specification window.
5. (Optional) Assign the actual value for each template binding substitution.
More Information
For more information about specifying property values, see Editing property values (see
page 890).
Value Specification
To assign a particular value of the value specification, you must specify a Value
Specification first and then type its particular value in the Actual value cell. For more
information about Value Specification, read Value Specification (see page 868).
• Model elements150
• Auxiliary Diagram Symbols (see page 869)
• Diagramming (see page 449)
2.5.73 Transition
A transition is a directed relationship between a source vertex and a target vertex. It can be a part of a
compound transition, which takes the state machine from one state configuration to another,
representing the complete response of the state machine to an occurrence of an event of a particular
type. The transition relationship is created between two states. The transition specifies event
occurrences and guard conditions.
When these events occur and conditions are satisfied with the object in the source, state will perform
the specified effect and will enter the target state. So, in the transition, the main subjects are as follows:
In the preceding example, the transition relationship is created from the Ringing state to the Connected
state. The transition has the specified event - phone answered, and the specified effect - enable speech.
When the phone answered event occurs, the Ringing state performs the speech effect, and then the
Connected state is
entered.
The event on the transition is specified as event of the concrete type. The event trigger is the event
whose reception in the source state makes the transition eligible to fire. That is, the trigger is specified
by the event. Event (see page 677)types are as follows:
150 https://docs.nomagic.com/display/MD190SP2/Model+elements
You can specify transition properties (see page 890) in the Transition Specification window (see page 882). In
the same window, you can find the description of each property. Descriptions are presented in the
description area of the Specification window (see page 882).
Related pages
Related Pages
See the list with the event type and its command syntax in the following table.
The event type assigning by typing the command straight on the diagram pane is also available
for a transition to self in the State Machine diagram, as well as for a protocol transition and
protocol transition to self in the Protocol State Machine diagram.
Related pages
Related Pages
• In the Containment tree, select a behavior type element and drag it to the selected transition on
the diagram.
• In the transition’s Specification window (see page 882) > Effect category, click the Behavior Type
property value cell and select the behavior from the list.
• To quickly trace the effect of the transition, from the transition shortcut menu, select Go
To and then the effect element.
• If a behavior (see page 629)of an activity, interaction, protocol state machine, or state
machine type is assigned to a transition, a diagram for that behavior is created
automatically.
Related pages
Related Pages
2.5.74 Trigger
A Trigger used in a State Machine (see page 813) is an extension of the basic definition found within the
behavioral and structural portions of the specification. A Trigger defines the types of events that can
initiate a transition between states. An event is anything that can happen in a system, such as a signal
sent by a Behavior (see page 629), a call to a specific operation, reaching a point in time, or a change in
values within the system.
• For a State (see page 846) element, in the State dialog box, click Add. The Trigger dialog box opens.
• For a Transition relationship, in the Transition dialog box, select the Trigger box, and click Add
(note that the Trigger property is hidden by default). The Trigger dialog box opens.
Specify the Trigger element in the Trigger Specification window (see page 882).
In the Trigger dialog box, near the Event box, click the ... button and select existing or create new Event
(see page 677).
Contents
Use Cases are a means of specifying the required usages of a system. Typically, they are used to capture
the requirements of a system, that is, what a system is supposed to do.
In the following figure you can see a fragment of the Library System. The Use Case Register Return is
associated to the Actor Librarian, which means that this Actor initiates that Use Case.
A Use Case can be specified by changing its property values in the Use Case Specification window (see
page 832). Each property is described in the description area on this window.
• Generalization
• Include
• Extend
You can see the Actors that are related to the selected Use Case in Specification window (see page 882) of
that Use Case, the Actors property group. This group displays a list of Actors that are directly (through
the Association relationship) or indirectly (through the Extend, Include, or Generalization relationships)
connected to the selected Use Case.
Related pages
Extension Point
Contents
1. Draw an extend relationship from the extending Use Case to the extended Use Case.
2. Subsequent actions depend on whether the extended Use Case has at least one extension point
already:
• If there are no extension points, a dialog appears asking for confirmation to add a new
extension point. Click Yes and type the name of the extension point.
• If there is at least one extension point, the Extension Points dialog opens, displaying the
list of extension points of that Use Case. Click Create, type the name of the new extension
point, and click Close.
You can also add extension points via the Specification window of the Use Case. To do this, click
Extension Points at the left side of the Specification window and type the name of the new extension
point.
Related pages
Contents
The subject of a Use Case represents a system under consideration to which that Use Case applies. The
subject can be any element that may have a behavior, such as a Component or Class (SysML Block).
Contents
You can extend the Use Case description with additional Use Case properties, such as Use Case ID,
Author, Date, Use Case Complexity, Pre Condition, and others.
To extend the Use Case with additional properties, you must load the Use Case Description Profile
manually; in a new project, it is not loaded by default.
After the Use Case Description Profile is loaded, the following additional properties appear in the Use
Case Specification window (see page 882):
• The Use Case ID property in the Use Case general property group. This property is designed to
number use cases to correspond to particular sequences.
• The Use Case Description property group. In this property group, you can specify properties
describing the particular Use Case, such as an Author, Date, Goal, and other.
• The Use Case Scenario Obsolete property group. Use cases numbering values used in projects
created with earlier modeling tool versions are stored in this property group after importing the
project to version 17.0.2 or later. By default, this property group is displayed in the Expert mode.
You can specify the Use Case extension properties in the Use Case Specification window (see page 882).
Descriptions of each property appear in the description area of the Specification window.
Related pages
Contents
On this page
This functionality is available in the Standard, Professional, Architect, and Enterprise editions.
Use Case Scenario Sketch is designed for creating the very first Use Case Scenario. After the scenario is
created, you may edit it directly in the Activity diagram.
With the help of the Use Case scenario editor, you can:
• Create, review, and edit steps of the Use Case scenario by using the convenient textual values
editor.
• Automatically create an Activity diagram representing the textual Use Case scenario flow. This
enables you to have the textual numbered action flow and its graphical representation.
• Create the Use Case scenario from the Activity diagram for the particular Use Case and
automatically represent this action flow as textual information in the Use Case scenario.
A Use Case scenario can have defined basic (see page 855), alternative (see page 856), and exceptional (see
page 857) flows.
Basic flow
A basic flow represents the sequence of basic steps or actions of the Use Case scenario. You can also
add steps from included or extended use cases to the flow. Each basic flow step can have one or more
alternative and exceptional paths. The two figures above depict the basic flow, consisting of four steps.
Letters and numbers in the brackets next to the basic flow step indicate how many alternative
conditions and exceptional types that particular step has. The letter A indicates alternatives flows; the
letter E indicates exceptional flows.
Alternative flow
An alternative flow is an alternative path of the basic flow. You can define an alternative flow from a
particular step of the basic flow. The alternative flow is an alternative solution, performed after the
defined condition is satisfied. The alternative flow contains steps that are executed if one or more
conditions occur.
Thus, in the Use Case scenario, the alternative flow is specified by these two parameters: the alternative
condition and the alternative flow steps.
The following figure shows the content of the Alternative Flow tab of the Use Case Scenario in
the Use Case Specification window (see page 882).
Here, the alternative flow is created for the second step of the basic flow — 2. Get Loan Details.
The alternative flow has the condition named 2.1 Item is overdue. The condition contains one
alternative flow step named 2.1.1 Penalize for overdue.
In the Activity diagram, the alternative flow is created between the decision and merge nodes. The
alternative condition is represented as a decision node; the name of the alternative condition in the
Activity diagram is the name of the decision node. In the Activity diagram, the alternative flow steps are
represented as Call Behavior actions.
The alternative flow representation is shown in the activity diagram in the following figure.
In the Activity diagram, you can read the alternative flow as follows: if the item is overdue, then
penalize for overdue; if not, continue to the basic flow.
In the Use Case scenario, the exceptional flow is specified by two parameters: the exception type and
the exceptional flow steps.
The type of the exception object indicates the nature of the exception. Any class could be assigned as a
type of the exception.
The exceptional flow steps are performed as actions when the execution occurs. The exceptional flow
steps are specified for the concrete type. Normally, there is one exceptional flow (in other words, one
exception type) assigned for one basic flow step. There can be any number of exceptional flow steps
specified for one exception type.
The following figure shows the content of the Exceptional Flow tab of the Use Case Scenario in
the Use Case Specification window.
Here, the exception flow is created for the third step of the basic flow, 3. Confirm Return. The
exceptional flow has the type named 3.1 Cancel; that is, the Cancel class is assigned as the
exception type.The type contains one exceptional flow step named 3.1.1 Close Item Dialog.
In the Activity diagram, the exceptional flow is connected using the Exception Handler relationship. The
Exception Handler has the type specified, the same as the exception type, in our sample Cancel class.
Exceptional flow steps in an activity diagram are represented as Call Behavior actions.
You can create a Use Case scenario in the Use Case Specification window using the Use Case Scenario
Sketch property group, where you can specify the basic, alternative, and exceptional flows, as well as
open the Activity diagram.
Related pages
Contents
1. Open the Use Case Specification window and click the Use Case Scenario Sketch property
group.
2. In the Basic Flow area, click the Add new step button or press Alt+ENTER and type a name of
the basic flow step. Repeat this action for each basic flow step you need to create.
Steps of the basic flow are numbered automatically. Use the Up and Down buttons to change
the order of steps. In the activity diagram, steps are represented according to their order in the Use
Case scenario.
Related pages
Contents
Make sure the selected Use Case has included or extending use cases.
1. Open the Use Case Specification window and click the Use Case Scenario Sketch property
group.
2. Select the basic flow step where you want to add steps from another Use Case.
3. Click the Add steps from other use cases button . The shortcut menu opens.
• Click Add New Steps From Included Use Case or press ALT+I to add steps from the
included Use Case.
• Click Add New Steps From Extending Use Case or press ALT+E to add steps from the
extending Use Case.
Depending on your choice, the Select Included Use Case or Select Extending Use Case dialog
opens.
5. In the opened dialog, select the use case(s) from which you want to add steps to the selected step
of the basic flow. Click OK after you have selected a Use Case.
Steps added from included or extending use cases are read-only. You are not allowed to modify
them in the current scenario.
You can modify added steps only in use cases from which these steps are added.
Related pages
Contents
1. Open the Use Case Specification window and click the Use Case Scenario Sketch property
group.
2. Select the basic flow step you want to create an alternative flow for.
3. In the Alternative Flow tab, click the Add new button . The shortcut menu opens.
Conditions and steps of the alternative flow are numbered automatically. Use the Up and
Down buttons to change the order of conditions in the alternative flow or the order of steps in
Related pages
Contents
1. Open the Use Case Specification window and click the Use Case Scenario Sketch property
group.
2. In the use case scenario, select the basic flow step you want to create an exceptional flow for.
3. In the Exceptional Flow tab, click the Add New button . The shortcut menu opens.
Types and steps of the exceptional flow are numbered automatically. Use the Up and Down
buttons to change the order of types in the exceptional flow or the order of steps in the particular type.
In the Activity diagram, steps are represented according to their order in the Use Case scenario.
Related pages
Contents
After you have created a Use Case scenario, you can represent this scenario in an Activity diagram. The
following procedure describes how to represent the Use Case scenario in the Activity diagram and how
to turn the automatic layout on or off in the Activity diagram when representing the Use Case scenario.
1. Open the Use Case Specification window and click the Use Case Scenario Sketch property
group.
2. Click the Open Activity Diagram button . The Activity diagram opens with
the Use Case scenario represented on it.
You need to reopen the Activity diagram each time after you make modifications to the Use Case
scenario in the Specification window (see page 882). Modifications to the Activity diagram where the Use
Case scenario is represented automatically appear in the textual Use Case scenario.
For Use Cases having read-only accessibility, the use Case Scenario cannot be represented on
the Activity diagram.
In the Activity diagram, all symbols are laid out automatically every time the diagram is opened.
To leave symbols in the same place while opening the Activity diagram after modifying the Use
Case scenario in the Specification window (see page 882), change the Layout use case scenario
activity diagram option value to false. This option appears in the Project Options dialog, in
the General project options group.
Related pages
Contents
To understand the Use Case scenario representation in the Activity diagram, see the following table.
One (the first) Basic flow 1. The Activity with the Activity diagram is created under the
(see page 853) step owning Use Case just after the first basic flow step is
created.
2. The name of the created Activity and Activity diagram is the
same as the owning Use Case name.
3. In the Activity diagram, the Call Behavior Action is created
for the basic flow step.
4. The Initial Node is created before the Call Behavior Action.
5. The Final Node is created after the Call Behavior Action.
6. The Control Flow relationships are created from the Initial
Node to the Call Behavior Action and from the Call Behavior
Action to the Final Node.
Basic flow (see page 853) 1. The Call Behavior Action is created for each basic flow step.
steps 2. The Initial Node is created before the first Call Behavior
Action.
3. The Final Node is created after the last Call Behavior Action.
4. The Control Flow relationships are created from the Initial
Node to the first Call Behavior Action, between each Call
Behavior Action, and from the last Behavior Action to the
Final Node.
Included use case (see 1. The Call Behavior Action is created for the basic flow step of
page 859) the included Use Case.
2. The Call Behavior Action is inserted to the activity basic flow
according to the order it was inserted in the basic flow.
3. The Call Behavior Action is connected with the Control Flow
relationships. The Call Behavior Action is not named.
4. The Call Behavior Action has the Activity behavior defined.
This Activity name corresponds to the name of the included
Use Case.
5. The activity (the Behavior or the Call Behavior Action) is
owned by the included Use Case.
6. If the included Use Case has its own Use Case scenario, this
scenario is represented in the activity; the Activity diagram
is created inside the Activity and flows are represented.
Extending use case (see 1. The extending Use Case with the extension point is added
page 859) (with the as an alternative flow; the Decision and Merge nodes are
extension point) created.
2. The Decision node name corresponds the name of the
alternative condition.
3. The Call Behavior Action is created for the alternative flow
step of the extending Use Case. The Call Behavior Action is
not named.
4. The Call Behavior Action has the Behavior defined: the
Activity whose name corresponds to the name of the
extending Use Case.
5. The Activity (the Behavior or the Call Behavior Action) is
owned by the extending Use Case.
6. If the extending Use Case has its own Use Case scenario,
this scenario is represented in the Activity diagram; the
Activity diagram is created inside the Activity under the
extending Use Case.
7. The [else] Guard property is defined for the Control Flow
created from the Decision node to the Merge node.
Extending use case (see 1. The Call Behavior Action is created for the basic flow step of
page 859)(without any the Use Case scenario.
extension point) 2. The Call Behavior Action is connected with the Control Flow
relationships according to the extending Use Case order in
the basic flow.
3. The Call Behavior Action is not named.
4. The Call Behavior Action has the Behavior defined - the
Activity whose name corresponds to the name of the
extending Use Case.
5. The Activity (the Behavior or the Call Behavior Action) is
owned by the extending Use Case.
6. If the extending Use Case has its own Use Case scenario,
this scenario is represented in the Activity; the Activity
diagram is created inside the Activity under the extending
Use Case.
Alternative flow (see page 1. The alternative flow is interrupted in the basic flow by using
853): alternative the Decision and Merge nodes.
condition, alternative 2. The Decision and Merge nodes are created after the Call
flow step Behavior Action. The Call Behavior Action in the Use Case
scenario represents the basic flow step of this alternative
flow. In other words, in an Activity diagram, the elements of
the alternative flow are created after the basic flow step this
alternative flow belongs to.
3. The Decision node name corresponds to the name of the
alternative condition.
4. The Call Behavior Action is created for each alternative flow
step.
5. All these elements are connected with the Control Flow
relationships.
6. The [else] Guard property is defined for the Control Flow
created from the Decision node to the Merge node.
Exceptional flow (see 1. The Structured Activity Node with the Input Pin is created.
page 853): exception type, 2. The Call Behavior Action for which the exceptional flow was
exceptional flow step created is linked with the Input Pin using the Exception
Handler relationship.
3. The Class element is created under the Activity. The Class
corresponds to the exception type in the Use Case scenario,
that is, the Class name corresponds to the exception type
name in the Use Case scenario.
4. The Class is assigned to the Input Pin as a type property.
5. In the Structured Activity Node the Call Behavior Action is
created for each Exceptional Flow step.
6. The Call Behavior Actions inside the Structured Activity
Node are connected with the Control Flow relationships.
7. In the Structured Activity Node the Initial Node is created
before the first Call Behavior Action, and the Final Node is
created after the last Call Behavior Action.
8. In the Structured Activity Node, the Initial Node is
connected with the first Call Behavior Action by using the
Control Flow relationship and the last Call Behavior Action
is connected with the Final Node by using the Control Flow
relationship.
Related pages
Contents
Beginning with version 17.0.2 of MagicDraw or other modeling tools developed by No Magic Inc., Use
Case scenarios of projects created with earlier versions are stored in the Use Case Scenario Obsolete
property group in the Use Case Specification window (see page 882).
Related pages
1. In the Specification window of the selected element, choose an appropriate property value cell
and click the Show Shortcut Menu button (the black arrow).
2. In the shortcut menu, click Value Specification and select a value specification.
To create a value specification automatically
1. Assign a default value to a property for which you want to create a value specification.
2. The value specification of the corresponding type will be assigned automatically according to the
assigned default value in your model.
To change an assigned value specification
1. In the Specification window of the selected element, choose an appropriate property value cell
and click the Show Shortcut Menu button (the black arrow).
2. From the shortcut menu, select Value Specification > Delete <value specification>.
3. Assign a new value specification.
Related Pages
2.6.1 Content
s
You can create auxiliary diagram symbols from the Common category in the diagram pallet.
Related pages
Contents
The image shape provides a simple and quick way to insert a image into a diagram. Images may include
logos, graphs, tables, or others. The default shape size after the insertion is the actual image size.
You can format image shape representation properties in the Symbol Properties dialog (see page 943).
1. On the diagram pallet, in the Common category, click the Image Shape button or press the I
key.
2. Click on the diagram pane. The Open dialog opens.
3. Browse for an image in the *.gif, *.jpg, *.jpeg, *.svg, or *.png format and click Open.
Related pages
Contents
Functionality Availability
The diagram overview functionality is available in Standard, Professional, Architect, and
Enterprise editions.
A diagram overview shape provides the ability to overview other diagrams (see page 495) on a diagram
pane. When using the diagram overview shape, you can overview dependency matrices (see page 309),
tables (see page 377), and relation maps (see page 336) on the diagram pane.
To open the particular diagram's Specification window (see page 882), double-click the diagram overview
shape. The description of each diagram property appears in the same window. Descriptions are found
in the description area at the bottom of the Specification window.
1. On the diagram pallet, under the Common category, click the Diagram Overview button.
The Select Diagram dialog opens.
2. Select the diagram for which you want to create a diagram overview shape and click OK.
3. Click the diagram pane outside the dialog. The diagram overview shape is created and shows the
full content of the corresponding diagram.
Related pages
Sample model
2.6.4 Separator
Contents
You can use either a horizontal or vertical separator to rule off different parts of a diagram. The Rotate
button allows changing the separator from the horizontal to vertical position, and vice versa.
You can display text next to the separator as plain text or HTML text. You can edit the HTML text using
the HTML editor (see page 1018).
1. From the separator's shortcut menu, select Symbol Properties or select the separator and press
Alt+Enter.
2. The Symbol Properties dialog opens. In that dialog, set particular property values, such as Text
Position, Line Style, Line Width and other, as you need.
3. Click Close, when you are done.
Related pages
Contents
You can use a rectangular shape to delineate different parts of a diagram, as seen in the following
figure.
A text next to the separator can be displayed as plain text or HTML text. You can edit the HTML
text using the HTML editor (see page 1018).
1. From the rectangular shape's shortcut menu, select Symbol Properties or select the rectangular
shape and press Alt+Enter.
2. The Symbol Properties dialog opens. In that dialog, set particular property values, such as Fill
Color, Line Style, Line Width and other, as you need.
3. Click Close, when you are done.
Related pages
Contents
A text box is a box where you can type any text. Text in the text box can be displayed as plain text or
HTML text.
• On the diagram pane, select the text box. Click the button that appears on the lower left corner
of the shape:
• The HTML button converts the text to HTML text.
• Open the selected text’s shortcut menu and select or click to clear the HTML Text command.
You can edit the HTML text using the HTML editor (see page 1018).
1. Select one or more elements in the Model Browser (see page 29), or Specification window (see page
882).
2. Drag the selected elements on the text box on the diagram pane. The hyperlinks to specifications
of dragged elements are created on the text box. Click the link on the text box to open the
Specification window of the selected element.
Related pages
• Model elements151
• Auxiliary Diagram Symbols (see page 869)
• Diagramming (see page 449)
2.7.1 Content
s
The chapter outlines various methods of working with your model's elements. You will find detailed
instructions on creating and defining model elements, default property values, extracting, defining
hyperlinks, etc. You will also learn how the modeling tool shortcut menus, toolbar, and browser enable
you to easily edit model elements.
In the model, a model element is stored in the Model Browser and its symbol or path (for relationships)
is represented on the diagram pane, as shown below.
151 https://docs.nomagic.com/display/MD190SP2/Model+elements
1. In the Containment Tree, right-click the element owner where you want to create a new model
element.
2. From the shortcut menu, select Create Element.
3. A list with available elements appears. Select the element you need or start typing an element
name in the Search box to find it faster.
4. Type the name of the element.
You can also create an element directly on the diagram pane. In this case, a symbol of the element and
the element in the diagram owner is created.
1. Open the diagram or create a new diagram where you want to create a new model element.
2. From the diagram palette, select an element and drag it on the diagram pane. The element
symbol is created.
3. Click the symbol and type the element name.
Containment Tree
Please note, the new element is created in the Model Browser as well.
Related pages
Avoid names duplication, because elements with the same name cannot be created for the
same owner.
1. Copy a list.
2. Select the possible owner in the Containment tree (see page 32).
3. From the shortcut menu select Paste or press Ctrl+V.
4. From the Select Type dialog choose the element type.
The named elements are created in the model. As example, see the figure below where the
Actors are created in the Containment tree by pasting the list.
To create the elements from the clipboard on the diagram pane using Select Type dialog
1. Copy a list.
2. Click a free space on the diagram pane.
3. Press Ctrl+V and from the Paste Special dialog select Elements.
1. Copy a list.
2. From the diagram palette (see page 24) select the element type.
3. Press Ctrl+V.
The named elements are displayed in the diagram pane and are created in the model.
Contents
MagicDraw shortcut menus, toolbars, and browser help ease the task of editing model elements.
You can also edit model elements and symbol properties directly in the Properties tab (see page
54), which is located at the bottom of the Model Browser (see page 29).
Related pages
Contents
Using Specification window you can perform various actions that are necessary when working with
model elements. Every model element has its own specification.
Function Description
Add/modify model Choose the desired property group and specify its properties in the
element properties general specification pane.
and inner elements
Open referenced
From the shortcut menu, select Open Specification or click .
element
When another element specification is open, you can work with both
specifications
specifications in the same window.
Navigate between To navigate between open specifications, use the Back and Forward
open specifications buttons.
Add/edit element Add element description, describe use case scenarios, or add other
documentation relevant information that can be used for generating reports or
technical documentation. Documentation also can be written in
HTML using the HTML editor (see page 1018).
Manage element Open, edit, add, or remove hyperlinks (see page 970)from the selected
hyperlinks model element to a file, address, other element / symbol, or
requirements.
Manage element tags and tagged Create tag definitions, view, create, modify, assign (see page 836)
values default tagged values.
Manage element Define new, edit, or apply constraints (see page 659) to an element.
constraints
Track element Find out in which diagrams the symbol is used. Open these diagrams
symbol usage in diagrams directly from the specification window.
Select model From the shortcut menu, choose Select in Containment Tree or
element in the
click .
Containment tree
View element traceability Monitor element changes and the impact of those changes using
traceability (see page 1153).
Select a specification property and from the shortcut menu, select the action you want to
perform.
Related pages
Contents
Select in Containment Tree Selects the chosen element in the Containment tree of the
Model Browser.
Related pages
Contents
Strip Multiline Text If the text in the property cell (e.g., ToDo) covers more
than five rows, it is finished with ... showing only those
five rows. The complete text is available in the tooltip
or in the cell edit mode.
The toolbar configuration can vary according to the selected property group.
Related pages
Quick filter
Contents
To find a property, just start to type the desired property name in the open dialog.
The quick filter box is displayed only when ten or more properties are displayed in the property
list.
The quick filter allows you to quickly find the required property in the property list. This is especially
handy with a long properties list. Properties can be filtered by the keyword entered in this field.
You can also use the quick filter in Environment Options (see page 64), Project Options (see page 213), and
Symbol Properties (see page 943) dialogs in the Specification window as well.
Related pages
1. From the Options menu, select Project. The Project Options dialog opens.
2. Expand Default model properties. Select the desired elements and change their property
values.
After creating a new element it will have new property values. Values for previously created elements
will not be changed.
• In he Project Options dialog, Default model properties group, click the Reset to Defaults
button.
Exception: interface attribute default visibility will always be #public, no matter what your
settings are.
1. From the Diagrams menu, select Customize. The Customize Diagrams (see page 1962) dialog
opens.
2. Select the diagram type you want to customize.
3. Click the Edit button. The Customize Diagram Wizard opens.
To create a template
1. From the File menu, select New Project. The New Project dialog opens.
2. From the Other domain, select the Project from Template icon.
3. In the Select template tree, choose your template. The project options are imported to the
project together with the template.
On this page
Related pages
Related pages
Related pages
Using the editor for multiline textual values, you can perform the following actions:
To strip long values, make sure that the Strip Multiline Text mode is turned on in the
Specification window (see page 882).
Select the HTML check box to edit a selected row in the HTML mode.
The HTML editor toolbar will appear. For more information about the
HTML toolbar, refer to "HTML editor toolbar" on page 428.
ALT+ENTER Click to add an empty row after the selected one to type a new value.
Mac OS users should use MAC shortcut key as an alternative for the ALT key.
Related pages
Selecting values
Selectable value type property values are selected from lists. There can be two types of lists:
• Non-editable - for properties with value ranges restricted by UML (for example,
Visibility, Message Sort, Event Type).
• Editable - for properties with value ranges not restricted by UML and can be defined by the user
(for example, Type Modifier, Multiplicity).
Learn about selecting property values from lists in:
• Selecting single property value from non-editable list (see page 893)
• Selecting single property value from editable list (see page 894)
• Selecting multiple property values (see page 896)
Related pages
The property value can be removed only for those properties, that can have an empty value.
• Selecting a value either from a predefined value (auto-completion) list or from the whole
model in the Select Element dialog.
• Creating an element and selecting it as property value.
Related pages
The element is removed from both the property value list and the model.
Examples of properties whose values are value specifications: Default Value, Value.
When editing owned element properties, keep in mind that you create a new element in your
model.
A property set in the property group may vary before and after owned element specification. For
example, let’s say, we have an activity assigned as a behavior type in the Entry property group. As a
result the additional properties appear in the Entry property group (Name and Owned Diagram) after
creating a new activity (see the following figure).
1. In the property group, wherein you want to create the owned element, select either a type or an
element property specification cell.
2. From the list, select an element you need to create.
3. Specify additional properties corresponding to the created element.
• Either
Contents
On this page
1. In the model browser, double click the model element that owns the elements you want to sort.
Its Specification window opens.
2. In the property group list on the left side of the window, select the Inner Elements node.
3. Make sure the sorting view is selected in the Specification window toolbar, as displayed in the
figure below.
4. On the right side of the window, select the element that you want to move up or down in the
model browser.
Once you sort elements in the Specification window of the owning element, the elements are instantly
reordered in the model browser as well. The newly created elements of the sorted element type are
automatically placed at the bottom.
1. In the model browser, double click the model element owning the elements you want to sort. Its
Specification window opens.
2. In the property group list on the left side of the window, select the Inner Elements node.
3. Make sure the sorting view is selected in the Specification window toolbar, as displayed in the
figure above.
4. On the right side of the window, select any element in the group of elements that you want to
sort.
5. Click the Sort A to Z button.
Tip
If the Sort A to Z button is disabled (grayed out), the elements of the selected element
group are already sorted alphabetically.
After completing the steps above, all the elements in the selected element group are sorted
alphabetically.
2.7.7 Refactoring
Refactoring allows you to modify model elements including all related data. Within refactoring, you can
convert element types, replace elements, decompose diagrams, and perform other actions.
All the refactoring commands have been moved under the Refactor command in the shortcut menu of
the particular element. Now the refactoring covers the following commands:
• Convert To.
• Replace With.
• Reverse Direction.
• Reverse Flow Direction.
• Extract.
• Split Control Flow for the selected Control Flow edge.
• Split Object Flow for the selected Object Flow edge.
• Join Connector for the selected split Control Flow or Object Flow edge.
• Swap.
• Redefinition.
Some of the Refactor sub-commands are available only in element shortcut menu that is
opened from the diagram pane, not available in the Model Browser.
Related pages
Redefinition
Any inherited part can now be quickly redefined directly in the composite structure diagrams. A new
part redefining the original one is created and graphically replaced in the diagram with all ports and
connectors remaining in their places.
1. Right-click a part and choose Refactor > Redefine To. The Select Type dialog opens.
2. Do one of the following:
• Type a name, if you want to create a new type.
• Select one of the existing types.
Converting Elements
Conversion target
The conversion target is the element type, to which the original element is going to be converted.
Converted element
The converted element is the element that type has been changed during the conversion.
Related elements
The related elements are elements having relations to the original element. Related elements can
be the following:
• If the original element is a relationship, elements connected by this relationship are considered
as related element to relationship.
• If the original element is not a relationship, relationships going from or to the original element
are the related elements (such as an association, dependency, generalization, and others).
• Other related elements associated to the original element. They are properties of the original
element, such as inner elements, types, and others.
Compatible properties
The compatible properties are original element specification that are compatible with the
conversion target. The term “properties” includes related elements, inner elements, and all other
elements listed in the element Specification window.
Compatible means that the converted element can have or own the particular property or
properties of the original element.
Incompatible properties
Incompatible properties are original element specification that are incompatible with the
conversion target. Incompatible means that the converted element can NOT have or can NOT own
the particular property(-ies) of the original element.
Element conversion allows converting one element type to another. To be more specific, the element
conversion functionality allows the UML model element conversion from one metaclass to another. For
example, a class element can be converted to a use case, component, interface, or other. All
compatible properties and all compatible related elements are moved from the source element to the
converted element during the conversion.
To convert elements
1. From the selected element's shortcut menu, select Refactor > Convert To. The list with available
conversion target types opens.
2. Do one of the following:
• Select the element type from the commonly used element type list. The element is
converted.
• Select More Elements to see the whole list of available conversion targets. In the opened
More Elements dialog, select the element type you need and click OK. The element is
converted and selected element type is included as commonly used element type.
As of the MagicDraw version 17.0.2, the following commands have been moved under the
Refactor command in the shortcut menu of the particular element:
• Convert To > Output Pin for the selected Object Node or Input Pin.
• Convert To > Input Pin for the selected Object Node or Output Pin.
• Convert To > Object Node for the selected Input Pin or Output Pin.
• Convert To > Attribute(s) for the selected Association that has defined roles, that is,
roles have names.
• Convert To > Association(s) for the selected Attribute. NOTE: The Association(s)
command is available only if the attribute(s) type is specified.
• If the Refactor command is unavailable, make sure you have permissions to edit the
selected element or related element(s).
• Use Undo to restore the original element and its data.
Related pages
Incompatible means that the converted element can NOT own particular properties or can NOT be
associated with particular related elements of the original element.
For example, let’s convert the component to package. See an example in the following figure.
As you see, the component has the assigned port. According to UML guidelines, a package cannot own
ports. So, in this case, ports are incompatible with the packages. After the conversion, the package, that
is, a converted element, has no assigned port. The port is deleted from the project.
To prevent from losing model data, you always get a message with a warning that incompatible
properties will be lost after the element conversion.
On this page
Replacing elements
Replacement target
The replacement target is the element with which the original element is going to be replaced.
Replaced element
The replaced element is the element to which the original element has been changed during the
replacement.
Element properties
The element properties are so called the element specification properties (specified in the element
Specification window) and the element symbol properties (defined in the element Symbol
Properties dialog).
Inner elements
Inner elements are the elements stored inside the element (that is, owned by that element), for
example, the class as inner package element.
You can replace one model element with another of the same type (metaclass) element. The model
element replacement is useful when during the modeling process you notice that one model element
needs to be replaced with another. All relations and references of the original element are transferred
to the newly replaced element.
After the replacement, an original element will be replaced with a replacement target:
• The replacement target will be displayed in all diagrams instead of the original element.
• All references to the original element will be replaced by references to the replacement target.
• The replacement target after the replacement will have all the relationships of the replacement
target and the original element.
• The original element will be deleted from the project.
• The original element properties and inner elements will be deleted from the project.
See the replacement example in the following figure.
1. Select a symbol on the diagram pane or an element in the Model Browser and open its shortcut
menu.
2. Click Refactor > Replace With. The warning message appears:
• Click Yes to continue the element replacement. The properties and inner elements of the
original element will be lost.
• Click No to cancel the element replacement. The selected element will not be replaced.
3. If you decided to continue the replacement, the element selection dialog opens.
4. In the element selection dialog, select the element with which you want to replace the original
element.
5. Click OK. The original element is replaced with the target element.
Related pages
• The selected relationship and elements connected by this relationship are editable.
• The source and target elements are compatible, that is, they can be counterchanged.
To reverse a relationship direction
1. Select the relationship in the Model Browser or the relationship’s path on the diagram pane.
2. From the element’s shortcut menu, select Refactor > Reverse Direction. The direction of the
relationship changes.
The direction of the information flow (see page 701) will not be changed on the direction reverse
action. Additionally, in some cases when the information flow (see page 701) is not valid anymore,
the information flow (see page 701) will be removed from the project after the direction reverse
action.
Related pages
Swapping
Swapping allows counter-change symbols with each other on the diagram.
• In the Activity diagram, you can swap actions, merge or decision nodes, join or fork nodes
with each other, if the symbols are connected through control flow.
• In the State diagram, you can swap states or pseudo states (initial state, deep history, join, fork,
junction, choice, entry point, etc.) with each other, if symbols are connected through transition.
To swap elements, do one of the following
Swap does not work when dragged shape can be added into the target shape (or in
other words, can be added as a child).
• On the diagram, select the two shapes that you want to swap, right-click, and from the
shortcut menu, select Refactor > Swap.
Rule Example
You can swap the elements that You can swap the following elements:
are in the same branch
• “Select the reading item to remove” with “Confirm
deletion”
• “Request removal confirmation” with “Check if there
are loaned copies of reading item”
• “Check if there are loaned copies of reading item”
with “Notify librarian and do not allow removal”
• “Check if there are loaned copies of reading item”
with “Check if reading item is reserved”
You cannot swap the You cannot swap the following elements:
elements that have different parents
• “Select the reading item to remove” with Request
removal confirmation, because one element is in the
“Librarian” partition and the other is in the “System”
partition.
• “Confirm deletion” with “Check if there are loaned
copies of reading item” because one element is in the
“Librarian” partition and the other is in the “System”
partition.
You cannot swap the elements that You cannot swap the following elements:
are in different branches
• “Notify librarian and do not allow removal” with
“Check if reading item is reserved”.
Related pages
1. Select the Connector that has the Information Flow set in the Containment tree or on the
diagram pane.
2. From its shortcut menu, select Refactor > Reverse Flow Direction.
The direction of the Information Flow is changed and updated in all the related diagrams.
2.7.8 Extracting
In order to make the diagrams more readable and usable, you can extract a specific part of the diagram
to another diagram. By using the extraction, you can reuse that part of the diagram to simplify a
complicated system.
Definitions
Source diagram
A source diagram is the diagram from which the elements are extracted.
Target diagram
A target diagram is the newly created diagram resulting from the extraction. The selected elements
are moved from the source diagram to the target diagram.
Extracting
Extracting means moving selected elements from one location to another. In other words, the
selected elements are deleted from the source diagram and moved to the newly created target
diagram.
Referencing element
A referencing element is created as the result of the extraction. The referencing element is created
in the source diagram and represents the elements moved to the target diagram during the
extraction.
A referencing element contains the reference to the target diagram. Therefore, double-clicking the
referencing element on the diagram pane or in the Model Browser will open the target diagram.
Intersected relationship
An intersected relationship is the relationship selected in the source diagram. The intersection
appears when the selection intersects the relationship - one end element of the relationship is
selected, but not both.
Related pages
Related pages
That is, the interaction use is a referencing element that references the newly created sequence
diagram.
Related pages
Related pages
• Create and specify the new element wherein the extracted part will be moved.
• Select the intersected incoming messages for which the formal gates will be created in the target
diagram.
To start the Extract Sequence Wizard
Type interaction name Type the name of the new interaction, wherein the extracted part will
be stored and the new sequence diagram will be created. The newly
created sequence diagram name will be the same as the interaction
name.
Select element type Open the list and select the element type in which the extracted part
and new diagram will be created. The default element type is
interaction.
Select owner In the model tree, select a package, profile, or model as an owner of
the newly created element. You can also:
Select diagram type Open the list and select the diagram type for the extracted part. The
default diagram type is a sequence diagram. You can also select to
create a new time diagram.
By using the customized plugins, you can add custom diagrams to the
diagram type list.
After you have specified the new element name, type, owner, and the type of the new diagram, do one
of the following:
• Click Next, if you want to select intersected messages that will be created in the new target
diagram.
• Click Finish. The selected part of a sequence diagram is extracted to a new diagram. The second
wizard step is skipped, and the messages that by default are selected in this step, will be created.
• The Select messages list is empty unless there are intersected incoming messages that
are selected in the source sequence diagram.
• If there are intersected outgoing replay messages when they are listed in the Extract
Sequence Wizard, the second step. For more information, see Rules of extracting in
Sequence diagram (see page 919).
• For more information about intersected messages, see concepts in Extracting (see page
916).
• Click Finish. The selected part of the sequence diagram is extracted to a new diagram.
On this page
Related pages
Related pages
Related pages
• Rule 1. Only one incoming and/or outgoing control flow is allowed for a valid diagram extraction
(see page 925)
• Rule 2. The selected elements should exist in the same owner, action, or activity partition (see page
925)
• Rule 3. The intersected exception handler is not extracted to a new diagram (see page 926)
Rule 1. Only one incoming and/or outgoing control flow is allowed for a valid diagram extraction
If the selected part of an activity diagram has two or more intersected incoming or outgoing control
flows, the extraction is not valid.
Let’s analyze an example of the extraction when two incoming control flows are selected in the activity
diagram as depicted in the following figure.
After you start the extraction, you will be warned that only one incoming control flow and only one
outgoing control flow is allowed. Click the OK button to close the message and then change the
selected elements in the activity diagram.
Rule 2. The selected elements should exist in the same owner, action, or activity partition
The extraction will be invalid if:
• The selected elements do not belong to the same owner. For example, if one of the
selected actions is located in a structured activity node and the other does not belong to the
If an attempt is made to extract using an invalid selection, a warning will be displayed. Make a valid
selection in order to proceed with the extraction.
1. In the source activity diagram, select an exception handler along with an action.
3. Click Yes to continue with the extraction. See the example of the extraction result in the following
figures. After the extraction the referencing element is created in the source activity diagram in
place of the selected exception handler and the Confirm Return action. The path of the exception
handler is not represented in the new target diagram because in this case the exception handler
• Click No to close the message. The extraction is canceled and you can select elements for
extraction again.
• Use Undo to restore the original element and its data.
Related pages
• Create and specify the target diagram that will be created as the result of the extraction.
The selected part will be extracted to the newly created diagram.
• Select the parameters that will be created in a new diagram. The parameters are listed for
each intersected object flow from the source diagram.
• Specify a referencing element that is created in the source activity diagram and represents
the elements moved to the target diagram during the extraction.
To start the Extract Activity Wizard
The new diagram will be created along with a new activity - the diagram will be created as an inner
activity element.
Type diagram name Type the name of the new diagram wherein the extracted part will be
stored.
Select owner In the model tree, select a package, profile, or model as the owner for
the newly created activity. You can also:
Select diagram type Open the list and select the diagram type for the extracted part. The
default diagram type is activity diagram. You can also select to create
an interaction overview diagram. By using the customized plugins, you
can add custom diagrams to the diagram type list.
After you have specified the new diagram name, owner of the diagram, and the type of the new
diagram, do one of the following:
• Click Next, if you want to specify parameters and to define a referencing element. The
next wizard step opens.
• Click Finish. The selected part of an activity diagram is extracted to a new diagram that
is specified in this step. Instead of the extracted part, the Call Behavior Action is created in
the activity diagram referencing to the newly created diagram. The second and the third
wizard steps are skipped - that is the default options are taken.
Type element name Type the name of the referencing element that will be created in the
source activity diagram in place of the selected elements.
Select element type Open the list and select the referencing element type. The default
referencing element type is a call behavior action. Custom elements
can be added to the referencing element type list using customized
plugins.
On this page
Related pages
Related pages
• Create and specify the target diagram that will be created as the result of the extraction. The
selected part will be extracted to the newly created diagram.
• Select the entry and exit points that will be created in a new diagram. The entry and exit points
are listed for each intersected transition from the source diagram.
• Specify a referencing element that is created in the source state machine diagram and represents
the elements moved to the target diagram during the extraction.
To start the Extract State Machine Wizard
1. In the state machine diagram, select a part that you want to extract.
2. From the selected part’s shortcut menu, choose Refactor > Extract. The Extract State Machine
Wizard opens.
The Extract State Machine Wizard consists of three steps:
Type element name Type the name of the new element wherein the extracted part will
be stored. The new element will contain the new diagram.
Select element type Open the list and select the element type in which the extracted part
and new diagram will be created. The default element type
is a state machine. By using customized plugins, you can add
custom elements to the element type list.
Select owner In the model tree, select a package, profile, or model as an owner of
the newly created state machine. You can also:
Select diagram type Open the list and select the diagram type for the extracted part. The
default diagram type is a state machine diagram. By using
customized plugins, you can add custom diagrams to the diagram
type list.
• Click Next , if you want to specify entry/exit points and define a referencing element. The next
wizard step opens.
• Click Finish. The selected part of a state machine diagram is extracted to a new diagram that is
specified in this step. Instead of the extracted part, the submachine state is created referencing
to the newly created diagram. The second and the third wizard steps are skipped - that is the
default options are taken.
As you can see in the example, in the Access Control source diagram, the intersected transitions are
selected for the extraction. After the extraction, in the target diagram, the entry and exit points are
created for each intersected transition.
After you have typed the submachine name, do one of the following:
Related pages
With the SysML plugin, the extracting in composite structure diagram feature is available in
Standard, Professional, Architect, and Enterprise editions.
The extraction functionality allows for extracting a selected part of a composite structure diagram to a
newly created diagram. After extraction, a property is created in the source diagram in place of the
extracted part(s). That is, the property is a referencing element that references the newly created
activity diagram.
Related pages
Related pages
• Create and specify the target diagram that will be created as the result of the extraction. The
selected part will be extracted to the newly created diagram.
• Select the ports that will be created in a new diagram. The ports are listed for each intersected
connector from the source diagram.
• Specify a referencing element (in this case, a property) that is created in the source composite
structure diagram and represents the elements moved to the target diagram during the
extraction.
To start the Extract Structure Wizard
1. In the composite structure diagram, select a part that you want to extract.
2. From the selected part’s shortcut menu, choose Refactor > Extract. The Extract Structure
Wizard opens.
This section describes components of the Extract Structure Wizard, such as text boxes and buttons.
The Extract Structure Wizard consists of three steps:
Type element name Type the name of the new element, that is, classifier, wherein the
extracted part will be stored.
Select element type Open the list and select the element type. The default element type is
a class. By using the customized plugins, you can add custom
elements to the element type list.
Select owner In the model tree, select a package, profile, or model as an owner of
the newly created element. You may also:
Select diagram type Open the list and select the diagram type for the extracted part. The
default diagram type is a composite structure diagram. By using the
customized plugins, you can add custom diagrams to the diagram type
list.
• Click Next , if you want to specify ports and to define a referencing element. The next wizard step
opens.
• Click Finish. The selected part of a composite structure diagram is extracted to a new diagram
that is specified in this step. Instead of the extracted part, the selected element type is created in
the composite structure diagram referencing to the newly created diagram. The second and the
third wizard steps are skipped, that is, the default options are taken.
• intersected connector(s)
• incoming connector(s)
• outgoing connector(s)
The Create ports list is empty unless there are intersected, incoming and/or outgoing
connector(s) selected in the source composite structure diagram.
On this page
Related pages
Symbol properties Every symbol may have its own style: color, font, size, and so forth.
Symbol properties may be defined for the concrete symbol, for all
symbol of one element, or according to the diagram type.
Related pages
Apply Style Button Click to open the menu with the available styles (see page 954).
Show All Button Click to display all the properties for the selected symbol types.
Properties
Note that the Show All Properties button is displayed only when at
least two shapes of different
element types are selected, for example, a class and a package.
Make Default Button Click to change the default symbol properties to the properties
that are specified in this dialog.
If your project is of the earlier version you need to set up a new symbol properties manually.
Related pages
Applying image
Contents
On this page
1. From the Window menu, select Image Library. The Image Library tab opens on the right side of
the window.
2. Select the image you want to apply from the Image Library tab (see page 56) tree.
3. Drag the image directly on the symbol.
The image is applied on a symbol.
Only mentioned elements support the Image Library button on the smart manipulator
by default. You can customize the smart manipulator of any other element.
1. Select an image from any external resource (e.g. web browser, email).
Image formats
You can apply images of the following formats: .gif, .jpg, .jpeg, .svg, .png, .wmf.
If the the image that you applied on a symbol is large, you can resize that symbol to a
preferred size automatically.
To resize a symbol to a preferred size
Exceptions
• If the Property already has the image applied, the new image replaces it and is set to the
Property but not to it's type.
• If the Property type already has an image applied, you cannot replace it with the new one
by dragging it on Property shape.
1. In the diagram palette (see page 24), switch on the Type Selection Mode (see page 999).
2. Select an image from the Image Library (see page 945) or other resources (see page 947).
3. Drag selected image on the Property shape which:
- Type is specified.
- The Property is without image.
- The Property type is without image.
The image is applied to the Property type and the notification message is shown by default. You
can specify to apply image on Property by changing the Apply Image To property value.
The descriptions given in the following table will help you to understand this functionality better.
Name Description
Stereotype Every element can be extended by applying a stereotype (see page 827). For
more information about applying stereotype properties, see Stereotype
properties (see page 957).
Image Image which can be assigned to element and displayed as icon or instead
of element shape. To assign image to element in the element Specification
window (see page 882), assign the Image property.
To change the icon visibility mode on the element shape, do one of the following
• Open the Symbol Properties dialog (see page 943) and in the Show Stereotypes property
specification cell, select the icon visibility mode.
• Select an element shape and click the Compartments button. From the menu, select Stereotypes
and choose the icon visibility mode.
The stereotype visibility modes are described in the following table:
Icon and Text Icon of stereotype displayed. Image of element is displayed in the
corner of shape.
Name of stereotype displayed.
Text Only Icon of stereotype is not displayed. Image of element is not displayed.
Do Not Display Icon of stereotype is not displayed. Image of element is not displayed.
* - When the Shape Image and Text or Shape Image property is selected, all symbol
compartments should be suppressed in order to display the icon of a stereotype instead of the
element symbol. If the symbol contains port or pins, these ports or pins are displayed around
that symbol.
Shape Image and Text and Shape Image properties are not added to the Path element
properties list.
If element has assigned both - image and stereotype icon - then image of element will be
displayed on the shape.
Every style has its own presentation of Diagram, Shape, Path, and Stereotype that you can modify using
the Project Options dialog in the Symbol styles option group. You can set your own options for every
model element to the current style.
Path, Shape, and Stereotype branches have the inner structure that helps you find the model element,
the representation of which must be changed. The section on the right side of the dialog contains
possible choices and instruments to manage them.
• Shapes. Set general options for the shapes in the right pane of the Project Options dialog. You
can set options for all shapes that appear on the Diagram pane.
• Paths. Set general options for the paths in the right pane of the Project Options dialog. You can
set options for all paths that appear on the Diagram pane.
• Diagram. Set general options about a diagram.
• Stereotypes. Set general options for the stereotypes in the right pane of the Project Options
dialog. You can set options for all stereotypes that may be applied to elements on the Diagram
pane.
When expanding any of these option groups, the style for a particular element (diagram) can be
created.
1. In the Project Options dialog, change the element style properties and click the Apply button.
The Select Diagrams dialog opens.
2. Select the diagrams to which the element properties will be applied and click OK. The Select
Properties to Apply dialog opens.
3. Select the properties to be applied to the element symbol by moving them from the All list to
the Selected list.
4. Click OK when you are done.
If a new style was set, it will be applied for all newly created elements after drawing them
on the diagram pane. You can always set the default symbols style to the element by
clicking the Apply Default Symbol Style button in the main toolbar.
• Click the Extend by Diagram button, in the open Extend by Diagram dialog, click the Add
Diagram button and select the desired diagram type.
2. Set the style properties for the element. The properties will be applied only in the specified type
of diagram.
To remove the extended diagram from the tree, do one of the following
• In the Project Options dialog, select the extended diagram and from the shortcut menu,
choose Remove.
• In the Project Options dialog, select the extended diagram and click the Remove button on the
right.
On this page
Related pages
Contents
Shape and Path trees have the inner structure to help you find the model element for which you want
to change the symbol style. The right side of the dialog contains possible choices and the instruments
to manage them.
Before changing symbol styles, we advise you to make a copy of the default style so you can come back
to it if needed. You can make a copy by cloning the default style, which will create a new style. You can
make changes in any selected style.
1. In the Symbol styles group, select Default style and click the Clone button.
2. Enter a name for the new style.
3. Change options of the new style.
As stated previously, you can create several symbol styles. You can set the desired style to be your
default at any time.
• In the Symbol styles options group, select the style to make the default and click the Make
Default button.
You can change Default symbol styles using the Set Select Symbol Style as Default button in
the diagram toolbar. If you do not see this button, you need to change Perspective to the Full
feature or customize perspective (see page 67).
You can select to apply one of the predefined styles for the existing diagrams.
• In the Symbol styles group, select the style you want to apply and click the Apply button.
You can also apply the desired options to selected diagram model elements. Click the Apply
button in the specific element's pane.
You can move your earlier defined symbol styles between other projects or users. Simply export the
defined style and pass it on for other projects or users to import.
1. In the Symbol styles group, click the Import button. The Open dialog opens.
2. Select the style you wish to import (*.stl).
Related pages
The Inherited column check box value in the element properties pane specifies if the current property
is synchronized with its parent property. When the Inherited value is “true”, the element property is
changed after changing the parent property.
If the property has no correspondent property in the upper (parent) level, the Inherited column check
box will be cleared and not available.
If the property is modified for the specific element and the value differs from the upper level current
property value, the Inherited column check box is cleared automatically.
Related pages
Stereotype properties
The Stereotype properties can be applied only if the stereotype properties style is created in the
Project Options dialog.
The Stereotype properties are derived from their base class. The Stereotype base class is defined in the
label of the right pane of the Project Options dialog.
The same element can have several stereotypes assigned. In this case, the style of the first stereotype
will be applied to the element symbol. If the stereotype is removed from the element, the next (first)
stereotype properties are applied. If the last stereotype is removed from the element, the base class
(shape or path) properties are applied to the element symbol.
All stereotypes that have defined symbol properties are included in the Stereotypes property group.
The default style is created for these stereotypes.
1. In the Project Options dialog > Symbol styles, select Stereotypes and from the shortcut menu,
choose Add/Remove Stereotype. The Select Stereotypes dialog opens.
2. Select the stereotypes you want to add and click the OK button.
The stereotypes are included into the Stereotypes option group. Set the stereotype style properties in
the right pane of the Project Options dialog.
1. In the Project Options dialog > Symbol styles, expand the Stereotypes options group. The list
of stereotypes opens.
1. In the Project Options dialog, after changing the stereotype style properties, click the Apply
button. The Select Diagrams dialog opens.
2. Select the diagrams to which the stereotype properties will be applied and click OK.
3. In the Select Properties to Apply dialog, select which properties will be applied to the
stereotype. Click OK.
Related pages
You can see the particular used project from which the symbol style is used and copy the symbol style
from the used project.
The symbol style from used project is not editable because the used project by itself is read-only. By
copying the symbol style from the used project to the project you can create a new symbol style and
then edit it.
Note that there are no rules for the symbol style usage from used projects - symbols styles are
used according to used projects loading order.
To copy a symbol style to the project style by using the Project Options (see page 213) dialog
To copy a symbol style from a used project in the Symbol Properties dialog (see page 943)
1. In the Symbol Properties dialog (see page 943), click the Apply Style button and from the drop-
down list, select a style from a module that you want to copy.
2. Click the Make Default button.
3. Edit the symbol style.
4. Click OK to close the dialog.
5. Reopen the Symbol Properties dialog (see page 943). In the expanded Apply Style drop-down list,
you can see the newly created symbol style. This is the copy of the selected style from the used
project.
1. On the diagram pane, select symbol(s) which style properties you want to copy.
2. Copy style properties by doing one of the following:
• From the Edit menu, select Copy.
• Press Ctrl+C.
• Click the Copy button on the diagram toolbar.
3. On the diagram pane, select the symbol(s) on which you want to paste style properties.
4. Paste style properties on the selected symbols by doing one of the following:
• From the Edit menu, select Paste Style.
• Press Ctrl+Shift+V.
• Click the Paste Style button on the diagram toolbar.
Related pages
You can create and define your own project and use it as template.
After you define your desired symbol styles, you can use them in your new projects. All you need to do
is to create project from template.
Related pages
• In the element Specification window, expand the Properties list and click Customize.
• In the Model Browser, the Properties > Element tab, at the right-top corner, click to expand the
list and click Customize.
• On the diagram, right-click the symbol and select Symbol Properties. In the Symbol Properties
dialog, at the right-top corner, click to expand the list, and click Customize.
• Select the symbol on the diagram. In the Model Browser, in the Properties > Symbol tab, at the
right-top corner click to expand the list and click Customize.
When the Customize Properties dialog is open from the element Specification window (see page
or the Element tab from the Model Browser (see page 29), you can customize the list of
882)
properties in the element Specification window (see page 882).
When the Customize Properties dialog is opened from the Symbol Properties dialog or the
Symbol tab in the Model Browser (see page 29), then you can customize the following:
• The list of properties in the element Specification window (see page 882).
• The list of properties in the menus that opens after clicking the Compartments smart
manipulator and after clicking the Create Element smart manipulator.
• The list of properties in the symbol shortcut menu.
See the following examples of customizing list of properties in the element Specification window (see
page 882), in the Compartments and Create Element menus, and in the symbol shortcut menu.
Contents
You can define and manage navigation from the element symbol. The Go To icon at the left bottom
corner of the element allows you:
1. Select an element.
2. At the left bottom corner, click the Go To icon.
3. From the menu, select Manage Navigation. The selected element's Specification window
opens.
4. In the Navigation/Hyperlinks property group, click the check box near the element which you
want to set as an active target.
Related pages
Contents
On this page
Introduction
The hyperlink is a reference to another location that you access by clicking a highlighted text or
element. Hyperlinks ensure fast access of information directly from your model. You can create
hyperlinks in text, on elements, or on entire diagram to link them to external or internal resources. For
example, a hyperlink can open a file from your file system.The following figure illustrates all available
hyperlink types.
• The hyperlinks to wizards, validation, and reports are available only if the Methodology
Wizard Plugin is installed. Please see how to install the Methodology Wizard Plugin >>152
• The hyperlinks to OSLC resources are available only if the Cameo DataHub Plugin is
installed. Please see how to install the Cameo DataHub Plugin >>153
152 https://docs.nomagic.com/display/NMDOC/Installing+plugins
153 https://docs.nomagic.com/display/CDH190SP2/Installation
Hyperlinks representation
Visual representation of hyperlinks is outlined below:
- To a file:
- To OSLC resources, wizards, validation, and reports:
If the element has an active navigation target then an active navigation target icon is
show on a symbol. You can choose whether to show the icon by changing a value of the
Environment Option (see page 64) Show Active Navigation Icons. By default, this option is
set to true.
Adding hyperlinks
For more information on how to add and manage hyperlinks, please see:
• Hyperlinks extension154
• Report tab155
• Validation tab156
• Model Wizard tab157
• Model Transformation tab158
• Visualizer Wizard tab159
Related pages
154 https://docs.nomagic.com/display/MWP190SP2/Hyperlinks+extension
155 https://docs.nomagic.com/display/MWP190SP2/Report+tab
156 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
157 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
158 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
159 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
160 https://docs.nomagic.com/display/MD190SP2/Linking+model+elements+to+OSLC+resources
Contents
On this page
Introduction
You can add new or manage existing hyperlinks in the Edit Hyperlink dialog, consisting of:
• Three main tabs containing all modeling tools: Address tab, File tab, and Element/Symbol tab.
• Five tabs required to install the Methodology Wizard Plugin:161 Report tab, Validation tab,
Model Wizard tab, Model Transformation tab, Visualizer Wizard tab.
• One tab required to install the Cameo DataHub Plugin162: OSLC Link tab.
The following figure illustrates the tabs.
161 https://docs.nomagic.com/display/MWP190SP2/Methodology+Wizard+Plugin
162 https://docs.nomagic.com/display/CDH190SP2/Introducing+Cameo+DataHub
File tab Opens the file from your Learn more about File tab
file system. >> (see page 978)
Model Transformation Opens the Model Methodology Wizard Learn more about Model
tab Transformation Wizard Plugin. How to install Transformation tab >>165
(see page 1088) and allows the Methodology Wizard
you to transform your Plugin >>163
model according to a
selected scope and Learn more about
transformation kind. hyperlinks extension
>>164
Model Wizard tab Opens either the Analysis Learn more about Model
Classes Creation Wizard Wizard tab >>166
or Use Case Model
Creation Wizard for a
selected scope only if the
«wizard_Capture»,
«wizard_Name»,
«wizard_Relate»,
«wizard_Text»
stereotypes are applied
on the Action (see page
596)element.
163 https://docs.nomagic.com/display/NMDOC/Installing+plugins
164 https://docs.nomagic.com/display/MWP190SP2/Hyperlinks+extension
165 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
166 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
167 https://docs.nomagic.com/display/MWP190SP2/Report+tab
OSLC Link tab Links to OSLC resources. Cameo DataHub Plugin. Learn more about OSLC
How to install the Link tab >> (see page 974)
Cameo DataHub Plugin
>>170
Related pages
• Hyperlinks extension171
(see page 2212)
• Report tab172
• Validation tab173
• Model Wizard tab174
168 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
169 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
170 https://docs.nomagic.com/display/CDH190SP2/Installation
171 https://docs.nomagic.com/display/MWP190SP2/Hyperlinks+extension
172 https://docs.nomagic.com/display/MWP190SP2/Report+tab
173 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
174 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
Address tab
Contents
The Address tab is dedicated to adding, editing, or deleteing hyperlinks to webpages and other external
resources.
The example of the Address tab in the Edit Hyperlink dialog. The text "units" links to the unit description
in the NoMagic documentation.
All boxes and buttons of the Address tab are described in the table below.
175 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
176 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
177 https://docs.nomagic.com/display/MD190SP2/Linking+model+elements+to+OSLC+resources
Text to display box Shows the text that will be displayed as a hyperlink. If you select the text
before opening this dialog, you will see that text in this box. If you change
the displayed text in this box, it will be changed in the HTML text field too. If
this field is empty, you can type a text and it will be added in the HTML text
field.
Type the address box Allows you to type or paste the hyperlink address.
Select from list box Displays all previously used hyperlinks. You can select them to fill in the
Type the address box.
Opens the hyperlink in the web browser specified in the Text to display
box.
The Clear button Deletes all previously used hyperlinks from the Select from list box.
The Active check box Activates the hyperlink if selected. It is available only when adding a
hyperlink on element or entire diagram.
Related pages
• Hyperlinks extension178
• Report tab179
• Validation tab180
• Model Wizard tab181
• Model Transformation tab182
• Visualizer Wizard tab183
• Managing hyperlinks (see page 2212)
• Linking model elements to OSLC resources184
File tab
Contents
178 https://docs.nomagic.com/display/MWP190SP2/Hyperlinks+extension
179 https://docs.nomagic.com/display/MWP190SP2/Report+tab
180 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
181 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
182 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
183 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
184 https://docs.nomagic.com/display/MD190SP2/Linking+model+elements+to+OSLC+resources
An example of the File tab in the Edit Hyperlink dialog. The text "SysML specification" links to the SysML
specification pdf document from your computer.
The table below describes the boxes and buttons found in the File tab.
Name Description
Text to display box Shows the text to be displayed as a hyperlink. If you select the text
before opening this dialog, you will see that text in this box. If you
change the displayed text in this box, it will be changed in the HTML text
field, too. If this field is empty, you can type a text and it will be added in
the HTML text field.
Type the file name box Allows typing or pasting the directory to reference to an appropriate file,
Select from list box Displays all previously used directories. You can select them to fill in the
Type the file name box.
The Clear button Deletes all previously used directories from the Select from list box.
The Active check box Activates the hyperlink if selected. It is available only when adding a
hyperlink on an element or entire diagram.
Related pages
• Hyperlinks extension185
• Report tab186
• Validation tab187
• Model Wizard tab188
• Model Transformation tab189
• Visualizer Wizard tab190
• Managing hyperlinks (see page 2212)
• Linking model elements to OSLC resources191
Contents
The Element/Symbol tab is dedicated to adding, editing, or deleting hyperlinks to elements in your
model.
185 https://docs.nomagic.com/display/MWP190SP2/Hyperlinks+extension
186 https://docs.nomagic.com/display/MWP190SP2/Report+tab
187 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
188 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
189 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
190 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
191 https://docs.nomagic.com/display/MD190SP2/Linking+model+elements+to+OSLC+resources
The table below describes the boxes and buttons of the Element/Symbol tab.
Name Description
Text box (highlighted in orange in the figure) Shows the text that will be displayed as a hyperlink. It
dynamically changes according to the selected option in the
Text to display drop-down box and the specified element/
symbol in the Select element/symbol or paste element URL
(mdel://) box.
Text to display drop-down box Allows you to select the hyperlink representation options of
the specified text in the text box:
• Name. Displays the element name from its
Specification window (see page 882).
• Representation text. Displays the full element title
which is visible in Containment tree (see page 32).
• Icon+Representation text. Displays the element
icon together with the full element title which is
visible in Containment tree (see page 32).
• Custom text. Allows you to type your own text in
the text box; however, then you cannot specify the
Update mode option.
It is available only when adding a hyperlink in text.
Update mode drop-down box Allows you to select when the hyperlink will be updated if the
referenced element and the hyperlink become inconsistent.
This option depends on the option selected in the Text to
display box and the element type specified in the Select
element/symbol or paste element URL (mdel://) box.
• Automatically updated. Updates the hyperlink
text or the referenced element name automatically.
• Automatically checked. Enables active validation
rules that check if the hyperlink text and the
referenced element are coherent.
• Manually checked. Allows you to run validation
manually to check if the hyperlink text and the
referenced element are coherent.
• Do not update. Does not update if the hyperlink
text and the referenced element name become
inconsistent. Validation will not find any
inconsistencies.
It is available only when adding a hyperlink in text.
Select element/symbol or paste element Displays the unique URL of the selected element from
URL (mdel://) box the Select Model Elements/Symbol dialog.
Select from list box Displays all previously used elements/symbols from your
model. You can select them to fill in the Select element/
symbol or paste element URL (mdel://) box.
The Clear button Deletes all previously selected elements/symbols from the
Select from list box.
Related pages
• Hyperlinks extension192
• Report tab193
• Validation tab194
• Model Wizard tab195
• Model Transformation tab196
• Visualizer Wizard tab197
• Managing hyperlinks (see page 2212)
• Linking model elements to OSLC resources198
Hyperlinks in texts
Contents
On this page
Introduction
You can link text directly to internal or external resources by adding hyperlinks. This enables you to
open a document, wizard, diagram, or other hyperlink type (see page 975) by clicking the hyperlink.
192 https://docs.nomagic.com/display/MWP190SP2/Hyperlinks+extension
193 https://docs.nomagic.com/display/MWP190SP2/Report+tab
194 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
195 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
196 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
197 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
198 https://docs.nomagic.com/display/MD190SP2/Linking+model+elements+to+OSLC+resources
• In all element Specification window (see page 882) > Documentation/Hyperlinks property groups.
• HTML text - you can add any type of hyperlink (see page 975). How to add hyperlink in text to any
hyperlink type >> (see page 985)
• Plain text - you can add a hyperlink only to an element/symbol. How to add hyperlink in text to
element/symbol >> (see page 986)
1. Select a place to add a hyperlink. All places to add hyperlinks in text >> (see page 0)
2. Click
or press
Ctrl+K
.
3. In the Edit Hyperlink dialog199, select the tab according to hyperlink type (see page 974).
4. Specify the boxes and options in the selected tab.
199 https://docs.nomagic.com/display/MD190SP2/Edit+Hyperlink+dialog_old
200 https://docs.nomagic.com/display/MWP190SP2/Report+tab
201 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
202 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
203 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
5. Click OK.The hyperlink added in text becomes underlined and blue. For example, the figure
below shows where the hyperlink on the text "Car" will open the Specification window of the Car
Class. The hyperlinked text will be represented with icon and will be automatically updated after
changes.
The Element/Symbol tab in the Edit Hyperlink dialog where the text "Car" refers to the Car Class
from the model. It is represented with an icon and will be automatically updated after changes.
204 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
The Update Mode and Text to display values are selected according default settings.
How to change the default settings of hyperlinks to model elements >> (see page 988)
If you press Ctrl+K, the Edit Hyperlink dialog (see page 984) opens and you can insert a
hyperlink to an appropriate property. Make sure the selected property is correct.
The list provides all parameters, structural members of behavior, and structural
members of the contextual classifier of behavior.
The hyperlinked property is added according to the default setting of the Update Mode and Text
to display list boxes. How to change the default settings of hyperlinks to model elements >> (see
page 988)
For example, in the figure below, the hyperlink to the currentSpeed Property is added on the
guard expression. It is updated after renaming the currentSpeed Property to speed.
• Hyperlinks extension205
(see page 2212)
• Report tab206
• Validation tab207
• Model Wizard tab208
• Model Transformation tab209
• Visualizer Wizard tab210
• Linking model elements to OSLC resources211
• Managing hyperlinks (see page 2212)
• HTML editor (see page 1018)
Contents
205 https://docs.nomagic.com/display/MWP190SP2/Hyperlinks+extension
206 https://docs.nomagic.com/display/MWP190SP2/Report+tab
207 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
208 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
209 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
210 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
211 https://docs.nomagic.com/display/MD190SP2/Linking+model+elements+to+OSLC+resources
• Hyperlinks extension212
• Report tab213
• Validation tab214
• Model Wizard tab215
• Model Transformation tab216
• Visualizer Wizard tab217
• Managing hyperlinks (see page 2212)
• Linking model elements to OSLC resources218
212 https://docs.nomagic.com/display/MWP190SP2/Hyperlinks+extension
213 https://docs.nomagic.com/display/MWP190SP2/Report+tab
214 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
215 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
216 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
217 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
218 https://docs.nomagic.com/display/MD190SP2/Linking+model+elements+to+OSLC+resources
Contents
Introduction
Hyperlinked elements or diagrams allow you to quickly navigate through the model, to other resources,
or between them. If an element or diagram refers to the active hyperlink (see page 990), you can access
that content by double clicking an element or an entire diagram. You can add all types of hyperlinks (see
page 975) on elements and diagrams.
The meaning of boxes and options of each tab is described in the following pages:
- Address tab (see page 977).
- File tab (see page 978).
- Element/Symbol tab (see page 980).
- Report tab219.
- Validation tab220.
- Model Wizard tab221.
- Model Transformation tab222.
- Visualizer Wizard tab223.
- OSLC Link tab. (see page 990)
The Text to display box does not exist in the Edit Hyperlink dialog (see page 974).
Only one hyperlink can be active. By default the last added hyperlink is active.
6. Click OK.
The hyperlink is added on the selected element or diagram. In the Model Browser, you will see
219 https://docs.nomagic.com/display/MWP190SP2/Report+tab
220 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
221 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
222 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
223 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
You can manage hyperlinks on an element and diagram in the Manage Hyperlinks dialog (see
page 991).
Related pages
• Hyperlinks extension224
• Report tab225
• Validation tab226
• Model Wizard tab227
• Model Transformation tab228
• Visualizer Wizard tab229
• Linking model elements to OSLC resources230
• Managing hyperlinks (see page 2212)
Contents
On this page
224 https://docs.nomagic.com/display/MWP190SP2/Hyperlinks+extension
225 https://docs.nomagic.com/display/MWP190SP2/Report+tab
226 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
227 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
228 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
229 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
230 https://docs.nomagic.com/display/MD190SP2/Linking+model+elements+to+OSLC+resources
1. From the main menu (see page 25), select Tools > Hyperlinks.
2. In the Manage Hyperlinks dialog, select the hyperlink row you want to manage.
3. Manage hyperlink(s) by using the following buttons:
• Click the Edit button to edit a hyperlink with the Edit Hyperlink dialog (see page 974).
• Click the Add button to add a hyperlink with the Add Hyperlink dialog.
• Click the Remove button to delete the hyperlink from the Manage Hyperlinks dialog.
4. Click OK.
The following figure shows an example of the Manage Hyperlinks dialog.
The Manage Hyperlinks dialog of the hybrid sport utility vehicle project.
Managing hyperlinks of a specific element and diagram
To manage hyperlinks of specific element and diagram
Related pages
• Hyperlinks extension231
• Report tab232
• Validation tab233
• Model Wizard tab234
• Model Transformation tab235
• Visualizer Wizard tab236
• Managing hyperlinks (see page 2212)
• Linking model elements to OSLC resources237
231 https://docs.nomagic.com/display/MWP190SP2/Hyperlinks+extension
232 https://docs.nomagic.com/display/MWP190SP2/Report+tab
233 https://docs.nomagic.com/display/MWP190SP2/Validation+tab
234 https://docs.nomagic.com/display/MWP190SP2/Model+Wizard+tab
235 https://docs.nomagic.com/display/MWP190SP2/Model+Transformation+tab
236 https://docs.nomagic.com/display/MWP190SP2/Visualizer+Wizard+tab
237 https://docs.nomagic.com/display/MD190SP2/Linking+model+elements+to+OSLC+resources
1. Select the hyperlinked element on the diagram pane or in the Model Browser.
2. Do one of the following:
• Double click the element.
• Click the icon which indicates that the element has a hyperlink.
• Press and hold Ctrl and double click the element (or click the icon which indicates that the
element has a hyperlink). If the hyperlink leads to a diagram, the diagram is opened in the
new window.
The content of the hyperlink is opened.
1. Select the hyperlinked element on the diagram pane (see page 24) or in the Model Browser (see page
29), or hower your mouse pointer at the hyperlinked text.
2. Do one of the following:
- Press Alt and double click the hyperlinked text or element.
- Press Ctrl+Alt and double click the hyperlinked text or element.
The referenced element is selected in the Containment tree.
Contents
238 https://docs.nomagic.com/display/SYSMLP190SP2/Containment+tab
The element Selection dialog opens when assigning a property value - the particular element or
elements. For example, the element Selection dialog opens when assigning the base classifier in the
Class Specification window (see page 882).
In the element Selection dialog, you can perform the following actions:
Contents
The Multiple Selection button is available only when it is allowed to select more than one
element.
1. Click the Multiple Selection button. The Selected elements area appears on the right side of the
element selection dialog.
2. In the model tree or list, select one or more elements at a time by holding the Ctrl or Shift keys.
3. Move selected elements to the Selected elements area.
To return to the single selection
When more than one element is selected in the tree or in the list in the multiple selection
mode, the selection will be reduced to one element (the first one based on alphabetical order),
when switching to the single selection mode.
Related pages
Search Description
Type
Simple In the Search by Name box, type a phrase to search for in element names. Elements matching the
search in search phrase will be displayed in the List or Tree view.
the
When switching between element selection views, the selected elements are remembered. That is,
List and if the element is selected in the Tree view, it will be selected in the List view as well.
Tree
views
Search In the Search by Name box, type a phrase using the following wildcard characters:
using
wild • “*” substitutes any range of characters. So if your search phrase is “*dd”, all the
cards elements containing “dd” in their names can be found. For example, “Address” and
“ThreadDeath”.
• “?” substitutes exactly one character. So if your search phrase is “?dd”, only the
elements with “dd” in their names starting from the second character can be found.
For example, “Address”. “ThreadDeath” cannot be found in this case, because it
contains more than one character before the search phrase “dd”.
To optimize the search, you can customize search options. For this, click on the Search By Name
box. The following table describes the commands for the search customization.
Command Description
Match Text Anywhere • To search for matching phrase in any part of element
name, click the command to add the check mark.
• To explicitly search from the beginning of element
name, click the command to remove the check mark.
Use Camel Case • To search for matching phrase typed in camel case,
click the command to add the check mark.
• To search for matching phrase typed in regular case,
click the command to remove the check mark.
You can use camel case as follows:
Command Description
Hide Uncommon Elements Reduces the search results list by hiding uncommon elements,
keeping elements such as Interface, Association Class, Class, and
Component in the list.
Exclude Auxiliary Resources Reduces the search results list by excluding elements marked as
auxiliary. By default, elements in the standard/system profiles are
marked as auxiliary.
Filter by Package Imports (see page 673) Reduces the search results list by showing elements from the
imported packages only.
Contents
You can create a new element directly in the element selection dialog. To create a new element, turn on
the element creation mode. The Tree view is opened automatically, when the element creation mode is
turned on.
To turn on the element creation mode in the element selection dialog, do one of the following
Related pages
Contents
In the element selection dialog, you can clone an existing element. It means you can create a new
element on the basis of the selected element having the same data as the selected element.
Contents
The Type Selection Mode turns on the automatic port and part type selection. When the function is
turned on:
• If a part does not have a specified type, then on a nested port creation, a new type for the part
will be created. A type for the new port will be created too.
• If a part is without name, type the name on the part shape on the diagram and the type will be
created automatically. The typed name will be the name of the part type (note, that part will be
without name).
• On the Composite Structure, Class, Component, or Package diagrams palette (see page 24), click .
You can save the time spent looking for elements in the type selection list by using package
imports (see page 673).
Contents
You can enable the Hide Uncommon Elements filter in the Select Type dialog to leave out uncommon
element types and thus find the ones you need easier.
If the SysML profile is loaded, only elements of Block and ValueType types are listed in the Select
Type dialog.
If the Stereotype tag types are being specified, metaclasses are not filtered out.
Contents
Modeling tools developed by No Magic Inc. provides you with a generic numbering mechanism that can
be applied to any elements created in the modeling tool. The generic numbering mechanism allows you
to:
• Automatically assign a unique number to the elements in the model when they are
created, moved, or your model is refactored.
• Easily identify and find an element in the model when communicating with colleagues
or stakeholders.
• Show an element's place in a hierarchy.
With this feature you can easily:
Concept Description
Related pages
Make sure that numbering customizations (see page 2049) are already created.
Automatic numbering
Make sure that numbering customizations (see page 2049) are already created.
With an automatic numbering feature, you can number the elements of the selected type upon the
element creation or modification. You can specify the number display location after the elements are
numbered.
1. From the main menu, select Options > Project. The Project Options dialog (see page 213) opens.
2. In the options group list, select or expand the General option and click Numbering either in
the options list or in the options group list. The numbering properties opens.
3. Set the Use Element Auto-numbering property value to true.
4. Click OK.
To specify the element number display location
Manual numbering
Using the manual numbering, you can:
1. On the selected element’s shortcut menu, click Element Numbering. The Element Numbering
dialog opens.
2. In the element list on the right side of the dialog, select an element you want to number.
3. Click Create.
1. Open the selected element’s shortcut menu and click Element Numbering. The
Element Numbering dialog opens.
2. Click the Edit button.
• If you need to change just the last number of the element ID, click Edit. The Edit ID dialog
opens.
You can enter only the number, if the selected element’s numbering value is
numerical.
You can enter only a new literal symbol, if the selected element’s numbering value
is a literal symbol.
• If you need to change the whole element ID (including the prefix), click Set Custom ID.
The Custom ID dialog opens.
1. Open the selected element’s shortcut menu and click Element Numbering. The
Element Numbering dialog opens.
2. Select the element from which you want to remove the number and click the Remove button.
3. You can select either to remove the number only from the selected element or to
remove numbers from all elements owned by the selected elements. Do one of the following:
• Click the Remove button. Only the selected element’s number is removed.
• Click the Remove Recursively button. Numbers are removed from the selected element
and all elements owned by the selected element.
1. Open the selected element’s shortcut menu and click Element Numbering. The
Element Numbering dialog opens.
2. Select the element which number you want to increase.
3. Click the Increase button. The element number is increased by one.
4. Click OK when you are done.
To decrease the element number
1. Open the selected element’s shortcut menu and select Element Numbering. The
Element Numbering dialog opens.
2. Select the element which number you want to decrease.
3. Click the Decrease button. The element number is decreased by one.
The Decrease button is available, when the selected element’s number is not the first in
the list.
1. On the selected element’s shortcut menu, click Element Numbering. The Element Numbering
dialog opens.
2. Click Details to extent the dialog with the renumbering commands.
3. You can select either to renumber only elements listed in the element list or to
renumber elements listed in the element list including their owning elements. Do one of the
following:
If the Renumber from Initial Value is selected, the whole element number changes.
Otherwise just the number of the selected level changes.
1. On the element owner’s shortcut menu, select Element Numbering. The Element
Numbering dialog opens.
2. In the Prefix column, click the appropriate cell (according to the used numbering property
and numbering scheme).
3. Type the prefix. It can be any symbol.
4. Click OK.
The following example illustrates how numbers with prefixes and without prefixes are depicted on the
element shape.
1. Open the element owner’s shortcut menu and click Element Numbering. The
Element Numbering dialog opens.
2. In the Separator column, click the appropriate cell (according to the used numbering
property and numbering scheme).
3. Type the separator symbol.
1. On the selected element’s shortcut menu, click Element Numbering. The Element Numbering
dialog opens.
2. In the appropriate Numbered property row, click the Numbering Scheme cell to open the
list of the defined numbering schemes.
When you change the numbering scheme for the selected element, the new numbering
scheme is applied to all elements owned by the selected element.
The following example illustrates how numbers are depicted on the element shape after changing
the numbering scheme from numerical to literal.
1. Right-click an element numbered in the sequence, whose last ID you want to update.
2. From the shortcut menu, select Element Numbering. The appropriate dialog opens.
3. Click Details and then click the Update Last ID button.
4. Wait while the message informs you that the last ID is set to the particular value. This value is the
highest ID in the sequence.
5. Click OK to close the Element Numbering dialog.
As a result, all subsequently created elements are numbered continuing from the the highest ID. This is
especially useful after you delete one or more elements from the end of the numbered sequence. In
such cases, the last ID remains higher than it is expected to be, causing a numbering gap in the
sequence. Updating the last ID prevents the emergence of that gap.
However, if a numbering gap is not at the end of the sequence, it remains even after the update of the
last ID.
Your model is represented in the Model browser on the left side of the dialog. If the element of the type
that is filtered in the Filter Elements by Element Type list is selected in the Model browser, owned
elements are listed on the right side of the dialog.
In the Filter Elements by Element Type list, you can select which type of elements you want to
number. The selected element type separator, prefix, and numbering scheme are displayed in the
numbering properties list.
Separator Text box Enter your custom separator which can be any
symbol. The separator is changed for all numbers
of the selected element type.
Prefix Text box Enter your custom prefix which can be any
symbol. Just the one prefix can be entered for the
selected numbering scheme. The defined prefix is
displayed before the element number.
Numbering Scheme Drop-down list Select one of the available numbering schemes for
the selected element type. Numbering schemes
are defined in numbering customization.
Renumber from Initial Value Check box Select if you want elements to be renumbered
from the initial value after you have changed it.
For more information on numbering properties, see Creating your first numbering
customization (see page 2052).
You can have several numbering schemes defined for one type of elements.
All defined numbering schemes for the selected element type are displayed in the numbered
properties list.
The Element Numbering dialog buttons are described in the following table.
Edit Click to change the numbering symbol for the selected element. The
button is available, when the selected element has a number and the
element is editable. It has two options:
Create / Remove The Create button is available, if a selected element in the element
list is not numbered. Click the Create button to number the selected
element. A unique successive number will be created for the selected
element.
The element’s place in the list changes after increasing the number.
The element’s place in the list changes after decreasing the number.
Update Last ID Click to set the maximum ID in the numbered sequence as the last
one.
Renumber Click to update the element numbers. The numbering is updated for
all elements in the list.
Renumber Recursively Click to update all element numbers recursively. The numbering is
updated for all elements in the element list, including their owning
elements.
Related pages
2.7.16 Favorites
You can mark as favorite any element, including diagrams, types, packages, and so forth that you
regularly use in your model and need to access quickly.
Related pages
• By using the Add Selected to Favorites command from the Favorites menu. This way
is especially handy for the quick addition to favorites.
• By using the Manage Favorites (see page 1016) dialog. Choose this way, when you need to add and
then perform another manipulations with favorites.
To quickly add an element to favorites
2. In the Manage Favorites (see page 1016) dialog, select the element and click the button, which
is between two lists of the dialog. The element appears in the list of favorites.
3. Click OK to confirm the addition and close the dialog.
Once the element is added to favorites, the following changes occur in your project:
• The element becomes marked as favorite in all the trees and lists of the model.
• You can easily navigate to the element in the Model Browser. The element name is added to the
Go To Favorites command group on the Favorites menu that opens in the Model Browser.
• You can easily specify the element (in case it is a diagram or a package) as the search scope. The
element name is added to the Search in Favorites command group on the Favorites menu that
The following procedure describes how to change the order of favorite elements on the Favorites
menu. To change the order of favorites on the Favorites menu, you need to make appropriate order
changes in the list of favorites on the Manage Favorites (see page 1016) dialog.
Manage favorites
The Manage Favorites dialog allows for
• Adding to favorites
• Removing from favorites
• Changing the order of favorites
To open the Manage Favorites dialog
The Manage Favorites dialog is a modification of the element Selection dialog. The dialog displays
• All elements (in tree or list view on the left side of the dialog)
• Favorite elements (in the list on the right side of the dialog)
• Buttons for adding and removing from favorites
• Search modes and scope filters area
• Buttons for reordering favorites
Related pages
Contents
• Select a note (see page 759)/text box (see page 876) shape and click the HTML button when Switch To
HTML Text appears on the lower-left corner of the shape.
Click the text area on the selected shape or start typing to open the HTML editor toolbar. The buttons
on the HTML editor toolbar have the same functions as a normal editing toolbar.
You can write HTML text in various dialogs, but you must turn on the HTML mode first.
• Simply click to select the HTML check box. The following scenarios show the various ways of
reaching the check box:
a. Element Specification window (see page 882):
i. Open an element's specification window.
ii. Click the Documentation/Hyperlinks tab.
iii. Check HTML. Click Close. See the figure below.
You can also use the HTML editor toolbar when editing a tagged value directly on the element’s shape.
• On the element shape, double-click the tagged value. The HTML mode will be turned on and the
HTML editor toolbar will open for editing the tagged value.
he Advanced HTML Editor allows you to change text style, insert images (see page 1025), insert symbols
and tables, and perform other formatting actions.
• Click the Advanced HTML Editor button on the HTML editor toolbar.
For more information, please see how to turn on the HTML mode (see page 1018) in a dialog.
If you are working on a server project, make sure that the path to the image
location is accessible from any computer that has an Internet connection.
Otherwise, the image does not display when the project opens on another
computer.
To insert an image as an attached file, simply paste its URL to the Picture Source box by
pressing Ctrl+V (Cmd+V on OS X). For more information, refer to Inserting into HTML text
(see page 1025).
3. Click OK when you are done.
The image is inserted into HTML text.
• When the image is already an AttachedFile, please refer to Working with attached files (see page
211).
• From File – to browse the image in your file system or paste the attached image file
URL into the Picture source field.
• From Attached File – to open the Select Elements dialog and select the
appropriate parent element to which the AttachedFile image should be attached.
• From Image Library – to use images from a bundled image collection or your own
added sets of images.
3. Click OK twice to close both dialogs.
1. Open the image file location, select the file(s) you want to insert, then do either:
• copy/paste them to the HTML Editor. In the Paste Special menu, select Image to paste
image and attach it to the project or Image (without attaching) to paste it only for
referencing in the diagram.
• drag them to the HTML Editor. In the Select Image Owner, select the appropriate
parent element to which the AttachedFile image should be attached. If you click Cancel,
the image will be displayed in the diagram, but not attached to the project.
2. Click OK to close the dialogs.
If you chose to not attach the image, it is displayed in the HTML Editor, but when you
delete the file from your file system, it is no longer displayed. That also means, other
users that you want to share the project with, won't be able to see the image if they
open the project from another device. This option is very useful when the file you
want to insert is large and you don't want to increase the project size.
This feature works on both HTML Editor and Advanced HTML Editor.
1. Do either:
• copy/paste the image to the HTML Editor. In the Paste Special menu, select Image to
paste image and attach it to the project or HTML Text to paste it only for referencing in
the diagram.
• drag the image to the HTML Editor.
2. Click OK to close the dialogs.
This feature works only with Google Chrome and Mozilla Firefox.
1. Do either:
• copy/paste content to the HTML Editor. In the Paste Special menu, select HTML Text
to choose whether paste it only for referencing in the diagram or attach it to the
project, or select Image to paste and attach it to the project, or select Plain Text to
paste only text without image.
• drag the image to the HTML Editor. In the Select Image Owner, select the appropriate
parent element to which the AttachedFile image should be attached. If you click Cancel,
the image will be displayed in the diagram, but not attached to the project.
2. Click OK to close the dialogs.
If the image from the rich text document is not stored in your file system, you are not
asked to choose whether to attach the file or not.
1. Open the image files location, select the files you want to insert, then do either:
• copy/paste them to the HTML Editor. In the Paste Special menu, select Image to paste
images and attach them to the project or Image (without attaching) to paste them only
for referencing in the diagram.
• drag them to the HTML Editor. In the Select Image Owner, select the appropriate parent
element to which the AttachedFile images should be attached.
2. Click OK to close the dialogs.
This feature works on both HTML Editor and Advanced HTML Editor.
Operation (Parameter) Call Operation Action when source when source always when source
(Pin) and target and target and target
have the have the have the
same values same values same values
Behavior (Parameter) Call Behavior Action
(Pin)
Call Operation Action Operation when target when target always when target
(Pin) (Parameter) is undefined is undefined is ndefined
or unnamed or unnamed or nnamed
Signal (Attribute) Send Signal Action when source when source - when source
(Pin) and target and target and target
have the have the have the
same values same values same values
Signal (Attribute) Accept Event Action
(Pin)
Send Signal Action Signal (Attribute) when target when target - when target
(Pin) is undefined is undefined is undefined
or unnamed or unnamed or unnamed
Related pages
In addition, you can solve the broken parameters synchronization by using the Synchronization dialog.
In this section, you will find the brief information on how to open the Synchronization dialog and on
each button that can be useful while working in the dialog.
• In the Model Browser, right-click the invalid element, on the shortcut menu, point to Validation,
then to the validation group, and click the Synchronize Manually command.
• On the diagram pane, select the invalid shape, on the smart manipulator toolbar, click the
button, and then click the Synchronize Manually command.
• In the Validation Results window, click the Solve button and then click the Synchronize
Manually command. For more information on how to open the Validation Results window, see
Validation (see page 1261).
Up Click to shift the selected source element up a row. In this way you can change
the order of the source elements.
Down Click to shift the selected source element down a row. In this way you can change
the order of the source elements.
Remove Click to remove the selected source element from the project.
Edit Click to open the Specification window of the selected source element.
Up Click to shift the selected target element up a row. In this way you can change the
order of the target elements.
Down Click to shift the selected target element down a row. In this way you can change
the order of the target elements.
Remove Click to remove the selected target element from the project.
Edit Click to open the Specification window of the selected target element.
Button Description
Synchronize All Click the button to synchronize all the not synchronized elements. Then
from the menu select the straightforward or backward synchronization.
For example, when synchronizing Parameters (Activity) and Pins (Call
Behavior Action) you can select to synchronize one of the following:
Synchronize Selected Click to synchronize the selected parameter. Note that the button is
disabled if no parameters are selected in the list.
After you click the Synchronize Selected button, the following menu
appears:
Create -> - Click to create the target element with the same properties
as the source element.
<-Create - Click to create the source element with be create with the
same properties as the target element.
Update -> - Click to update the not synchronized properties of the
target element according to the properties of the source element.
<-Update - Click to update the not synchronized properties of the
source element according to the properties of the target element.
Note that the Update command exists only if there are properties to
update.
On this page
Related pages
Contents
Note
Copying and opening element URLs do not work with the no install version (.zip) of a modeling
tool.
You can copy a project element URL to a clipboard and share it with others as a quick reference to
model elements.
• Select Copy URL from the element shortcut menu in the Containment tree to copy the URL to a
model element.
• Select the element symbol in a diagram and click Edit > Copy URL on the main menu to copy the
URL to element symbol.
You can open any element through its URL by clicking the Open Element from URL command. The
element will then be highlighted in the Containment tree or in the diagram. Custom URL "mdel://" is
registered into windows registry. Activating the URL in other applications will allow you to start
MagicDraw, open the project (if possible), and select one or more elements. You can paste URLs from
the clipboard to any MagicDraw diagram. Hyperlinks also can hold URLs of any model elements.
Note
You cannot open elements through their URLs on Chrome or Opera browser to start a
modeling tool.
Related page
• The Specification window (see page 882) of an element that has a property with a date type value
• A Generic Table (see page 406) that has a column of date type values.
Set the date Text box Allows you to enter date and time values in the following order:
and time
• Date
• Time (optional)
• Time zone (optional)
Values should be separated by spaces.
Date Visual calendar To select a date, click a day on a calendar. To switch between months, use
the arrows on the left and on the right side of the title section of the
calendar. To switch between years, use the double-arrows on the left and on
the right side of the title section of the calendar.
The selected date is automatically entered in the Set the date and time box
using the format that is specified in your computer's locale.
Date Spin box Allows you to select a date value in the format specified in your computer's
locale. The default value is the current date.
Time Spin box Allows you to select a time value in the format specified in your computer's
locale. The default value is the current time.
Time zone Drop-down list Click the arrow on the right side of the box to select the desired time zone.
Today Button Click the button to set the Date box value to the current date of your
computer.
Now Button Click the button to set the Time box value to the current time of your
computer.
Default Button Click the button to set the Time zone box value to the value set in your
computer.
On this page
• The Date and Time Settings dialog elements (see page 1034)
Related pages
Contents
Model elements and diagrams belong to a package, model (system boundary), subsystem, or other
appropriated model element, which is called owner.
The name of the owner is displayed in the model element name compartment in parentheses.
To add a model element to a package, model (system boundary), or subsystem, do one of the following
• Drag a model element to the desired package on the diagram pane or in the Model Browser.
• Open the Package, Model , or Subsystem Specification window (see page 882), the Inner Elements
property group. Click Create and select a model element or diagram you want to add. Define a
model element or diagram in the open Specification window and click OK.
• From the selected owner shortcut menu in the Model Browser, select Create Element. From the
list, select the desired model element. The element is created.
To display/hide the package/system boundary/subsystem name (the owner of an actor) on a model
element
• From the symbol shortcut menu, select Symbol Properties. The Symbol Properties dialog (see
page 943)opens. In the Show Owner drop down list, select one of the owner display mode: Do Not
Display, Below Element Name, In Same Line With Name, Above Element Name. For more
information about the owner display mode, see " Owner display mode".
• From the Options menu, select Project. The Project Options dialog opens. Select the desired
model element and in the Show Owner drop down list, choose one of the owner display mode. If
you want to apply changes for previously created model elements, click Apply.
Related pages
1. On the diagram, right-click the shape and, from the shortcut menu, select the Symbol Properties
command or select the shape and press Alt+Enter.
2. In the open Symbol Properties dialog, change the property Show Owner. Select one of the four
property modes:
Below Owner is displayed below This is MagicDraw style notation. The owner name is
Element the element name. constructed from the names of the containing
Name namespaces starting at the root of the hierarchy and
ending with the owner of the NamedElement itself.
Containing namespaces are separated by dot and
owner is displayed in brackets.
In Same Element owner is displayed This is a notation from UML specification. The qualified
Line With in the same line as the name is constructed from the names of the containing
Name element name. namespaces, starting at the root of the hierarchy and
ending with the name of the NamedElement itself.
Containing namespaces are separated by double
colons. The double colon is shown to separate
containing namespaces and element name.
Above Owner is displayed above Notation is the same as In Same Line With Name
Element the element name. option notation.
Name
1. From the Options menu, select the Project command. The Project Option dialo (see page 213)g
opens.
2. In the option group list, select General > General, and then select the Qualified name display
style option.
3. For the option, set Model Library Relative (default value for a new project) to display the full
qualified name hierarchy of the element starting from the model library as a root element. The
model library itself is not displayed. The Qualified name display style property allows for
having the relative path for library items used in the project.
Contents
In the Select Element Type dialog, you can select the check box next to the model element type to be
filtered – displayed or searched for. The dialog opens when filtering items in the Containment tab (see
page 32) and when searching or filtering for elements:
• When searching (see page 215) for items, the purpose of the Select Element Type dialog is to select
the type of element to search.
• When filtering (see page 230) items in the Containment tab, the purpose of the Select Element
Type dialog is to provide a possibility to hide elements which you do not want to see in the
Containment tab.
The following table explains the functions of the tabs, option, and buttons in the Select Element Type
dialog.
Search text box Specifies a searching word to filter the search results of element
types in the List, Inheritance, and Structural tabs.
Note
The appearances of the searching word in the search
results are highlighted in yellow.
List Click the List button to list the types of elements in one
alphabetic list. There are two groups in the list: Element and
Symbol.
Select All Selects all types of elements in the list – all elements will be
displayed after filtering or searching.
Clear All Clears all types of elements in the list – no elements will be
displayed after filtering or searching.
Include Subtypes Includes subtypes of the selected elements, e.g., models and
profiles of Packages.
(Available only when opening the Select
Element Type dialog from the Find dialog
(see page 216))
Help Opens the Selecting element types page with the description
of the dialog.
The Search Results tab (see page 46) opens in the Model Browser to display the search results according
to the searching criteria you have created from selecting/clearing types of elements in the Select
Element Type dialog.
The Search Results tab in the Model Browser to display the search results.
Related pages
Contents
An auxiliary element is as element needed in the model but not necessary to be visible in the Model
Browser (see page 29). Usually some profiles are marked as auxiliary and are not displayed by default in
the model. You can mark the element in your model as an auxiliary as well.
The element marked as auxiliary is visible in the Model Browser in an option Show Auxiliary
Resources is selected in the Options.
Related pages
2.8 Tools
MagicDraw provides a number of tools and wizards to help you quickly and easily perform design and
analysis tasks. The following links provide detailed instructions for using them:
Contents
Model Merge allows copying changes between different project versions. This functionality is usually
needed when there are several branches that reflect different releases or versions of the product, for
example, when certain fixes have to be copied from a release branch to the mainstream development
You can merge different versions of both local and server projects.
Projects that use other projects can be compared and merged in one single operation. You do not need
to merge each used project and finally the main project one-by-one.
Basic concepts
For a better understanding of the further material, learn the following concepts.
Concept Description
Contributor General description for a project version that participates in the merge as a source or a target.
Contents
There are two types of model merge: 3-way merge and 2-way merge. Choose the way of merge
according to a particular case.
3-way merge
Conceptually, 3-way merge is a reconciliation of two difference sets, if we assume that a difference set
contains changes between a contributor and the ancestor. For example, a difference set v1-v2
represents changes between project v2 and ancestor v1 as well as v1-v3 does for project v3 and the
same ancestor.
Use the 3-way merge, if you need to compare and merge changes from two projects into one and
consider the ancestor of both projects. For example, you may need to merge two branches of the same
server project that have been simultaneously developed by two different users in a collaborative
environment, as shown in the following figure. As you can see, branch b.1 has been created from
project version i. Then both versions have been developed in parallel: i+1, ..., n-1, n and b.1, ..., b.n. The
merge operation copies changes that have been made in the branch version to the trunk version.
2-way merge
2-way merge is a specific case of the 3-way merge. Use this type of merge for joining together two
versions of the same local or server project. The logic of this type of merge is the same as of 3-way
merge, only the target project is taken as the ancestor.
Contents
Change is a difference, found between the ancestor and a contributor. Every change can be accepted or
rejected, as well as have dependent changes. Changes can conflict with each other or be equivalent.
Merging begins with building a composite change tree, which consists of a model, diagramming, and
non-model changes.
Change types
Read the following definitions to get familiar with different change types.
Addition change
If an element has been added to a contributor, an addition change occurs.
Deletion change
If an element has been removed from a contributor, a deletion change occurs.
Modification change
If an element property in a contributor has been modified, a modification change occurs.
If the IsAbstract property value of a class in the ancestor had the default value false and the
same property value in a contributor has been changed to true, a modification change occurs.
Movement change
Let's say package A contains some class in the ancestor and package B contains the same class
in a contributor. This means that the class has been moved from package A to package B in the
contributor. This case is recognized as a movement change.
Another case of the movement change is when an attribute or an operation that has been
owned by class A in the ancestor, becomes the attribute or an operation of class B in a
contributor.
Order change
If the order of elements has been changed in a contributor, an order change occurs. Order changes can
occur on elements such as attributes, operations, and other ordered elements. Even if a single element
in a collection has changed its place, the order change is applied to the entire collection.
Since an element can have several ordered collections, several order changes can occur on a single
element.
Let's say class A has attributed a, b, and c in the ancestor. The attribute c has been moved up
and placed above attribute a in a contributor. This means that the order of attribute collection
in class A has changed in the contributor. This is a case of the order change.
This is the optional phase of the merge procedure. You may not need to perform it.
Order changes can be skipped while merging. For this, you need to specify names of properties wherein
order changes should not be detected.
1. Fromthe Options menu select Environment. The Environment Options dialog opens.
2. Find the Do Not Detect Order Changes for the option under the Merge category in the General
options group.
3. In the option value cell, specify names of properties wherein order changes should not be
detected while merging.
Property names must be written in camel case, for example, ownedAttribute, ownedElement,
and so on.
Every change, whether it is addition, modification, deletion, movement, or order change, can be either
accepted or rejected. It is a change state.
All accepted changes will be incorporated into the target. Alternatively, they can be rejected and
excluded from the target.
Dependent changes
In some cases, other changes have to be accepted or rejected before accepting or rejecting a selected
change. In other words, a selected change sometimes depends on other changes and is called a
dependent change.
For a better understanding of the concept of dependent changes, study the following examples.
Let's say a class attribute type has been changed to a type that had been created by another
change. In consequence, the attribute type change depends on the change that has created the
type. This means that type creation change must be accepted before accepting type
modification change.
Let's suppose there is an attribute type change in a contributor. An old type has been deleted
and a new type has been added to the contributor. In this case, three changes occur:
• deletion change (for the old type)
• addition change (for the new type)
• modification change (for the property type)
These are also ownership changes, but they are accepted together with deletion and addition
changes.
The modification change depends on the addition change, and the deletion change depends on
the modification change.Thus accepting the deletion change means also accepting the addition
change, the modification change and the deletion change itself.
Conflicting changes
Conflict occurs when two changes are incompatible, i.e., the changes cannot be accepted together.
Conflicts can only occur when using 3-way merge.
Equivalent change is a pair of identical changes that are detected in both source and target when
performing a 3-way merge.
Let's say package A contains some class in the ancestor and both contributors contain the
same class in package B. This means that the class has been moved from package A to package
B in both source and target. This is a case of the equivalent change.
Another case of equivalent changes is when the same element A becomes renamed to B in
both contributors.
Related pages
Contents
One option to customize the model merge procedure is turning off the order changes detection. This
means you can skip the order changes of specified properties while merging.
1. From the Options menu, select Environment. The Environment Options dialog opens.
2. Expand the General option group and select Merge and Compare.
3. In the value cell of the Do Not Detect Order Changes for option, specify the names of the
properties for which order changes should not be detected
Related pages
Contents
On this page
• For Teamwork Cloud projects, the modeling tool automatically applies the 3-way merge,
as a merge is only available between project versions from different branches.
• Partial locking of a project occurs when merging changes of a project in the Teamwork
Cloud. Only changed/updated and merging elements are locked in the project, not the
whole project. Thus, actions with other server project elements are not interrupted for
other users by locking and merging activities.
• While the merge is in process in a server project on the Teamwork Cloud server, other
users will not be able to commit project changes to the server, as it will be unavailable.
5. Do one of the following:
• Click Continue to lock the server project. Other users will not be able to commit changes.
• Click Show Merge Results to proceed directly to the Merge Results, without locking the
server project.
• Click Cancel merge process and close the dialog.
6. The project merge will start. If changes are found, the Merge window will open.
7. Proceed to Analyzing and managing merge results (see page 1055).
• Speed, to merge the projects faster. This will require more memory.
• Memory, to decrease memory usage while merging the projects if your computer does
not have enough memory. This will slow down the merge procedure. It will not include the
differing diagrams/elements count. If you need that information, select optimize
for Speed.
You can also specify the Optimize for option in the Environment Options dialog.
Find this option under the Merge and Compare category in the General options
group.
1. Open a server project that will be the target (see page 1044).
2. From the Collaborate menu, select Merge From.
3. In the opened dialog, select a server project that will be the source (see page 1044).
4. In the same dialog, click the Advanced button to see more merge options. Otherwise, go to
step #7 (see page 1053) .
5. In the Optimize for drop-down list, select either:
• Speed, to merge the projects faster. This will require more memory.
• Memory, to decrease memory usage while merging the projects if your computer does
not have enough memory. This will slow down the merge procedure. It will not include the
differing diagrams/elements count. If you need that information, select optimize
for Speed.
You can also specify the Optimize for option in the Environment Options dialog.
Find this option under the Merge category in the General options group.
6. In the Used projects to include list, select the used projects of the target you want to merge
with the appropriate used projects of the selected source. To select a used project, click the check
box next to the used project name (see the following figure).
Learn about 3-way and 2-way merge in Choosing merge type. (see page 1045)
4. Select a project that will be the source (see page 1044) .
5. If you selected 3-way merge, choose a project that will be the ancestor.
6. Click the Advanced button to see more merge options. Otherwise, go to step #9 (see page
1054) .
7. In the Optimize for drop-down list, select either:
• Speed, to merge the projects faster. This will require more memory.
• Memory, to decrease memory usage while merging the projects if your computer does
not have enough memory. This will slow down the merge procedure. It will not include the
differing diagrams/elements count. If you need that information, select optimize
for Speed.
You can also specify the Optimize for option in the Environment Options dialog.
Find this option under the Merge and Compare category in the General options
group.
The list is available only for server projects and includes only the projects that:
• are used by the target in the read-write accessibility mode
• have the same composition in both contributors
• do not have private parts
9. Click the Merge button. The project merge will start. If changes are found, the Merge window will
open. Proceed to Analyzing and managing merge results (see page 1055).
Learn about 3-way and 2-way merge in Choosing merge type (see page 1045).
4. Select a project that will be the source (see page 1044).
5. If you selected 3-way merge, choose a project that will be the ancestor.
6. Click the Advanced button to see more merge options. Otherwise, go to step #8 (see page
1054).
7. In the Optimize for drop-down list, select either:
• Speed, to merge the projects faster. This will require more memory.
You can also specify the Optimize for option in the Environment Options dialog.
Find this option under the Merge and Compare category in the General options
group.
8. Click the Merge button. The project merge will start. If changes are found, the Merge window will
open. Proceed to Analyzing and managing merge results (see page 1055).
Related pages
• Getting merge summary information and changes legend (see page 1056)
• Understanding content of the Merged Result panel (see page 1057)
• Inspecting element property changes in the Specification panel (see page 1061)
• Inspecting changes in the Change details panel (see page 1063)
• Displaying and navigating through changes (see page 1064)
• Quickly navigating through conflicting changes (see page 1066)
• Accepting and rejecting changes using shortcut menu (see page 1067)
• Viewing and analyzing changes of modified diagrams (see page 1068)
• Generating a differences report (see page 1071)
If you do not need to perform the analysis and management of merge results, proceed to Finishing and
canceling merge (see page 1072).
Contents
On the Summary/Legend panel, for 3-way merge, you can see how many differences have been
detected between the ancestor and the source, as well as between the ancestor and the target.
Related pages
Contents
Elements with all change types are displayed in the Merged Result tree/list that is located at the top
left of the Merge window.
You can also filter the elements displayed in the Merged Results tree/list by type of changes. Use
the Changes filter drop-down list to filter out a specific type of changes.
When a change occurs on a single element, the ticks and crosses before element icon indicate the state
of the change which can be either accepted or rejected.
Accepted
(green tick before the element icon)
Rejected
(red cross before the element icon)
To understand the concept of change states, refer to Change states (see page 0).
Elements with resolved conflicting changes are marked as shown in the following table. Owners of
these elements are also marked.
System
(red diamond on the lower-left corner
of the element icon) The element had a conflicting
modification change which was resolved
automatically by choosing the target.
User
(yellow diamond on the lower-left
corner of the element icon) The element had a conflicting
modification change which was resolved
by the user.
For the addition change description, refer to Addition change (see page 0).
For the deletion change description, refer to Deletion change (see page 0).
For the modification change description, refer to Modification change (see page 0).
For more information about using the Specification panel, see Inspecting changes in the Change details
panel (see page 1063).
For the movement change description, refer to Movement change (see page 0).
Elements with movement changes are highlighted in the same blue background that is used to highlight
modification changes. Since movement changes are some kind of modification changes. Icon of an
element with movement changes is represented with an arrow symbol on the left.
You can navigate from the element original location to the new one (and vice versa) using the
commands on the element shortcut menu.
For the order change description, refer to Order change (see page 0).
Elements with order changes are highlighted in the same blue background that is used to highlight
modification changes, since order changes are some kind of modification changes.
After accepting the change, all the elements in the collection are reordered so that it would be the same
as in one of the contributors.
You can turn off the order changes detection. For more about it, see Turning on showing merged
diagram annotations. (see page 0)
• Getting merge summary information and changes legend (see page 1056)
• Inspecting element property changes in the Specification panel (see page 1061)
• Inspecting changes in the Change details panel (see page 1063)
• Displaying and navigating through changes (see page 1064)
• Quickly navigating through conflicting changes (see page 1066)
• Accepting and rejecting changes using shortcut menu (see page 1067)
• Viewing and analyzing changes of modified diagrams (see page 1068)
• Generating a differences report (see page 1071)
Contents
You can see all the details of the element property changes in the Specification panel that is located at
the top right of the Merge window. All you need to do is selecting the element in the Merged Result
tree or list.
As you can see in the following figure, the first column of the panel contains a list of element property
names, and other columns display their value changes that have been detected in both source and the
and target. Third column Merge Results Preview shows the final merge result. Properties changes can
be accepted or rejected in this panel.
To navigate from the Specification panel to the Merged Result tree, do either
• In the Properties column, right-click the name of a property, which references other elements.
Then on its shortcut menu, point to Select in Merged Result Tree and choose an element to
which you want to navigate.
The Ancestor column by default is hidden. To show it in the Specification panel, click on
the Merge toolbar and select Show Ancestor.
You can see exact changes between textual values of element properties, such as element
documentation, comments, pre- and post-conditions of a use case. Differences of compared texts can
be displayed in a single dialog, where inserted and deleted parts of the text are highlighted.
Contents
The Change details panel displays a tree structure reflecting the changes that occurred either on the
element selected in the Merged Result tree/list or on the property selected in the Specification panel.
The panel is located under the Specification panel on the Merge window.
The panel contains a tree structure that has two top-level branches – Source changes and Target
changes – in 3-way merge, and 1 top-level branch – Source changes – in 2-way merge. In this panel, you
can accept or reject changes using the shortcut menu.
In this panel, you can see dependent changes. In order to see them, expand the Dependent changes
branch under an element with dependent changes.
For the dependent changes description, refer to Dependent changes (see page 0).
Related pages
Contents
You can customize the content of the Merged Result tree/list as well as navigate through changes in
both the Merged Results tree/list and the Specification panel using the toolbar that is located at the
top of the Merge window.
The toolbar buttons for customizing the Merged Results tree/list and navigating through changes are
described in the following tables.
Accept the selected change and go to Click to accept the selected element
the next change change and go to the next change (might be
a property or the element).
Accept the selected change, its Click to accept the selected element
property changes and go to next change together with the element property
change changes and go to the next changed
element.
Accept the selected change, its Click to accept all changes from both
property changes, all subelement contributors starting from the selected
changes and go to next change element and go to the next changed
element (which is not a subelement). For
example, if the root package Model
selected, then all changes for the whole
project will be accepted.
Reject the selected change and go to Click to reject the selected element change
the next change and go to the next change (might be a
property or the element).
Reject the selected change, its Click to reject all changes from both
property changes, all subelement contributors starting from the selected
changes and go to next change element and go to the next changed
element (which is not a subelement). For
example, if the root package Model is
selected, then all changes for the whole
project will be rejected.
Options menu
Show Elements from Used projects Click to show or hide in the Merged Result
tree/list the elements from used projects.
Show Merge Result Preview Click to show or hide Show Merge Result
Preview column in the Specification
panel. This column shows final changes in
the merged project and by default, this
column is shown.
Related pages
Contents
Related pages
• Getting merge summary information and changes legend (see page 1056)
• Understanding content of the Merged Result panel (see page 1057)
• Inspecting element property changes in the Specification panel (see page 1061)
• Inspecting changes in the Change details panel (see page 1063)
• Displaying and navigating through changes (see page 1064)
• Accepting and rejecting changes using shortcut menu (see page 1067)
• Viewing and analyzing changes of modified diagrams (see page 1068)
• Generating a differences report (see page 1071)
Contents
You can accept and reject changes using the toolbar that is located at the top of the Merged
Result window or using the shortcut menu in all panels.
The following table lists the commands of the shortcut menu that can be opened when an element is
selected in the Merged Result tree/list.
Command Description
Accept Click to accept the selected change. If the change has equivalent
changes, they are accepted too.
Reject Click to reject the selected change. If the change has equivalent
changes, they are rejected too.
Accept With Properties Click to accept the selected change and its property changes.
Reject With Properties Click to reject the selecting change and its property changes.
Accept Recursively Click to accept the selected change, its property changes, and all
owned element changes in the Merged Result tree view.
Reject Recursively Click to reject the selected change, its property changes, and all
owned element changes in the Merged Result tree view.
Mark as Resolved Click to mark the conflicting change as resolved by the user, but
not automatically.
Select Original Location(s) If the selected instance of a moved element is in the new location,
the Select Original Location(s) command appears on the
shortcut menu. Click it to navigate to and select the original
location(s) of the moved element in the Merged Result tree.
Select New Location(s) If the selected instance of a moved element is in its original
location, the Select New Location(s) command appears on the
shortcut menu. Click it to navigate to and select a new location(s)
of the moved element in the Merged Result tree.
Related Pages:
Contents
The different diagram versions are displayed in separate Difference Viewer tabs in the Merge window
next to the Merged Result tree (see the following figure).
All the diagram difference viewers are used to display the following changes:
Be advised that symbols with property value changes that actually have no effect on their
appearance are highlighted in a diagram difference viewer as well. For example, changing the
Show Stereotypes property value in the Symbol Properties dialog of a class makes the class
symbol highlighted as changed in a diagram difference viewer.
As you can see in the following figure, all these changes are marked by color coded lines and flags
allowing the quick distinguishing between different types of changes. Numbers on flags indicate the
number of changes made to that element. Clicking a flag switches to the Merged Result tab and selects
the flagged element in the Merged Result tree.
The colors of lines and flags correspond to the color system explained in the difference legend:
• Blue flags indicate the number of modification/movement changes made to the element, blue
lines represent modified/moved relations, and blue borders around symbols mark modified/
moved elements in the diagram.
• Green flags indicate the number of addition changes made to the element, green lines represent
added relations, and green borders around symbols mark added elements in the diagram.
• Red flags indicate the number of deletion changes made to the element, red lines represent
deleted relations, and red borders around symbols mark deleted elements in the diagram.
If you would like to see the diagram version from other project version without switching between tabs,
use the slider available at the bottom of the Difference Viewer. Moving the slider makes the current
diagram symbols to fade, and the symbols from another diagram version start appearing. When the
slider is set to the middle position, different symbols from both diagram.
Return to Merged Result Click to open the Merged Result tree with the
appropriate diagram selected within.
Print Diagram Click the button to print a diagram. The diagram will be
printed with highlighted areas on it, if the highlighting
of the diagram changes is turned on.
• Getting merge summary information and changes legend (see page 1056)
• Understanding content of the Merged Result panel (see page 1057)
• Inspecting element property changes in the Specification panel (see page 1061)
• Inspecting changes in the Change details panel (see page 1063)
• Displaying and navigating through changes (see page 1064)
• Quickly navigating through conflicting changes (see page 1066)
• Accepting and rejecting changes using shortcut menu (see page 1067)
• Generating a differences report (see page 1071)
Contents
When you're done reviewing differences and wish to see them on paper, you can simply export all the
diagrams with visible changes to a Microsoft Word document using one of the predefined templates or
your custom report template.
2. Choose the preferred template – Full Report for a more detailed overview, including the
entire Merged Result tree with all changes, or Diagrams Report.
3. The Save Report dialog opens. Specify the location in your file system for your report to be
stored, type the file name and click Save.
If you need to slightly modify the report, for example, to show less data or add your company's
information, you can edit the generated Microsoft Word document as per your needs.
However, if you require more control over what's represented in reports, you can customize report
templates and generate differences reports of any desired depth and scope.
You will see your saved template in the drop-down list of available templates when you click the Report
button .
You can read more about creating and modifying report templates in the Report Wizard Template
Creation Tutorial (see page 1833).
Related pages
Contents
• On the Merge window, click the Finish Merging button and all accepted changes will be copied
to the target.
After the merge results are copied to the project, do not forget to either save or commit the
project to the server.
• On the Merge window, click the Cancel button. The question dialog box opens asking you if
you want to cancel the merge procedure.
• Click Yes if you are sure that you want to cancel merge procedure.
• Click No and you will be returned back to the Merge window.
Also you can cancel merge procedure by clicking Close button on the Merge window.
Before finishing the merge procedure, you can show merged diagram annotations. For this, click
the Annotate Merged Diagram button on the toolbar located at the top of the Merge window.
The Annotate Merged Diagram button in the Merge Results window toolbar.
Availability
This button is available if any positions of symbols in diagrams have been changed.
The purpose of the annotation is to mark symbols that have different positions on the same diagrams
in ancestor and source projects on a merged diagram. If the Annotate Merged Diagram button is
enabled, those symbols are annotated in yellow, as shown below.
Related pages
Contents
On this page
https://www.youtube.com/watch?v=T_1Bpu18KXI
For better understanding of further material, get acquainted with the following concepts
Concept Description
Parameter definition The variable that is used to calculate metrics. It can be an element
type (including both relationship and DSL element types),
particular element, data type, or data type value.
Metric definition The attribute of a Metric Suite defining the formula for calculating
metrics according to the parameter values.
Validation-based metric definition The attribute of a Metric Suite specifying the validation rule for
calculating metrics according to the parameter values.
In general, a Metric Suite is a Class with the «MetricSuite» stereotype applied. Both parameter and
metric definitions are attributes of a Metric Suite.
• Metric Suite must have a target. A target specifies model elements, for which metrics of
the particular metric suite can be calculated. The target value can be any type of elements or
even a particular element of your model.
• Metric Suite must have one parameter definition declared as context. The element, which
is selected for calculating metrics, is automatically set as the value of the context
parameter definition.
• Metric Suite must have a date tracker, so that you could see the timestamp of each metric.
To create and define a Metric Suite, complete the following steps:
It’s recommended to have a single person per project, who is responsible for creating and
managing all the Metric Suites of the project.
Related Pages
Contents
There are two ways to add a new Metric Suite to your model:
You are free to choose either way, but we highly recommend the first one. It aids the creation of a new
Metric Suite, which inherits the BaseMetricSuite attributes that are necessary for calculating metrics (e.g.,
the context parameter definition and the metric definition for date tracking). This way you don’t have to
specify them on your own.
1. Make sure that your project uses the UML Standard Profile. If not, use it (see page 239) by going to
Options > Project Usages.
2. Create a Package to store all the Metric Suites of your model.
3. In the Package, create a Profile Diagram. If you can't find it in the list of available diagrams,
enable the Expert mode.
4. Press Ctrl+Alt+F and in the Quick Find dialog type “BMS”.
Contents
Although the target of a Metric Suite can be any type of element or even a particular element of
your model, we recommend selecting the required Package or
the Package type.
1. Double-click the shape of the newly created Metric Suite to open its Specification window.
2. Click the cell of the Target property value and then click . The Select Elements dialog opens.
3. In the tree or list on the left side of the dialog, select the element that you wan to use as a target.
If you want to select the type of elements (e.g., Package), which is stored in a standard/
system profile used in your project, make sure you clear the Apply Filter check box.
Besides, you can select more than one element. For more information about the
manipulations in the element selection dialog, see Elements multiple selection (see page
996).
4. Add the element to the Selected elements list by clicking or (if you want to
add elements recursively).
5. Click OK.
6. In the Specification window, click Close.
If you need to calculate metrics for the whole model, select the Model Package as the target of
your Metric Suite.
Related pages
Contents
On this page
3. Type its name directly on the shape, and then click a free space on the diagram.
Make sure the type of the parameter you are going to declare as the context is the same as the
type of the target of a Metric Suite.
1. On the shape of a Metric Suite, double-click the parameter you need to define as the context for
the Metric Suite. The Specification window of the parameter opens.
2. Set the Set As Context property value as true.
3. Click the Close button.
The parameter is declared as the context of the Metric Suite.
If your Metric Suite is created using the BaseMetricSuite, it already has the context parameter
definition - the scope.
Related pages
Contents
Metric definition is the attribute of a Metric Suite with the «MetricDefinition» stereotype applied.
3. Type its name directly on the shape and then click a free space on the diagram.
This step is mandatory. A metric definition must have a result type, e.g., Real or Integer.
6. Press Enter to open the Specification window of the metric definition.
7. Click the cell of the Default Value property value. and appear on the cell.
8. Click and select Value Specification > Opaque Expression.
9. Click the cell of the Default Value property value again, and then click . The Default
Value dialog opens.
10. From the Language drop-down list, select a language.
If your Metric Suite is created using the BaseMetricSuite, it already has the metric definition for
date tracking.
One metric definition can refer to another metric definition of either the same Metric Suite or a more
general one (in case there is the Generalization relationship between these Metric Suites).
Related pages
Contents
1. Select the shape of a Metric Suite, click the smart manipulator on the shape, and select
Validation-Based Metric Definition. An attribute with the «ValidationBasedMetricDefinition»
stereotype is created.
2. Type the name of the attribute directly on the shape and then click a free space on the diagram.
3. Select the newly created validation-based metric definition on the Metric Suite shape and click
.
4. Select the type of the result values that should be calculated according to the validation rule
specified in the validation-based metric definition.
Related pages
Contents
On this page
1. Add a new metric definition with the following characteristics to your metric suite:
Make sure you clear the Apply Filter check box in the Select Opaque Behavior dialog.
4. In the Body area of the Default Value dialog, select the Date parameter of the FormatDate
operation and click The Reset button.
5. Select Operation from Model on the right side of the dialog.
6. In the open dialog, select the Timestamp built-in operation which is stored in the UML Standard
Profile and click OK.
To access the value of the scope parameter inherited from the BaseMetricSuite
An alternative way to access parameters is calling the getValue() method from MagicDraw Open API on
the valueContext globally defined value, as the following Groovy script sample illustrates:
How to build a metric definition that takes the result of another metric definition?
Let’s say, you need to calculate the percentage of requirements that are covered by blocks. To do this,
you must have the following values:
int all = valueContext.getOneValue(“requirementsCount”);
int covered = valueContext.getOneValue(“requirementsCoveredByBlocksCount”);
com.nomagic.magicdraw.modelmetrics.ScriptHelper.calcPercentage(all, covered)
Related pages
https://www.youtube.com/watch?v=Ls4f12ieG44
Transformation engine itself is available in MagicDraw editions from Standard and up.
However, only MagicDraw Architect and Enterprise editions bring any particular
transformations. So for MagicDraw Standard and Professional edition users,
transformations are not available.
Plugins can bring additional transformations regardless of MagicDraw edition. For example,
users, who have the Cameo Data Modeler plugin, can use the transformation engine to run ER
to SQL(Generic/ Oracle) transformations, even if they do not have the MagicDraw Architect/
Enterprise editions.
The Model Transformation Wizard enables running one of the predefined transformations. When using
this wizard to run a chosen transformation, you have to perform the following steps:
All transformations follow a similar approach. They take a part of a model as the transformation source
and copy it to the destination model, establishing traces between the transformation source and target
elements. Then each transformation performs the specific model reorganizations, which are necessary
for each
transformation type according to the transformation options specified by the user in the
transformation wizard. Transformation can also be performed in-place, i.e., the source model is not
copied to the destination model, but transformation works directly on it instead.
Transformations also perform the so-called type remapping. During the transformation between the
different modeling domains, such as UML and SQL, it is necessary to go through the data types used in
the source model and change the types from the source domain into the equivalent types in the target
domain, for
example, changing String type usages in the UML model into the varchar type usages in the SQL model.
Available Transformations
Transformations are usually used for converting models between different modeling domains.
Transformations are named by the types of their source models and their destination models. These
are the available transformations:
UML to SQL(Generic/Oracle), SQL to UML, UML to XML Schema, XML Schema to UML
transformations are available with the separately-installed Cameo Data
Modeler plugin (which comes free of charge with MagicDraw Architect and Enterprise Editions
and is separately purchseable for MagicDraw Standard and
Professional editions).
Related pages
The following operations are available in the Select transformation type window:
Button Function
Next Proceed to the next step (in this case, Select source/destination).
Select the Transform in place option button, if you want the source model to be edited.
If you choose the in-place transformation, the model part selected as the transformation
source, will be edited directly, and you will not retain your original model. So, please, be careful
with this option.
If you choose the destination package, the source model will be copied to it and the
transformation will be performed on this copy. Hence you will retain your source model and get
a resulting model and traces will be established between elements in these model parts.
Button Function
Next Proceed to the next step (in this case, Select type mappings).
Finish Finish the transformation configuration. All other options will be set by default.
The Model Transformations Wizard exits and transformation results appear in the project.
A type map can be regarded as a collection of rules of the form “Replace the usage of type X in the used
project with the usage of type Y”.
A type map (see page 1094) is a model object, i.e. a package with a collection of dependencies, hence all
model manipulation operations can be performed on it. In particular, it can be refactored into a used
To see a list of the type maps available in your model, click the down arrow in the Transformation type
map (see page 1094) combo box. These type maps specify the mapping rules that will be applied to the
model during the transformation.
When you select a particular map, its contents are displayed in a table below. Each row in the table is a
rule to remap one particular type to another. The From type and To type columns in the table show
the source and target types.
The Run type mapping in reverse order check box creates the opposite type mapping. Type maps can
be bidirectional, e.g., the same type map is reused both in the UML to XML schema and XML schema to
UML transformations. This checkbox governs the direction in which the type map should be used.
The following operations are available in the Select type mapping window:
Button Function
Next Proceed to the next step (in this case, Specify transformation details).
NOTE: This button is disabled during the Any to Any transformations.
The following operations are available in the Specify transformation details window:
Button Function
A type map can be regarded as a collection of rules of the form “Replace the usage of type X with the
usage of type Y”. A type map is created by modeling means and is a model object, hence all model
manipulation operations can be performed on it. In particular - it can be refactored into a module and
mounted into any project, that needs it. It can be a simple package in your project as well, if you need a
custom, one-off type map. Predefined type map can be taken from the MagicDraw module and edited.
A type map is a stereotyped package, holding a collection of stereotyped dependencies. Stereotypes for
building type maps are stored in the Model Transformation Profile.
Be sure to place dependencies in the type map package (MagicDraw is prone to placing
dependencies in or near the dependent model element, so you may need to relocate them).
In the example above, after the transformation, all int types will be transformed to char.
Each of thus created dependencies represents one type remapping rule. The package represents the
complete type map.
Type mapping rule behavior can be further customized by setting various tags on the rules (see page
1096).
Transitive type mapping (of the form type1 > type2 > type3) is not supported.
Controlling direction
By default, the same type map can be applied in two directions: forward and backward. The backward
direction can be set by selecting the Run type mapping in reverse order check box in the third step of
the Model Transformation Wizard. This is useful, when there are two related opposite transformations
for some domain; for example, the same type map is used for both UML to XML schema and XML
schema to UML transformations.
If you want to limit the directions, in which type map can be used, you can set the defaultDirection tag
for your type map package. Possible values are forward, reverse, and both (default).
The direction can also be limited on a per-rule basis. This is controlled by setting the direction tag on
the type map dependency. Then the mapping rule is excluded from the rule set when the type map is
run in a different direction than specified for this rule.
The type map having several rules for the same type and without any one set as default cannot
be used.
However, during the transformation update, all rules come into play. If the destination type is one of
the acceptable types according to the map, it is not changed. Otherwise it is replaced with the default
mapping.
Regarding the example above, let’s say that after the initial transformation, the user changes the type of
the property in the destination model from varchar to nvarchar (as a post-transformation refinement
process). If the user now runs a transformation update, this change will not be overwritten, since
nvarchar is an acceptable
type as there is a String > nvarchar mapping in the type map as well. If on the other hand the user sets
the type of this property to number, this would be reset the during transformation update, and the type
will be forced back to varchar, as there is no String > number mapping.
Here T1, T2, and T5 are types in the source domain, while T2 and T4 are types in the destination
domain. Given these two mappings (T1 > T2 and T3 > T4), the following statement is true: T1, and all
types derived from it (such as T5), are mapped to the T2 type, except T3 and any of the types derived
from it. These types are
mapped to T4.
You can also control the mapping behavior of the type inheritance in the destination model. This is only
effective on the transformation updates, the second (and successive) reapplications of the
transformation. By default, derived subtypes in the destination model are not overwritten, since they
are considered suitable substitutes of their parent. Let’s review the following example:
Here T1 is a type in the source domain, while T2 and T4 are types in the destination domain. Given this
mapping (T1 > T2), on the first application of the transformation, type T1 residing in the source model
will be mapped to type T2 in the destination model.
Now let us look at a case, where the user refines the destination model by changing the type on the
destination model attribute from T2 to T4. This situation is quite common, for example, the user refines
an attribute type from string to basic URI in the XML schema, or from Integer to nonNegativeInteger, and
so forth. The essence is that the mapping for inherited types of T2 is performed as if there was a
mapping T1 > T2 (default), T1 > T4, T1 > <any_other_type_inherited_from_T2>.
Now consider what happens, when we apply the blockInheritedDestinationTypes tagged value:
When the user loads the type map in the reverse direction, the roles of the
blockInheritedSourceTypes and blockInheritedDestinationTypes are transposed (unless of course
the direction tag mandates that this mapping is not used in the reverse direction).
The special type AnySourceType is a template that matches any type in the source model (see
mapping rules for type inheritance). By using this type, together with the inheritance mapping rules, the
user can specify that any other types not defined by the mapping should be interpreted by this
mapping.
The special type AnyDestinationType is a template that matches any type in the destination model
(see mapping rules for type inheritance).
According to this rule, any types in the source model for which there are no other mapping rules should
be stripped in the destination model.
Type modifiers
Type mapping rules can also affect type modifiers during the type replacement. Type modifier is a small
string, which modifies type usage in the typed element. They are used, for example, for specifying
arrays during the modeling (e.g., property type = char and type modifier = [30] gives property:char[30]).
Type modifiers are
extensively used in SQL models for specifying number field widths and varchar field lengths. For
example, phone:varchar”(100)”, where varchar is a type of phone property and “(100)” is a type modifier.
Each type mapping rule can carry a triple <modifier, regexp, replacementregexp> for setting type
modifiers during the type replacement. These are specified in the tags on the mapping rule
<forwardTypeModifier, forwardTypeModifierRegexp, forwardTypeModifierRegexpReplace> triple
for controlling modifiers during
the forward application of type map and correspondingly the
<reverseTypeModifier, reverseTypeModifierRegexp, reverseTypeModifierRegexpReplace> triple
for controlling modifiers during reverse application of type map.
Any of the components of the triple can be missing, i.e., not specified.
If just the modifier is specified for the mapping rule, then modifiers are set during the application of
this type rule. This can be used for setting the fixed type modifiers. For example, mapping boolean in
the UML model to number(1) in the SQL models (in this case the modifier=”(1)” is used in the type map).
If all three are specified, a modifier, regexp, and regexp replacement, modifier remapping is performed
as follows: during the transformation, the existing type modifier is matched against the given regexp. If
it does not match, the type modifier is overwritten with the value, specified in the modifier field of the
rule. If it does match
regexp, the replacement is run on the match result and produces a type modifier to be set as a result.
This allows quite complex rules to be written and executed, however this mandates good knowledge of
regexp.
Let’s review the following live example: in the char -> varchar type mapping rule for the UML to SQL
transformation, the following triple can be used: modifier="(255)", modifierRegexp="^[\(\[]([0-9]*)[\)\]]$",
and modifierRegexpReplace="($1)". This causes the char[20] type usages (type=char, modifier=”[20]”) in
the source be changed to varchar(20); char (without modifier) would be remapped to varchar(255).
If regexp replacement is not specified, it is treated as if “$0” was specified: the type modifier is copied
from the source, if it does match the regexp.
Trace information can be used for navigating between the model layers. This is done with the
traceability features of MagicDraw. To navigate in the forward direction, i.e., from the transformation
source model element to the destination model element, right-click that element and choose Go To >
Traceability > Model
Transformations > Transformed To > <element>. To navigate in the backward direction, i.e., from the
transformation destination model element to the source model element, right-click that element and
choose Go To > Traceability > Model Transformations > Transformed From > <element>.
Traceability information is also visible in the element’s Specification window (see page 882), the
Traceability tab; in the Properties panel, Traceability tab; it can also be depicted in the Relation Map
diagram or in the custom dependency matrix.
Traces can be used for running the transformation update. The transformation update reapplies the
transformation with the same source and target for the purpose of carrying additional changes from
the source (which occurred after transformation was made) into the destination.
During the transformation update, presence of unmapped model elements in the source model
indicates that these are newly added elements. Usual rules and the same behavior for the
transformation are used for these elements as if this were the first application of the transformation.
• Right-click the destination package and select Tools > Update Transformed Model.
The Model Refresh Options dialog opens.
The Change destination properties according to source option causes overwriting of element
properties in the destination model with properties from the source model (only for the elements
connected with mapping dependencies).
The Leave destination properties intact option leaves the destination model properties unchanged
but different from the source model, in other words retains changes made to the destination model
while it ignores changes made to the source model.
In Oracle DDL transformation updates, only changing of destination properties according to the source
is available. It means, all changes are overwritten when updating a transformed Oracle DDL model, and
the Model Refresh Options dialog does not appear in this case.
If new elements are added to the source, once the update occurs, copies of the new elements
will be created in the destination model. If an element is deleted
from the source, it will not be removed from the destination after the update.
• Applied stereotypes
• Tagged values
• Usages of one type with another type
Element symbols are updated according to model changes.
To create mapping rules you need to create Dependency relationship between elements you want to
transform.
Mapping rules can be created (dependency relationship can be created) between the following
elements:
1. Stereotypes
2. Tags
3. Types
• disableNewTypeCreation tag. By default false. Set this tag to true if you do not want to perform
transformation when target and source metaclasses are not compatible. For example, if you do
not want that Class would be changed to Use Case.
• disableReplaceWhereSaveAsElementValue tag. By default false. Set this tag to true if you do
not want that stereotype would be changed where it is used as Tag value (tag value is stereotype
itself, for which you perform transformation).
To create mapping rule correctly, you have to create Dependency relationship not only between
Tags, but also between Stereotypes of these tags (see mapping between stereotypes, which is
described above).
The Next step is disabled in the wizard, if there are no mapping defined.
We call executable such concepts that can be specified by some expressions and calculated. In
modeling tools developed by No Magic, executable are:
• Validation rules (see page 1261) - that are predefined or custom constraints having a purpose to
validate a model or particular model elements.
• Derived properties - properties that are automatically calculated from the other properties.
• Smart packages (see page 796) - that are special collections of model elements.
• Executable opaque behaviors - reusable expression fragments callable form other executable
concepts.
• Metric definitions - calculate aggregate parameters of models.
• Macros (see page 2585) - a script that is created using a particular script language. With the help of
macros, you can control items that are allowed in Developer Guide (see page 2072).
• Opaque behaviors (see page 767) - a behavior with implementation-specific semantics.
In a modeling tool, executable concepts are defined in one of the languages that our modeling tool can
evaluate:
• StructuredExpression (see page 1188) - a graphical way to construct expressions out of predefined
blocks.
• Object Constraint Language (see page 1104).
• Binary - an expression that is written in Java, compiled and added to our modeling tool with a
plugin.
• One of the following scripting languages:
• Groovy
• JRuby
• JavaScript
• JavaScript Rhino
• Jython
You can test and evaluate your expressions with the help of the Expression Evaluation tool (see page 1230).
Related pages
• An invariant is a constraint that states a condition that must always be met by all instances of the
class, type, or interface. The invariant is described using an expression that evaluates to true if
the invariant is met. Invariants must be true all the time.
• A precondition to an operation is a restriction that must be true at the moment the operation is
going to be executed. The obligations are specified by the postconditions.
• A postcondition to an operation is a restriction that must be true at the moment the operation
has just been executed.
• A guard is a constraint that must be true before a state transition discharged.
You can use derived properties in the OCL expressions. Scripts having multiple parameters can now be
defined using OCL in structured expressions or Opaque Behaviors (see page 767)
Invariants on attributes
The simplest constraint is an invariant on an attribute. Suppose a model contains a class Customer with
an attribute age, then the following constraint restricts the value of the attribute:
Invariants on associations
One may also put constraints on the associated objects. Suppose a model contains the class Customer
that has an association to the class Salesperson with the role name salesrep and multiplicity 1, then the
following constraint restricts the value of the attribute knowledge level of the associated instance of
Salesperson:
Collections of objects
In most cases the multiplicity of an association is not 1, but more than 1. Evaluating a constraint in
these cases will result in a collection of instances of the associated class. Constraints can be put on
either the collection itself, e.g. limiting the size, or on the elements of the collection. Suppose in a model
the association between
Salesperson and Customer has the role name clients and multiplicity 1..* on the side of the Customer
class, then we might restrict this relationship by the following constraints:
Derivation Rules
Models often define derived attributes and associations. A derived element does not stand alone. The
value of a derived element must always be determined from other (base) values in the model. Omitting
the way to derive the element value results in an incomplete model. Using OCL, the derivation can be
expressed in a derivation rule. In the following example, the value of a derived element usedServices is
defined to be all services that have generated transactions on the account:
Initial Values
In the model information, the initial value of an attribute or association role can be specified by an OCL
expression. In the following examples, the initial value for the attribute points is 0, and for the
association end transactions, it is an empty set:
Contents
Resource Manager functionality allows you to manage local resources (installed with a modeling tool or
downloaded separately) and resources available on the web.
With Resource Manager you can manage different types of resources, such as Profiles, Plugins,
Templates, Language resources, Case studies/examples, Custom diagrams, and others.
The Resource/Plugin Manager helps you manage the resources. You can add the resources (.zip
or .rdzip) to your modeling tool from the following locations:
Distributing resources
You can bundle your resources into one .rdzip file and then distribute that file on a local file system,
network share, or web server.
To build the resources file, you need the Development Tools plugin to be installed. The Development
Tools plugin can either be installed from the No Magic Server in the Resource/Plugin Manager, or can
be found in the no-cost resource distribution file.
For more information about building the resource distribution file, read Building a resource
distribution file (see page 2109).
In the Manage Resource Locations dialog, you will be able to see the defined resource locations. You
can manage this locations list by adding, removing, or reordering the resource locations.
1. In the Manage Resource Locations dialog, click Add button. The Select Resource Location or
Distribution File dialog opens.
The resource distribution file (.rdzip) contains the resources and their descriptor file. If you are
using the web server for the resource distribution, make sure that the resource distribution file
(.rdzip) is extracted into the intended server location.
To specify the server where the resources and their descriptor file are located
1. In the Manage Resource Locations dialog, click Add URL. The Resource Server URL dialog
opens.
2. In the open dialog, type or paste the server address.
3. Click OK.
The resources from the selected location will be listed in the Resource/Plugin Manager.
If you need to add the No Magic server, enter <nomagic.resource.server> in the Resource Server
URL dialog.
Related pages
Contents
Modeling Tools
This functionality is available in Standard, Professional, Architect and Enterprise editions only.
Setters and Getters are common operations that contain almost every Class (see page 633). With the help
of our modeling tool, set and get operations for Class attributes can be generated automatically.
1. From the shortcut menu of the selected Class, select Tools, and then select Create Setters/
Getters.
a. The Select Attributes/Association Ends dialog opens.
2. Add a tagged value "getter/setter for attribute=attribute_name" to the selected Class.
The names of created operations (setters) are combined according to the following format:
Example
If you have an attribute called x of type int, then the generated setter will look this way:
• public void setx (int x);
239 https://docs.nomagic.com/display/MD190SP2/License+Manager+dialog
Example
If you have an attribute called x of type int, then the generated getter will look this way:
• public int getx ();
Related Pages
Modeling Tools
This functionality is available in Standard, Professional, Architect and Enterprise editions only.
When you inherit Classes from the base Class that has abstract functions, you have to redefine them in
the inherited Classes. The implement/override operations tool will help you generate operations that
are defined as abstract in the base Class.
• When one classifier inherits operations from the base classifier (Generalization relationship (see
page 2025)).
• When some classifiers implement an Interface (Realization relationship (see page 1167)).
Box Function
All Contains names of all operations defined within the selected class.
> Moves the selected operation from the All list to the Selected list.
< Moves selected operation from the Selected list to the All list.
>> Moves all operations from the All list to the Selected list.
<< Moves all operations from the Selected to the All list.
Shortcut Key
Double-click the item name and it will be moved to the opposite list.
Related Pages
Contents
This tool allows you to create instances of various entities with just a few clicks. It is useful for working
with complex models, and for assembling large systems from parts.
The Automatic Instantiation wizard analyzes the structure of the selected element and collects all
available information about that element from the model (attributes, properties, and so on). All this
information is presented in the first step of the wizard.
The Automatic Instantiation wizard evaluates collected information and provides a suggestion of all
possible instances to be created.
If you are satisfied with default values provided in the Automatic Instantiation wizard, you can finish
the wizard in the first step without making any changes. The instances will be created with the default
values and in your working package. But if you want to change default values, create several different
configurations, see the Working with Automatic Instantiation Wizard and the Case study: sections
on how to do that.
• Instance Specification240
• Constraint Link (see page 660)
• Value Specification (see page 868)
• Working with Automatic Instantiation Wizard (see page 1114)
• Automatic Instantiation Wizard Case Study (see page 1118)
• Automatic Instantiation wizard in SysML Plugin241
240 https://docs.nomagic.com/display/MD190SP2/Instance+Specification
241 https://docs.nomagic.com/display/SYSMLP190SP2/Automatic+Instantiation+wizard
Parts are displayed if the multiplicity is greater than 1. The number of parts displayed depends on the
multiplicity.
• If the multiplicity is a particular value, for example 2, then you will see 2 parts displayed in
the Automatic Instantiation wizard. Also in this case, you will not be able to add parallel parts
or remove existing parallel parts.
• If the multiplicity is defined as an interval (for example, 0..*, 1..10, 1..* ) or *, only one part will be
created by default. If you need more parts, you can create them by pressing Insert or selecting
Add parallel part from the selected property’s shortcut menu.
• If the multiplicity is 1, parts will not be created.
The parts and properties are displayed with the suggested types and values. In this step of the wizard,
you can change them. You can also change the type for the part only in that case, if there is an available
sub element for that part in your model (see the Case study).
After this step, if you do not wish to display your created instance specifications, click the Finish button.
1. If you choose to create a new diagram for displaying instance specification(s), check off Create a
new diagram.
2. If you wish to create and display links between your instance specification(s), check off Create
link between instances.
3. Fill in the Type diagram name field with the appropriate name. By default the diagram name is
Instance of the <element name>. For example, "Instance of the Administrator."
4. From the Select diagram type drop-down list, you can select one of the diagram types.
5. The final step is to select, create new, or clone an owner for your new diagram.
6. After clicking the Finish button, a new diagram with instance specifications is created and
displayed in your project.
On this Page
Related pages
Let’s say we have three classes named Administrator, Librarian, and Personnel. These classes are
connected in the following way:
242 https://docs.nomagic.com/display/SYSMLP190SP2/Automatic+Instantiation+wizard
In the following figure, these values are displayed as [1], [2], [3], and [4]. Each of them have a set of
properties inherited from the type of the parts. In this case, we cannot add more parts because the
multiplicity points to the particular number of available parts. The type of the part can be changed, if
there is a sub element in the model.
In this case, class Librarian has a sub-class Personnel, so the type of part [1] can be changed to
Personnel as you can see in the following figure.
1. Select a new package, wherein our created instance specifications will be stored.
2. Create a new package Instances of the Administrator.
3. Create a new diagram, wherein our created instances will be displayed.
4. After selecting the diagram type (in this case, we will select to create a class diagram) and owner,
let’s click the Finish button.
5. See the result in the following figure.
Contents
Edition Availability
This functionality is available in Standard, Professional, and Enterprise editions only.
In our modeling tool, you can find various GOF, Java, Junit, CORBA IDL, and XML Schema Design
Patterns. Additionally, you can create new patterns and edit existing ones using Java code or JPython
scripts.
In your project, if you have a Class diagram (see page 289) created, do the following:
You can find a description of each pattern at the bottom of the dialog in the Description area.
Related pages
Contents
• Check spelling as you type (see page 1121). A shortcut menu provides spelling options. Right-click
the word underlined in red to enter the shortcut menu and display the Spelling commands. You
can also enter words in a customized dictionary.
• Check the spelling of a whole project or of a selected part. (see page 1124) You can list all the
spelling errors found in a project and easily correct them.
• Set Spelling Checker options (see page 1126). You can set spelling checker options, such as skipping
numbers or uppercase words, in the Environment Options dialog (see page 64).
• Add a spell checking dictionaries (see page 1129). All "Open Office" supportive spelling languages
can be added to the existing ones.
Related pages
Contents
Spell Checker checks if a word is correct as you type. If the word is incorrect, it is underlined with a red
winding line. Right-clicking the underlined word brings up a shortcut menu menu with suggested edits
and gives you the option to add the word to the dictionary or custom glossary.
Spell checking as you type is performed in the following locations in a modeling tool:
• Diagram pane
• Containment tree
• An incorrect word can be changed by typing or by selecting provided suggestion that is always
correct syntactically, but not always correct semantically.
• The Ignore command. If you select Ignore, the incorrectly spelled word is treated as correct for
this time but will be considered to be incorrectly spelled in other cases.
• The Add to dictionary command. If you select Add to dictionary, the incorrect word will be
added to a custom dictionary. Next time it will not be treated as incorrect.
• The Add to New Glossary command. Select Add to New Glossary to create a new glossary (see
page 418) of terms.
Note
Incorrectly spelled words are underlined only in the edit mode of a particular component. If you
turn edit mode off, the underline disappears and vice versa.
Related Pages:
Contents
On this page
2. In the Check Spelling For drop-down list, select the scope. For Selection, click to define a
project scope to check. It may be a package, a diagram, or an element.
3. Click the Spelling Options button to specify spelling options in the Environment Options dialog
(see page 64).
4. Click the Check button. Results are displayed in the Validation Results panel (see page 1271).
To correct an error
3. In the Value area, all incorrectly spelled words are underlined. Correct the words.
4. Click Next to go to the next spelling error (or Previous to return to the previous spelling error)
found during the validation.
5. To close the dialog and save changes, click OK. To close the dialog without saving
changes, click Cancel.
Related Pages:
Contents
1. On the main menu, click Options > Environment. The Environment Options dialog box opens.
2. In the options group list, select Spelling. Spelling options appear to specify in the options list.
Check Spelling as you type Underlines incorrectly spelled words and provides a list of
suggested corrections in a shortcut menu. For more information
about spell check while typing, see Spell Checking as you type (see
page 1121).
Dictionary Select language for spelling. All "Open Office" supportive spelling
languages can be added to the existing ones. For more
information about spelling dictionaries, see Spell checking
dictionaries (see page 1128).
Case Sensitive If true, words will differ in meaning based on the differing use of
uppercase and lowercase letters.
Use Camel Case Words If true, compound words or phrases in which the words are joined
without spaces and are capitalized within the compound, e.g.
BackColor will be spelled as separate words.
Ignore Upper Case Words If true, words with uppercase words only are not to be spell
checked.
1. Click the Add button in the Environment Options dialog box > the Spelling branch > the Add
Spelling Dictionaries group. The Dictionary dialog box opens.
2. Type the name of a new spelling dictionary in the Name text box.
3. Click the ... button and select the OpenOffice zip file location.
4. Type the description of the new spelling dictionary in the Description text box.
Figure 314 -- The Dictionary dialog box
Dictionary Link
More dictionaries can be found at http://wiki.services.openoffice.org/wiki/Dictionaries
Related Pages:
Contents
You can check both DSL customization classes and their properties. You can choose which properties of
the customized element (see page 1990) (Class (see page 633)with a «Customization» stereotype (see page 827))
to be spell checked.
You accomplish this by defining a customization class tag (see page 836)checkSpelling value, found in the
properties tag group. By creating a value for this tag, you can choose String properties to check spelling
for. By default, there are no properties marked as checkable.
Related pages
Contents
Modelling tool allows you to use an external Evaluator to evaluate an opaque expression in your model.
Therefore, you can use any language supported by the external Evaluator in the body of the opaque
expression.
243 https://docs.nomagic.com/display/CST190SP2/Integration+with+MATLAB
244 https://docs.nomagic.com/display/CST190SP2/Integration+with+MapleTM
245 https://docs.nomagic.com/display/CST190SP2/Integration+with+Mathematica
246 https://docs.nomagic.com/display/CST190SP2/Integration+with+OpenModelica
247 https://docs.nomagic.com/display/CST190SP2/Specifying+the+language+for+the+expression
248 https://docs.nomagic.com/display/CST190SP2/Value+binding
249 https://docs.nomagic.com/display/CST190SP2/Evaluating+expressions
250 https://docs.nomagic.com/display/CST190SP2/Evaluation+with+causality
251 https://docs.nomagic.com/display/CST190SP2/Dynamic+constraint
252 https://docs.nomagic.com/display/CST190SP2/Manual+value+updates+using+the+Parametric+Evaluator
253 https://docs.nomagic.com/display/CST190SP2/Communicating+with+evaluators+through+simulation+console
254 https://docs.nomagic.com/display/CST190SP2/
Exchanging+values+between+Cameo+Simulation+Toolkit+and+the+Parametric+Evaluator
255 https://docs.nomagic.com/display/CST190SP2/Built-in+Math
Contents
You can use MATLAB® to evaluate expressions written in MATLAB syntax in Cameo Simulation Toolkit.
You must install MATLAB® first and set up your system to call and use it in Cameo Simulation Toolkit.
Note
For Mac users, Cameo Simulation Toolkit version 18.5 SP2 and later can integrate
with MATLAB® 2016b seamlessly without disabling System Integrity Protection (SIP) unless it is
necessary to disable SIP as a new feature of the latest OS X El Capitan for successful
integration.
Warning
MATLAB® 2014a on Mac OS is not capable of evaluating and returning values via Simulation
Console, which causes MagicDraw to freeze. To solve this problem, please consider
upgrading MATLAB® 2014a to 2014b or later.
To integrate MagicDraw or Cameo Systems Modeler with MATLAB® (on Microsoft Windows or Mac OS X)
256 https://docs.nomagic.com/display/CST190SP2/Trade+study+with+Cameo+Simulation+Toolkit
257 https://docs.nomagic.com/display/CST190SP2/Sample+project
Note
• If there are problems with integrating MATLAB® on Windows, run MagicDraw as an
Administrator, and then try to integrate again.
• When integrating with MATLAB® for the first time or changing the MATLAB® version,
restart your machine.
• If the system has been integrated with MATLAB® previously, you do not have to restart
the system since system variables have already been updated. Only restart MagicDraw.
You can also integrate MagicDraw or Cameo Systems Modeler with MATLAB® manually using the
following steps.
1. Install MATLAB®.
2. Press Windows + R to open the Run dialog.
3. Type cmd in the open combo box and click OK to open the command prompt window.
4. Type "matlab /regserver" and press Enter to register the MATLAB® components to Windows.
The MATLAB® command prompt opens and is ready to use.
5.4 In the Variable value box, enter the path to the MATLAB® bin and bin/win32 folders (or
bin/win64 for Microsoft Windows 64-bit version), for example, ;C:\Program
Files\MATLAB\R2010b\bin;C:\Program Files\MATLAB\R2010b\bin\win32;.
5.5 In the Variable value box, enter the path to the MATLAB® runtime/win32 (or runtime/
win64 for Microsoft Windows 64-bit version), for example, ;C:\Program
Files\MATLAB\R2010b\runtime\win32;.
Note
You can skip Step 5.5 in the above procedure if the MATLAB® runtime directory does not
exist, since this directory only existed in earlier versions of MATLAB® and not in the
newer versions. The MATLAB® runtime is not required in these cases.
1. Install MATLAB®.
2. Type the following commands in the terminal to show all files in Finder
• $ defaults write com.apple.finder AppleShowAllFiles TRUE
• $ killall Finder
4. Create a link to the MATLAB® executable file in /usr/bin if it does not yet exist.
5. Call the following commands in the terminal
• $ cd /usr/bin
• $ ln -s /Applications/MATLAB_R2010b.app/bin/matlab matlab
258 https://docs.nomagic.com/display/CST190SP2/Integration+with+MATLAB
6. Create a link to the MATLAB® executable file in /usr/bin if it does not exist, by using the
following command in the Terminal
• $ cd /usr/bin
• $ sudo ln -s /Applications/MATLAB_R2012a.app/bin/matlab matlab
Note
You need to change the /Applications/MATLAB_R2012a.app in the command line to your
MATLAB directory.
To use MATLAB® on 32-bit and 64-bit (tested with Ubuntu) versions of Linux
3. Create a link to the MATLAB® executable file in /usr/bin if it does not exist, and type the following
commands in the terminal
• ~$ sudo -i
• ~$ cd /usr/bin
Information
If there are problems with integrating MATLAB® on Windows, run MagicDraw as an
Administrator, and then try to integrate again.
Related page
First, you must install Maple™ on your local machine and set up your system in order to call Maple™
and use it in Cameo Simulation Toolkit.
1. Install Maple™.
2. Add the path of the Maple™ bin folder to the path environment variable using the steps as
follows
2.1 Double-click System in the Control Panel to open the System Properties dialog.
2.2 Click the Advanced tab.
2.6 Click OK.
3. Restart Windows.
3. Open the /etc/launch.conf (if this file does not exist, create launch.conf with any text editor) and
follow these steps:
3.1 Type setenv DYLD_LIBRARY_PATH <BINDIR> where <BINDIR> is the bin dir from step 2.2
3.2 Type setenv MAPLE <MAPLEDIR> where <MAPLEDIR> is the maple dir from step 2.1
3.3 Save launch.conf.
Footnote
First, you must install Mathematica® on your local machine, and then set up your system to allow
Cameo Simulation Toolkit to use the installed Mathematica®.
1. On the MagicDraw main menu, select Tools > Integrations. The Integrations window opens.
Contents
On this page
Used By command
The Used By command allows you to find all the elements that use a selected element (e.g., as
property, tag etc.). This also includes usage in diagrams.
The Specification window showing that the WorkStation Class is used by the Computer Property.
Note that containing (owning) other elements is not considered usage. For example, when a Package
contains a Class, this does not mean that the Package uses the Class. The Package is only a container of
the Class.
Depends On command
Use the Depends On command to find all elements used by a selected element (e.g., properties, tags
etc.).
The content tree of a sample model with the Workplace Infrastructure Package having dependencies to
the outer elements of the model.
Note that in this particular situation you must select the Search recursively check box in the
Usages/Dependencies Search Options dialog. This allows you to search for dependencies of
the Package content rather than the Package itself. Also, select the Ignore inner interrelations
checkbox to eliminate the dependencies between the elements contained by the package from
the search results.
1. In the model browser or a diagram right-click the element, the usages or dependencies of which
you want to find.
2. In the shortcut menu of the element click Related Elements, and select Used By or Depends On
(depending on what you want to find).
The search results are listed in the usages/dependencies search results window (see page 1151) at the
bottom of the modeling tool. The search results window also provides additional information, such as
element type and how a particular element is used by/in the element for which you perform the search.
Related pages
Contents
Use the Usages/Dependencies Search Options dialog to find model elements that either use the
selected element, or are used by it. You can search using different sets of criteria and analyze the
search results to understand the relationships between model elements.
• In the model browser or a diagram, right-click the element, the usages or dependencies of which
you want to find, and select Related Elements > Used by/Depends On.
Dialog Description
element
Load Select this check box to include unloaded used projects in the usages search scope. Before
autoloadabl starting the search, you can select the unloaded projects you want to load.
e used
projects This check box is available only if you select the Used By command.
Search Select this check box to search for usages/dependencies for the selected element and all the
recursively elements it owns.
Ignore Select this check box to exclude the derived properties (see page 1184) of the selected element
derived from the usages/dependencies search results.
properties
It is recommended to select this check box, as including derived properties in the search scope
may cause performance downgrade.
Ignore inter Select this check box to exclude the usages/dependencies between the elements owned by the
interrelatio selected element from the usages/dependencies search results. This option allows you to
ns analyze how the selected element and its owned elements are related to the outer elements
(not owned by the selected element) of the model.
Usage information
This option is only effective if you select the Search recursively check box as well.
Level of
Select one of the predefined values (Classifiers or Packages), or click and select
details
desired element types to define the level of details. If you select element types manually, the
usages/dependencies search results will only display the elements of these types.
Treat Select this check box to find a complete list of used/dependent relationships together with
relationship other results.
s as search
result
Treat model Select this check box to exclude relationships from search results and only find the usages/
elements at dependencies connected with these relationships.
the end of
relationship
s as search
result
Show Select this check box to display the results of each search in a new tab.
results in
the new tab
Show this Select this check box to open the Usages/Dependencies Search Options dialog before a new
dialog search is started. If you leave the check box empty, the dialog will not open, and the next search
before will use the search options specified during your last search.
searching
To open the Usages/Dependencies Search Options dialog, click on the toolbar of the
usages/dependencies search results window.
Contents
The usages/dependencies search results window lists the usages/dependencies of the element for
which you perform the search. In the usages/dependencies window you can analyze, group and filter
search results, find element locations, and more.
Expand All Expands all search results listed in groups. To expand the content of a single
group, click the plus sign next to the group name.
Collapse All Collapses all search results listed in groups. To collapse the content of a single
group, click the minus sign next to the group name.
Select in Containment Selects the desired element in the containment tree. To enable the button,
Tree select one of the search results in the usages/dependencies search result
window.
Open Specification Opens the Specification window of the desired element. To enable the button,
select one of the search results in the usages/dependencies search result
window.
Add to Search Results Moves all usages/dependencies search results to the Search Results tab of the
model browser. In the Search Results tab, all results are organized in two
groups: Found in loaded diagrams and Found in model.
Open all diagrams that Opens all diagrams that use at least one the usages/dependencies search
contain current Usages/ results. The button is inactive when there are no search results used in
Dependencies diagrams.
Display the full path of Displays full paths to the elements next to their names in the usages/
the elements dependencies search results window.
Print Prints the usages/dependencies search results table. Make sure that you expand
the search results listed in groups if you want them to be shown on the printed
page.
Filter The filter boxes above each column of the usages/dependencies search results
table allow you to filter search results by element type, used/dependent
element name and usage type. Click a filter box to select the desired filter
option.
Column Description
Project Displays the name of the used project file that owns the model element,
which the package/model element uses.
Related pages
2.9.2 Traceability
Contents
Compatibility
The traceability solution is available in Architect and Enterprise editions.
Our modeling tools support the traceability feature that allows you to track, visualize, navigate, and
analyze the elements involved in the traceability relations. The traceability relations are used to relate
the elements representing the same concept in different UML models at different levels of abstraction
or from different viewpoints. Different levels of abstraction may contain, include, or even correspond to
different stages of system development process (starting from requirements analysis and finishing with
implementation). The higher level of abstraction (e.g., requirements analysis), contains models with
specifying elements, and the lower level of abstraction (e.g., implementation) includes models with
realizing ones.
Multiple types of custom and extended UML relationships (e.g., realization, abstraction), tags (e.g.,
Alternative Flow of Events Diagrams ), and properties (e.g., Owned Behavior ) are used to represent
traceability relations between the specifying and realizing elements for showing traceability from
requirements analysis to implementation and deployment models.
You can visualize the traceability relations of your project in order to analyze them using the modeling
tool's features, such as Relation Map (see page 336) (for the analysis of traces among multiple levels of
abstraction) and Dependency Matrix (see page 309) (for the analysis of traces between any two levels of
abstraction).
You may track and navigate the elements, that are directly or indirectly related to a specific element
through the traceability properties that will be represented in a special property group of the element’s
Specification window (see page 882) and Properties panel (see page 1159), or on the element’s shortcut menu
under the Go To menu. The traceability properties can also be visualized on a diagram using the
standard modeling tool mechanism for displaying property values in notes.
Traceability Report
A Traceability Report is particularly useful when there is a need to visualize and verify that requirement
analysis, design, and implementation model elements are all covered in higher or lower levels of
abstraction, for example, all use cases should be covered with design classes realizing them.
Model Sample
The model used in all the examples in this section is the Traceability sample model that comes
with our modeling tool. To open this sample do one of the following:
• On the Welcome screen, select Samples > Product Features > Traceability.
• Go to the folder <MagicDraw installation directory>\samples\product features and open
the Traceability.mdzip file.
Related pages
Contents
Multiple relationships can be used for traceability representation, depending on the element type and
method used.
The traceability relations can be represented by the following types of element dependencies:
• When elements are related directly by using a custom UML relationship, property, or tag, the
traceability relation is considered to be a single level relation.
• When elements are related indirectly by usually using multiple types of the above mentioned
dependencies, the traceability relation is considered to be a multilevel relation.
The traceability relations can be specifying, realizing, or other. This depends on which direction a
relation is analyzed and which element is considered as a basis.
• A relationship between a specific element and an element that is the realization of this specific
element, from the point of view of the specific element, is considered to be realizing traceability
(for forward traceability (see page 1167)).
• A relationship between a specific element and an element that is the specification of this specific
element, from the point of view of the specific element, is considered to be specifying traceability
(for backward traceability (see page 1174)).
• All other traceability relations (see page 1179).
Related Pages
Contents
The traceability relations are represented through the so-called traceability properties that have been
predefined for each element type according to the traceability method supported in the modeling tool.
A single traceability property shows an element or a set of elements that are related to a particular
element through the relationships which are specified by some traceability rule. The predefined
traceability rules are stored in the Traceability customization profile used by the MagicDraw Profile.
The relations for traceability creation (see page 1155), visualization (see page 1156) and navigation (see page
1163) is also possible without using traceability properties. However, the customizable model driven
traceability properties, which represent the traceability relations in a single place, can greatly help in
traceability information visualization and access.
Tip
You can customize the predefined traceability properties according to your needs or create
your own traceability properties and specify your own rules. You can also customize the
grouping of the traceability properties according to your needs. For more information, please,
refer to the sections Extending metamodel with derived properties (see page 2062) and Creating
your own property groups and subgroups (see page 2042).
Related pages
The Traceability property group in element’s Specification window is one of the places, wherein the
element’s traceability properties, showing its realizing and/or more specific elements, are represented.
1. Select an element and open the element’s Specification window by right clicking on the element.
2. Click the Traceability property group.
The following picture gives an example of the traceability relations between the elements from
different abstraction levels of the same project.
Therefore, the traceability properties such as Realizing Class and Realizing Element represent both
design classes as realizing elements of this use case. Accordingly, the traceability properties such
as Specifying Use Case of each design class represent the “Create User” use case as a more specific
element.
1. Select the element in the Containment tree or its shape on the diagram.
2. In the Model Browser, click on the Properties panel > Traceability tab. Now you can view
element’s traceability properties.
1. Create a note for the element, whose traceability properties you want to visualize.
2. From the note’s shortcut menu, select Edit Compartments > Element Properties .
3. In the list on the left-hand side, click the traceability property of you choice (e.g., Realizing Class
or Specifying Use Case) and then click the > button.
4. Click OK. Now you can view the element’s traceability with other elements.
To select an element from the higher/lower level of abstraction in the Containment tree
1. Select the element in the Containment tree or its shape on the diagram.
2. From the element’s shortcut menu, select Go To > Traceability > Specification/ Realization/ Other,
choose a property, and then select an element.
3. The element will be selected in the Containment tree.
Coverage analysis provides the visibility of each element’s related artifacts, indicated as realizing (lower
level of abstraction) and/ or specifying (higher level of abstraction) ones.
The main objective of the Traceability Report is to visualize and verify that Analysis, Design, and
Implementation model elements are all covered.
Contents
During the development process and in order to understand the system fast, navigating between
elements from different levels of abstraction is necessary. Navigating from one element to another is
easy using the modeling tool's GUI capabilities of the traceability feature, if there is at least one
traceability relation between them.
Element’s Specification Open the element’s Specification window and select the Traceability property
window group, and then right-click on the property. Choose Open Specification and
select an element (if there is more than one related element). The Specification
window of this element will be opened.
Element’s Properties Open the element’s Properties panel, select the Traceability tab, and then right-
panel click on the property. Choose Open Specification and select an element (if there
is more than one related element). The Specification window of this element will
be opened.
Go To submenu on From the element’s shortcut menu, select Go To > Traceability > Specification/
element’s shortcut menu Realization/Other . Choose a property and then select an element. The element
will be selected in the Containment tree.
Contents
You can perform the impact and/or gap analysis in your project using the Dependency Matrix feature,
which is a powerful way for representing traceability relations between multiple elements from
different packages, levels of abstraction, views, or other relations that cannot be represented on
diagrams, for example, relations through UML tags. You can create your own dependency matrices or
even custom dependency matrix types for visualization of various traceability relations. You only need
to define a relevant traceability property as dependency criteria for this.
The following figure depicts an example of traceability relations between several model elements.
You can create a dependency matrix to visualize these traceability relations. The following steps will
show you how to create a dependency matrix fort he Realizing Class predefined property.
The following figure depicts the created Dependency Matrix showing the traceability relationships
between use cases and design classes they realize:
Contents
The main objective of the predefined traceability rules is to allow the use of the traceability engine
instantly (out- of-the-box) for a typical project. The predefined rules allow for analyzing and verifying
links between elements residing in Analysis, Design, and Implementation layers of your models.
Elements in these layers are extended with a set of properties, pointing to elements from the higher
abstraction layer (backward traceability) and the lower abstraction layer (forward traceability).
Overall, there are three groups of predefined traceability properties, which will be detailed in
subsequent sections:
Related pages
Manifeste The property shows artifacts that physically render Compone Relationshi Artifact E
d By the current component. nt ps: x
Artifacts Manifestatio a
n m
pl
e
Realizing The property shows the components representing Class Relationshi Compon E
Compone the class realization in the Implementation model. ps: ent x
nt Abstraction a
m
pl
e
Realizing The property shows classifiers that realize Compone Relationshi Classifie E
Classifier components through component realization. nt ps: r x
Component a
Realization, m
Realization pl
e
Realizing The property shows the classes representing the Use Class Relationshi Class E
Class use case realization in the Design model. ps: x
Abstraction a
m
pl
e
Realizing The property shows the realizing use cases of the Use Case Relationshi Use Case E
Use Case current use case in the lower level of abstraction ps: x
thus demonstrating how the use case is Abstraction a
implemented. For example, the Requirements Use m
Case realizes the Business Use Case. pl
e
Realizing The property shows the classifiers conforming to Interface Relationshi Classifie E
Classifier the contract specified by the interface and related ps: Interface r x
with this interface through the interface realization Realization a
relationship. m
pl
e
Realizing The Realizing Element property gathers realizing Element Relationshi Element E
Element, elements from the lower abstraction level. ps: x
All Abstraction, a
Realizing The All Realizing Elements property transitively Component m
Elements. gathers realizing elements from all lower Realization, pl
abstraction levels. Interface e
Realization.
The All
General
Classifie
rs
property
gathers
classifier
s from
which
the
current
element
directly
or
indirectly
inherits.
Contents
On this page
1. In the model browser or a diagram, double-click the element for which you want to create a
custom traceability rule to open its Specification window.
2. In the property group list on the left side of the Specification window, select the Traceability
group.
3. Click the Create button.
4. In the open Expression dialog, specify the name and expression (see page 1187) of a new
traceability rule.
5. Click OK and close the Specification window.If you want to create a derived property with a result
other than an element, you need to change the derived property type manually.
The customization of the newly created traceability rule is saved in the Derived Properties Package with
the «derivedPropertiesSuite» stereotype. This folder is normally hidden in the containment tree of your
model. You can find it using the Quick Find functionality (see page 222). This may be useful when you
want to change traceability rule properties.
1. In the model browser or a diagram, double-click the element with the traceability rule you want
to edit to open its Specification window.
If a custom traceability rule is displayed in a table, you can edit it directly from that table.
1. In a table, right-click the header of the desired custom traceability rule column and select Edit
Derived Property.
2. In the Expression dialog, make desired changes and click OK.
1. In the toolbar of an active table, click the Show Columns button and from the menu select
the Select Columns commnad.
2. In the Select Columns dialog, set the traceability rules you want to display as true.
3. Click OK.
1. In the model browser or a diagram, double-click the element with the traceability rule you want
to remove to open its Specification window.
2. In the property group list on the left side of the Specification window, select
the Traceability group.
3. In the property specification area on the right side of the window, select the traceability rule you
want to remove.
4. Click the Delete button and close the Specification window.
• In a table, right-click the header of the unwanted custom traceability rule column and
select Remove Derived Property.
Related pages
Contents
• Simple navigation
• Metachain navigation (indirect relations through chains of properties)
• Find
• Union
• Exclude
• Filter
• Various scripts
You can also use custom operation types. In addition, a criterion can be an expression combining
several operations by passing the results of one operation call to another operation.
If multiple criteria (operations) are specified, the result will be calculated according to all these criteria
(operations).
You can copy and paste the selected structured expressions in the Expression dialog. Select all or part
of the structured expression in one dialog and paste it into the same or another dialog.
Concepts
Read the following description to better understand the material.
Concept Description
• In the Criteria area of a dependency matrix (see page 309), click the ... button next to the
Dependency Criteria box. The Dependency Criteria dialog opens.
• In the Filters area of a relation map (see page 336), click the ... button next to the Relation
Criterion box. The Relation Criterion dialog opens.
• Open the Specification window (see page 882) of a smart package (see page 796), under the Content
category on the right, click the cell of the Query property value, and then click the ... button. The
Query dialog opens.
The layout of the dialog is the same in all the described cases. On the left side of the dialog, you can
select an operation type that best suits for specifying the needed criterion. Selecting an operation type
opens the criteria specification panel on the right side of the dialog.
The dialog has two modes: Standard and Expert. The Expert mode offers more options for specifying
criteria and allows for creating combinations of several operations.
Related pages
2. Select a relationship, property, or tag and specify other options described in the following table.
Filter by Expert
Click the button and in the open dialog select
Property
one or more properties of the selected relationship
Value
and specify their values for more specific filter.
Result Expert
Click the button and in the open dialog select
Type
one or more result element types. The column is
available only in the Query dialog and the Expression
dialog. You can define element types (see page 310) for representation
on a dependency matrix and. Moreover, you can define
the element types (see page 337) for representation on a relation map.
Color Standard/ Click the button and in the open dialog select the color
Expert to represent the appropriate relationship, property, or tag.
The column is available only in the Relation Criterion dialog.
To change the Contextual element (see page 1187) of a simple navigation criterion
1. On the left side of the dialog, expand the simple navigation criterion and select
the Context parameter.
2. On the Context specification panel, click the Reset button.
3. Specify other parameters of the new operation.
On this page
Related pages
Note
To remove a step from the metachain, click the Remove button.
Information
You can add a new metachain operation (see page 1210).
Information
To restore the original context, expand the Other group, and click Contextual Variable.
3. Specify other parameters of the new operation.
Related pages
Tip
If you would like to simply find the desired model element, and don't need to automatically
query your model every time you update it, use the Find dialog (see page 216) instead.
To use a Find operation, you need to specify it as criteria. The next section describes how to complete
this task.
Useful information
Selecting the Search in all texts check box allows you to search for text in Documentation and
TODO properties.
Completing the steps described above specifies a Find operation as criteria. If specifying the Find
operation properties available in the Standard mode is not sufficient, and you want to customize the
advanced properties and/or options of the selected operation, you can do this in the Expert mode.
5. Click OK.
The selected Find operation is now customized to query a model according to your specified properties.
As mentioned before, the Expert mode also gives you the option to use a specific Find operation as an
argument of another operation. In other words, you can create a new Find, Filter, Implied Relation,
Exclude, Script, Union or Collection operation, and use the results of a specific Find operation as its
property.
You now have a new operation that has been created with the selected Find operation as one of its
properties.
On this page
Related pages
The figure above displays composition and inheritance structure between blocks. If a composite block
depends on a particular element, the whole block also depends on this element. The same situation
exists with inheritance between blocks. Inherited elements indirectly depend on the elements to which
the parent element has relations. These indirect relations are referred to as implied relations, and can
be displayed in a dependency matrix, as shown in the figure below.
• Matrices
• Relation maps
• Tables
• Derived properties
• Smart packages
To specify an Implied Relation operation as a criterion
A source is a Contextual element (see page 1187), and a target is the result of the
calculation.
5. If you want direct relations to be displayed together with (and the same way as) implied relations,
select the Include Direct Relations check box. However, be aware that after selecting this check
box, there is no way to visually distinguish direct relations from implied relations.
6. If the implied relation is created in a matrix or relation map, optionally modify the style of the
relation by clicking next to the Style box to open the Style dialog, then select preferred
style properties and click OK.
7. Click OK.
Criteria can be other relations than those listed in the Criteria drop-down list. In the Expert mode, any
operation or even a combination of operations can be set as a criterion, e.g., metachain or find
• Source: specifies the operation that recursively collects elements starting from the Contextual
element.
1. Once you select implied relation as a criterion, in the lower left corner of the dialog for specifying
criteria, click Expert to enable the Expert mode.
2. In the criteria list on the left side of the dialog, expand the implied relation operation, and select
the parameter you want to specify.
3. In the open pane for specifying the parameter, select the value you want to use.
To set the value of the selected parameter as null, click the Reset button.
Important
To create a new Property Test operation, you must enable the Expert mode.
3. From the property list, select the desired properties and specify their values, as shown below.
After specifying a Property Test operation, it checks if model elements contain the property values that
you specified in the step 3. For example, if you select the risk property and set it to High, as highlighted
in the figure above, the Property Test operation returns true for all model elements with the risk
property set to High. Advanced operation properties can be specified in the Expert mode (see page 1208).
Property information
If AND Operator is set to true (default value), the operation returns true only for the elements
that contain all of the selected properties with specified values. If AND Operator is set to false,
the operation returns true for the elements that contain at least one of the selected properties
with the specified value.
On this page
Related pages
Contents
2. Click the appropriate icon on the right side of the dialog to select a new operation type (see the
descriptions in following table).
If the Standard mode is on, switch to the Expert mode to make more operation types
available.
Operations group
Expert Click to create a new simple navigation operation (see page 1191). This icon is
available only when specifying members of a union or exclude operation, input
collection for a filter operation, scope and type parameters for the find operation.
Standard / Click to create a new metachain navigation operation (see page 1194).
Expert
Expert Click to create a new filter operation and then specify both the input collection that
you need to filter and the filter criteria.
Expert Click to specify a new type test operation as a condition for selected filter
operation. In other cases, the icon is not available.
The operation tests, whether the type of the element matches the given type or
stereotype. If the types matches, it returns true, and if they not – false. You can also
use this operation to check, if the element is an instance of the given classifier.
Expert Click to create a new Property Test operation. This operation tests model elements
to find out if they contain the specified property values. If the property values of a
model element match with the ones you specified, the operation returns true,
otherwise it returns false.
To specify a Property Test operation, select the desired properties and specify their
values in the Property Test specification area on the right side of the dialog.
Additionally expand the operation node in the operation list on the left side of the
dialog and, if needed, change the AND Operator property value. If AND Operator
is set to true (by default), the operation returns true only for the elements that
contain all of the specified property values. If AND Operator is set to false, the
operation returns true for the elements that contain at least one of the specified
property values.
Expert Click to specify a new Nested Operation. Nested Operation is an operation, the
body of which is a structured expression. It is inline equivalent to defining an
executable operation in the model as an Opaque Behavior with the
StructuredExpression language and then using it. Nested Operation can be used as
an argument to higher order operation calls, such as Filter. In simple operation
calls it is not available.
Expert Click to create a new union operation and then specify as many members for it as
you need.
Expert Click to create a new exclude operation and then specify both From and Excluded
members for it.
Expert Click to add a new operation from the model (see page 1215). You can select either
one of the built-in operations, which are stored in standard/system profiles of your
project, or a custom operation.
Expert Click to create a new script operation (see page 1224), which language can be one of
the following:
• BeanShell
• Groovy
• Jython
• JRuby
• JavaScript
• OCL 2.0
It can also be a reference to a java class (Binary).
Values group
Other group
Expert Click to add an expression retrieving the contextual variable specified by name.
Most common case is accessing the THIS variable, which stores the current
Contextual element (see page 1187). This is usually the starting point – argument for
other operations – such as Simple Navigation or Metachain Navigation.
Related pages
Contents
On this page
In a structured expression, you can call an operation defined in the model. An operation from the
model can be either built-in or custom. The built-in operations, such as Union, Find, or Filter, are stored
as executable opaque behaviors in the Built-In Operations package, which is owned by UML Standard
Profile::MagicDraw Profile.
Related pages
Built-in operations
Date
Timesta The operation returns current system time in milliseconds as a string type Result =
mp value. It takes no parameters. “1392798008000”
ParseDa The operation converts a date and time in a human readable format to Format =
te milliseconds. In other words, the operation reverses the result of the “yyyy.MM.dd G 'at'
FormatDate operation (it returns the value that can be the Date parameter HH:mm:ss z”
for a FormatDate operation).
Formatted Date =
The operation takes two parameters: “2014.02.19 AD at
10:20:08
• Format – a current format of the date and time that should be EET”
converted to milliseconds. It must be a string type value.
• Formatted Date – a date and time that should be converted to Result =
milliseconds. It must be a string type value. “1392798008000”
TypeTes The operation tests, whether the type of an element matches a given type or Element = class
t stereotype. If the types matches, it returns true, and if they not – false. Profile
Type = Class
You can also use this operation to check, if an element is an instance of a Include Subtypes =
given classifier. false
• Element – a model element, whose type you need to test. The element type
• Type – a type, stereotype, or classifier for testing the element. matches the given
• Include Subtypes – true, if the inherited types, stereotypes, or type.
classifiers of the selected Type parameter value should be
included in the test; false, if not.
Element = class
Profile
Type = Classifier
Include Subtypes =
true
The TypeTest operation can be used in the Filter operation as the condition. Result = true
For this, click the Use as Condition of a new Filter operation button on the
Type Test operation specification panel. Though the
element type does
not match the
given type, it is its
subtype, and in
this case subtypes
are included in the
test.
Element = class
Profile
Type = Classifier
Include Subtypes =
false
Result = false
Thought the
element type is a
subtype of the
given type, in this
case subtypes are
not included in the
test.
Result Collection =
Instance The operation finds the needed slot of the given instance and returns one or Instance =
Navigati more values of that slot. WN345AB
on Navigate Property
The operation takes two parameters: = Year
The result type of this operation matches the type of the property specified
as the Navigate Property parameter.
Contain The operation verifies specified object in given collection and returns Input =
s Boolean value true if sets contains object, otherwise operation returns value
false.
Intersec The operation returns the data common to both collections, with no C1 = [7 0 5], C2 = [7
t repetitions and in sorted order. 1 5],
Concat The operation joins two lists. The List1 and List2 are joined end-to-end.
Keeps the order, allows duplicates.
Get The operation returns the element at the specified position in collection.
MapFlat The operation maps objects from collection to collection of other objects. Input = { {1,2}, {3,4},
Flattens mapping result if it is a collection. {5,6} }
Zip The operation zips two collections using given zip operation.
AnyMatc The operation checks if all collection elements match given predicate and
h returns boolean value.
Logical
And The logical conjunction operation returns Boolean value true if all
parameters are true, in all other cases - operation returns false value.
Or The logical disjunction operation returns Boolean value true if either or both
parameters is true, otherwise operation returns false value.
Xor The logical exclusive disjunction operation returns Boolean value true if both
parameters differ, otherwise operation returns false value.
Not The logical negation operation returns Boolean value true if parameter have
value false, and false when parameter have value true.
• A - logical value.
LessTha The operation returns true if the left parameter is less than the right
n parameter (A < B).
LessTha The operation returns true if the left side parameter is less than or equal to
nOrEqu the right parameter (A <= B).
als
The operation consist of:
Greater The operation returns true if the left parameter is greater than the right
Than parameter (A > B).
Greater The operation returns true if the left parameter is greater than or equal to the
ThanOr right parameter (A >= B).
Equals
The operation consist of:
Equals The operation converts parameters if they are not the same type, then
compares them. If parameters are equal, operation returns Boolean value
true, otherwise operation returns false.
String
StringC The operation joins two parameters with string values. A and B string values A = Hello
oncat are joined end-to-end.
B = world!
The operation consist of:
Return = Hello
• A and B - two string values. world!
StringC The operation returns Boolean value true, if specified string value is find in A=o
ontains specified scope, otherwise.
B = world!
The operation consist of:
Return = True
• A - according to this string, operation will verify B
• B - string value.
Other
Diagram The operation returns Boolean value true if project uses specified diagram, Diagram =
TypeTes otherwise returns value false.
t Use Case
The operation consist of: Diagram
Class
• Diagram - all diagrams in the specified scope. Diagram
• Type - write diagram name exactly how it is named in modeling Free Form
tool. Diagram
Type = Class
Diagram
Return = True
Use the script operation, when you need to specify an inline expression in OCL 2.0, as Java binary, or in
any of MagicDraw supported script languages. MagicDraw supports any script language that has a
JSR-223-compliant engine.
2. Click the Script icon on the right side of the dialog.
If you do not see the Script icon, switch to the Expert mode.
3. If needed, change the operation name.
4. If you are specifying the criteria for displaying relations between elements in a relation map,
you can select a color, which will represent these relations. Otherwise, the color selection is
not available.
5. From the Language drop-down list, select a language.
If the engine of the language you need is not built into MagicDraw by default, you can
add it (see page 2622) to the application yourself. Make sure the Automaton plugin is
enabled!
6. Type in the Body box. Use the syntax of the selected language.
7. In the Listeners Configuration box, type a reference to the java class, which specifies when the
result of the script operation must be recalculated.
The listeners configuration is not necessary, but using it can improve the performance.
You can create your own listener (see page 2206) using MagicDraw API.
8. Click the ... button next to the Results Filter By Type box and select one or more element types
to filter the result of the script operation.
The script operation is created. Now you can create a new one, where the result of the previously
created operation is used as an argument.
Related pages
Specifying parameters
The number of parameters a script operation can have depends on the script operation language:
• An OCL expression can have a single parameter, which by default specifies the Contextual
element (see page 1187). Though the parameter cannot be removed, you can easily reset the
Contextual element (see page 1187), if necessary.
Writing scripts
The following instructions applies to BeanShell, Groovy, JRuby, JavaScript, and Jython scripts
only.
How to access the arguments and other values from the script body?
To access an argument from the script body, you should refer to the corresponding parameter name.
• Arguments passed to this script as parameters, such as the Context parameter in the preceding
figure.
• Values passed to the structured expression, inside of which the script operation is defined.
If you have an opaque behavior with a couple of parameters, you can refer to them from
a script operation, which is inside of the structured expression - the body of this opaque
behavior.
If you have a structured expression specifying a derived property, validation rule, relation
criterion, etc., use THIS to refer to the Contextual element (see page 1187).
For the list of available MagicDraw Open API methods (see page 2072), refer to javadoc.zip, which
can be found in <MagicDraw installation directory>\openapi\docs.
More complex model access operations are available in ModelHelper and StereotypesHelper.
Use import statements to shorten java class names as shown in the following figure.
Let’s say we need a script operation, which counts the number of nested packages. You can use
MagicDraw Open API to navigate through the model and find all the nested packages, but it
would be complicated.
To simplify the script:
1. Use the Find operation to list these nested packages.
2. Use the script operation for nothing else than counting the number of the list items. Pass
the result of the Find operation to this script through the PackageList parameter as the
following figure shows.
• In the modeling tool main menu, click Tools, and select Expression Evaluation.
• Use Selection. Set to True, if you want to use the selected elements as the evaluation criteria.
Elements can be selected either in the Model Browser or in the diagram, but not both.
• Iterate through selection. Select the check box to evaluate model elements one by one.
The Expression Evaluation is also available in the dialogs, wherein you can define expressions,
e.g., Expression editor, Dependency Criteria, Body and Language dialogs. If you want to start using
the expression evaluation in one of these dialogs, click the Evaluation Mode button.
Related pages
Contents
No Magic modeling tools allow you to see element usages in diagrams by listing all diagrams that
display the symbols of a particular model element. You can access the diagrams in which an element is
used from the Specification window (see page 882) of that element, the element's shortcut menu, or the
main menu (see page 25).
Additional information
For more information about element usages and relations between model elements, see
Analyzing usages and dependencies (see page 1145).
If you open a diagram (described in the first option of step 3), the symbol of the related element is
selected in that diagram. If the diagram includes several symbols of the same element, all of those
symbols are selected in the diagram.
1. Right click either the desired element in the model browser or its symbol in a diagram.
2. From the element’s shortcut menu, select Go To > Usage in Diagrams.
3. Select either Diagrams with Symbols or Other Diagrams.
4. Depending on what you want to do, complete one of the following actions:
• To open one of the listed diagrams, select the desired diagram.
• To open all listed diagrams, click Open All Diagrams.
Depending on the action you performed in step 3, one or all of the diagrams in which the related
element is used are opened with the element symbol(s) selected.
1. Select either the desired element in the model browser or its symbol in a diagram.
The selected diagram or all of the diagrams in which the related element is used are opened with the
element symbol(s) selected.
Related pages
• Model analysis (see page 1145)
• Analyzing usages and dependencies (see page 1145)
• Traceability (see page 1153)
• Specifying criteria for querying model (see page 1187)
• Element usage in diagrams (see page 1232)
• Identifying Package Dependencies (see page 1235)
• Comparing projects (see page 1246)
• Validation (see page 1261)
• Model Visualizer (see page 1301)
• Suspect links (see page 1310)
To avoid any violations on editing a package, especially on removing or exporting a package to another
project, it is always good to know all of the package dependencies. Dependency analysis allows users to
detect cyclic dependencies that impede reusing the package in the current or other projects because
it can cause an infinite recursion. This analysis manages the impact of changes to other related
elements.
In the modeling tool, the Dependency Checker allows you to analyze package dependencies in the
whole project scope or analyze dependencies between the selected package/model and shared
packages. The dependency severity level status shows how a package depends on a particular element.
There are three severity levels:
Severity levels
While checking dependencies, conflicts of the selected severity (and higher) are displayed in the
Package Dependencies panel (see page 1237).
In the Project Options dialog (see page 213), you can define the default values for checking dependencies.
You can specify the following:
In the following procedures, learn how to work with the Dependency Checker:
• How to set default values for the Dependency Checker (see page 1236)
• How to analyze package dependencies of the whole project or between the selected package/
model and shared packages (see page 1236)
• How to analyze package dependencies while exporting packages (see page 1236)
• How to analyze package dependencies while sharing packages (see page 1237)
To set default values for the Dependency Checker
Description of an option
Each option has a short description. Click the option to see the description in the description
area of the dialog.
To analyze package dependencies of the whole project or between the selected package/model and
shared packages
1. From the package/model shortcut menu, choose Project Usages > Export Packages to New
Project. The Export Packages to New Project dialog appears.
2. Select the packages you want to export. For more information, see Exporting packages to
new projects (see page 235).
Notes
• Dependencies between the selected package/model and shared packages will be
analyzed and shown in the opened Package Dependency panel (see page 1237).
• If you want to discover cyclic dependencies, select the Check for cyclic
dependencies among used projects check box. This enables for the
dependencies which have Error and Warning severity levels to be displayed.
1. From the package/model shortcut menu, choose Project Usages > Share Packages. The Shared
Packages dialog appears.
2. Select the packages you want to share. For more information, see Sharing project data (see page
236).
3. Click OK.
4. In the question dialog, click Yes.
Notes
• Dependencies between the selected package/model and shared packages will be
analyzed and shown in the opened Package Dependency panel (see page 1237).
• If you want to discover cyclic dependencies, select the Check for cyclic
dependencies among used projects check box. This enables for the
dependencies which have Error and Warning severity levels to be displayed.
Cyclic dependency
If there is a chain of dependencies such that A → M(1), M(1) → M(2), M(2) → M(3), ..., M(X) →
M(A), where:
• A is an element from the used project M(A)
• M(1..X) are other used projects
• A → M(x) is element A dependency on used project M(x)
• M(y) → M(x) is a dependency of at least one element in used project M(y) on used project
M(x),
then this chain is called a cyclic dependency and every atomic dependency in this chain is
considered as part of cyclic dependency.
Related pages
Contents
Before hiding a package, you can identify and analyze package usages and usages of all elements in the
package first. The Package Usage window will help you with that. The Package Usage panel is
displayed when you choose to check usages of elements in the selected packages for hiding (see page
1395).
Button Description
Expand All Tree Branches Expands all nodes in the package dependencies tree.
Collapse All Tree Branches Collapses all nodes in the package dependencies tree.
Display the Full Path of the elements Displays the element full path next to the element name.
Select in Containment Tree Shows the selected element in the Browser. The button is
available, when a dependency is selected in the table.
Change Shares Opens the Shared Packages dialog wherein you can select
another packages to be shared.
Change Exports Opens the Export Package to New Project dialog wherein you
can select another packages to be exported.
Export Closes the Package Dependencies panel and opens the Save
as/ Commit Settings dialog for saving/committing the package
as separate project.
The button is available, when the Check Dependencies on
Package Export/Sharing environment option is set to Allow
dependencies (to open the Environment Options dialog, select
Options > Environment).
Project Displays the name of the used project file that owns the model
element, on which the package/model element depends.
Part of Cycling Dependency Indicates that the element is a part of the cycling dependency*.
* Cyclic dependency
If there is a chain of dependencies such that A → M(1), M(1) → M(2), M(2) → M(3), ..., M(X) →
M(A), where:
• A is an element from the used project M(A)
• M(1..X) are other used projects
• A → M(x) is element A dependency on used project M(x)
• M(y) → M(x) is a dependency of at least one element in used project M(y) on used project
M(x),
then this chain is called a cyclic dependency and every atomic dependency in this chain is
considered as part of cyclic dependency.
Related pages
Some movements can be achieved by clicking Solve in the Package Dependencies panel (see page 1237).
The used project depends on an external element, but can be exported (with warning)
Even though the used project element has a relationship with an external element, that relationship is
contained in an external package:
Example of a relationship when the used project does not depend on an external element
Dependencies by reference
The used project depends on the external elements which have references to the model elements from
the used project packages.
Diagram dependencies
The diagram depends on all model elements displayed within it.
If the diagram is contained in the package Items and depends on external elements, this package
cannot be exported to a separate project.
In this case, if the diagram is not important to the used project, it can be moved from the used project
package into any external package by dragging-and-dropping it within the Model Browser:
Teamwork Server or Teamwork Cloud is an ideal solution for a collaborative work on the same project.
For more information about using a modeling tool in the collaborative environment, see Collaborative
modeling (see page 1313).
Related pages
Contents
Before exporting or sharing a package as an independent used project, you need to identify and solve
package dependencies first. More specifically, you have to make sure that the package does not depend
on any external elements (except other used projects) in a project.
The same situation occurs when you edit the used project inside the current project (the used project
permissions should be set to read-write) and introduce dependencies from the used project back to the
project where it is being used. In this case, you will be asked to solve these dependencies when saving
the used project.
However, the modeling tool allows for continuing without solving these dependencies right away. The
elements, which were referenced, but are missing in the used project will be shown as recovered
elements (see Maintaining Decomposed Model Integrity (see page 251)).
You can choose how the dependency checking will be carried on in your projects by changing the Check
Dependencies on Package Export/Sharing environment option (from the Options menu, select
Environment > General > Save/Load). You can choose from one of the following:
• Do not allow dependencies. If this option is selected, then unsolved dependencies should not
be allowed while exporting or sharing packages. The Export (or Share) button is not available
until the dependencies are solved.
• Allow dependencies. If this option is selected, then the dependencies are identified, but it is not
required to solve them and the Export (or Share) button is available.
• Do not check. If this option is selected, then the dependencies will not be checked at all. In this
case, the selected package will be exported or shared as is. Be aware, that this might cause an
increasing number of the recovered elements in your project (see Maintaining Decomposed
Model Integrity (see page 251)).
Related pages
Concept Description
Compared A project version that contains modifications added to original project version.
Related pages
Read the following definitions to get familiar with different change types.
Addition change
If an element has been added to a compared project version, an addition change occurs.
Deletion change
If an element has been removed from a compared project version, a deletion change occurs.
Modification change
If an element property in a compared project version has been modified, a modification change occurs.
If the IsAbstract property value of a class in the base had the default value false and the same
property value in a compared project version has been changed to true, a modification change
occurs.
If an element owner has been changed in a compared project version, a movement change occurs.
Another case of the movement change is when an attribute or an operation that has been
owned by class A in the base, becomes the attribute or an operation of class B in a compared
project version.
Order change
If the order of elements has been changed in a compared project version, an order change occurs.
Order changes can occur on elements such as attributes, operations, and other ordered elements. Even
if a single element in a collection has changed its place, the order change is applied to the entire
collection.
Since an element can have several ordered collections, several order changes can occur on a single
element.
Let's say class A has attributes a, b, and c in the base. The attribute c has been moved up and
placed above attribute a in a compared project version. This means that the order of attribute
collection in class A has changed in the compared project version. This is a case of the order
change.
Order changes can be skipped while comparing projects. For this you need to specify names of
properties wherein order changes should not be detected.
1. From the Options menu select Environment. The Environment Options dialog opens.
2. Find the Do Not Detect Order Changes for option under the Merge and Compare category
in the General options group.
3. In the option value cell, specify names of properties wherein order changes should not be
detected while merging.
Dependent change
In some cases, changes depend on other changes and are called dependent changes.
For better understanding of the concept of dependent changes, study the following examples.
Let's suppose there is an attribute type change in a compared project version. An old type has
been deleted and a new type has been added to the compared project version. In this case,
three changes occur:
• deletion change (for the old type)
• addition change (for the new type)
• modification change (for the property type)
The modification change depends on the addition change, and the deletion change depends on
the modification change.
3. From the Base box, select a project you want to compare your open project to. The following
options are available:
• Local project. Click and select a project from your file system you want to compare
the current project to.
• Server project (a Teamwork Server project or Teamwork Cloud server project). Click
From the Open Server Project dialog, select a project and its version, trunk or branch you
You can also specify the Optimize for option in the Environment Options dialog.
Find the option under the Merge and Compare category in the General options
group.
5. Click Compare.
To start comparing projects from the Collaborate menu
To compare project versions in the Teamwork Cloud environment, you are required to
have a Read Resources permission259 for every used project in compared versions.
259 https://docs.nomagic.com/display/TWCloud190/Permissions
• Getting comparison summary information and changes legend (see page 1251)
• Understanding content of the Differences tree (see page 1251)
• Inspecting element property changes in the differences Specification panel (see page 1061)
• Inspecting differences in the Change details panel (see page 1256)
• Displaying and navigating through differences (see page 1256)
• Viewing and analyzing differences of modified diagrams (see page 1258) (see page 1258) (see page
1258)
• Generating a project comparison differences report (see page 1260)
For the addition change description, refer to Addition change (see page 0).
For the deletion change description, refer to Deletion change (see page 0).
For the modification change description, refer to Modification change (see page 0).
To see what properties have been modified, click the element and see changes in the Specification
panel.
For more information about using the Specification panel, see Inspecting differences in the Change
details panel (see page 1256).
For the movement change description, refer to Movement change (see page 0).
The following figure illustrates a movement change, when element X has been moved from package A
to package B.
You can navigate from the element's original location to the new one (and vice versa) using the
commands on the element shortcut menu.
For the order change description, refer to Order change (see page 0).
Elements with order changes are highlighted in the same blue background that is used to highlight
modification changes, since order changes are some kind of modification changes.
As you can see in the following figure, the first column of the panel contains a list of element property
names, and other columns display their value changes that have been detected in both base and
compared projects.
• In the Properties column, right-click the name of a property, which references other elements.
Then on its shortcut menu, point to Select in Differences tree and choose an element to which
you want to navigate.
• In the Base or Compared column, right-click the value of a property, which references other
elements. Then on its shortcut menu choose an element to which you want to navigate.
You can see exact changes between textual values of element properties, such as element
documentation, comments, pre- and post- conditions of a use case. Differences of compared texts can
be displayed in a single dialog, where inserted and deleted parts of the text are appropriately
highlighted. As of version 18.3, the differences between compared text written in HTML are now
represented as rich text, enabling you to see all changes in formatting as well.
• Select a property with a modified text on the Specification panel and then click on the
toolbar.
• Double-click the property on the Specification panel. The Compare property dialog opens.
The panel contains a tree structure that has 1 top-level branch – Changes.
In this panel, you can see dependent changes. In order to see them, expand the Dependent changes
branch under an element with dependent changes.
For the dependent changes description, refer to Dependent changes (see page 0).
The toolbar buttons for customizing the Differences tree and navigating through differences are
described in the following tables.
You can also filter the elements displayed in the Differences tree by change type. Use the Display
drop-down list to specify a change type. Be advised that filtering elements by a particular change type
displays both elements with the particular changes and elements with the particular owned element
changes.
All the diagram difference viewers are used to display the following changes:
Be advised that symbols with property value changes that actually have no effect on their
appearance are highlighted in a diagram difference viewer as well. For example, changing the
Show Stereotypes property value in the Symbol Properties dialog of a class makes the class
symbol highlighted as changed in a diagram difference viewer.
As you can see in the following figure, all these changes are marked by color coded lines and flags
allowing the quick distinguishing between different types of changes. Numbers on flags indicate the
number of changes made to that element. Clicking a flag switches to the Differences tab and selects
the flagged element in the Differences tree.
The colors of lines and flags correspond to the color system explained in the difference legend:
• Blue flags indicate the number of modification/movement changes made to the element, blue
lines represent modified/moved relations, and blue borders around symbols mark modified/
moved elements in the diagram.
• Green flags indicate the number of addition changes made to the element, green lines represent
added relations, and green borders around symbols mark added elements in the diagram.
• Red flags indicate the number of deletion changes made to the element, red lines represent
deleted relations, and red borders around symbols mark deleted elements in the diagram.
If you would like to see the diagram version from other project version without switching between tabs,
use the slider available at the bottom of the Difference Viewer. Moving the slider makes the current
diagram symbols to fade, and the symbols from another diagram version start appearing. When the
slider is set to the middle position, different symbols from both diagram.
You can manage the content of a diagram difference viewer using the toolbar that is located above it.
2. Choose the preferred template – Full Report for a more detailed overview, including the entire
Differences tree with all changes, or Diagrams Report.
3. The Save Report dialog opens. Specify the location in your file system for your report to be
stored, type the file name and click Save.
If you need to slightly modify the report, for example, to show less data or add your company's
information, you can edit the generated Microsoft Word document as per your needs.
However, if you require more control over what's represented in reports, you can customize report
templates and generate differences reports of any desired depth and scope.
You can read more about creating and modifying report templates in the Report Wizard Template
Creation Tutorial260.
2.9.7 Validation
Contents
On this page
Purpose
Validation checks the accuracy, completeness, and correctness of a model, marks invalid elements in
the model, and suggests solutions.
Validation suites
Models are validated against a set of validation rules. Each validation rule captures an imperative
condition that must be checked against the model. Validation rules are grouped into meaningful groups
called validation suites. There are predefined validation suites that you can customize. You can also
create your own rules and group them into suites. Some validation rules are active; that is, they run all
the time. Validation rules and suites can be exported into a separate project in order to reuse them.
They are stored in the Teamwork Server or Teamwork Cloud server for exchange.
• Learn more about predefined validation suites >> (see page 1263)
• Learn more about SysML validation suites >>261
• Learn more about active validation suites >> (see page 1265)
• Learn more about SysML active validation suites >>262
• Learn more about Requirements validation suites >>263
• Learn how to create new validation suites >> (see page 1278)
• Learn how to create new validation rule >> (see page 1283)
• Learn more about global validation rules >> (see page 1294)
260 http://www.nomagic.com/files/manuals/MagicDraw%20ReportWizard%20Template%20Creation%20Tutorial.pdf
261 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+validation+suites
262 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+active+validation+suites
263 https://docs.nomagic.com/display/CRMP190SP2/Requirements+validation+suites
• In the Model Browser (see page 29) an invalid element is marked with a small symbol that depends
on the failure severity.
• In the validation results marker bar (see page 1270) every marker of an invalid symbol is colored
according to the violation severity.
Related pages
Contents
On this page
Introduction
You can validate your model against a set of constraints called validation suites. You must perform the
validation manually to check your model against the predefined validation suites. The predefined
validation suites have the «validationSuite» stereotype applied.
Each Profile contains its own validation suites. You can create your own validation suites (see
page 1278).
The following predefined validation suites appear in the Validation dialog (see page 1276) or Validation
Suites dialog (see page 1280):
• Composition Integrity contains validation rules that check the structure of the project, such as
recovered elements, references, versions of project usages, etc.
You can find predefined validation suites in the Containment tree (see page 32) when the Show
Auxiliary Resources option is enabled, expand the UML Standard Profile Package> Validation
Profile Package.
To show the auxiliary resources
• In the Model Browser (see page 1263), click and enable the Show Auxiliary
Resources option.
Contents
On this page
264 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+validation+suites
265 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+active+validation+suites
266 https://docs.nomagic.com/display/CRMP190SP2/Requirements+validation+suites
Introduction
Active validation suites enable you to immediately see if a model is correct and complete, instantly
displaying any errors in the model and suggesting appropriate solutions. The active validation suites
have the «activeValidationSuite» stereotype applied.
Each profile contains its own active validation suites. You can create your own validation suites
(see page 1278).
You can see the following active validation suites in the Validation dialog (see page 1276) or Validation
Suites dialog (see page 1280):
You can find active validation suites in the Containment tree (see page 32) when the Show
Auxiliary Resources option is enabled. Expand the UML Standard Profile Package > Validation
Profile Package > Active Validation package.
To show the auxiliary resources
• In the Model Browser (see page 1265), click and enable the Show Auxiliary
Resources option.
Info
You can check these rules under the Auxiliary Resources > UML Standard
Profile > Validation Profile > Composition Integrity.
To show the auxiliary resources
• In the Model Browser (see page 1265), click and enable the Show
Auxiliary Resources option.
3. Click OK.
Selected validation suites are active for all projects, not just the current project.
267 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+validation+suites#SysMLvalidationsuites-
startStartingthevalidation
Related pages
• The entire model, or its part (e.g. several packages). (see page 1269)
• Diagram, table, matrix, or relation map (see page 1270)
• Elements (see page 1270)
1. Open the Validation dialog. How to open the Validation dialog >> (see page 1276)
2. Specify the following options:
- Validation Suite.
- Validate For.
- Minimal Severity.
Learn more about each of the option >> (see page 1276)
268 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+validation+suites
269 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+active+validation+suites
270 https://docs.nomagic.com/display/CRMP190SP2/Requirements+validation+suites
• On the toolbar of diagram, table, matrix, or map, click the Validate Diagram button .
• Right-click the diagram, table, matrix, or map in the Containment tree (see page 32), select
Validation > Validate Diagram.
The markers are shown even for the items that are not currently visible on the screen (you may need to
scroll down to see them). The marker bar shrinks to fit the screen and displays relative positions of
annotated symbols on the axis of ordinates. Every marker is colored according to the violation severity.
Clicking a marker on the bar selects the appropriate symbol on the diagram pane. Moving the mouse
over the marker eye (the red square at the top-right corner of the diagram pane) opens the summary of
the diagram validation results.
Contents
On this page
Introduction
The Validation Results panel and Active Validation Results panel display the results of the validation:
invalid element, severity, explanation of the validation rule and its abbreviation.The Active Validation
Results panel shows the results of active validation suites (see page 1265), while the Validation Results
panel shows predefined validation suites (see page 1263).
Since the active validation suites always check your model's correctness, you must open the Active
Validation Results panel to see the results of active validation.
• On the status bar (see page 24), click the failure indicator (e.g. ).
If you cannot see the failure indicator on the status bar, your model is correct according
to active validation suites.
The Validation Results panel areas: toolbar, validation results, and summary of severity areas.
Toolbar
The toolbar allows you to manage the validation results. All buttons are described in the following table.
Expand All Click to expand recursively all the elements in the validation results
area.
Collapse All Click to collapse recursively all the elements in the validation results
area.
Navigate to Validated Click the button to select the element in the Containment tree (see
Object (Alt+B) page 32).
Click the arrow next to the button to open the menu of the following
navigation commands:
Click the arrow next to the button to open the menu of the following
commands:
271 https://docs.nomagic.com/display/TWS190SP2/Teamwork+Server+Documentation
Display the full path of Click to show the full path of all elements in the validation results
the elements area.
Run validation with Click to run the validation with current settings.
current settings
Run validation with new Click to open the Validation dialog (see page 1276) and run the
settings validation with new settings.
Export Click to export the list of validation results either to .html or .csv file.
• Right-click the element in the validation results area and select one of the following commands
from the shortcut menu:
• Solver name
• Ignore
• Navigate to Validated Object
• Open Specification
• Go To
• Select Rule in The Containment Tree
All those commands are described in the table above (see page 1273).
• Click the header of the column you want to sort the validation results. A small arrow appears on
the column header:
• - ascending sorting.
• - descending sorting.
1. Point to the header of a column whose value you want to select for filtering the validation results.
2. Click at the right of the column header and select a value from the drop-down list.
Validation dialog
Contents
On this page
Introduction
The Validation dialog allows you to limit the scope of the constraints to validate against your model.
Since the active validation suites (see page 1265) check your model all the time, the validation according
predefined validation suites (see page 1263)must be started by using this dialog. If you select the All
Validation Suite as the Validation Suite in the Validation dialog, your model is validated against all
predefined (see page 1263) and active validation suites (see page 1265) at the same time. To limit the scope of
the constraints to be validated against, select a more specific validation suite, such as Numbering
Validation. The model or its part will be validated against the selected validation suite only. The
Validation Results panel (see page 1271) shows the results, listing all elements that do not conform to
some constraints (invalid elements) in the selected validation suite.
.
2. In the Validation dialog, specify the options. Descriptions of options >> (see page 1277)
3. Click Validate.
The model or its part is validated against the selected validation suite. The results are shown in
the Validation Results panel (see page 1271).
You can run the validation for the entire diagram, table, matrix, relation map, or elements.
Learn how to start the validation >> (see page 1269)
• The Validation Suite drop-down list (#1 in the image above) allows you to select a validation
suite that you want to validate the model or its part against.
The list of available validation suites depends on the open project; the validation suites
and validation rules are stored in the model as regular model elements.
• The Validate For drop-down list (#2 in the image above) allows you to choose:
• Whole Project to run validation on the entire model.
Validation is always recursive. If you select a package for validation, you do not
need to select its inner elements.
• The Minimal Severity drop-down list (#3 in the image above) allows you to select the minimal
severity level: debug, info, warning, error, fatal. Debug is the lowest possible severity level.
• Clear the Exclude elements from projects used in read-only mode check box (#4 in the image
above) if you want to run validation on the elements stored in the the read-only project usages.
• The Validation Suites button (#5 in the image above) opens the Validation Suites dialog (see
page 1280).
Custom validation
You can extend existing validation suites that come with Profile (see page 788)by customizing existing
suites or creating your own validation suites and rules.
• «validationSuite» is dedicated for inactive validation rules. Learn more about predefined
validation suites >> (see page 1263)
• «activeValidationSuite» is dedicated for active validation rules. Learn more about active validation
suites >> (see page 1265)
You can:
Sharing
You can share validation suites by exporting validation suites Package (see page 235) and then use
it in another project. (see page 242)
1. Open the Validation Suites dialog. How to open the Validation Suites dialog >> (see page 1281)
2. Do the one of the following:
- In the toolbar (see page 1280), click and select Validation Suite or Active Validation Suite
command.
- Right-click the Validation Suites area (see page 1280) and select Create Validation Suite or Create
Active Validation Suite command.
3. In the Select Owner dialog, choose the owner for the new validation suite Package, and click OK.
4. In the Rename dialog, type the name of the new validation suite Package, and click OK.
An empty validation suite Package is created and is located in your model. You can include
validation rules from other validation suites. How to include validation rules >> (see page 1279)
Alternative
An alternative way is to create a new or select existing Package element and apply one of
the following stereotypes:
- «validationSuite»
- «activeValidationSuite»
How to apply a stereotype >> (see page 828)
1. Open the Validation Suites dialog. How to open the Validation Suites dialog >> (see page 1281)
2. In the Validation Suites area (see page 1280), select the validation suite Package you want to modify.
3. Do the one of the following:
- In the toolbar (see page 1280), click .
- Right-click it and select Clone Validation Suite command.
4. In the Select Owner dialog, choose the owner for the cloned validation suite Package, and click
OK.
5. In the Rename dialog, type the name of the cloned validation suite Package, and click OK.
The clone of the existing validation suite Package is created and contains the same validation
rules as the original. You can include or exclude validation rules from the cloned validation suites
Package. How to include/exclude validation rules >> (see page 1279)
1. Open the Validation Suites dialog. How to open the Validation Suites dialog >> (see page 1281)
2. In the Validation Suites area (see page 1280), select the newly created or cloned validation suite
Package.
You cannot include/exclude the validation rules to/from read-only validation suites.
3. In the Validation Rules area (see page 1280), select/clear the check boxes for the entire Package or
an appropriate validation rule to include/exclude validation rules to/from the new validation
suites Package.
The validation suites Package contains only selected validation rules.
On this page
• Do either:
- From the main menu, select Analyze > Validation > Validation Suites.
- Open the Validation dialog (see page 1277) and click the Validation Suites button.
Description of Validation Suites dialog areas
The Validation Suites dialog consists of the following areas:
Toolbar
The toolbar allows you to manage the validation suites. All buttons are described in the following table.
Create New Click to create a new validation suite. This button contains the following
Validation Suite commands:
Clone Validation Click to clone an already existing validation suite with its validation rules. It is
Suite stored in your model as a Package with «validationSuite» stereotype applied.
Rename (F2) Click to rename the package of new or cloned validation suites.
Remove Click to delete the new or cloned validation suites from the model.
All those commands are described in the table above (see page 1281).
Validation Rules area
The Validation Rules area contains:
• Constraints Tree displaying the structure of the validation suite Packages with their validation
rules. It allows you to include/exclude validation rules to/from a newly created or cloned
validation suite Package. For this select/clear the check box before the entire Package or an
appropriate validation rule.
You cannot include/exclude the validation rules to/from read-only validation suites.
• Buttons:
Edit Click to open the Specification window (see page 882) of the selected element in the
Constraint Tree.
Load Click to load the used project (see page 242) with its validation rules.
Contents
You can create your own validation rules in the model and use them to check your model or keep them
only for documentation purpose. You can locate new validation rules anywhere in your model, but
usually they are created for the classifier, stereotype, or metaclass.
Related pages
There are three types of Constraints (see page 657) that can be evaluated:
• Classifier level Constraints. Constraints placed on the classes, datatypes and other classifiers
(see page 427)of the model are evaluated on all the instances of these classifiers (i.e. those Instance
Specifications (see page 704) that have the particular classifier set as their type). Constraints defined
on some particular classifiers are evaluated on the instances of these particular classifiers when
validating. Inheritance is taken into account; instances of the subclasses of the class are also
validated.
• Constraints on Metaclasses. When a Constraint is placed on a metaclass (see page 748) (one of the
classes in the UML Standard Profile > UML2 Metamodel), this Constraint is evaluated on all the
model elements of that kind (e.g. if the Constraint is placed on the Actor metaclass, then this
Constraint applies to all actor elements in the model). The following is an example of a rule
(specified in OCL2.0) mandating that all actor names in the model must be capitalized. These
Constraints are useful for specifying generic rules that must apply on all the model elements of a
particular kind.
• Constraints on Stereotypes. When a Constraint is placed on some Stereotypes (see page 827) of
the Profile (see page 788), that Constraint applies to all the model elements that have these
Stereotypes applied to them. These Constraints are useful when creating domain specific
profiles. When adapting UML to some specific modeling domain, a Profile is usually created with
extensions for that domain - Stereotypes, tags etc. The Constraints on these Stereotypes allow
enforcing the rules of that domain.
Recommendation
It is strongly recommend not to mix the Constraints from different metalevels into one
validation suite. Learn more how to create validation suite >> (see page 1278)
• Classifier (see page 427), which is constrained – classes, datatypes, etc. (for classifier level
Constraints). How to create a validation rule for a classifier >> (see page 1285)
272 https://docs.nomagic.com/download/attachments/42586363/model%20validation.mdzip?
api=v2&modificationDate=1513353053644&version=1
1. Open the Specification window of a classifier or Stereotype. How to open the Specification
window >> (see page 882)
2. On the left side of the window, select the Constraints property group.
3. On the right side of the window, click the Create button and select Constraint.
4. Type its name.
The new Constraint is created in the model.
If you create a new Constraint for a metaclass, you must specify the Constrained
Element property in the Constraint Specification window. How to specify Constrainted
Element property >> (see page 1285)
1. Open the Constraint Specification window. How to open the Specification window >> (see page 882)
2. Find the Constrained Element property and select it's value box.
3. Click and select an appropriate element from the Select Elements dialog.
For constraints on metaclasses, select an appropriate element from the UML Standard
Profile > UML2 Metamodel. Only the single Constrained Element property value is
supported for validation rules.
4. Click OK.
The Constrained Element property value is specified.
• «invariant» stereotype. It separates Constraint from the other types of Constraints. (see page 657)
• «validationRule» stereotype. It is derived from «invariant » stereotype. It expands the Constraint
properties with the ability to specify the following information: severity level (for sorting/filtering),
abbreviation string (a short string, for easy recognition) and error message (complete description
of error explanation). How to specify the validation rules properties >> (see page 1286)
• In the corresponding element's Specification window (see page 1286), click the Applied Stereotype
property specification cell, then click , and select stereotypes from the open list. After you have
selected, click Apply.
• In the element's shortcut menu, select Stereotype and select a stereotype that you wish to
apply. Click Apply when you are done.
• On the diagram pane, select an element and in that element's name area, type the stereotype
name between brackets « ». The element's name comes after the stereotype.
If you want to name the element Books and assign it the «table» stereotype, in the
element's name area type the following: «table» Books. The name completion for the
stereotypes works in the name editing mode, press Ctrl+Spacebar or Ctrl+Backspace to
get a list of available stereotypes.
You can change the order of the stereotypes applied to the element. The symbol style of the first
stereotype in the list will be applied to the element.
1. Open the Constraint Specification window. How to open the Specification window >> (see page 882)
2. On the right side of the window, find the Validation Rule group.
3. Specify the following properties:
• Abbreviation. Select the Abbreviation property value box, click and type a
short word, phase, acronym of the validation rule. It allows you to distinguish the
validation rules among other rules when sorting or filtering.
• Error Message. Select the Error Message property value box, click and type the
description of the invalid situation when this validation rule fails.
You can insert a hyperlink. Learn more about defining hyperlinks >> (see page 970)
• Severity. Select the Severity property value and from the drop-down list select one of the
following severity levels:
• debug - for missing information of a constrained element that is dedicated for the
developer.
• info - for missing information of a constrained element that is dedicated mostly for
the end-user.
• warning - for incorrect situations that can cause errors. It is used for less severe
situations than the error.
• error - for incorrect situations that must be solved.
• fatal - for critical errors such as model corruption or model is invalid according to
the UML metamodel. This severity level is mostly reserved for future use.
The icons on invalid elements in the model depend on the selected severity
level described above. Learn more about invalid elements representation >>
(see page 1262)
You can customize severity levels. How to customize severity levels >> (see
page 1287)
4. Click Close.
The validation rule properties are specified.
Customizing severity levels
You can customize the default severity levels (such as debug, info, warning, error, fatal) by creating
new and and additional levels. For this you must edit the SeverityKind Enumeration (see page 666)element,
located in the UML Standard Profile.
The custom severity level named critical in the drop-down list of the Severity property in the validation
rule specification.
1. Open a project.
2. In the Containment tree (see page 32), click and enable to show the Show Auxiliary
Resources in the Model Browser (see page 29).
3. Right-click the UML Standard Profile Package.
You can create new or modify default severity levels only if the UML Standard Profile is editable.
To see how to edit the profile read the procedure above (see page 1288).
Each Enumeration Literal created for the Enumeration element corresponds to available severity levels.
1. In the Containment tree (see page 32), click + to expand the UML Standard Profile Package >
Validation Profile Package.
2. Double-click the SeverityKind Enumeration element to open its Specification window (see page 882).
3. On the left side of the Specification window, select the Enumeration Literals property group (see
page 882).
4. On the right side of the Specification window, select severity level from the list:
- Click to open Specification window (see page 882).
- Click the Up/Down button to move the severity level up/down in the list.
1. In the Containment tree (see page 32), click + to expand the UML Standard Profile Package >
Validation Profile Package.
2. Double-click the SeverityKind Enumeration element to open its Specification window (see page 882).
3. On the left side of the Specification window, select the Enumeration Literals property group (see
page 882).
4. On the right side of the Specification window, click the Create button. The Specification window
of the newly created Enumeration Literal opens.
5. In the Name property, type the name of the new severity level (e.g. critical).
6. Click Close.
The new severity level is created and can be modified by using buttons (see page 1289).
1. In the Containment tree (see page 32), right-click the Validation Profile Package, and select Create
Element > Stereotype.
2. Type its name (e.g. criticalIcon) and press Enter.
3. Double-click newly created Stereotype.
4. In the Specification window (see page 882) of Stereotype specify the following properties:
- Select the Icon property value, click to select an image from the Image Library (see page 56), or
to select an image from your file system.
5. Click Close.
The new stereotype with a new icon is created and ready to be applied to a severity level. How to
apply it >> (see page 1291)
Applying new icon for severity level
After you define the new icon for severity level, you can apply it to custom or default severity levels
(Enumeration Literals). This icon is shown when representing invalid elements (see page 1261) of your
model.
1. In the Containment tree (see page 32), click + to expand the UML Standard Profile Package >
Validation Profile Package > SeverityKind Enumeration element.
2. Double-click the severity level (Enumeration Literals element) to which you want to apply a new
icon.
3. In its Specification window (see page 882), select the Applied Stereotype property value.
4. Click and select the newly created stereotype (e.g. criticalIcon) dedicated for this severity
level.
5. Select Apply.
6. Click Close.
The new icon for the severity level is applied. In the figure below, the criticalIcon stereotype is
1. Open the Constraint Specification window. How to open the Specification window >> (see page 882)
2. Find the Specification property and select its value box.
3. Click
.The Specification dialog opens.
F
rom the Language list
,
select one of the following languag
4. es:
OCL (see page 1104) 2.0 is used for validation rules, specified in OCL language. Learn how to
• create OCL2.0 validation rule in Developer Guide >> (see page 2240)
Constraint types
Since the Constraint is stereotyped by «validationRule» which is derived from
«invariant » stereotype, inv is shown in the header.
Only inv constraints can be evaluated.
Other types of Constraints
are not evaluated, but
can be modeled for documentation purposes:
• def – for the expression of the constraint with «definition» stereotype
applied.
• init, derive - for the expression of the default value of the property.
• pre, post, body - for the expression of the appropriate fields of operation.
OCL Performance
When evaluating the validation rule defined in OCL language, the validation on the
first run can have a delay of 20-30 seconds (depending on the computer
performance) while the Java compiler is loading. Subsequent validations will run
faster than the first one.
If the validation process is run heavily on medium-large projects, increasing the
default Java VM size is advisable. By default, the VM size is set to 400MB in
MagicDraw; increasing this to 600 (or 800 if the computer has sufficient RAM)
might improve the performance.
• Binary
is used for more advanced expressions not easily expressed in OCL.These expressions are
written in Java, compiled, and specified in the MagicDraw classpath. These expressions can
MagicDraw can evaluate only those validation rules whose expression is defined in one
of the languages listed above. The other languages can be used only for documentation
purposes.
You can add hyperlinks in the Body box. How to define hyperlinks >> (see page 970)
You can define expressions for global validation rules. Learn more about global
validation rules >> (see page 1294)
(optional) Click the Evaluation Mode button to to execute an expression on the actual testing
6. model while editing. How to use the Evaluation Mode >> (see page 1230)
7. Click OK.
The Constraint condition is defined.
273 https://docs.nomagic.com/download/attachments/42586363/model%20validation.mdzip?
api=v2&modificationDate=1513353053644&version=1
Pre-commit validation
Contents
On this page
Validate Only Locally True or False When set to true, pre-commit validation will only run on the
Changed Elements elements that are locally modified or added by the user.
Exclude Elements from True or False When set to true, it will exclude projects that are used in read-
Used Read-Only Project only mode and elements that exist in these projects.
Validation Suites Validation Specify a validation suites list that must be run before
suites committing changes to a server.
Excluded scope Excluded scope Specify the validation scope to be excluded from the rules that
belong to pre-commit validation suites. Elements in the selected
scope will not be validated before committing changes to a
server.
Minimal Severity That • None Specify the minimal severity violation severity threshold that
Prohibits Commit • prohibits commit. Pre-commit validation will be performed
- debug. before executing commit to a server. It will validate the model
and check if there are validation results with reached or
• - info.
exceeded selected severity levels. Commit will be prohibited until
• - these violations are fixed.
warning.
• - error.
• - fatal.
Minimal Severity That • None Specify the minimal severity threshold that produces a warning.
Produces Warning • Pre-commit validation will be performed before executing
- debug. commit to a server. It will validate the model and check if there
are validation results with reached or exceeded selected severity
• - info.
level. If these violations are found, a warning dialog will appear,
• - allowing you either to review warnings or to execute project
warning. commit.
• - error.
• - fatal.
• If there is an error, you are not allowed to choose. You will get a list of the validation results.
Toolbar
The toolbar allows you to manage the validation results. All buttons are described in the following table
Display Click to show the full path of all elements in the validation
the full results area.
path of
the
elements
Validatio Click to open the Project Options dialog with the Validation
n Options node open.
274 https://docs.nomagic.com/display/TWS190SP2/Teamwork+Server+Documentation
Contents
This functionality is available in Standard, Professional, Architect, and Enterprise editions only.
The Model Visualizer helps to create elements from existing data and analyze the
relationships between elements created in a UML model. It is also possible to analyze the inheritance
and dependency relationships between classes.
All model visualizing and analyzing tools are presented as Wizards, with several steps that should be
followed in order to accomplish the desired results.
• Add – add selected model elements from the All list to the Selected list.
• Add All – add all elements located in the same hierarchy level as the selected element to the
Selected list.
• Add Recursively – add all elements in the selected packages and all elements from nested
packages to the Selected list.
• Remove – remove the selected element from the Selected list.
• Remove All – remove all selected elements.
• Back – return to the previous dialog.
• Next – proceed to the next step.
• Finish – finish the configuration. All other options will be set by default. The Wizard exits and
results are displayed.
• Cancel – cancel the wizard.
• Reset To Defaults – if changes were made to the element properties, values will be set to
default.
Related pages
Contents
This functionality is available in Standard, Professional, Architect, and Enterprise editions only.
The Class Diagram Wizard helps you create a class diagram275 when all classes and their relationships
are already created and specified. You can select which classes, packages, and relationships will be
included in a new class diagram276, as well as the details of the class representation to be configured
(attributes, operations, accessibility). The Class Diagram Wizard then guides you through several steps
and collects information along the way. It will automatically create a class diagram277 with your selected
elements, freeing you from creating the class diagram278 manually.
• Class diagram280
Contents
This functionality is available in Standard, Professional, Architect, and Enterprise editions only.
275 https://docs.nomagic.com/display/MD190/Class+diagram
276 https://docs.nomagic.com/display/MD190/Class+diagram
277 https://docs.nomagic.com/display/MD190/Class+diagram
278 https://docs.nomagic.com/display/MD190/Class+diagram
279 https://docs.nomagic.com/display/MD190/Class+diagram
280 https://docs.nomagic.com/display/MD190/Class+diagram
If a package owns one or more elements used by or dependent on other package elements, the
Package Dependency Diagram Wizard analyzes dependencies and creates «virtual» relations
between the dependent packages, as shown in the following example.
The Virtual dependencies package containing dependency links is created after finishing the wizard. If
more than one dependency exists between elements in the packages selected to analyze, the number
of dependencies is assigned to the tagged value number {n=... } on the virtual dependency.
281 https://docs.nomagic.com/display/MD190/Package+diagram
282 https://docs.nomagic.com/display/MD190/Package+diagram
Contents
In the Package diagram283, the virtual dependencies (dependency links) are created. All virtual
dependencies are stored in the Virtual dependencies package, which you can find in the model
browser.
You can use the Show Dependency Details command to see the dependencies of a particular package.
Dependency results are displayed in the dependency details panel (see the following example).
1. In the Model Browser or on the diagram pane, right-click the dependency with the details you
want to display.
2. In the shortcut menu, select Related Elements > Show Dependency Details. The dependency
details panel opens.
Related pages
Contents
This functionality is available in Standard, Professional, Architect, and Enterprise editions only.
The Package Overview Diagram Wizard allows you to create a diagram for every package from the
selected scope (reversed packages). The created diagram displays the content of the packages – inner
packages with inner elements connected with available relations.
283 https://docs.nomagic.com/display/MD190/Package+diagram
Related pages
This functionality is available in Standard, Professional, Architect, and Enterprise editions only.
The Hierarchy Diagram Wizard collects the largest hierarchies and allows each of them to be
displayed either as separate diagrams or all in one diagram.
This functionality is available in Standard, Professional, Architect, and Enterprise editions only.
The Realization Diagram Wizard shows a table of the largest element groups that realize an interface.
• The Add all implementations into one diagram check box creates only one diagram for all
selected realizations. This option is available only if the selected realizations can be added into
one diagram (the same diagram type).
• The Show outside specializations check box shows realizations when derived interfaces are in
the scope, but specializations are outside the scope.
This functionality is available in Standard, Professional, Architect, and Enterprise editions only.
The Activity Decomposition Hierarchy Wizard allows you to convert an activity into a class and SysML
Block Definition Diagram. This provides the ability to represent, analyze, and document activity
hierarchies in the structure diagrams.
• Behaviors will be connected with contained object node types by compositions. The name of the
object node that corresponds to the composition will be used as the end name of the association
on the end towards the object node type.
• Pins are not included in the calculation.
• CallBehaviorActions that are not directly in the Activity, but are in the Structured Activity Nodes
contained by the Activity, for example, are also included in the calculation.
• An activity will be connected by composition association with other behaviors that are called by
CallBehaviorActions. The part end name must be the same as the name of a CallBehaviorAction
in the composing activity. If the action has no name, then the end name is as same as that of the
invoked activity.
• Hierarchical layout - Top to Bottom is used to arrange the generated diagram.
• If CallBehaviorAction calls the same activity, the composition to self will be displayed on the
generated diagram.
Recursive structure analysis will be stopped after reaching a behavior that has already been
analyzed. This requirement prevents an endless cycle.
• In such a case, the composition will be created in a previously analyzed activity in the
diagram. The new behavior symbol will not be created.
• There will be as many compositions from one activity into another as different
CallBehaviorActions call this activity.
To create a diagram using the Activity Decomposition Hierarchy Wizard
• The Add contained Object Nodes check box is selected by default. Types of object nodes are
displayed and connected to the composition with activities containing object nodes.
• The Search recursively check box is selected by default. The search will be conducted in the
selected activity and those activities invoked by CallBehaviorActions that are in the selected
activity. This search is recursive. If not selected, the search will be conducted in only one level of
the selected activity.
Contents
Contents
Editions
This functionality is available in Standard, Professional, Architect, and Enterprise editions only.
A Generic Table (see page 406) allows you to display a list of selected elements and their properties in a
single place.
The Generic Table Wizard helps you create a table when model elements and their relationships are
already created and specified. You can select which elements (e.g., classes, packages, use cases, and
relationships) will be included in a new table. You can also select properties of the selected element
types, which will be displayed as columns in the table.
The Generic Table Wizard guides you through several steps and collects information along the way. It
will automatically create a table with your selected elements, freeing you from creating the table
manually.
Contents
You can also create a model corresponding to your Java code structure manually.
Ensure the model you use to create a sequence diagram fully corresponds the Java source code
you want to represent in the diagram.
One sequence diagram (see page 291) can represent one method in a Java code. Classes are represented
as lifelines, and method calls are represented as messages in the diagram. The sequence diagram (see
page 291) can also be used to visualize dependencies for all classes used in this method.
To create a sequence diagram using the Sequence Diagram from Java Source Wizard
• Analyze and split long expressions in the diagram: Select to display every call as a separate
call message with a temporary variable initialization, if the expression containing calls cannot be
displayed as a call message. In the final expression message, these calls are replaced
with appropriate temporary variable names.
• Create reply message: Select to display the return message for every call message.
• Wrap message text: Select to wrap message text in the diagram. In the Maximum
wrapped messages name length (in pixels) box, specify the maximum message text length in
pixels.
Related Pages:
Contents
Creating a sequence diagram284 from a Java code allows you to analyze dependencies between the
methods represented on the diagram and the classes they are referencing to and/or the other methods
they call for. This means you can create a sequence diagram285 for any method selected in the existing
sequence diagram286.
1. Select the method (call message with an operation assigned) whose details you want to see.
2. Right-click the message and, from the shortcut menu, select Reverse Implementation.
The Sequence Diagram from Java Source Wizard opens to create a sequence diagram for
the selected method.
If you have started the wizard via the operation assigned to the message, be aware that
in this case the first step of the wizard will be skipped, and the wizard will start from Step
#2.
Related pages
284 https://docs.nomagic.com/display/MD190/Sequence+diagram
285 https://docs.nomagic.com/display/MD190/Sequence+diagram
286 https://docs.nomagic.com/display/MD190/Sequence+diagram
Before you start tracking changes using the Suspect Link analysis, make sure your model (or its
particular elements) are locked (see page 1345).
1. In the main toolbar, go to Analyze > Suspect Links and select Enable Tracking.
2. In the Enable Tracking message dialog
• choose to track Entire Model, or
• click Specific Scope to choose packages, where the requirements and design elements
you want to track are.
3. Click OK.
If you're working on a Teamwork Server or TWCloud project, commit it for the changes to
apply.
To change scope
If you're working on a Teamwork Server or TWCloud project, commit it for the changes to
apply.
2. To see changes in a requirement, right-click the validated cell and select Show Changes*.
• In the main toolbar, go to Analyze > Suspect Links and select Options. If the check box next to
the Track Deprecated Elements property group is checked and set to true, tracking deprecated
elements is enabled.
1. In the main toolbar, go to Analyze > Suspect Links and select Options.
2. Click the right column next to the Track Unlinked Requirements property group and choose:
a) All – if you want to track all the unlinked requirements
b) Excluding Owning – if you want to track only those unlinked requirements, that have no sub-
requirements
c) None – if you want to disable tracking unlinked requirements.
3. Click OK.
• Teamwork Cloud (see page 1320) (formerly known as Cameo Enterprise Data Warehouse)
• MagicDraw Teamwork Server (see page 1409)
Projects stored in the server repository can be accessed through the network from multiple clients who
have MagicDraw or any Cameo Suite product installed. Different users, depending on their role in a
team or enterprise, can have different permissions to the projects.
The same model or even the same diagram can be accessed and modified in parallel. Every user may
instantly obtain the newest version of the model as well as commit his/her own changes.
Concept Description
Server project usage Another server project used in the project you
are working with. It can be a library, profile or
regular project.
Creating users and deciding the access rights of the users against projects is an
administrative task. For more information, see Teamwork Cloud User Guide287.
287 https://docs.nomagic.com/download/attachments/792966/
Cameo%20Enterprise%20Data%20Warehouse%20UserGuide.pdf?
api=v2&modificationDate=1438322880484&version=5
Related pages
Contents
The server Java version 1.8.0_45 will work with the client Java version 1.8.0_51.
To log in to a server
i. Click the Login tab.
ii. Type your user name and password.
• For users having a single ID and password for multiple software systems (valid only for
Teamwork Cloud Server):
3. Provide the server name (address) and select server type. If you need to specify a server port,
type <server name> : <port number>, for example 10.2.2.47:3579.
4. If you want the client application to remember your credentials and automatically log in to the
server next time upon starting the client application, select the Auto Login to Server check box.
5. If you need to connect to the server using the SSL connection, select
the Use Secured Connection (SSL) check box.
The SSL connection must be established on both the server and the client side.
6. Click OK.
7. Wait while you are connected to the server, and then you can start performing collaborative
tasks.
• From the Collaborate menu, select Logout.
Related pages
• No need to remember and type credentials each time you logging to a server.
• No issues about weak passwords and updating it.
288 https://www.teamdev.com/jxbrowser
• macOS (64-bit)
• macOS 10.9.x - 10.12.x (Intel)
For more information about supported OS, please refer to JxBrowser289 system requirements290.
Related pages
Contents
Introduction
Teamwork Cloud (TWCloud) is No Magic’s next-generation repository for collaborative development and
versioned storage of models. TWCloud is envisioned and developed to provide significant future
improvements in the areas of model governance, model analysis, and integration with third-party tools.
The first release will bring tangible benefits to enterprise users:
• Role Based Access Control is a major new feature, enabling efficient management of users’
access rights across the enterprise. Additionally, as distributed systems can be challenging to
administer, we have built a convenient web-based administrative interface to TWCloud, which
provides a single way to manage user accounts, licensing, access control, LDAP integration, and
SSL.
• TWCloud is designed from the ground up to support working with large models. In particular, the
efficient delta-based protocol used when users commit and retrieve updates to a model will save
time for those users who access the repository through poor network connections. Likewise, the
amount of data that is transmitted depends only on the size of the change being made and the
users working on the model.
289 https://www.teamdev.com/jxbrowser
290 https://jxbrowser.support.teamdev.com/support/solutions/articles/9000013733-system-requirements
291 https://docs.nomagic.com/display/TWCloud190SP2/Authentication+server
• Project Usages location: The model browser has a dedicated location for Project Usages, rather
than mounting everything under the main model element. This also means that all Used project
content will have one root in the Project.
• Shared Packages: There are no shared packages in the Project Usages; all content is available for
reference. However, the TWCloud project can be stripped using the Hiding packages (see page 1395)
feature.
• The TWCloud projects do not support Mounting. During the export of Local/Teamwork Server
projects to the TWCloud, the Mount relations are added automatically. This allows containing a
project as similar as possible to the original project.
• The model with the Used projects is always available (loaded) unless the Used projects could not
be loaded or found during export from the modeling tool (incomplete relocation of the Used
project).
• Automatic Update of Project Usages: When referencing the latest version of the Project Usage, a
message will appear notifying you of the new version of the Project Usages instead of the silent
auto-update. You may choose to update it or keep using the current version.
• Command Line Interface (CLI) for Managing Users and Permissions: This feature is currently
under development and will be added in the upcoming release.
You can find more information about the TWCloud's key benefits, required resources, and the latest
news on its official product page here http://www.nomagic.com/products/teamwork-cloud.html.
Related pages
Contents
Projects can be added to Teamwork Cloud (TWCloud) in one of the following ways:
1. From the Collaborate menu, choose Projects. The Manage Projects dialog opens.
2. In the Online Projects tab, click the New button. The New Server Project dialog opens.
5. Click OK.
You can create a new category in the server repository by typing its name directly in the
Category box.
6. If you have some explanations or notes about this project, provide them in the Comments box.
7. If the project has no used projects, or if it has some that you want to be added to the server, skip
this step. If you don't want any of the used projects to be added, do the following:
a. Click More in the Add Project to the Server dialog for more options.
b. Click the Local Projects tab. The list of used local projects opens.
c. In the Action column of each local project that don't want to add to the server, select
Leave as Local Project.
If you exclude all or some of the used projects from the addition to TWCloud (see
step #7), you can always link them to the project later.
• The contents of the Model Browser are gray (see page 1347). The model is unlocked.
• If the project is added to the used projects, you can see them in the Model Browser under the
root package and under Project Usages.
Contents
On this page
Pre-conditions
• Server, which you want to migrate from, and the server, which you want to migrate to, are
connected to the same network (recommended).
• TWCloud repository has enough space on disc to store migrated projects. We recommend to
allocate at least 100 MB per project.
Please contact your sales executive for getting a temporal licence key.
3. Start the temporary Teamwork Server with the backup repository.
4. Resave projects in this temporary Teamwork Server (see page 1425). After that, projects are ready to
migrate to the Teamwork Cloud. (This step is recommended for smoother and faster project
migration to TWCloud.)
Migration Procedure
1. Log in to the temporary Teamwork Server (see page 1316).
2. From the Collaborate menu, select Export Projects to TWCloud. The Project Export Wizard
opens.
3. Select the projects you want to migrate to TWCloud repository – in the Action column of each
project, select one of the following:
• Export Trunk, if you want export the last trunk version of that project.
• Export All Branches, if you want to export the last trunk version of that project and the
last versions of all its branches.
• Export Custom Branches, if you want to export the last versions of selected branches
and/or trunk of that project.
If you want to export all the projects in the list, select Export Trunk or Export All
Branches from the drop-down list on the toolbar above that list.
4. Click Next.
5. Type your user name and password on TWCloud, and then provide the TWCloud server address.
6. Click Finish.
7. Wait while project copies are created and exported to TWCloud. This may take 5 to 15 minutes
per project.
Only the last versions of the selected projects are exported. Project history cannot be
migrated.
292 https://docs.nomagic.com/display/TWC185/Backup+and+restore+data+procedures
The projects exported to TWCloud will have original commit details from the Teamwork Server:
• Who committed the last commit in the Teamwork Server,
• The date of the last commit in the Teamwork Server,
• The comment of the last commit in the Teamwork Server.
These details can be found in the Version Properties dialog.
Troubleshooting
Projects migration cannot be completed
This may happen because of many reasons, for example:
If the problem persists, report the issue with the log file attached to No Magic Customer Support team.
1. Open for edit the .properties file of the client application, for example, magicdraw.properties, which
can be found in <MagicDraw installation directory>\bin.
2. In the JAVA_ARGS line, replace -Xmx800M with -Xmx3700M , which stands for 3,7 GB allocated, or
greater value.
3. Restart the client application.
4. Try to export again.
User rights are insufficient to create projects in TWCloud
To export projects to TWCloud you need to have the Project Creator permission. Contact the
TWCloud Administrator to obtain the permission.
You can use the search tab to quickly filter used projects by name.
In the Manage Projects dialog, you can:
Permissions
To create, remove, or rename a branch, you need to have an Administer Project
permission293assigned.
Project branching duplicates versions of a project and enables users to work simultaneously on them.
Branching increases productivity for those, who have several development teams working on a single
product and have to merge several development branches before releasing the product.
Branches can be created from any version of a Teamwork Cloud project or its branch. The branch
version holds the information about the project version it is derived from. Every branch version can be
tagged. Two versions of the same of different project branch can be compared (see page 1246)and merged
(see page 1044)into a single one.
Projects that have usages can be branched with or without these usages. In the later case, the branch
version of the project references versions of the projects used in the project, which that branch is
derived from (it can be the latest version or some specific version selected by the user).
1. From the main menu, select Collaborate > Projects. The Manage Projects dialog opens.
2. Select a project you want to branch.
3. On the toolbar of the Manage Projects dialog, click the Select Branches button . The Select
Branch dialog opens.
4. In the open dialog, click the Edit Branches button. The Edit Branches dialog opens.
5. Select a project version you want to branch.
6. Click the Create Branch button. The Create Branch dialog opens.
293 https://docs.nomagic.com/display/TWCloud190SP2/Permissions
8. Click OK. The new branch is created, and the dialog closes.
9. The Edit Branches dialog displays the new branch of the project.
Search bar
Use the search bar to filter projects according to:
• Project Version (together with the commit tags)
• Author
• Comment
Archived branch
The branches that are not being worked with anymore and are only maintained for historical purposes
can be hidden from users eyes.
Performance and disk space are not affected because hidden branches are hidden only
graphically.
Contents
You can clone the latest version of your server project as a separate project. The project being cloned
can be used as a "template" to create a new project or as an independent base for new development.
IDs of a cloned project and elements are reset automatically. Project permissions are reset as well; the
project is available only for a user who has cloned the project. All references to used projects (if there
are any) are maintained.
To clone a project
Related pages
By default, there is a single category Uncategorized, but you can create as many categories as you need.
A project can be created directly in a selected category and later easily moved to another one. The
category can be created in advance or while adding the project to the server (see page 1322). Categories
can be renamed and removed. However, they cannot have sub-categories.
Categories can also be managed via the Teamwork Cloud Administrative Console. Learn more
about this in Teamwork Cloud User Guide294.
1. From the Collaborate menu, choose Projects. The Manage Projects dialog opens.
2. Be sure the Categorized View is turned on in the dialog. If it is not, click on the toolbar of the
dialog.
3. Choose one of the following:
1. From the Collaborate menu, choose Projects. The Manage Projects dialogs opens.
2. Select a category or a project that belongs to the category you want to rename and then do
either:
1. From the Collaborate menu, choose Projects. The Manage Projects dialogs opens.
2. Select the project you want to move and do one of the following:
3. When the Move to Category dialog opens, select the category to which you want to move the
project.
294 https://docs.nomagic.com/display/TWCloud190SP2/Teamwork+Cloud+Documentation
1. From the Collaborate menu, choose Projects. The Manage Projects dialogs opens.
2. Select the category or the project that belongs to the category you want to remove and then do
either:
• Click on the toolbar of the open dialog.
• Right-click the selection and then select Remove Category.
• Click on the toolbar of the open dialog. Click the button once more to show the empty
categories again.
Password-protected projects
You can protect your server projects with a password. The password covers all project versions, and can
be set or removed by a project owner or a user having Administer Projects permission295.
295 https://docs.nomagic.com/display/TWCloud190SP2/Permissions
Contents
Currently open project is automatically selected in the Open Server Project dialog, making it easier to
find it in the project list.
Search bar
You can use the search bar to faster filter used projects by name.
Password-protected projects
You may be prompted to enter a password if a selected project is password-protected (see page
1335).
Show When selected, shows empty categories. Cancel the selection if you do not want empty
empty categories to be displayed.
categories
In the Tags tab, the Major version checkbox was added, to easily add tag Major.
Related pages
Offline modeling
Contents
• Work with the project (read/edit) when a connection to the server is not available.
• Save intermediate changes locally (privately), and commit changes to the server when required.
• Save time by saving changes locally, which is much faster than committing directly to the server.
In an offline project, you can:
You should save the online project locally to make it an offline project.
1. From the Collaborate menu, select either Open Server Project (or press Ctrl+Shift+O), or
Projects.
2. In the open dialog, click the Offline Projects tab and select the offline project to open.
You can open the project as it is saved locally (without checking for the latest updates) or open the
project and update it automatically from the server, if a connection is available. To include updates,
right-click the selected project and select Update Project After Load for each project you want to
update when loading.
In the title bar, you can see information about a project opened from TWCloud. This
information allows you to distinguish Online from Offline projects:
If you open the Online project, the title bar will show:
• Modeling tool name and version,
• Project name,
• Project trunk or branch,
• Project version,
• Server name.
If you open the Offline project, the title bar will show:
• Project name,
• Project trunk or branch,
• Project version,
• Server name,
• Last user who saved the project,
• Available Offline.
Related pages
Contents
Teamwork Cloud server allows for contributing on huge projects, supporting multiple contractors who
are not able to work on the same Teamwork Cloud installation. This feature allows you to
import .mdzip files that have been previously exported back to the server project. Thus, you can simply
save your project locally (see page 1364) as a .mdzip file and send this file to another contractor. The
contractor is then able to update the very same server project from the local project. Once the
contractor completes project editing, he or she can send the project back to you. This life cycle may
continue between any amount of contractors. The feature works even when multiple contractors work
with separate Teamwork Cloud installations as well as local work environments. Teams can either use
Teamwork Server in addition to Teamwork Cloud, or select not to use Teamwork Server or Teamwork
Cloud at all.
Locked elements
In a server project, elements to be updated should not be locked.
Related pages
Package permissions
Contents
By default, all packages in the project can be reviewed and modified by any Teamwork Cloud user.
• The Global permission specifies which permission is applied for all project packages for all
users:
• Select Read-Write as the Global permission to restrict editing of the selected package,
leaving the rest of the model editable.
• Select Read-Only as the Global permission to restrict editing of the entire model, leaving
only the selected package editable.
For each package, the global permission can be over-specified by the package permission.
Related pages
Contents
On this page
1. Right-click the package or its shape and select Permissions. The Permissions of Package dialog
opens.
The full name of the dialog depends on the selected package name. Thus, if you select to
modify the permissions of the package domain, the Permissions of Package domain
dialog opens.
296 https://docs.nomagic.com/display/TWCloud190SP2/Permissions
297 https://docs.nomagic.com/display/TWCloud190SP2/Permissions
a. Click the Add button under the Package permissions table. The Select User/Group
dialog opens.
b. Use search bar to filter users or groups, then click to select the check box near the user or
group name.
c. Click OK and see the new row appeared in the Package permissions table.
d. Click the Permission cell and select:
e. If you don't want to apply the same permission on the subpackages of this package, click
the Apply To cell and select This package only.
Option Description
Include inheritable permissions from the parent Inheritable permissions of the package are those that apply
to its subpackages as well.
Replace all subpackages permissions with Inheritable permissions of the package are those that apply
inheritable permissions from this package to its subpackages as well.
Contents
The following table explains what you can edit after you lock a single element, single diagram, diagram
with elements, and so on.
Diagram Edit:
Symbol styles Edit properties of symbol styles (in the Project Options dialog)
Project usages • Import used projects as packages into the main project
• Stop using projects
• Change versions of used projects
There is a 60-second threshold; if locking takes longer than 60 seconds, a project update will be
required.
An example
You are trying to lock package B, which contains many elements, recursively. The
modeling tool cannot check all contained elements' status in the later versions of the
project in 60 seconds. After 60 seconds, a project update will be required to lock the
package.
The following table provides suggestions on which locking commands to use for different purposes.
1. Double-click either:
• This element in the Model
Browser.
• A symbol of this element on a
diagram pane.
2. In the Specification window, click the Lock
element for Edit button .
1. In the Lock View tab on the Model Browser, expand Project Options.
It is the last tab on the Model Browser. If the tab is closed, you can simply open it by selecting
Collaborate > View Locked Elements.
2. Right-click Symbol Styles and from the shortcut menu select Lock Symbol Styles for Edit.
1. Do either:
• Select Options > Project.
• In the Lock View tab on the Model Browser, right-click Project Options and from the
shortcut menu, select Symbol Styles.
It is the last tab on the Model Browser. If the tab is closed, you can simply open it by
selecting Collaborate > View Locked Elements.
2. In the Project Options dialog, click the Lock Symbol Styles for Edit button.
1. From the Options menu, select Project Usages. The Project Usages dialog opens.
2. Select a used project on the left side of the dialog.
3. Click the Edit button and then select Lock.
You can then import this used project as a package to the main project, stop using it, or change its
version.
Related pages
Unlocking model
Unlocking the model is useful in one of the following cases:
• After you choose to keep locks, when committing changes (see page 1357).
• If you locked the model (see page 1345), but haven't made any changes in the model.
• When you want to clean other user locks.
On this page
The following table provides suggestions on what unlocking commands to use for different purposes.
1. Double-click either:
• This element in the Containment tree
of Lock View tree on the Model
Browser.
• A symbol of this element on a diagram
pane.
2. In the Specification window, click the Unlock
element button .
At least one of the following: 1. Right-click this diagram in the Containment tree
of Lock View tree on the Model Browser.
• Diagram representation properties 2. From the shortcut menu, select Lock > Unlock
(including diagram layout) Diagram.
• Symbol properties of elements OR
represented on that diagram pane
1. Right-click a free space on this diagram pane.
2. From the shortcut menu, select Lock Diagram >
Unlock Diagram.
At least one of the following: 1. Right-click this diagram in the Containment tree
of Lock View tree on the Model Browser.
• Diagram specification properties 2. From the shortcut menu, select Lock > Unlock
• Diagram representation properties Diagram Content.
(including diagram layout) OR
• Properties of elements represented on
that diagram pane
1. Right-click a free space on this diagram pane.
• Symbol properties of elements
2. From the shortcut menu, select Lock Diagram >
represented on that diagram pane
Unlock Diagram Content.
1. In the Lock View tab on the Model Browser, expand Project Options.
It is the last tab on the Model Browser. If the tab is closed, you can simply open. For this,
select Collaborate > View Locked Elements.
2. Right-click Symbol Styles by <user name> and from the shortcut menu select Unlock > Commit.
It is the last tab on the Model Browser. If the tab is closed, you can simply open. For
this, select Collaborate > View Locked Elements.
2. In the Project Options dialog, click the Unlock button and then select Commit.
3. In the Commit Project to the Server dialog do the following:
a. If there is a need, type a comment.
b. Click to clear the Keep Locks check box.
c. Click Commit.
1. From the Options menu, select Project Usages. The Project Usages dialog opens.
2. Select a locked used project on the left side of the dialog.
3. Click the Edit button and then select Unlock > Commit. The Commit Project to the Server
dialog opens.
4. In the dialog:
a. Type a comment, if there is a need.
b. Click to clear the Keep Locks check box.
c. Click Commit.
However, the user who started the merge operation can release the lock manually as well.
1. From the File menu, select Project Properties. The Project Properties dialog opens.
2. Click the Unlock (locked by <user name>) button, for example, Unlock (locked by billybob).
The Commit Project to the Server dialog opens.
3. In the dialog:
a. Type a comment, if there is a need.
b. Click to clear the Keep Locks check box.
c. Click Commit.
Other users cannot unlock the project structure manually.
When committing changes, you can choose to release or keep the locks on the model (see page 1345). If
you are going to continue editing after the commit is over, keep the locks.
1. From the Collaborate menu, select Commit Changes To Server, or press Ctrl+K. The Commit
Project to the Server dialog opens.
2. If you need to describe the changes you are going to commit, type a comment in the open dialog.
You can select a comment from the recently used comments list. Click the Choose
Comment button above the Comment box, and select any comment from the list in
the Choose Comment dialog.
Last comment written in the Comment box is saved as draft after user clicks Cancel
instead of Commit in a Commit Project To the Server dialog. Next time when user
opens Commit Project To the Server dialog, he will be notified about saved comment
draft, with Choose Comment button . In addition, in the Choose Comment dialog
user will see saved comment marked as a draft.
3. If you want to keep locks on the model and continue editing after the commit is over, select the
Keep locks check box.
4. If you want to tag the new project version, such as an Loan final tag, do the following:
a. Click More. The Version Tags tab appears on the Commit Project to the Server dialog.
b. Click the Add button.
c. In the open dialog, type a text and click OK.
If you want to tag the new project version with a Major tag, do the following
a. Click More. The Version Tags tab appears on the Commit Project to the
Server dialog.
b. Check the Create major version checkbox. This will create the Major tag.
In case of commit failure commit message and commit tags are saved for next commit
attempt, so user does not have to re-type commit information.
Contents
On this page
You can specify the interval you want the tool to check for new committed project versions on the
server; by default, this time interval is two minutes.
Any changes to the interval will be applied to newly opened projects only.
After notifications are turned on and/or a time interval is specified, the tool will automatically check to
see if there is a new project version available on the server. When a new version is detected, the
following notification will appear:
You can choose these actions from this notification: Update the project from the server (see page 1362) or
display upcoming changes (see page 1362) in the Upcoming Changes panel.
Updating lock information is a special case of the update feature. Use it to refresh the list of elements
locked by other users.
If you want to see the latest changes, open the Upcoming Changes panel, which shows the changes
committed to the server project while you were working on it.
Refresh Refresh the view to check for changes in the latest project version.
Update Update the project to the latest version (or press Ctrl+U).
project
Show Select a changed element and click Show description. The latest changes committed
descriptio for that element are displayed, including project version, date, author, and commit
n comment.
Difference Reviewing (see page 1368) element history and inspecting changes.
checker
Related pages
Contents
To assign a Teamwork Cloud (TWCloud) project to a user who cannot access the project on the server,
or to move the project to another server, you can save a local copy on your computer. This enables you
to send the local copy by email or add it to another server.
Note
The local copy of the project will not have locking and project version information. You will not
be able to commit local project changes to the server.
A new version of the element is created once you modify element properties, for example, update the
documentation, change the multiplicity or type of the element, create a new attribute or operation. A
new version of the diagram is correspondingly created after you modify its properties, for example,
rearrange the diagram layout.
You can view changes in the model in a particular scope (see page 1375) at the element level - that is a
selected package or a classifier element (a composed element). The latter is a big benefit for system
engineers as now you can see the history of, e. g., a selected Block298, Requirement299, or other
composed element.
1. From the Collaborate menu, select Projects or Open Server Project. The Manage Projects or
Open Server Project dialog opens appropriately.
2. Select the project, whose historical versions you want to review.
3. Do either:
• Click on the toolbar of the open project.
• Right-click the selected project and from the shortcut menu, select Project History.
4. In the History dialog, review a list of all versions of the selected project. If a version has tags, you
can see them next to the version number.
298 https://docs.nomagic.com/display/SYSMLP190SP2/Block
299 https://docs.nomagic.com/display/SYSMLP190SP2/Requirement
Search bar
Use the search bar to filter projects according to:
• Project Version (together with the commit tags)
• Author
• Comment
Colu Description
mn
name
Proje The version number of a project. In the example above, the last project version number is denoted as
ct “3/1”. This is the result of setting a previous project version as the newest one. In this particular
versi example, “3” denotes the current project version number and “1” denotes the number of the version,
on which has been set as the newest one.
Auth The login name of the user who created the project version.
or
Date The date and time the project version was created.
Proje The version number of a project. In the example above, the last project version number is denoted as
ct “3/1”. This is the result of setting a previous project version as the newest one. In this particular
versi example, “3” denotes the current project version number and “1” denotes the number of the version,
on which has been set as the newest one.
Com The description of changes in the version. You can make a version comment when committing a
ment version.
Butto Description
n
Comp Compares two selected branches. If there are differences between project branches, the result is
are presented in the Difference Viewer dialog. The button is available only when two project branches are
selected (use the SHIFT or CTRL keys).
Open Open the selected version of the project. You can make changes only to the latest version of the
project. Earlier versions are read-only.
1. In the History dialog, select a project version, whose properties you need to review and edit.
2. Click the Properties button. The Version Properties dialog opens with version comments
displayed by default.
3. If you need to review and edit version tags, click the Tag tab. After the Tab opens, do ether:
• If you need to edit a tag, select it and click Edit.
• If you need to add a new tag, click Add.
Contents
On this page
The History panel of the selected element then opens at the bottom of the client application window,
such as MagicDraw or a Cameo Suite product (i.e., Cameo Systems Modeler). If you select an element in
a used project, the corresponding panel title is Usage History. The highlighted row indicates current
changes that are not yet committed. To refresh the list of versions, click the button in the panel's
toolbar or perform the same actions as for opening the panel.
By default, the list of versions is stripped to a a small number of the latest versions. To see
more versions, click the Show more results button under the list.
You can compare any two versions of an element to see the differences between them.
To compare project versions in the Teamwork Cloud environment, you are required to have a
Read Resources permission300 for every used project in compared versions.
1. Hold down Ctrl and select the versions you want to compare.
You can only compare two versions. Please note that if you select more than two items,
only two (the latest and the earliest versions) will be compared.
If you want to compare subsequent versions, you only need to select the later one.
300 https://docs.nomagic.com/display/TWCloud190SP2/Permissions
• Quick Diff – to inspect changes of element property values (such as documentation, type,
or multiplicity) in a compact form.
• Full Diff – to inspect changes of diagrams or element property values in a detailed form, as
well as look at the properties of new relationships and directly related elements (such as
new or modified attributes and operations).
You can also choose the same commands from the toolbar of the History panel.
After you select the Quick Diff command, a dialog opens that shows changes in element property
values (see the following figure). Different colors help identify new, modified, and deleted values. You
can analyze exact changes in the textual value of the selected property in the Text Diff box. If you want
to see the original texts of both versions, click the Compare property values button on the toolbar
of the dialog to open the Compare property dialog and then click Original Texts.
After you select the Full Diff command for an element, the Difference Viewer dialog opens, showing
changes in element property values, as well as detailed information for directly related elements and
new relationships (see the figure below). For more information about using this dialog, see Analyzing
comparison results (see page 1250).
Generating reports
To generate an element history report
Contents
You can view changes in the model in a particular scope at the element level; that is, a selected package
or a classifier element (a composed element). The ability to see the history of a
selected Block301, Requirement302, or another composed element is a big benefit for system engineers.
1. Select a composed element in the Containment tree (see page 32) or diagram pane and right click it.
2. From the shortcut menu, select Content History. The history review panel opens, where you can
analyze changes between selected server project versions.
3. To see differences between server project versions:
• Double click the project version to see differences between the selected version and the
earlier one.
• Select the list of versions and click the button.
301 https://docs.nomagic.com/display/SYSMLP190SP2/Block
302 https://docs.nomagic.com/display/SYSMLP190SP2/Requirement
In a Differences report you can find project scope and element scope:
• Project scope – name, version, the number of elements and diagrams in the compared
project versions.
• Element scope – name, path and element type of the particular model element that was
chosen as a content history scope.
This Differences report compared to the Full Diff (see page 1368)report only includes changes
from the chosen model element scope and not the entire model. These changes are included in
the sections Diagram Differences, Model Differences, and Changes by Type of the report.
Change Sets
Contents
While editing your server project, you can track project modifications in the Change Sets panel, located
right after the Model Browser (see page 29). A change set is a related group of elements, diagrams and
symbol modifications in a project that are created or modified locally and not yet committed to the
server. You may have several sets for your project and commit them one by one. This feature is useful
when, for example, you are working on a server project and receive a request for an immediate change.
You can suspend your changes, complete the immediate task and commit the changes, after which you
can resume your work on the previously suspended change set. This also applies when you are working
simultaneously on different tasks that are required to be delivered as separate commits.
You can create as many change sets as you need. To organize and identify change sets, you may name
each one. Only one change set can be active at a time. In order to create a new change set, all other
change sets must be suspended. As shown in the preceding figure, colors on an element in the change
set indicate whether the edit is an addition, modification or deletion. Also, you may compare
differences between the original project and a project with modifications applied.
To compare a project
Contents
We recommend project partitioning when the model has weakly dependent parts, such as type
libraries, models of different phases of software/system development, etc. A part of the model moved
to a separate project can be used in many projects. From the perspective of the project using elements
from another project, we refer to the other project as a project usage or used project.
You can easily detach a selected part of the model by exporting (see page 1379) it to a separate
TWCloud project and re-use (see page 1380) it in other server projects. Since projects are used as read-only,
you cannot modify their contents directly from the main project. To modify (see page 1388)a used project,
you should open it as stand-alone. If there is a need, you can simply switch (see page 1385) to another
used project version.
If you no longer need a fragment of the model in a separate project, you can import (see page 1389)the
project into the main project. Additionally, you can stop (see page 1390)using the project.
You can manage TWCloud project usages in the Project Usages dialog, which opens after you select
Options > Project Usages.
Related pages
Exporting a package to a separate project is the first step of the model decomposition. It is followed by
reusing (see page 1380) that project in other projects.
303 https://docs.nomagic.com/display/TWCloud185/Permissions
304 https://docs.nomagic.com/display/TWCloud185/Permissions
a. Change the default name of the new server project, if you choose.
b. Select a category to store the new project.
c. Add a comment for the project.
d. Click OK.
You can reuse (see page 1380) the newly created server project in other projects.
Contents
To begin using a project in your current project, you must have an Administer Project
permission305.
If you want to use an element from either a local or Teamwork Cloud (TWCloud) project, you must use
that project in your project first. Projects can be used only in the read-only mode.
305 https://docs.nomagic.com/display/TWCloud185/Permissions
2. Click the button and then select Use Server Project (see the following figure). The Use
Server Project wizard opens.
Search bar
Use the search bar to filter projects according to:
• Project Version (together with the commit tags)
• Author
• Comment
Used project
Please note, the whole content of a used project is added to the main project.
The selected server project also appears in the Model Browser, under the package Project Usages.
Once the usage to the project is established, you can start using its elements. For example, you can
select them as types in your project.
Establishing usage to a local project is very similar. In this case, you don't have to select the project
version, since local projects don't have them.
Related pages
Contents
On this page
To change a used project version, you must have an Administer Project permission306.
You can set an option to receive a notification when a new used project version appears. You may then
choose to update the used project version to the latest version or keep working with the current one.
You can change the default notification settings to receive notifications when a server project is opened
and when updates are done, as well as disable them if they are not necessary.
306 https://docs.nomagic.com/display/TWCloud185/Permissions
If you do not specify tags, the modeling tool will show a warning icon.
It is recommended that tags specification be done in patterns, because the modeling tool
searches for partial matches. See the example below for more information.
Example
After a new version of the used project is committed to the server with a tag that
fully or partially matches the specified tag, you will be notified about updates of
these tagged projects.
Let’s say you specify these tags:
2018Q
2019Q
2020Q
Major
New versions and notification status:
• New version without tags - no notification
• New version with the tag [ Major ] – notification about a new version
• New version with the tag [ 2018q1 ] – notification about a new version
• New version with tags [Release][Major] – notification about a new version
• New version with the tag [Release] – no notification
• New version with the tag [Q_2018Q2T] - notification about a new version
If a used project has tags specified for notification, only the version meeting the used projects
notifications criteria (tags) will be shown in this dialog.
5. Wait while the version changes to the latest and click OK to close the dialog.
5. In the open dialog, select the used project version to switch to and click OK.
6. Wait while the version changes to the selected one and click OK to close the dialog.
Versions are displayed in the following format: #<used version>/<latest version>.
The term #1/3 denotes that 1 is the used version and 3 is the latest version.
To switch versions of the used projects you must have an Administer Project permission307.
Teamwork Cloud (TWCloud) projects can only use other projects in the read-only mode. If you want to
edit a used project, you must open it as stand-alone.
1. In the Model Browser, right-click the project to open a shortcut menu under the package Project
Usages.
2. Click Project Usages and select:
• Open Latest Version to open the latest version of the used project for editing. Note that
the version used in the project does not change after editing the used project.
307 https://docs.nomagic.com/display/TWCloud185/Permissions
• Open This version to open the actual project version for editing. If the used version is not
the latest one, the project will open in the Read-only mode.
Now you can modify the structure and content of the project.
To import the content of a used project into your project, you must have an Administer
Project permission308.
If you no longer need to keep a part of the model in the used project, you can import the content of
that used project into your project. After the import, all the elements of the used project are copied to
the main project. The inner structure of the used project is included in the project as a package.
308 https://docs.nomagic.com/display/TWCloud185/Permissions
4. In the Import dialog, choose how to import the elements of the used project: with new IDs or
with old.
5. If you receive a message asking to commit changes made in your project before the import,
click Yes and wait while the import completes. This may take some time.
Note
The imported project no longer appears in the Project Usages dialog.
6. Click OK.
The imported project also disappears from the package Project Usages and a new package named after
the imported project appears under the root package in the Model Browser. If the imported project
uses other projects, these projects will be directly used in your project.
After it is imported to the contents of your project, a used project will still exist in the Teamwork Cloud
(TWCloud) repository.
To stop using the project in your project, you must have an Administer Project permission309.
If you no longer need to use a project, you can easily remove it from your project usages.
• Complete, after which all references to the elements stored in the used project are eliminated.
309 https://docs.nomagic.com/display/TWCloud185/Permissions
Before you attempt to stop using a project, make sure other users are not currently creating
usages to this project.
1. Lock the used project (see page 1345) you want to stop using.
2. On the main menu, click Collaborate > Project Usages > Project Usages.
3. Select the used project and click the button.
To link an embedded project with relevant server project, you must have an Administer
Project permission310.
Linking replaces the privately embedded project (also referred to as the local project) with a relevant
server project.
310 https://docs.nomagic.com/display/TWCloud185/Permissions
If a relevant project is stored on the server (it may be added to the server individually, separately from
the project using it), you can easily link the embedded project with it.
4. The same steps of using a project in the server project (see page 1380) are outlined below.
The following figure highlights the differences between displaying an unlinked embedded project and
one linked with the server project (converted to the used project).
Search bar
You can use the search bar to faster filter used projects by name.
• Apply - to apply changes and keep the dialog open in order to see what changes are applied.
Please note, the applied changes cannot be undone.
• OK - to apply changes and close the dialog.
Contents
To move elements from the main server project to a used one
Hiding packages
Contents
To hide packages
Dedicated branch
A stripped model is stored in a dedicated branch created when element hiding is performed for the first
time. By default, this branch is named Public Project. You can rename the branch (see page 1329) if you
need to.
Project with it`s Public Project branch. The public project now can be reused in another project.
If all packages from the model are unhidden, the dedicated branch will be deactivated.
If the main project is using a public branch of another project and that branch gets deactivated, you will
be informed about this change with a warning icon in the main project with a warning icon in:
The icon with a lock on a package (or on a used project package) is also shown in:
Model synchronization
A stripped model is read-only. It can only be used for reuse in other projects, not for editing. However,
you can edit the main project. On committing, checking is performed to see if the changes affect hidden
and public parts of the model, and model synchronization is initialized. In the Project Options dialog
(see page 213), you can define the model synchronization mode. The default mode is Manual; that is, after
committing project changes, you will be notified about local changes affecting a public model stored in
a dedicated branch. You can then decide either to synchronize changes or not.
Projects within the update path will require these permissions: Administer Resources; Edit Resource; Edit
Resource Properties; Read Resource. However, the target used project only needs the Read Resources
permission.
An example
You have projects: A, B and C. These projects are in use as follows A->B->C (project A is using
project B; project B is using project C). In order to update B project to the latest version you
only need Read Resource on project B and Administer Resources, Edit Resource, Edit Resource
Properties and Read Resource permissions on project A.
However, in order to update B and C used projects you need Administer Resources, Edit Resource,
Edit Resource Properties and Read Resource permissions for projects A and B. You will need only
Read Resource on project C.
311 https://docs.nomagic.com/display/TWCloud190SP2/Users+Application
312 https://docs.nomagic.com/display/TWCloud190SP2/Roles+Application
313 https://docs.nomagic.com/display/TWCloud190SP2/Teamwork+Cloud+Documentation
• Use command line to start updating used projects (see page 1403).
The plugin does not update used projects that are involved in cyclic dependencies.
After the plugin is enabled in the Project Usages dialog you will see a new button: Used Projects Auto
Update Wizard .
To configure a properties file with the Used Projects Auto Update Wizard
1. In the opened Used Projects Auto Update Wizard dialog, you can see the username you are
logged in with. This user will be set up for the properties file to automatically update used
projects.
2. In the Properties file field, you need to select a file and location to overwrite or save the new
properties file that will be generated for the plugin.
3. After you have selected a properties file, click Next.
4. Select directly and indirectly used projects. Values listed in the Status column show whether or
not a used project can be updated.
5. After you select the used projects, click Generate to create the properties file that should be
used with a plugin.
To see where the selected used project is used, click the Project Usage Information
button. This will help to find update paths. An update path is a path of projects that must be
updated in order to update a certain used project.
An example
A Main Project uses project A. Project A uses Project B. In order to update Project B in
the Main Project, we are required to update Project B in Project A first and then update
Project A in the Main Project. Thus, the update path for Project B is: Main Project >
Project A.
twc.user.password TWCloud user hashed password (the only way to get a hashed
password is to generate it through Used Projects Auto Update
Wizard (see page 1401) first)
1. Move the properties file to the plugin directory <modeling tool installation directory>/plugins/
com.nomagic.magicdraw.twcusageupdater
2. Open the command-line interface.
3. Go to the <modeling tool installation directory>/plugins/com.nomagic.magicdraw.twcusageupdater
directory containing the executive file for the used projects update.
Executive file
The executive file is the corresponding .sh or .bat file depending on your operating system.
To update used projects using a single properties file, type the following command in the command line
• On Windows:
update.bat -properties sample.properties
• On OS X or Linux
./update.sh -properties sample.properties
• On Windows:
update.bat -properties first.properties second.properties third.properties
• On OS X or Linux:
./update.sh -properties first.properties second.properties third.properties
Troubleshooting
1. Right-click the used project version you want to change. The shortcut menu appears.
2. Click Project usages > Change version. The Edit branches dialog opens.
3. Select the Show impact of changes before changing versions check box, as shown below.
4. Choose the used project version and click OK. The Impact analysis window opens shortly.
You can also invoke the used project impact analysis window using the following method:
1. Go to the Project usages dialog, reached either from the context menu by
choosing Project usages > Project Usage Options... or from the main menu Options >
Project usages.
2. The Edit Branches dialog opens. Select Show impact of changes before changing
versions check box.
3. Select the used project version and click OK. The Impact analysis window opens.
When the tool finds any impacting changes to be caused by a used project version switch the Impact
analysis window shows up. Otherwise, you will get a notification that there are no impacting changes
and used project version will be changed without invoking the dialog.
• Affecting Element Changes - the first panel, showing the changes in used project elements
between the current used project version and the one that is to-be-switched to. Next to the panel
title there are a number of elements that affect the main (using) project. This panel is
separated into two columns:
• The first column shows used project elements. It can be displayed as a tree or in list form.
• The second column is named Affecting. This column shows how many elements are
affected by the changed element and what kind of impact it might have (composition
integrity errors or no errors).
The Affecting Element Changes panel covers both direct and indirect usages, that is, if
affecting change comes from an indirectly used project, it will be taken into account as well.
• Affected Elements - the second panel, which shows elements from the main project that are
directly affected by element change(s) from the Affecting Element Changes panel. Next to the
panel title are a number of elements that are affected in the main project by the selected
element in the first panel.
• Element specification - the third panel, showing the properties of selected element either from
the Affecting Element Changes (changed element properties are shown) or Affected Elements
(directly affected element properties are shown) panel. This panel works similarly to quick diff (see
page 0) and is separated into three columns:
Toolbar
All three panels have toolbars to ease navigation through changes.
Strip Multiline Text Click to strip multiline text. If the text in the property cell
(e.g., ToDo) covers more than five rows, it is finished
with ... showing only those five rows. The complete text
is available in the tooltip or in the cell edit mode.
Affecting Element Changes and Affected Elements panels have a List view tab. Use this to
list all changed elements. You can search for a specific element in these List views.
Summary/Legend
The Summary/Legend section introduces change types, the number of different affecting changes and
the number of affected elements. It also includes marking composition integrity errors and a green tick
to notify you that changes will not invoke any new composition integrity errors.
Understanding changes
The following definitions show the different change types.
Addition change
If an element has been added, an addition change occurs. It is important to note that changes occurring
when changing from one used project version to another (and elements from recovered elements to
good ones) are considered as element additions and are represented in the green rectangle in
the Affected elements panel.
Deletion change
If an element has been removed, a deletion change occurs. The deletion change usually results in
composition integrity errors, i.e., it causes the appearance of recovered elements, since the deleted
element is still used in the main project.
Modification change
If an element property has been modified, a modification change occurs.
Reject Changes restores the project to the version opened before invoking the Impact analysis
window. The same applies for X (closing the dialog).
When you are connected to Teamwork Server, you must have certain permissions to work with server
projects. The following pages explain the most important steps you need to take when working with
server projects:
1. Create a server project or add a non-server project to the Teamwork Server. Open the server
project.
2. Lock the elements you want to edit and edit them in the open project.
3. Select the model elements to unlock and commit the project.
4. Create categories for visual grouping of server projects.
If you want to lock an element for editing, the application will check for the permissions you have and
the availability of the element.
Before committing elements, you can unlock the elements you have previously locked. Committing to
Teamwork Server will create a new project version.
https://www.youtube.com/watch?v=4Fw1ycgw_Xw
1. Start a new project in the IDE integration you are working on. The New Project Wizard dialog
opens.
2. Select Teamwork model and click the button to login to Teamwork Server.
3. After log in, select an existing project or add a new one. The model from the IDE source will
be updated in the selected project. Click Next.
4. Specify integration properties and click Finish. The server project opens in the modeling tool.
Contents
On this page
You must lock the part of the model you are going to edit so that other users cannot edit it at the same
time. Locking is allowed if that part of the model is not locked by another user, because an item can be
only be locked by one user at a time.
The following table explains what is editable after you lock a single element or diagram, diagram with
elements, and so on.
Diagram Edit:
314 https://docs.nomagic.com/display/MD190SP2/
Locking+model+for+edit+in+Teamwork+Server#LockingmodelforeditinTeamworkServer-
Representationoflockedelements
315 https://docs.nomagic.com/display/MD190SP2/
Locking+model+for+edit+in+Teamwork+Server#LockingmodelforeditinTeamworkServer-
Lockingelementsanddiagrams
316 https://docs.nomagic.com/display/MD190SP2/
Locking+model+for+edit+in+Teamwork+Server#LockingmodelforeditinTeamworkServer-Lockingsymbolstyles
317 https://docs.nomagic.com/display/MD190SP2/
Locking+model+for+edit+in+Teamwork+Server#LockingmodelforeditinTeamworkServer-Lockingprojectusages
318 https://docs.nomagic.com/display/MD190SP2/
Locking+model+for+edit+in+Teamwork+Server#LockingmodelforeditinTeamworkServer-
Lockingforreverseengineering
319 https://docs.nomagic.com/display/MD190SP2/
Locking+model+for+edit+in+Teamwork+Server#LockingmodelforeditinTeamworkServer-
Lockingtheprojectstructure
The following table provides suggestions on which locking commands to use for various purposes.
1. Double-click either:
• This element in the Model
Browser.
• A symbol of this element on a
diagram pane.
2. In the Specification window, click the Lock
element for Edit button .
At least one of the following: 1. Right-click this diagram in the Model
• Diagram specification properties Browser.
• Diagram representation properties (including 2. From the shortcut menu, select Lock > Lock
diagram layout) Diagram Content for Edit.
• Properties of elements represented on that OR
diagram pane
• Symbol properties of elements represented 1. Right-click a free space on this diagram
on that diagram pane pane.
2. From the shortcut menu, select Lock
Diagram > Lock Diagram Content for Edit.
It is the last tab on the Model Browser. If the tab is closed, you can simply open it by selecting
Collaborate > View Locked Elements.
2. Right-click Symbol Styles and from the shortcut menu select Lock Symbol Styles for Edit.
1. Do either:
• Select Options > Project.
• In the Lock View tab on the Model Browser, right-click Project Options and from the
shortcut menu, select Symbol Styles.
It is the last tab on the Model Browser. If the tab is closed, you can simply open it by
selecting Collaborate > View Locked Elements.
2. In the Project Options dialog, click the Lock Symbol Styles for Edit button.
As a result, symbol styles become editable. Additionally, the Make Default button (1) in all Symbol
Properties dialogs and the Set Selected Symbol Style as Default button (2) on all the diagram toolbars
become available.
1. Do either:
• In the Lock View tab on the Model Browser, right-click Project Structure and
select Options.
• From the Options menu, select Project Usages.
2. In the opened Used Projects dialog, select a used project on the left side of the dialog and click
the Lock button.
As a result, you can import this used project as a package to the main project, stop using it, or change
its version.
1. In the Code engineering sets branch, select a code engineering set or code engineering element
you want to reverse.
2. On the selected items shortcut menu, click Reverse. The Reverse Options dialog opens.
3. In the Reverse Options dialog, set the required options and click OK.
4. The Lock Elements dialog opens. Select elements you want to lock and click OK.
5. Depending on the options you have selected in the Reverse Options dialog, you may need
to perform some more steps. Please follow the instructions provided on your screen.
If you are in a collaborative environment and working simultaneously on the same project, the
following operations cannot be performed in parallel:
The project structure can be locked via the Lock View tab or the Project Properties dialog.
1. In the Lock View tab on the Model Browser, rigt-click Project Structure and select Lock Project
Structure.
It is the last tab on the Model Browser. If the tab is closed, you can simply open it by selecting
Collaborate > View Locked Elements.
You can choose to release or keep the locks on the model (see page 1411) when committing changes. If
you are going to proceed with editing after committing, keep the locks.
Any new elements added to the parent scope are given a unique name when placed among elements
of the same type.
You can select a comment from the recently used comments list. Simply click the Choose
Comment button above the Comment box, and select any comment from the list in
the Choose Comment dialog.
3. If you want to keep locks on the model and continue editing after committing, select the Keep
locks check box.
The Keep locks check box remembers the last choice of the user. Thus, if you want to
release the locks every time when committing changes, it is not necessary to unselect
this check box each time you commit, once you make your choice during the first
commit.
6. Wait while the new project version containing the committed changes is sent to the Teamwork
Server repository.
• From the Collaborate menu, select Update Lock Information, or press CTRL+SHIFT+U.
https://www.youtube.com/watch?v=hCxW2UssMns
Project Branching allows the user to derive one project version from another. It duplicates versions of a
project and enables users to work simultaneously on them. Branching increases productivity for those
who:
Related pages
1. From the Collaborate menu, select Projects. The Manage Projects dialog opens.
2. Select the project from which you want to create a branch.
3. Do one of the following:
• Click the Create Branch button.
• If you want to create a branch from the specific version of the project, click , in the
open dialog select the desired project version, and click the Create Project button.
The Create Branch dialog opens.
4. Enter the branch name and comment in the appropriate boxes.
If you want to branch a project together with used projects, select the Branch used
projects check box and select the used projects to branch.
Related pages
Contents
1. From the Collaborate menu, select Open Server Project. The Open Server Project dialog (see
page 1461) opens.
Related pages
For project migration, you can use the automatic server project migration feature or migrate each
server project manually.
Important!
While the project is upgrading, other users are prevented from any modifications in that
project. It is highly recommended to migrate all projects by the same person.
Tips!
You can migrate server projects to 17.0.5 or later version without upgrading the server.
Starting with version 17.0.4, upgrading Teamwork Server is not required to access server
projects with the upgraded version of the client application.
Permissions
You must have the Administer project permission for migrating projects.
1. From the Collaborate menu, select Migrate Project to Version <version number>.
2. The question message appears.
1. Open a server project in Teamwork Server. The message notifying that project has
been upgraded and requires to be committed to a server of a new version appears.
2. Click OK and commit the project to the server (see page 1420).
Perform these actions for all projects and modules you want to migrate to Teamwork Server version
17.0.1 or later.
Troubleshooting
In particular cases, server projects are not upgraded to the latest file format. It may happen in the
following cases:
• When the entire project or some modules are not committed to the server.
• When the project structure remains locked after the project has been committed to the server.
In these cases, you get the warning message that project modification is disabled because its structure
is being upgraded by another user. You are not allowed to make any modifications in such opened
project as projects are opened in the read-only mode.
On this page
Related pages
1. On the main menu, click Options and then select Environment. The Environment Options dialog
opens.
2. In the General option list > General options group, set the Recent Server Projects List Size
option to the wanted number of projects.
Contents
As of MagicDraw version 17.0.1, the project file inner structure has been changed. Now the latest
project file has additional auxiliary information about a project structure. After MagicDraw Teamwork
Server has been upgraded to version 17.0.1, you should upgrade your projects used in earlier server
versions to the latest file format. After that, you will have full project management features available. To
migrate a project to the latest format, projects and used modules must be re-saved (re-committed) in
the server.
For project migration, you can use the automatic server project migration feature or migrate each
server project manually.
While the project is upgrading, other users are prevented from any modifications in that
project. It is highly recommended to migrate all projects by the same person.
You can migrate server projects to 17.0.5 or later version without upgrading the server.
Starting with version 17.0.4, upgrading Teamwork Server is not required to access server
projects with the upgraded version of the client application.
For the instructions how to enable connections to the server from later client versions,
see Activating Teamwork Server license after purchase320 at nomagic.com321.
You must have the Administer project permission for migrating projects. For more information
about the permissions, see “User permissions” in MagicDraw Teamwork UserGuide.pdf.
320 https://docs.nomagic.com/display/NMDOC/Activating+the+Teamwork+Server+commercial+license
321 http://nomagic.com
After the project migration is completed, you will get a message informing about successful project
migration or containing the list of projects that were not migrated. You need to migrate those projects
manually.
You must have the Administer project permission for migrating projects. For more information
about the permissions, see User permissions322.
1. Open a server project in Teamwork Server. The message notifying that project has been
upgraded and requires to be committed to a server of a new version appears. See the following
example of the message.
322 https://docs.nomagic.com/display/TWS190SP2/User+Permissions
For more information about committing a project, see section Committing to Teamwork Server (see page
1420). Perform these actions for all projects and modules you want to migrate to Teamwork Server
version 17.0.1 or later.
Troubleshooting
In particular cases, server projects are not upgraded to latest file format. It may happen in the following
cases:
• When the entire project or some modules are not committed to the server.
• When the project structure remains locked after the project has been committed to the server.
In these cases, you get the following message while loading the project:
You are not allowed to make any modifications in such opened project as projects are opened in the
read-only mode.
Related procedures:
Locking Project
Related references:
The list of commands may vary depending on the item you have selected.
1. From the Collaborate menu, select Unlock All. The Commit Project to the Server dialog opens.
2. Click to clear the Keep Locks check box. By default, the check box is selected.
3. Click Commit when you are done.
1. Open the Specification window of the selected locked element or locked symbol.
2. Click the Unlock element button (see the highlighted button in the following figure). This forbids
editing element specification properties in the Specification window.
If the element was modified, you will be requested to commit changes to the server.
323 https://docs.nomagic.com/display/TWCloud185SP2/Unlocking+project%27s+elements
324 https://docs.nomagic.com/download/attachments/42590685/unlocking_commands_on_shortcut_menu.png?
api=v2&modificationDate=1443087158411&version=1
1. From the Collaborate menu, select Commit Project or press CTRL+K. The Commit Project to
the Server dialog opens.
2. Click to clear the Keep Locks check box.
3. Click Commit when you are done.
Model elements that are not modified are unlocked without committing them to the server.
The unlocking procedures for administrator are the same as described in section Unlocking
model elements and diagrams after editing (see page 1432).
Forced unlocking is helpful when elements are left locked by the user who is currently unavailable.
Use forced unlocking only in very special cases, as this may cause users working on this project
to start their work again.
The user has a possibility to commit changes made to elements that were forcibly unlocked by an
administrator. To commit changes, the following conditions should be satisfied:
• The user should have the latest version before locked elements have been lost.
• A new revision of the project has not been committed to the server.
The preceding scenario is very rare, and users should not rely on it. After all, if administrator forcibly
unlocked elements, it means there was a need to edit these elements for some purpose.
Changes to elements that were locked and not forcibly unlocked by an administrator, can be committed
to Teamwork normally.
1. Lock the element or elements you want to delete, see Locking model elements and diagrams for
editing (see page 1411).
If the element contains inner elements which can be locked separately, these inner elements
should not be locked by the other users to complete element removal. For this reason, we
suggest to use command Lock Element for Edit Recursively to lock all inner elements so nobody
could prevent you from removing selected elements.
Contents
You can save your server projects on a specific location in your computer. You can work with the local
project and also be able to commit changes to the server. Working with the local copy of the server
project helps to improve collaborative work productivity. Even if the connection with Teamwork Server
is lost, you can still continue working with the project and commit changes later, when the connection is
restored.
Related Procedures:
When updating lock information, the list of elements that are locked by other users is refreshed. You
should update a project when you know that a new project version is available on the server.
• From the Collaborate menu, select Update Lock Information, or press CTRL+SHIFT+U.
Versioning
Every time a project is committed, a new project version is created. You can undo committed changes
by setting a previous project version as latest.
1. From the Collaborate menu, select Projects or Open Server Project commands.
2. Click the Project History button. The Project Versions dialog opens.
The Project Versions dialog lists all versions of the selected project. You can set the selected project
version as latest, edit comments, and review other project versions.
• Version browser
• Branches browser
• Module/project name representation in the containment tree/application title.
For more information about general code engineering functionality, see MagicDraw
CodeEngineering UserGuide.pdf which can be found in <MagicDraw installation
directory>\manual.
1. From the Code engineering sets shortcut menu in the Browser, select New and then select a
code engineering language. Type a name for new set.
2. Add elements from the Data branch to the newly created set. All elements (locked and unlocked)
can be added to set for code generation. Drag & drop them from the Browser tree.
3. Select the code engineering set, containing elements in the Browser and from the shortcut menu,
select Generate. The code is generated for all elements.
To reverse code in the server project
1. From the created code engineering set shortcut menu, select Edit.
2. Specify the Working Directory and Working Package, to where reversed elements will be placed in
the model.
Reversing the whole set to a defined package is allowed only if the package is locked.
1. In the Add File tab from the Round Trip Set dialog, add code files from the All Files list to the Set
list. Click OK.
2. From the modified code engineering set shortcut menu, select Reverse. Define options in the
Reverse Options dialog. Click OK.
When performing a round-trip code engineering, code cannot be reversed for unlocked elements - the
Reverse command will be disabled in shortcut menu.
Contents
Additional Resources:
• http://www.nomagic.com/files/viewlets/Project_Usage_Map.html?ml=1
• http://www.nomagic.com/attachments/article/547/
Four%20Key%20Improvements%20When%20Managing%20the%20Teamwork%20Server%20Rep
ository.pdf
The Project Usage Map is a live visual graph that represents Teamwork Server project usages as well as
identifies potential problem areas.
• All Projects view that shows all projects and all the dependencies among them.
• Individual project view that shows a particular project along with other directly and indirectly
used modules.
Using the Project Usage Map you can easily do the following:
• Identify, analyze, and validate dependencies among projects (for example, you can find out easily
all the projects, wherein a particular module is used).
• Identify cyclic dependencies among projects. Identify and fix inconsistent dependencies among
projects.
Cyclic usages Several parts of the project are directly or indirectly using the
main project.
Inconsistent mount The project is mounted on different packages of the main project.
Inconsistent version or branch usage The main project uses different versions or branches of the same
module.
Not converted project A project whose usage information cannot be retrieved and
analyzed by the Project Usage Map since it was created using
MagicDraw version 17.0 or earlier. Open the project and add it
back to the Teamwork Server so it will be converted into the
newest format.
Non-sharing usage A usage that makes a project invisible to other projects despite
their using it as a used project.
Sharing usage A usage that makes a project visible to other projects wherein this
project is used as a module.
Unconfirmed usage The usage has been created automatically and is not yet
confirmed by the user.
Unused project (module) The project that has shared parts that are not used in any other
project.
Related Pages:
Contents
• Review the content of the entire Teamwork Server repository in the All Projects view.
• Narrow the analysis scope by hiding in the view any types of conflicts and / or projects, in which
you have no interest.
• Review usages of a particular project in the Individual project view.
• Open projects and resolve problems.
To open a current project usage map
• From the active project’s Collaborate menu, select Project Usage Map > Current Project Map.
• In the Edit Projects dialog, select the project and then click the Project Usage Map button.
To open the all projects usage map
• From the Collaborate menu, select Project Usage Map > All Projects Map.
To identify project usage problems
In the Project Usage Map, you can easily identify project usages. This means, that you can see which
projects uses or are used by the selected project.
An orange arrow represents the outgoing usage.The outgoing usage is drawn between a selected
projects and the project that is used by it. In the description area, pre project that is used by the
selected project is listed under Using.
For more information about comparing the projects, see Project Comparison (see page 1250).
• In the Project Usage Map window toolbar, click the Export to Model button.
Any changes in the exported project usage map will not affect the Project Usage Map view.
1. In the Project Usage Map window, click the Copy as BMP Image button. The map view is copied
to the clipboard.
2. Paste in any image editor.
3. Save to the selected location.
To select a particular project in the map
Search Criteria
You can select one of the search criteria:
• Match from start
• Match anywhere
Refresh the Project Usage Map to see the latest view of the Teamwork Server repository.
• In the Project Usage Map window toolbar, click the Refresh button.
• Double-click a project
• Select Show Project Structure from the project shortcut menu
Solve the inconsistent usages and other problems by opening projects directly from the Project Usage
Map.
To open as a project
Related Pages:
Contents
In the Project Usage Map window, you can analyze the contents of the entire Teamwork Server
repository, as well as individual projects. You can explore the displayed projects and analyze both
project usages and identified problems.
Open All Projects Map Click this button, if you closed the All Project view in the Project
Usage Map. This button is unavailable if the All Project view is
opened.
Refresh Click this button if you want to see the latest version of the repository
view. All the layouts and filters will be reset.
Export To Model Click this button to export an active usage map view to the Class
diagram. You can save the exported usage map for the later
comparison of the latest version.
Copy as BMP Image Click to copy the active usage map. The usage map view is copied to
the clipboard. You can paste it in any image editor.
Filter Area
Window element Description
Usage Highlight Select which usages you want to highlight: incoming, outgoing, or
both.
Cyclic Usages Select which cyclic usages you want to be displayed in the map view.
Inconsistent Usages Select which type of inconsistent usages you want to be displayed.
Not Used Modules Select if you want to see only the projects with not used modules.
Visible Projects Select the projects you want to be displayed in the map. By default, all
the projects are selected. Right-click in the Visible Projects list area
and select Show all or Hide all. Press the Delete key to unselect a
project.
Description Area See the information of the selected project. All the problems are
marked in red.
Map area: understanding the contents
The representation of the selected project, incoming and outgoing usages is depicted in the following
figure.
An orange arrow represents outgoing usages. A green arrow represents incoming usages.
The representation of the Sharing usage is depicted in the following figure by the solid grey arrow.
The representation of the mount point inconsistencies is depicted in the following figure.
Related Pages:
Contents
Using the Project Usage Map, you can identify usage problems. Then you can easily select and open
projects that need to be fixed.
Model Level
Be sure to check and resolve the model level usages between the project and module.
Model Levels
Be sure to check and resolve the model level usages between the project and module.
You are using a version from the trunk and branch of the same project in your main project
The Project Usage Map highlights these inconsistencies. You can then open projects with inconsistent
usages and fix them by unifying the used project branch.
You are mounting (mount - the other project usage in a particular package of the main project) the used
project in different packages in your main project.
Solution
The Project Usage Map highlights these inconsistencies. You can then open projects with inconsistent
usages and fix them by unifying the used project mounted package information.
Model Level
Be sure to check and resolve the model level usages between the project and module.
Solution
Model Level
Be sure to check and resolve the model level usages between the project and module.
If the module usage A => B is good and necessary according to the end-user policy, it can be confirmed.
I.e., the user-defined usage is to be created in place of the current unconfirmed automated module
usage.
To do that, use the Confirm and use the module into <module_name> solver of the validation result.
This solver opens the standard Use Module wizard and pre-selects the required module. When wizard is
completed, the necessary user-defined module usage is created.
If the usage A => B is not good according to the end-user policy (for example – leads to module usage
cycles or is incorrect because of semantically there should be no dependency between these modules),
then it needs to be rejected and removed. To remove the usage, the model-level references, which are
causing this automated module usage need to be changed – either removed or redirected to different
elements.
For more information about resolving the unconfirmed usages, see Resolving unconfirmed
module usages.
When the number of projects in the repository grows it is common for some of the projects to become
outdated or not used anymore. You would prefer removing them BUT you are not sure if they are not
used by some other, still-active project.
Model Level
Be sure to check and resolve the model level usages between the project and module.
The Project Usage Map highlights unused modules. Based on this information, you can move all of the
unused modules into the deprecated category or remove them entirely from the repository.
Related Pages:
Contents
Related pages
Contents
Related pages
1. Open a server project and lock it for editing (see page 1411).
2. From the Collaborate menu, select Project Usages > Export Packages to New Server Project.
The Export Packages to New Project dialog (see page 1379) opens.
You cannot export a package as a server project if another server project is mounted
inside.
3. In the All data list, select one or more packages from which you want to create a server project
and click the Add button. The packages will be added to the Selected packages list.
4. Click OK.
In this step, you may be asked to confirm or cancel the dependency checking between
the exported packages and the rest of the project (including shared packages that belong
to the project and used projects). The dependency analysis step is described in
Decomposing model (see page 234).
5. Enter the name of the project for Teamwork Server, if you need one.
6. Either select an existing category or type a new category name.
7. Click OK. The project will be created in Teamwork Server as a separate file.
You cannot export a package as a server project if another server project is mounted
inside.
4. You may decide to add more packages. In this case, perform Step #3 described in the previous
set of procedures.
5. Perform Steps #4 and step #5 described in the previous set of procedures.
Once the server project is created, all its packages and the elements they contain are read-only. A
project name and version number are displayed in the brackets next to each exported package name in
the Containment Tree.
Contents
Related pages
1. From the Collaborate menu, select Project Usages and then Use Server Project.
2. The Use Server Project dialog opens.
3. Select the project you want to use in your project. Click Next.
4. Specify usage options in the next step and click OK.
1. From the Collaborate menu, select Commit Changes to Server. The Commit Project to the
Server dialog opens.
2. If you want to save the local project as a separate server project, perform the following steps:
a. Click More to extend the dialog.
b. Click the Local Projects tab.
c. In the Action list, select Add to Server.
d. Perform this step for all used local projects you want to add to Teamwork Server.
Please note that a server project opens used project versions that were used on a project
commitment (but not the latest version of the used project).
You must reload the used project to get the latest version to be used.
1. From the shared package of a used project shortcut menu, select Project Usages > Reload. The
number of the latest version is shown next to the used project name.
This procedure allows you to use the latest version of a used project that was uploaded to the
Teamwork Server.
Contents
Here you will find descriptions about specific dialogs for Teamwork Server, which you will see only after
connecting to the Teamwork server environment.
Related Pages:
User management
Contents
Element Description
Name
Login The login name of the Teamwork user. Changing the user’s login name is not allowed.
External The check box indicating whether the user is a native user or an external user.
User
Do one of the following:
Confirm The new password retyped. This field will be visible if you add or edit a native user (the External
New user check box is clear).
Passwor
d
• Teamwork Server Dialogs (see page 1456)
• User management (see page 1456)
• Manage Projects Dialog (see page 1458)
• Open Server Project Dialog (see page 1461)
• Commit Project to the Server dialog (see page 1462)
• Project Versions dialog (see page 1464)
• Use Server Project wizard (see page 1467)
Contents
You can use the Manage Projects dialog to manage projects, assign them to other Teamwork users,
and set user permissions for the system and specific projects.
Element Description
Name
Expand Expands all categories. The button is available only in the categorized view.
Project Info Opens the Versions dialog. In this dialog, you can see project’s information, such as comment,
tags, modules, and meta information.
Project Opens the Project Versions dialog (see page 1464). The button is available only when the project
History is selected.
Create Opens the Create Category dialog for creating a new category. The button is available only in
Category the categorized view.
Remove Opens the dialog asking to confirm or cancel the removal of the selected category. The button
Category is available only in the categorized view when the category or the project is selected.
Rename Opens the Rename Category dialog for renaming the selected category. The button is
Category available only in the categorized view when the category or the project is selected.
Move to Opens the Move to Category dialog for choosing the category to move the selected project
Category into. The button is available only in the categorized view when the project is selected.
Rename Opens the Rename Dialog (see page 1460) for renaming the project. The button is available only
when the project is selected.
Add Opens the Add Server Project dialog for creating a new server project.
Remove Opens the dialog to confirm or cancel the removal of the project from the Teamwork Server.
The button is available only when the project is selected.
Create Opens the Create Branch dialog for creating a new branch for the selected project or its
Branch branch. The button is available only when the project is selected.
Login The login name of the user assigned to the selected project.
Name The full name of the user assigned to the selected project.
Permissions A list of permissions given to the selected user for a specific project.
list
<< Moves the selected users from the Available Users list to the Assigned Users list.
>> Move the selected users from the Assigned Users list to the Available Users list.
Rename Dialog
Contents
Use the Rename dialog to change the name of a project or module used in the project. In server
projects, it is safe to change module names as modules are identified by a module ID in the Teamwork
server, not by a module name.
To open the Rename dialog:
Rename dialog
Element Function
Category Select the category for the project or create a new one.
Contents
Use the Open Server Project dialog to open and manage projects.
Contents
Choose Comment Opens a Choose comment dialog with the recently added
comments. You can select a comment from the dialog.
Keep Locks Select this option if you want to keep all the currently locked
elements and modules locked.
Automatically Save Project Locally Updates locally saved project with the latest committed version.
Select this option, if you want to keep your locally saved project
copy up-to-date. This option becomes available when you save a
server project to your computer for the first time.
Local Modules List local modules that were used in the server project. Before
committing, select an action you want to perform for modules.
Contents
In the Project Versions dialog, project versions are listed from oldest (on the top) to newest.
Version The version number of a project. In the example above, the last project version number is denoted as
“3/1”. This is the result of setting a previous project version as the newest one. In this particular
example, “3” denotes the current project version number and “1” denotes the number of the version,
which has been set as the newest one.
Author The login name of the user who created the project version.
Date The date and time the project version was created.
Comme The description of changes in the version. You can make a version comment when committing a
nt version.
Create Opens the Create Branch dialog for creating a new branch for the selected version or branch. The
Branch button is available only if a version or branch is selected.
Remov Opens the dialog to confirm or cancel the removal of the selected branch. The button is available
e only when a branch is selected. You will not be allowed to undo this action.
Branch
Renam Indicates the branch name to rename. The button is available only when a branch is selected.
e
Set As Set the selected project version as the current version. The created version number consists of two
Latest parts: the current version number and the version number set as the current version. If a user does
not have the rights to edit the project, this button is disabled.
Compar Compares two selected branches. If there are differences between project branches, the result is
e presented in the Difference Viewer dialog. The button is available only when two project branches
are selected (use the SHIFT or CTRL keys).
Open Open the selected version of the project. You can make changes only to the latest version of the
project. Earlier versions are read-only.
1. Open the Project Versions dialog (see the procedure Project Versions dialog (see page 1464))
2. Select a project and click Properties.
Author The login name of the author who created the project.
Date The date and time the selected project version was committed.
Meta Information Displays the project's information, such as required plugins and used
modules.
Contents
With the Use Server Project wizard, you can add a selected server project, such as a library, profile, or
other user-defined project part.
1. Selecting a project.
2. Specifying selected project settings.
Step #1: Selecting a project
After the wizard is opened, the list of available server projects appears.
Select the server project you need and do one of the following:
Click Finish after you have specified project settings. The selected server project is added to your
project
Load Mode Opt By selecting an appropriate load mode, you can control how memory is used by a
ion program and project:
But
ton • Always load (default). A selected project is always loaded when the
project is opened.
• Autoload. A selected project is not loaded when the project is loaded.
MagicDraw monitors user activities in the project and loads a particular
project on demand by the project.
• Autoload with prompt. This mode is similar to an autoload mode. The
difference is that MagicDraw asks the user for confirmation before
loading it.
• Manual load. A selected project is not loaded when a project which uses
this project is loaded. The model integrity is not broken, as all required
elements of the project exist, just simplified versions (that is, loaded as
proxies) of the elements are used in the project. This load mode is
recommended for all projects that are stable or rarely modified.
Load Mode
Reload the project after changing the project load mode.
Use Index Che Select this check box to load indexed elements from the not loaded project. This is
ck valid only when the project is not loaded. Using indexed elements in the project
Box increases the performance, as only simplified versions (that is, proxies) of elements
are loaded.
Packages Tab This table lists all shared packages of the project and paths where these packages
le are mounted in the project.
Preferred Path Tex Suggests where to mount the package in the project. This location is used by default
t if not otherwise specified.
Box
Mounted On Tex Displays the real location where the package is currently mounted in the project.
t Click the ... button to change a package location.
Box
All commercial MagicDraw editions will have full use of all features within Report Wizard. The
MagicDraw Community edition allows you to generate reports with watermarks.
Contents
The Report Wizard dialog, see figure below, consists of 2 panes: Control buttons and Content
Management pane.
Control buttons
There are 4 control buttons
• The button is used for proceeding to the next content management pane.
Related pages
Contents
On this page
Report Wizard provides predefined templates such as Use Case, Model Extension, Data Dictionary, IEEE
1233, Class Specification Diagram, Business Process Diagram, and Web Publisher templates. The report
template management pane in the Report Wizard dialog lists all of the report templates from which
you can select to manage or generate your report.
Button Function
Opens the New Template dialog through which you can create a new template.
Imports a template.
Exports a template.
To create a template
1. On the MagicDraw main menu, click Tools > Report Wizard. The Report Wizard dialog will open.
2. Click . The New Template dialog will open.
To delete a template
Note
• In the Report Wizard dialog, when you select the attached template, the
button will be changed to button.
• You can use the button to extract the attached template to the local report
template folder. After you finish editing, you can use the button to re-attach
the updated report template to your project.
To extract a template
4. Click to extract the template. The attached template will be extracted to a local
template.
• After you finish editing, you can use the button to re-attach the updated
report template to your project.
• You can remove an attached template from a project by selecting it and clicking
.
To import a template
2. Select a Report Wizard template with the filename extension *.mrzip and click . The
following Message dialog will open.
To export a template
• In the Report Wizard dialog, select a template and click . The template file will open
in the default editor.
• Variable pane: This pane consists of a table in which the first column is the variable name, the
second column is the variable value, and also includes a report description field. You can view
and directly edit the value of a selected variable in the second column.
• Control buttons: and .
The following instructions explain how to manage the variables of a template.
3. Click .
Deleting a variable.
Glossary
• Use case
A a kind of behavior classifier that specifies a complete unit of useful functionality performed by
one or more subjects to which the use case applies in collaboration with one or more actors. It
also, for complete use cases, yields an observable result that is of some value to those actors or
each subject. Use cases allow you to capture the requirements of systems under design or
consideration, describe functionality provided by those systems, and determine the
requirements those systems pose on their environment.
• Business process diagram
A road map for implementation. It outlines the expected outcome, and provides something
concrete from which to build.
Contents
On this page
This section defines report data, and how to use it in your report to represent variables that you want
to include. Click the following links to navigate to the content of this page.
Selecting the built-in report data in the Report Data management pane.
The following table lists the buttons and their function in the Report Data management pane.
Button Function
• Report Wizard in which all data will be saved into an XML file.
• MagicDraw project, in which case the report data will be saved with the project itself. Saving
report data in a project will enable you to commit the report to Teamwork Server.
The following instructions show you how to create and manage your report data in Report Wizard and
in a MagicDraw project.
1. Click Tools > Report Wizard.
2. Select a template and click .
3. Click . The New Report Data dialog will appear.
Selecting a project module path for the report profile and Report Profile.mdzip in the Use
Project dialog.
4. Click . The “Report Profile” profile will open in the Containment tree as a read-only
profile. You can now use it in your project.
You can right-click a data model, a package, or a profile in the Containment tree to create a
Report Data.
emptyText Store a string value that will be replaced with an empty variable.
1. Click Tools > Report Wizard.
2. Select a template and click .
3. Click . The Edit Report Data dialog will appear.
1. Click Tools > Report Wizard.
2. Select a template and click .
3. Click . The Confirm delete dialog will appear.
4. Click either to delete the selected data or to cancel the operation.
To clone report data
1. Click Tools > Report Wizard.
When a cloned Report Data is created, a copy of the Report Data (variable) will also be created.
Variables contain information that you want to store in a project, such as names and dates. You can
create a report variable in a MagicDraw project or the Report Wizard dialog.
1. Right-click a Report Data in the Containment tree and select Create Element > Variable. The
variable will appear inside the Report Data.
You can also create, edit, and delete variables through the Report Variable dialog in Report Wizard.
3. The new variable will appear in the table in the Report Variable dialog.
3. Click . The new variable value will appear in the column next to the variable name
column.
To delete a report variable
Glossary
• Clone
To clone is to create an exact copy of report data.
• RTF
Rich Text Format (RTF) is a file format developed by Microsoft that can be used with different
word processors in different operating systems.
• In the Select Element Scope pane, see figure above, select the packages from the All
data tree and click Add, Add All, or Add Recursively to add them into the Selected
objects tree.
• In the Select Element Scope pane, see figure above, select the packages from
the Selected objects tree and click Remove or Remove All to remove them from
the Selected objects tree.
To select or clear the Generate Recursively option
• Select or clear the Show Only Package Element check box, see figure above.
The figure above shows the UML 2 Elements package and the Generate Recursively check
box were selected. It means that the UML 2 Elements package and its subpackages will be
generated in the report.
Report file Shows the report file’s location and name. The default report
location will be \data\template_folder\reports\. The
default report name will be the same as the report name
defined by the user.
Report image format Selects an image format for your report: JPG, PNG, SVG, EMF, or
WMF.
Note:
Auto image size Changes the size and orientation of an image before inserting it
into a document. There are four options available:
Generates a report.
The following three figures show you how Report Wizard can automatically deploy an MRZIP file.
325 https://docs.nomagic.com/display/MD190SP1/Report+Wizard+environment+options
• Generating a report from Model in the Containment tree (see page 1513).
• Generating a report from Report Data in the Containment tree (see page 1515).
1. Right-click a package in the Containment tree, select Generate Report, and then select a
template.
• To open the Report Wizard dialog and modify the data or output properties, click the
Report Wizard on the shortcut menu.
• By default, the Quick Generate Report command will select the default settings from
the last changes saved to the Report Data.
1. On the main menu, click Options > Environment to open the Environment Options dialog.
2. Select Keyboard from the tree list.
3. Select Tools from the Category drop-down menu.
4. Press the new shortcut keys on your keyboard, and click .
1. After a report has been generated, a new menu will appear below the Report Wizard menu. The
name of the new menu is the name of the recently generated template.
Info
• The next time you generate a report, a new menu will create and map the keyboard
shortcuts until the keyboard shortcuts list is fully filled. The number of keyboard
shortcuts is limited to five.
• If the keyboard shortcuts list is full, and the new template has been generated, the
keyboard shortcuts will be reused.
The table below lists some of the keyboard shortcuts provided by Report Wizard Quick Print:
Glossary
• Template
A file that serves as a starting point for a new report.
Contents
Report Wizard is built on Velocity Engine. Knowledge of the Velocity Template Language and the Report
Wizard Custom Language used within the Report Wizard template is necessary for understanding,
editing, or creating templates.
Related pages
Contents
On this page
#forrow directive
The Velocity template language (see page 1521) does not support loops inside a table structure. However,
the Report Wizard engine introduces a new custom syntax that allows looping inside the table structure
in order to clone the table rows.
Name Owner
Name Owner
#forpage directive
The #forpage directive is used to provide a loop over the codes within a page. This directive provides
implementation like #forrow, but it creates a loop over a page instead of a row. For example:
#forpage($uc in $UseCase)
$uc.name
#endpage
The report will contain a UseCase name for each document page.
Tip
• Statements preceding the #forpage directive, but in the same page will execute after the
#forpage directive because #forpage is a first priority directive, while statements in the
preceding pages will execute in normal sequence.
• Other statements like importing a library, or creating an array variable, have to be
declared in the pages preceding the #forpage directive.
In OpenDocument Spreadsheet template (see page 1857), you can also use the directives as a template.
The figure below displays an example of the #forpage directive in an OpenDocument Spreadsheet
(ODS) file. When this directive is used in an ODS template, it will create a separate
spreadsheet representing each name of the use cases in the model.
The output after including the #forpage directive in an OpenDocument Spreadsheet file.
The output after including the #forrow and #forcol directives in an OpenDocument Spreadsheet
file.
Since the #forrow syntax is similar to the #foreach syntax, the #foreach syntax can then be used in
#forrow.
You can find more examples of using the #forrow and #forcol directives in the Other Documents
templates in the Report Wizard dialog (see page 1470).
To open an Other Documents template in the Report Wizard dialog (see page 1470)
1. On the main menu, click Tools > Report Wizard. The Report Wizard dialog opens.
2. In the Select Template tree, expand Other Documents.
3. Select any template and click Open.
326 https://docs.nomagic.com/download/attachments/42588216/Magic%20Library.mdzip?
api=v2&modificationDate=1510562160640&version=1
#include allows you to import another template. The contents of the file will not be rendered through
the template engine.
#set($fileName = $attachedFile.file)
#include($fileName)
or
#include("document.docx")
Information
• $fileName can be either an absolute or relative path to a file in the file system.
• $fileName can be only static or dynamic String.
• If the file is not found in the file system, $fileName would be searched as an Attached
File Element in a MagicDraw project in the File property.
327 http://velocity.apache.org/engine/1.7/user-guide.html#include
#includeSection directive
Report Wizard introduces a statement, which allows a template to include any section of a document
from another template. This statement requires the template to define the beginning and the end of
the section.
The logical concept of the #includeSection and #parse directives is similar. Both directives allow a
template to include another template and render it through the template engine. However,
#includeSection can be used to specify only the section that you would like to include.
#sectionBegin ('sectionA')
...
#sectionEnd
#includeSection('document.docx', 'sectionA')
Information
• fileName and sectionName must be static String only, e.g.,
#includeSection('document.docx', 'sectionA').
• If the file is not found in the file system, fileName would be searched as an Attached File
Element in a MagicDraw project in the File property.
Variable Scope Variables declared in Variables declared in the parent Variables declared in
the parent template template can be the parent template can
are not accessible in the accessed in the included page. be accessed in the
included page. included page.
Rendering The Include template is The Include template is The Include template is
not rendered through rendered through the rendered through the
the template engine. template engine as a separate template engine as a
process. single process.
Size of parent The size of the parent The size of the parent template The size of the parent
template template remains remains unchanged. template is increased
unchanged. by the included section.
Processing The #include directive The #parse directive increases The #includeSection
overhead increases the processing the processing overhead with directive does not
overhead with the the necessity of an additional increase
necessity of an call to the template engine. the processing
additional overhead.
call to the template
engine.
328 http://velocity.apache.org/engine/1.7/user-guide.html#include
The velocity code in the figure above uses the Tab key to indent code. However, the generated report
does not include those indents. The Tab key support is available in RTF, DOCX, and ODT format files.
Unparsed code
Velocity allows the template designer to easily use a large amount of uninterpreted and unparsed
content in VTL code. This is especially useful if you want to avoid multiple directives or sections whose
content would otherwise be invalid (and thus unparseable) VTL.
#[[
#foreach($c in $Class)
$c.name
#end
]]#
#foreach($c in $Class)
$c.name
#end
The Unparsed Code support is available in HTML, XML, and text files only.
Contents
The variables imported to the template are collected by the type of element selected in the package
scope. Use the fourth step in the Report Wizard dialog to select the package scope. In this example, we
take a class diagram with the class name Customer, see figure below, to print it in a report.
• Right-click the Customer class diagram and open the Specification dialog. The element type will
appear on the dialog title, and the attribute names will appear on the right-hand side of the
dialog box (see the following figure).
Name: Customer
Owner: com
Visibility: public
Is Abstract: false
RepresentationTextCreator.getR
epresentedText(Element
element)
• $elements
contains a list of all the elements selected from the element scope.
• $packageScope
contains a selected package from the element scope.
• $elementScope
contains selected elements from the element scope.
• $empty
contains a String for empty value, which is specified from the Output Options pane.
humanName and humanType are locale-specific text. If you plan to generate a report in
different languages, try to avoid humanType and humanName. Instead, use elementType for a
non-locale-specific report.
Related pages
$element.propertyName
propertyName should be typed in camel case style. The name and returned type of property can be
found in MagicDraw UMLMetaModel UserGuide. It lists all the properties which can be called through
each element type.
Please be aware of the type of the returned value, as some properties may return an array. You can get
each value by using a #foreach directive or by specifying array index number. For example:
#foreach($c in $class.classifier)
$c.name
#end
Moreover, the customized elements are able to get their property value immediately by calling property
name:
$RepresentationText.propertyName
You can see the representation text of the element by opening the Specification dialog.
If the property value is not printed out to your report, you can assume the property that you call is not
the property of the customized element. It may be the property of the applied stereotype. You would
rather check the stereotype owner of that property by going to the Applied Stereotype property of the
element, then right click on the right column, and select the stereotype in the containment tree.
If you navigate to the stereotype element on the containment tree, then you can expand it to see its
owned properties. If you can see your desired property in the stereotype, you can get its value by:
We also provide helper module in section Helper tools (see page 1543). These modules are utility modules
for getting property values. More details about openAPI of each element can be found at:
{md_install}\plugins\com.nomagic.magicdraw.reportwizard\api\javadoc.zip
Contents
On this page
#foreach($instance in $InstanceSpecification)
#foreach($slot in $instance.slot)
#if($slot.definingFeature.name == 'Name')
#if($slot.value.size() > 0)
#set($v = $slot.value.get(0).text)
#else
#set($v = "")
#end
Slot value is $v
#end
#end
#end
In which:
• $element is an element.
• slots is a property for getting slot variables.
For example, if you want to obtain a collection of slot variables of an element, type:
#foreach($slot in $instanceSpecification.slots)
$slot.name
#end
$element.slots.ClassifierName
or
$element.slots.get("ClassifierName")
Where:
• $element is an element.
• slots is a property for getting the slots variable.
• ClassifierName is the classifier’s name.
The code returns:
$instanceSpecification.slots.Communicate
$instanceSpecification.slots.get("Communicate")
Retrieving slot value from an element, a classifier’s Name, and a defining feature name
$element.slots.ClassifierName.DefiningFeatureName
or
$element.slots.ClassifierName.get("DefiningFeatureName")
or
$element.slots.get("ClassifierName").DefiningFeatureName
or
$element.slots.get("ClassifierName").get("DefiningFeatureName")
• $element
is an element.
• slots
is a property for getting slots variable.
• ClassifierName
is the classifier’s name.
• DefiningFeatureName
is the name of a slot.
The code returns:
• A slot value whose name is DefiningFeatureName and a classifier whose name is ClassifierName.
• If the slot multiplicity is < =1 (less than or equal to 1), it will return the value in ValueSpecification.
• If the slot multiplicity is > 1, it will return the value in array of ValueSpecification.
For example, if you want to retrieve the values of a slot whose name is “Address” and those of a
classifier whose name is “Communicate”, type:
$instanceSpecification.slots.Communicate.Address
$instanceSpecification.slots.Communicate.get("Address")
$instanceSpecification.slots.get("Communicate").Address
$instanceSpecification.slots.get("Communicate").get("Address")
The following figure shows the Instance Specification dialog of the element Member of the slot variable.
As you can see in the dialog, the element Member of the slot variable contains slot names and values.
Example 1.
If you want to print the value of a slot Address of the element Member from the classifier
Communicate, you can use the following template code as a shortcut. Note that the slot multiplicity =
1.
#foreach($instance in $InstanceSpecification)
Slot value is $instance.slots.Communicate.Address
#end
Slot value is US
If you want to print the value of a slot Telephone of the element Member from the classifier
Communicate, you can use the following template code as a shortcut. Note that the slot multiplicity is
> 1, [1..*].
#foreach($instance in $InstanceSpecification)
Slot value is $instance.slots.Communicate.Telephone
#end
Example 3.
If you want to print the value of a slot Name of the element Member from the classifier Personal Data,
you can use the following template code as a shortcut. Note that the slot multiplicity = 1.
#foreach($instance in $InstanceSpecification)
Slot value is $instance.slots.get("Personal Data").get("Name")
#end
Example 4.
If you want to print the value of a slot Nickname of the element Member from the classifier Personal
Data, you can use the following template code as a shortcut. Note that the slot multiplicity is > 1, [0..*].
#foreach($instance in $InstanceSpecification)
Slot value is $instance.slots.get("Personal Data").get("Nickname")
#end
If you want to use $Report method to print the value of a slot Name of the element Member from the
classifier Personal Data, you can use the following template code.
#foreach($instance in $InstanceSpecification)
Slot value is $report.getSlotValue($instance, "Personal Data", "Name")
#end
Example 6.
If you want to use $Report method to print the value of a slot Nickname of the element Member from
the classifier Personal Data, you can use the following template code.
#foreach($instance in $InstanceSpecification)
Slot value is $report.getSlotValue($instance, "Personal Data", "Name")
#end
Example 7.
If you want to print the names and values of all classifiers and the slot properties of all instance
elements, you can use the following template code as a shortcut.
#foreach($instance in $InstanceSpecification)
#foreach($classifier in $instance.slots)
Classifier name: $classifier.name
Slots:
#foreach($slot in $classifier)
$slot.name : $slot.value
#end
#end
#end
Report tool
Contents
On this page
$report.createValueSpecificationText(specification)
Create texts representing the ValueSpecification element.
$report.filterDiagram(diagramList, diagramTypes)
Return a collection of diagrams from a list of diagrams filtered by types.
$report.filterElement(elementList, humanTypes)
Return a collection of elements from a list of elements filtered by human types.
Note
You can change the human type depending on the language used in MagicDraw. For example,
"Class" is human type of the classes in English MagicDraw while "Classe" is humanu type for the
classes in French MagicDraw. The specified humanTypes needs to be changed when you
change the language used in MagicDraw.
For example:
$report.filterElement(elementList, humanTypes)
$report.filterElementType(elementList, elementType)
Return a collection of elements from a list of elements filtered by element types.
$report.findElementInCollection(elementList, name)
Find an element from a collection of elements by name.
$report.findRelationship(modelPackage)
Search and return a collection of relationship elements inside a package.
$report.findRelationship(modelPackage, recursive)
Search and return a collection of relationship elements inside a package.
$report.getAppliedStereotypeByName(element, stereotypeName)
Return a stereotype assigned to an element.
$report.getBaseClassAssociations(classifier)
Obtain a collection of associations of a classifier.
$report.getBaseClassInheritableAttributes(classifier)
Get a collection of inheritable attributes of a classifier.
$report.getBaseClassInheritableOperations(classifier)
Obtain a collection of inheritable operations of a classifier.
$report.getBaseClassPorts(classifier)
Find a collection of ports of a classifier.
$report.getBaseRealizedInterfaces(behavioredClassifier)
Find a collection of realized interfaces of a behaviored classifier.
$report.getBaseRelations(classifier)
Find a collection of relations of a classifier.
$report.getBaseClassifiers(child)
Return a collection of base elements of a classifier.
$report.getClientElement(element)
Return a client of a relationship.
Get a customization property from the specified applied stereotype of the element.
$report.getCustomizationPropertyString(element, stereotypeName,
propertyName)
Get a customization property as a String value from the specified applied stereotype of the element.
$report.getDerivedClassifiers(parent)
Return a collection of derived elements of a classifier.
$report.getDiagramElements(diagram)
Get a collection of elements from a diagram.
$report.getDiagramType(diagram)
Return a diagram type.
$report.getDSLProperty(element, propertyName)
Return a DSL Property.
$report.getElementComment(element)
Return a comment attached to an element. If no comment is attached, it will return a null value.
$report.getElementName(element)
Get an element’s name. If the name is empty, it will return "<unnamed>". This method performs the
following procedures:
• If the element is generalized from the NamedElement metaclass, it will return $element.name
$report.getIconFor(element)
Return an image icon of an element with a default icon filename (“icon_”+element type).
$report.getIconFor(element)
$report.getIconFor($classObject)
This results in an Image object of a class whose name “icon_24676200”. The number in the icon name is
hash code, which is regenerated whenever MagicDraw starts.
$report.getIconFor(type)
Return an image icon for an element type with a default icon’s filename ((“icon_”+element type).
$report.getIconFor(type)
$report.getIconFor("class")
This results in an Image object of a class whose name “icon_24676200”. The number in the icon name is
hash code, which is regenerated whenever MagicDraw starts.
$report.getInnerElement(element)
Return a collection of inner elements.
$report.getInteractionMessageType(message)
Return an interaction message type.
$report.getMetaClass(stereotype)
Return a stereotype meta class.
$report.getPresentationDiagramElements(diagram)
Return presentation elements in a diagram. This method will return all presentation elements from the
diagram, except non-manipulator symbols.
$report.getPresentationDiagramElements(diagram, includeNonManipulator)
Return presentation elements in a diagram.
$report.getPresentationElementBounds(diagram, element)
Return the polygonal bounds of an element. The bounds specify the component coordinates to its
diagram.
$report.getPresentationElementBounds(element)
Return the polygonal bounds of an element. The bounds specify this component's coordinate to its
diagram.
$report.getPresentationElementRectangle(diagram, element)
Return the rectangular bounds of an element. The bounds specify the component coordinates to its
diagram.
$report.getQualifiedName(namedElement, separator)
Get a qualified name. A qualified name is the name that allows a NamedElement to be identified within
a hierarchy of nested Namespaces. It is constructed from the names of the containing namespaces
starting at the root of the hierarchy and ending with the name of the NamedElement itself.
$report.getPackageQualifiedName(namedElement, separator)
Get a qualified name by considering only Packages and a given element. Models and Profiles will not
be included in the qualified name.
Design : Model -> com : Package -> nomagic : Package -> ui -> Package -> BaseDialog :
Class
$report.getPackageQualifiedName($class, ".")
com.nomagic.ui.BaseDialog
$report.getReceivingOperationalNode(element)
Get the needline association ends.
$report.getRelationship(element)
Return an element’s relationship.
$report.getRelationship(element, recursive)
Return a collection of element relationships.
$report.getRelativeActor(element)
Return an element’s relative actor.
$report.getSendingOperationalNode(element)
Return the needline’s association ends.
Use the code to retrieve the value of a slot whose name and classifier’s name are Name and Personal
Data respectively.
#foreach($instance in $InstanceSpecification)
Slot value is $report.getSlotValue($instance, "Personal Data", "Name")
#end
$report.getStereotypes(element)
Return all stereotypes applied to an element. This method is replaced by $element.appliedStereotype.
$report.getSupplierElement(element)
Return the supplier of a relationship.
$report.getUsageElements(usagesMap, element)
Return the usage of a specified element.
$report.getUsages(selectedObjects)
Return the Usage Map of MagicDraw. It uses the getUsageElements method to return the usage of a
specified element.
$report.hasStereotype(element)
Check if an element has stereotypes.
$report.isNamedElement(element)
Return whether an element is a NamedElement.
$report.isNull(obj)
Test and return true if an object is null.
$report.isRelationship(element)
Test and return true if an element is a relationship.
$report.serialize(hyperlink)
Convert com.nomagic.magicdraw.hyperlinks.Hyperlink to
com.nomagic.magicdraw.plugins.impl.magicreport.helper.Hyperlink. Report Wizard needs the
com.nomagic.magicdraw.plugins.impl.magicreport.helper.Hyperlink class wrapper to return
com.nomagic.magicdraw.hyperlinks.Hyperlink data.
$report.getUsedBy(element)
Return a list of element(s) used by this element (except diagrams).
$report.hasProperty(element, propertyName)
Return true when a property with a given name is specified in this element, otherwise returns false.
#foreach($element in $elements)
$report.hasProperty($element, "name")
#end
$report.getProperty(element, propertyName)
Get element property.
#foreach($element in $elements)
$report.getProperty($element, "name")
#end
$report.findElementByName(source, regex)
Search and return elements that match the name using a regular expression.
$report.findElementByName(source, regex)
$report.getPresentationElements(diagram)
Get a presentation element in a diagram. This method is equivalent to
$report.getPresentationDiagramElements(diagram).
#foreach($diagram in $Diagram)
$foreach($d in $report.getPresentationElements($diagram))
$d.name
#end
#end
$report.getUsageRepresentationText(baseElement, bool)
Format the usage subject. The output string is the same as the Result column of Used by table in Magic
Draw.
$report.getUsageRepresentationText(baseElement, bool)
#foreach($baseElement in $Elements)
$report.getUsageRepresentationText($baseElement, false)
#end
$report.getUseCaseNumber(element)
Return a use case number of an element.
For example:
Sample of $report.getUseCaseNumber(element)
$report.getElementURL(element)
Return a MagicDraw's element URL.
Sample of $report.getElementURL(element)
$report.isEmpty(obj)
Test and return true if an object is null, empty string, or empty collection.
Sample of $report.isEmpty(obj)
#if ($report.isEmpty($var))
Object is null, empty string or empty collection
#end
$report.getBasicFlows(usecase:UseCase) : List<FlowStep>
Find and return a list of basic flows from a given use case. If a use case scenario is not being used, it will
retrieve the value from "requirementUseCase" stereotype tags.
For example:
$report.getAlternativeFlows(usecase:UseCase) : List<FlowStep>
Find and return all alternative flows from a given use case. The alternative flows will be listed from all
possible branches of basic flows. If a use case scenario is not being used, it will retrieve the value from
"requirementUseCase" stereotype tags.
#foreach($e in $elements)
$e.name : $e.humanType
#foreach($child in $report.getOwnedElementsIncludingAdditional($e, true))
$child.name : $child.humanType
#end
#end
#foreach($e in $SmartPackage)
$e.name : $e.humanType
#foreach($child in $report.getOwnedElementsIncludingAdditional($e, true))
$child.name : $child.humanType
#end
#end
#set($packages = $array.createArray())
#set($void = $array.addCollection($packages, $Package))
#set($void = $array.addCollection($packages, $SmartPackage))
#foreach($e in $packages)
$e.name : $e.humanType
#foreach($child in $report.getOwnedElementsIncludingAdditional($e, true))
$child.name : $child.humanType
#end
#end
Contents
On this page
$project.getName()
Returns a project name.
Parameter(s) - - -
Parameter(s) - - -
$project.getFileName()
Gets a project filename.
Parameter(s) - - -
$project.getExtension()
Gets a project filename extension.
Note
This function is only for local projects.
Parameter(s) - - -
$project.getDirectory()
Get a project directory name.
Note
This function is only for local projects.
Parameter(s) - - -
$project.getVersionList()
Returns a list of version information from an open Server project.
Par - - -
am
eter
(s)
$project.getDiagrams()
Returns all existing diagrams stored in a particular project.
$project.getDiagrams(type)
Returns existing diagrams of a given type stored in a particular project.
Sample code
$project.getPresentationDiagrams()
Returns all existing presentation diagrams stored in a particular project.
Sample code
$project.isRemote()
Returns the remote or non-remote state of a project.
Na Type Description
me
$project.isDirty()
Returns true if that particular project was modified after it had been saved or loaded.
Na Type Description
me
Ret - java.lang. Return true if a project was modified after it had been saved/loaded, otherwise false.
urn Boolean
$project.getElementByID(id)
Returns an element with a given ID.
Retur - com.nomagic.magicd An element with a given ID or null if the element with such ID is not
n raw.uml.BaseElement registered in the project.
Sample code
#set($ele = $project.getElementByID("_9_0_62a020a_1105704887361_983947_8206"))
$ele.name
$ele.humanType
$project.getAllElementId()
Returns a collection of all element IDs in a project.
$project.getXmiVersion()
Returns the XMI version of a project.
$project.getVersion()
Return a project version number.
$project.getModel()
Returns a model (the root container of all model structures).
$project.getPrimaryModel()
Returns the primary (main) model of the project (not including the ones from modules (attached
projects)).
Na Type Description
me
$project.getAllModels()
Returns a list of models in the project (the primary model of the project and all the models of the
modules(attached projects)).
$project.getModuleList()
Returns a list of used server and local modules from a current project.
Na Type Description
m
e
$project.getModuleList(includeAuxiliary)
Returns a list of used server and local modules as well as auxiliary resources from a current project.
Param include boolean Returns modules including auxiliary resources if this value is true
eter(s) Auxiliar (false by default).
y
$project.getSharedModule()
Returns a list of shared modules from a current project.
Na Type Description
m
e
$project.getSharedModule(projectModule)
Returns a list of shared modules from a specified project module.
$project.getServerModule()
Returns a list of used server modules.
Na Type Description
me
$project.getServerModule(includeAuxiliary)
Returns a list of used server modules as well as auxiliary resources.
Para includeAu boolean Returns server modules including auxiliary resources if this value is
meter xiliary true (false by default).
(s)
$project.getLocalModule()
Returns a list of used local modules.
Na Type Description
m
e
$project.getLocalModule(includeAuxiliary)
Returns a list of used local modules as well as auxiliary resources.
Para include boolean Returns local modules including auxiliary resources if this value is true
meter Auxiliar (false by default).
(s) y
$project.getAuxiliaryResource()
Returns a list of auxiliary resources.
Na Type Description
m
e
Project Version
The full class name is com.nomagic.magicdraw.magicreport.tools.ProjectVersion.
ProjectVersion is a class that represents some version of the project or module. It contains date, user,
number, etc.
Sample code
Project Module
The full class name is com.nomagic.magicdraw.magicreport.tools.ProjectModule.
ProjectModule is a wrapper Class of an attached project (com.nomagic.ci.persistence.IAttachedProject)
that represents a special kind of the project that is used as a component in the current project.
required java.lang.String Returns a required version of the module. This property works for
Version Teamwork Server projects. It will return -1 when the module is the latest
version, and the required version is not set.
isRemot boolean Checks if the module is remote - from Teamwork server or Teamwork Cloud.
e()
#foreach($module in $project.getModuleList())
Name : $module.representationString
Description : $module.description
Version : $module.version
RemoteID : $module.remoteID
URI : $module.URI
#if($module.isRemote())
#set($version = $module.projectVersion)
Current module version :
date : $version.date
number : $version.number
numberAsString : $version.numberAsString
user : $version.user
comment : $version.comment
tags:
#foreach($tag in $version.tags)
- $tag
#end
All module versions :
#foreach($version in $module.versionList)
date : $version.date
number : $version.number
numberAsString : $version.numberAsString
user : $version.usercomment : $version.comment
tags:
#foreach($tag in $version.tags)
- $tag
#end
----------
#end
#end
Shared module:
#foreach ($child in $project.getSharedModule($module))
- $child.representationString
#end
#end
Iterator tool
$iterator is used with the #foreach loops. It wraps a list to let you specify a condition to terminate the
loop and reuse the same list in a different loop. The following example shows how to use $iterator.
$iterator.wrap( list )
$<IteratorTool instance>.reset()
Reset the wrapper so that it will start over at the beginning of the list.
$<IteratorTool instance>.stop()
$<IteratorTool instance>.toString()
List tool
$list is a list tool used to work with lists and arrays in a template. It provides a method to get and
manage specified elements. You can also use it as a means to perform some actions on a list or array
such as:
• Check if it is empty.
• Check if it contains certain elements.
For example:
$list.contains(list, element)
element - An element
instance.
index - An index of an
object in a list.
index - An index of
an object in
the list.
value - An object to be
set to the list.
Bookmark tool
$bookmark contains utility functions for bookmarking. The functions of this module are accessible from
templates through $bookmark.
Information
In RTF reports, the default style of bookmarks depends on the RTF editor used. For example,
Microsoft Word 2003 displays hyperlinks in blue.
$bookmark.openURL(url, content)
$bookmark.openURL(uri, content)
Create a hyperlink for a bookmark. The bookmark ID will be automatically generated from the content.
Create a hyperlink for a bookmark. The bookmark ID value must match the parameter bookmark ID
that passes onto the link.
Create a bookmark. The bookmark ID will be automatically generated from the bookmark object.
Create a bookmark. The default element type for this function is "label".
Sorter tool
$sorter is used to sort a collection of report templates.
$sorter.sort(Collection, fieldName)
The sort function for report templates. The context name of this class is "sorter". Use $sorter to access
public functions of this class through templates.
$sorter.sort(Collection)
This is the sort function for report templates. The context name of this class is "sorter". Use $sorter to
access public functions of this class through the templates.
$sorter.sortByFirstNumber(Collection, fieldName)
The sortByFirstNumber function is for report templates. The context name of this class is "sorter". Use
$sorter to access public functions of this class through templates.
$sorter.sortByFirstNumber(Collection)
The sortByFirstNumber function for report templates. The context name of this class is "sorter". Use
$sorter to access public functions of this class through templates.
$sorter.sortByLocale(Collection, String)
This is a function to sort for report templates. The context name of this class is "sorter". Use $sorter to
access public functions of this class through templates. To sort a given collection by a particular
language, identify the country code to specify the language.
This is a function to sort for report templates. The context name of this class is "sorter". Use $sorter to
access public functions of this class through templates. To sort a given collection by a particular
language, specify the language by identifying the country code and field name.
$sorter.humanSort(collection, fieldName)
$sorter.humanSort(collection)
This is a special function to sort text in a human-like order. It splits text into numeric and non-numeric
chunks and sorts them in numerical order. For example, "foo10" is ordered after "foo2".
Template tool
$template is the tool used for getting a template’s information.
Parameter(s) - - -
$template.getResourcesLocation()
Parameter(s) - - -
$template.getTemplateFile()
Parameter(s) - - -
$template.getTemplateLocation()
In case, there is an included template, the latest included template location would be returned,
otherwise, the main location of a template file will be returned.
Parameter(s) - - -
Parameter(s) - - -
$template.getOutputFile()
Parameter(s) - - -
$template.getOutputFileNoExt()
Parameter(s) - - -
$template.getOutputLocation()
Parameter(s) - - -
File tool
Contents
On this page
$file.silentCreate('overview.html')
Return - void
$file.silentCreate(attachedFile)
A shortcut to create a file, the output filename of which is the template name, not an import context
object. For example:
$file.silentCreate($attachedFile)
Return - void
$file.silentCreate(templateFilename, importObject)
A shortcut to create a file, the output filename of which is the template name. For example:
$file.silentCreate('overview.html','')
Return - void -
$file.silentCreate(attachedFile, importObject)
A shortcut to create a file, the output filename of which is the template name. For example:
$file.silentCreate($attachedFile,'')
Return - void -
$file.silentCreate('overview.html','overview.html','')
Return - void -
$file.silentCreate($attachedFile,'overview.html','')
Return - void -
$file.silentCreate('html','overview','overview','')
Return - void -
$file.silentCreate('html',$attachedFile,'overview','')
Return - void -
$file.create('overview.html')
$file.create(attachedFile)
A shortcut to create a file, the output filename of which is the template name, not an import context
object. For example:
$file.create($attachedFile)
$file.create(templateFilename, importObject)
A shortcut to create a file, the output filename of which is the template name. For example:
$file.create('overview.html','')
$file.create(attachedFile, importObject)
A shortcut to create a file, the output filename of which is the template name. For example:
$file.create($attachedFile,'')
$file.create('overview.html','overview.html','')
importObje java.lang. An object reference, which will be $importer in the template file. You
ct Object can use the $importer variable in the template file to get data.
$file.create($attachedFile,'overview.html','')
$file.create('html','overview','overview','')
Parameter(s) templateType java.lang.String A template type such rtf, html, and htm.
$file.create('html',$attachedFile,'overview','')
Parameter(s) templateType java.lang.String A template type such rtf, html, and htm.
$file.createAndWait(templateFilename)
Open a new template engine to generate a report and return a path to generate the file. The generated
report will be given the template filename. For example:
$file.createAndWait('overview.html')
$file.createAndWait(attachedFile)
Open a new template engine to generate a report and return a path to generate the file. The generated
report will be given the template filename. For example:
$file.createAndWait($attachedFile)
$file.createAndWait(templateFilename, contextValue)
Open a new template engine to generate a report and return a path to generate the file. The generated
report will be named after the template filename. For example:
$file.createAndWait('overview.html',$var)
Return java.lang.String
$file.createAndWait($attachedFile,$var)
Return java.lang.String
$file.createAndWait('overview.html','overview.html',$var)
$file.createAndWait($attachedFile,'overview.html',$var)
$file.createAndWait('overview.html','overview.html','var',$var)
$file.createAndWait($attachedFile,'overview.html','var',$var)
$file.createAndWait('overview.html','overview.html',$map)
$file.createAndWait($attachedFile,'overview.html',$map)
$file.copy(inputFilename)
Copy an input file to an output file using the same name in the binary format. For example:
$file.copy('icon.gif')
$file.copy(inputFilename, outputFilename)
Copy an input file to an output file in the binary format. For example:
$file.copy('icon.gif','icon.gif')
$file.exists(pathname)
Test if a file denoted by a specific pathname exists. By default, the current directory refers to a template
location. For example:
$file.exists("$template.resourcesLocation/myimage.png")
$file.exists("C:/myfolder/myimage.png")
$file.exists("mytemplate.txt")
$file.computeName(directory, name)
Create a pathname string from a given directory and name.
Array tool
Use $array to create an Array or a HashSet instance.
$array.createArray()
Parameter(s) - - -
$array.createArray(collection)
Construct an ArrayList containing elements of the specified collection, in the order they are returned by
the collection's iterator. Return a zero size ArrayList if the given collection is null.
$array.subList(list, size)
$array.addCollection(parent, child)
Add a child list into a parent collection. It helps the template handle the case where the child is null.
Return - void
$array.createHashSet()
Parameter(s) - - -
Contents
$group.create()
Parameter(s) - - -
$group.init()
Parameter(s) - - -
Return - void -
$group.groupNames()
Parameter(s) - - -
$group.contains(groupName)
$group.put(groupName, object)
Return - void -
$group.get(groupName)
$group.removeAll()
Parameter(s) - - -
Return - void
$group.clear()
Parameter(s) - - -
Return - void -
Map tool
$map.createHashMap()
Parameter(s) - - -
Date tool
$date is a method to display and format the current date and time.
$date
Display the current date and time, for example, Oct 19, 2003 and 9:54:50 PM respectively.
$date.long
Display the current date and time in a long form, for example, October 19, 2003 and 9:54:50 PM.
respectively.
$date.full_date
Display the current date in a full form, for example, Sunday, October 19, 2003.
$date.get('format')
G Era designator AD
y Year 1996 96
w Week in year 27
W Week in month 2
d Day in month 10
a Am/pm marker PM
m Minute in hour 30
s Second in minute 55
S Millisecond 978
• If the number of letters in a pattern letters is four or more, a calendar specific long form is used.
• Otherwise, a calendar specific short or abbreviated form is used.
yy 10
yyyy 2010
• If the number of letters in a pattern is less than 3, the number form is used.
• If the number of letters in a pattern is 3, a short or abbreviated form is used.
• If the number of letters in a pattern is 4 or more, the full form is used.
M 4
MM 04
MMM Apr
MMMM April
Days
• If the number of letters in a pattern is four or more, the full form is used.
• Otherwise, a calendar specific short or abbreviated form is used.
E Mon
EEEE
Profiling tool
You can use $profiling to access MagicDraw meta-model information.
$profiling.getGeneralizationName(modelName)
$profiling.getElementProperties(modelName)
$profiling.getElementProperties(element)
$profiling.getElementProperty(element, propertyName)
Image tool
Contents
$image provides a rich set of image manipulation methods that enable you to transform images during
report generation. With $image, you can scale, rotate, and resize images.
Syntax
1. Scaling Images
2. Rotating Images
3. Fixed-Pixels Image Resizing
4. Fixed-Measurement Image Resizing
5. Including External Images
Multiple image transformations will have cumulative effects. Desired sizes can be specified either as
pixel counts or as measurements in inches, centimeters, or millimeters. While the parameters for
resizing an image with a specific measurement (in, cm, mm, pt, or px) must be specified in a pair of
quote marks, all other size parameters do not need to be specified in a pair of quote marks.
The keepRatio parameter takes either a true or false value; a true value will resize the image and keep
the original image height/width ratio; a false value will only resize one axis, as set by the method name,
resulting in a stretched image.
Related pages
Scaling Images
There are two scaling methods that you can use to scale an image using a given factor. For example,
Method 1 provides height and width parameters (scaleWidth and scaleHeight), while Method 2 provides
a single parameter that will scale both axes equally (scaleFactor). These three parameters must be
positive real numbers.
$image.scale(image, scaleFactor)
$image.setScalingQuality(5)
$image.scale(0.5)
The code above will set the image scaling quality to ‘highest’. The possible values are from 1 to 5, where
5 is ‘highest’ and 1 is ‘lowest’. The following table provides the description of each value.
Value Description
Rotating Images
There are two rotating methods that you can use to rotate a given image by 90 degrees: (i) rotateRight
for clockwise rotation and (ii) rotateLeft for counterclockwise rotation.
$image.rotateRight(image)
$image.rotateLeft(image)
RTF Image rotation, with the scaling quality set to 'highest,' is not supported in any RTF
document when opened with OpenOffice.org329.
$image.setWidth($diagram.image, -1)
As shown by the example, the image will be resized to a paper width while maintaining the aspect ratio.
The value -1 applies only to certain template types such as RTF, ODT, and DOCX. If the value is -2, it will
resize an image to document paper bounds if and only if image bounds are larger than paper bounds.
For example:
$image.setWidth($diagram.image, -2)
Using the value -2 also maintains the image aspect ratio. However, it can only be applied to certain
template types such as RTF, ODT, and DOCX.
Return an image icon for an element. This method is used to resize the image to an exact size; the
width and height in pixels.
329 http://OpenOffice.org
$image.setHeight(image, size)
Return an image icon for an element. This method is used to resize the image to a specific height (in
pixels), while maintaining the image aspect ratio.
Return an image icon for an element. This method is used to resize the image to a specific height (in
pixels) and to specify whether the image aspect ratio is to be maintained or not (depending on the
keepRatio parameter).
$image.setWidth(image, size)
Return an image icon for an element. This method is used to resize the image to a specific width (in
pixels), while maintaining the image aspect ratio.
Return an image icon for an element. This method is used to resize the image to a specific width (in
pixels) and to specify whether the image aspect ratio is to be maintained or not (depending on the
keepRatio parameter).
Return an image icon for an element. This method is used to resize the image to an exact size; the
width and height in terms of measurements.
$image.setHeight(image, measureSize)
Return an image icon for an element. This method is used to resize the image to a specific height in
terms of measurement while maintaining the image aspect ratio.
Return an image icon for an element. This method is used to resize the image to a specific height (a
term of measurement), and to specify whether the image aspect ratio is to be maintained or not
(depending on the keepRatio parameter).
$image.setWidth(image, measureSize)
Return an image icon for an element. This method is used to resize the image to a specific width in a
term of measurement, while maintaining the image aspect ratio.
Return an image icon for an element. This method is used to resize the image to a specific width (a term
of measurement), and to specify whether the image aspect ratio is to be maintained (depending on the
keepRatio parameter).
$image.setDPI(dotsPerInches)
This method is used to set the resolution (dpi) of images. The default value is 96 dpi. The dpi value will
only affect the methods that take inches, centimeters, and millimeters as their parameters.
Return - - -
Use $image.setSize($diagram.image, ‘1.5in’, ‘2in’), for example, to resize the image’s width to 1.5
inches and height to 2 inches. The following photos show the result.
$image.include(location)
$image.include("c:/my document/logo.gif")
$image.include("http:/www.nomagic.com/images/product_boxes/MD.gif")
Splitting images
If you have an image that is larger than the paper size, you can split the image into smaller tiles.
Split an image into rows and columns. The returned array of the image contains chunks of images
arranged from left-to-right and top-to-bottom.
Na Type Description
me
Return java.util.List<com.nomagic. The array of the split image ordered from left-to-right and top-
magicreport.Image> to-bottom.
For example, to split an image into 3x2 tiles, type the following lines:
Split an image into rows and columns by automatically calculating the number of rows and columns
based on the paper size. The returned array of the image contains divided images arranged from left-
to-right and top-to-bottom.
Na Type Description
m
e
Return java.util.List<com.nomagic. The array of the split image ordered from left-to-right and top-
magicreport.Image> to-bottom.
Tableprop tool
Contents
$tableprop is a table property tool to manage table style. In this version, you can set merged rows
vertically and columns horizontally in DOCX, PPTX, and XLSX templates using $tableprop.
Note
This statement must be defined in a table.
Related pages
$tableprop.mergeColumns(int number)
When you put the statement in to a column, it will be set as merged column in a specified number.
For example:
Template Code:
Project $tableprop.mergeColumns($Package.size())Packages
#forcol($p in $Package)$p.name#endcol
Output:
$tableprop.mergeColumns(String stringNumber)
When you put the statement in to a column, it will be set as merged column in a specified string of
number.
For example:
Template Code:
Project $tableprop.mergeColumns(“3”)Packages
#forcol($p in $Package)$p.name#endcol
Output:
$tableprop.mergeRows(Int number)
When you put the statement into a row, it will be set as a merged row in a specified number.
Template code:
#forrow($c in
#end#if(false) #end#end#endrow
$tableprop.mergeRows(String stringNumber)
When you put the statement into a row, it will be set as a merged row in a specified String of number.
For example:
Template code:
#set($a = $array.createArray())
#set($void = $a.add("A"))
#set($void = $a.add("B"))
#set($void = $a.add("C"))
#forrow($c in $c#endrow
$a)Name$tableprop.mergeRows("3")
Installation
To install Report Wizard Template Editor in Microsoft Word
1. Download and install Microsoft XML Services (MSXML) from the following URL (You can skip this
step if the latest version of MSXML is already installed in your system):
http://www.microsoft.com/downloads/details.aspx?
FamilyID=d21c292c-368b-4ce1-9dab-3e9827b70604&DisplayLang=en
2. Copy all files and subdirectories from the
<install.dir>\plugins\com.nomagic.magicdraw.reportwizard\vba folder to %APPDATA%
\Microsoft\Word\STARTUP (%APPDATA% is the location where user data is stored). For example,
• On Windows 2000 and Windows XP: C:\Documents and Settings\User Name\Application
Data\Microsoft\Word\STARTUP
• On Windows Vista: C:\Users\UserName\AppData\Roaming\Microsoft\Word\STARTUP
• On Windows 7 and 8: C:\Users\UserName\AppData\Roaming\Microsoft\Word\STARTUP
3. Restart Microsoft Word.
• On the Microsoft Word 2000 – 2003 menu, click ReportWizard > Template Editor, see figure
above, or
• On the Microsoft Word 2007 menu, click Add-Ins > ReportWizard > Template Editor, see figure
below.
Name Function
Data file
The Template Editor allows you to create a new data file and import it to the Report Wizard Template
Editor dialog. Click the Import button to import the data file. The data file is written in the XML format.
The following is the example of an XML data file schema, see the code snippet below.
The table below lists the XML Data File Schema Elements and Their Descriptions
• in
indicates this parameter is an input.
• out
indicates this parameter is an output.
Contents
In addition to default document templates, Report Wizard allows you to create customized specification
document templates. Templates may contain your own custom fields not related to model elements, as
well as fields that correspond to model elements. Once customized, a Report Wizard template can be
used with data from any project.
You can also format your template to create the style you want including tables of contents, headers
and footers, and page numbers. You can apply most character and paragraph formatting available from
your rtf editor for the rtf template or specify with html tags in the HTML template, including keywords.
Report Wizard templates can be in txt, rtf, html, odt, odf, odp, docx, xlsx, pptx, and xml for DocBook or FO
files. If you prefer, you can work in Report Wizard Template Editor until you have finished the template
file and use the Report Wizard template windows to save it in the template folder. The default
templates are located in the <MagicDraw home>/plugins/com.nomagic.magicdraw.reportwizard/data
folder.
All built-in rtf report templates are combined into the RTF (depreciated) report template
category.
Related pages
Concepts
Report Wizard includes the following concepts:
• Template
specifies the document layout, format, corresponding model elements, and custom defined
fields.
• Report Data
specifies a set of custom fields and data in the selected template. A template can have a number
of different custom
defined fields for a project or different projects organized in a report.
• Report
a generated user document with data from the project displayed in the selected template style.
Default templates
There are 12 default templates that come with the report engine.
Architecture templates
There are five architecture report templates that come with the report engine:
Behavioral Report
A Behavioral report is a standard report for the Behavioral view. This report will be generated by a
selected package that consists of Sequence, Communication, State Machine, and Activity diagrams. The
report lists all packages in a project and arranges them hierarchically. Each package consists of the
specification of messages in the Sequence diagram, the specification of lifelines in the Communication
diagram, the specification of states in the State Machine diagram, and the actions in the Activity
diagram. All elements in the report are ordered by their names.
Environment Report
An Environment report is a standard report for the Environment view. The report will be generated by a
selected package that consists of an Implementation diagram (Deployment diagram). The report lists all
packages in a project and arranges them hierarchically. Each package describes the specification of
nodes, interfaces, components, and artifacts which are ordered by the element’s name.
Implementation Report
An Implementation report is a standard report for the Implementation view. The report will be
generated by a selected package that consists of an Implementation diagram (Component diagram).
The report lists all packages in a project and arranges them hierarchically. Each package consists of a
list of interfaces, components, and artifacts. All elements in the report are ordered by their names.
Structural Report
A Structural report is a standard report for the Structural view. This report will be generated by a
selected package that consists of a Class diagram. The report lists all packages in a project and arranges
them hierarchically. Each package describes the specification of interfaces, classes, and enumerations
which are ordered by the element’s name.
A web portal report simplifies the complexity of a model by reducing less needed elements from the
model tree and displays the most relevant views of your project. For example, a MagicDraw project
report includes views such as Glossary, Requirements, Architecture, Implementation, and so forth, and
a SysML Plugin project report includes views such as Requirements, Structure, Interfaces, Constraints,
and so forth. It helps you generate your project in a user-friendly and easy-to-browse environment.
The web portal report features a quick search to help you find elements and diagrams for faster
content viewing.
Generating reports
Generating a web portal report is as easy as generating any other reports with Report Wizard.
If your MagicDraw has a plugin that provides another template for generating a web portal
report, you can find this template in a separate package. For example, if you have installed
SysML Plugin, you should expand the SysML - Web Reports package and select SysML - Web
Reports.
4. If you need to allow comments on the report, do the following:
• Click the Variable button. The Report Variable dialog will open.
• In the value cell of the WebComment variable, type the global address for comments
delivery, for example, example.com/jiraExample.php330, see figure below.
• Click OK.
• Click the Variable button. The Report Variable dialog will open.
• In the value cell of the ShowTip variable, type either True or true.
• Click OK.
6. Click Next.
7. Select the elements you need to include in the report and click Next. For more information, refer
to Select Element Scope Pane.
9. Save your report in a specific location, type the report name (for example, report.html), and
specify other output options if desired.
330 http://example.com/jiraExample.php
11. You can open the report by double-clicking the HTML/HTM file in the location specified in step 6
(in this example, report.html).
12. You can place the report in a shared directory or on a web server to make it available for the
other stakeholders.
Commenting on a report
If a web portal report enables feedback or comments, you can write something about a model element
or a diagram in the report. See step 4 in Generating Reports (see page 1654) for more information on how
to enable feedback or comments in a web portal report.
1. Select an element or diagram you need to comment in the model tree view on the left-hand side
of the web portal report.
2. Click the comment icon in the upper-right corner of the report. The Comment dialog opens.
5. Click Send. The global address of the selected element or diagram, the name of that element or
diagram, and the contents in both the Summary and Description boxes will be sent to the web
server.
Reading comments
There are several ways to deliver comments on elements and diagrams in a web portal report and allow
others to read them. You can choose to deliver them through an issue tracking system, such as JIRA, or
an e-mail platform, such as Gmail or Outlook.
The following example shows how to deliver comments, if you need to get the comments to a certain
account on JIRA as issues of the type ‘Bug’:
// element or diagram.
$contentTitle = $_GET['contentTitle']; //
Name of the commented element
// or diagram.
$contentSummary = $_GET['commentSummary']; // Summary text of the
comment.
$contentCommentArray = $_GET['comment']; // Text of
the comment.
$contentComment = implode(" ", $contentCommentArray);
$description = $contentTitle . " \\\\ " . $contentComment . " \\\\ " . "Link to
the content: \\\\" . $contentUrl;
$issue = array(
'type'=>'1', // Type
of JIRA issue
'project'=>'TEST',
// that stores the comment.
// '1'
means 'Bug'.
// Name of JIRA project
// that
stores the comments (3.1).
'description'=>
$description, // Description
contents
'summary'=> $contentSummary, // of JIRA issue
that
'priority'=>'2', // stores the
comment.
'assignee'=>'username', // Summary text
of JIRA issue
'reporter'=>'username', // that
stores the comment.
2. Create a new file and paste the script onto the file.
3. Change the following values (the red ones in the script):
a. The name of a JIRA project.
b. The assignee’s username.
c. The reporter’s username.
d. The global address of a web service, which provides JIRA.
e. The username and password of the JIRA account wherein a new issue is created from the
comment data.
4. Save the file as jiraExample.php.
5. Upload the file to your web server, for example, Apache Tomcat.
6. When enabling comments in your web portal report (Step 4 in Generating Reports (see page 1654)),
specify <web server address>/jiraExample.php (for example, example.com/jiraExample.php331)
as the value of the WebComment variable.
331 http://example.com/jiraExample.php
• Date variable
• Template variable
• Random number
• Project attribute
Date variable
A date variable is a variable for the current date and time. (See section $date in the previous
chapter). The date variable consists of:
For example:
C:\OutputReport\index_${date}.html
For example:
C:\OutputReport\index_${date.get('yyyyMMdd-hhmmss')}.html
Template variable
A template variable is a variable for a template that is created in Report Wizard. It allows you to add all
template variables into an output report filename (see Including Variables in a Template (see page 1664)).
For example:
C:\OutputReport\index_${Parent}.html
C:\OutputReport\index_${Parent.get('Child')}.html
Random number
Report Wizard supports only pseudorandom numbers in an output report filename. The random
number consists of:
For example:
C:\OutputReport\index_${random}.html
Random number with a distributed integer value between 0 (inclusive) and specified value
(exclusive)
You can use Report Wizard to generate pseudorandom numbers with the default distributed integer
value between 0 and a specific value.
The Parameters:
“n” - the bound on the random number to be returned. The “n” value must be a positive integer.
C:\OutputReport\index_${random.nextInt(1000)}.html
Project attribute
You can add a project attribute or information about a project into an output report filename.
• Project name
• Teamwork version
Project name
You can retrieve the name of a project by using the following syntax.
For example:
C:\OutputReport\index_${project.name}.html
Teamwork version
You can retrieve a teamwork version of a project by using the following syntax.
For example:
C:\OutputReport\index_${project.version}.html
Exception flow
You may accidentally specify an invalid output report filename such as:
For example:
C:\OutputReport\index_${date.get('yyyyMMdd-hhmmss)}.html
A single quote after “yyyyMMdd-hhmmss” was missing. Therefore, the output filename would be
“index_${date.get('yyyyMMdd-hhmmss)}.html” and a warning message would open in MagicDraw, see
figure below.
C:\OutputReport\index_${Parent}.html
“${Parent}” was not in the report template variable. Therefore, the output filename would be "index_$
{Parent}.html" and a warning message would open in MagicDraw, see figure below.
C:\OutputReport\index_${date.get('yyyy-MM-dd qq')}.html
FAQs
To generate an output report document from Report Wizard
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select the template or create a new one. Click Next.
3. Specify Report Data and add information for the variables. Click Next.
4. Select the document scope from the corresponding packages. Click Next.
5. Select the output location, images format, and text for blank fields.
6. Click Generate.
To add a new report template
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Click New. The New dialog will open.
3. Enter the template name and description. Click the button to specify the template file
location.
4. Click Create.
To remove a template
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select a template from the list and click Delete.
Once removed, the selected template with its folder and reports cannot be recovered.
How to modify a template file
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select a template from the list and click Open. The default editor and a template file for editing
will open.
3. Modify the template and perform the save command in the editor.
A different editor will be used for each template format. For example, MS Word could be used
for *.rtf template modification, or Macromedia Dreamweaver could be used for *.html template
editing.
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select a template or create a new one. Click Next. The Select Report Data pane will appear.
3. Click New. The New dialog will appear.
4. Enter the Report Data name and description. Click Create. A new Report Data will be created.
In the next step, you may add new fields or delete the existing ones.
To remove Report Data from the template
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select a template or create a new one. Click Next. The Select Report Data pane will appear.
3. Select the Report Data from the list and click Delete.
To set the default viewer option for the report file
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select a template and Report Data and specify the variables and package scope. Click the Next
button to proceed.
3. At the last wizard step, select the Display in viewer after generating report check box. The report
output will be displayed in the default editor or browser.
To change an output image format
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select a template and Report Data and specify the variables and package scope. Click the Next
button to proceed.
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select a template and Report Data and specify the variables and package scope each time.Click
the Next button to proceed.
3. At the last wizard step, select an option for output on blank fields:
• Select Display empty value or Display value as, and select NA or
• Enter the text to represent other than null value when the template query fields return
empty.
To add a new variable
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select a template and Report Data. Click the Next button to proceed.
3. Click the New button when the Variable pane opens. The Variables dialog will open.
4. Enter the name of a new variable and its value (the value can be modified later after the variable
has been created).
5. Click Create.
To delete a variable
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select a template and Report Data. Click the Next button to proceed.
3. Select a field and click Delete when the Variable step opens.
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select a template and Report Data. Click the Next button to proceed with the steps.
3. Select a field and modify its value when the Variable step opens. The value can be modified in
the properties list or in the Field Value box below the properties list.
To select a package for report generation
1. On the Tools menu, click Report Wizard. The Report Wizard dialog will open.
2. Select a template and Report Data and specify the variables. Click the Next button to proceed.
Clicking the Add button will add only the selected element, not its children, to the report scope.
In order to include all children, click the Add Recursively button instead.
1. Create the MagicDraw query in the text file using the text editor, see figure below.
Contents
On this page
You can create a new report variable, and modify or delete an existing one through the
Report Variable dialog.
5. Click once you have completed modifying or creating the report variables.
The Select Element Scope option will open in the Report Wizard dialog.
6. Select the scope of the report from the package tree on the left-hand side. In this case, it will be
the MagicLibrary Requirements[MagicLibraryRequirements.mdzip] model package, as all Use Case
requirements are stored in this package.
7. Click . The model package will be moved to the Selected objects tree on the right-
hand side.
9. Click to specify the location in which you want to save the report.
10. Select the file location, enter the filename, and click . The report file format varies
depending on the template file format. For example, if the template file format is *.rtf, the report
file format will be *.rtf as well.
11. Select the report image format, *.png, *.jpg, *.emf, or *.wmf, and select an image size option.
Tip
In some cases, a query may return an empty value that causes blank fields in the report.
The Display empty value as option is useful when you have a standard representation
for blank fields.
12. Select either the Empty text or Custom text option to display empty value information. If you
select the latter, type the information you want to display for every empty value.
13. Select to open the report document with a default editor.
14. Click .
The Use Case template is one of the default templates from which you can use and select in the Report
Wizard dialog. You can see all of the default templates on this page Default templates (see page 1655).
Sample model
Magic Library.mdzip332
Contents
Web Publisher 2.0 is a Java-Doc-like report template with a clickable navigation and an image map for
all diagrams and elements. It allows you to publish MagicDraw models (including diagrams) in HTML
with rich features, and to open them using your browser, e.g. Internet Explorer, Opera, or Firefox.
This section describes the features of Web Publisher 2.0, illustrates how to generate a Web Publisher
2.0 report template by using the Library.mdzip sample project, and gives you examples on how to work
with each feature.
332 https://docs.nomagic.com/download/attachments/36336975/Magic%20Library.mdzip?
api=v2&modificationDate=1475219260001&version=1
Note
Web Publisher 2.0 report is not fully supported by Google Chrome and Opera; therefore, the
data tree structure in the Containment tree may be missing because they do not allow
JavaScript to load local files via XMLHttpRequest. You can solve this problem by doing either:
• Deploy Web Publisher 2.0 report on web server, or
• Start Google Chrome with "--allow-file-access-from-files" argument by following the
steps below:
a. Close the web browser (Chrome) instances.
b. Open the web browser with "--allow-file-access-from-files" argument.
Cameo Collaborator is developed for replacing Web Publisher Collaboration report. This is a web-based
solution for publishing and reviewing models online. See more detail at www.nomagic.com/products/
cameo-collaborator-for-alfresco333.
Related pages
Contents
333 http://www.nomagic.com/products/cameo-collaborator-for-alfresco
Diagram
Specification
Appears in
Related page
Contents
Note
The Magic Library334 sample model, which comes with MagicDraw (see page 19), is used in the
figures of this page. To open the sample properly, you need to install MagicDraw (see page 19) and
download Magic Library.mdzip335 or find in the modeling tool <modeling tool installation
directory>\samples\case studies\Magic Library.mdzip.
The Web Publisher 2.0 report template comes with predefined variables and their values. Before
generating a report based on the Web Publisher 2.0 template, you can add more variables to it, edit the
existing ones, or delete those you do not want to include in your report.
334 https://docs.nomagic.com/download/attachments/36336926/Magic%20Library.mdzip?
api=v2&modificationDate=1492485589181&version=1
335 https://docs.nomagic.com/download/attachments/36336926/Magic%20Library.mdzip?
api=v2&modificationDate=1492485589181&version=1
Variable Value
ExportLinkedFile True: Copies a linked file from a model hyperlink into an output
report folder.
ShowAppearsInPage True: Shows data in a report, and opens the Appears in tab when
clicking an element in the Containment tree or a diagram pane.
The following section contains the instructions on how to work with your Web Publisher report.
3. In the Select Template pane, select Default Template > Web Publisher 2.0, and click
.
4. You can either:
• select the built-in report data or click to create a new one. Type the new
report name and description, and then click .
5. Click .
6. Select the element(s) from the model that you want to include in the report data, and click
. Select the scope of the report in the open package tree. Select the Model package if
you want to have a web-based report of your entire project.
In some cases, the query may return an empty value that creates blank fields in the
report. The Display empty value as option is useful when you have a standard
representation for blank fields.
12. Select the check box to open the report document with the
default editor.
13. After all options have been selected, click .
• Click the “+” button in the Containment tree to expand it, or click the “-” button to collapse it.
• Drag the separator line between the containment and the content panel to reduce or increase
the width of the Containment tree.
• Click and re-click the arrow button to show and hide the contents.
To show an element specification, active hyperlink, Submachine of state, or behavior of the Call
Behavior action
• Click a diagram's element to show the shorcut menu for opening its specification, Active
Hyperlink, Hyperlink, submachine of state, or behavior of the call behavior action.
You can add an active hyperlink to any symbol on a diagram (see page 970). There are three kinds of
hyperlinks: Element, File, and URL. However, the Element type hyperlink is available for the Active
Hyperlink column on the Generic Table diagram (see page 1696) image only.
You can navigate to the target if you double-click the hyperlink on the diagram in the Web Publisher
report. The following figure below shows the Submachine State hyperlink in the Web Publisher report.
Note
Only MagicDraw element type is available. File and URL address cannot navigate to the
associated artifacts.
MagicDraw elements in the Active Hyperlink column in the Generic Table diagram links to the
associated MagicDraw elements in the Specification page.
1. Click Tools > Report Wizard > Variable to open the Report Variable dialog.
2. Select the DisplayTreeElementId variable and enter the value true.
3. Click OK to show the requirement property IDs in the Containment tree.
• Click the MagicDraw Web Publisher 2.0 at the top-left corner of the screen to go to the index
page.
• On the Specification tab, move your mouse over an element to see the description in a tooltip.
• In the Specification tab, select Standard, Expert, or All from the Mode drop-down menu. The
mode appears in the property visibility depends upon the mode that you have selected in
MagicDraw.
1. Double-click either a state with a Submachine or a call behavior action of which behavior is
specified. For example, double-clicking the last Submachine State Request Access : Connection in
the following figure.
Contents
On this page
In this section, you will learn how to create a new remote location server step by step to upload a
generated report to a newly created server, and how to upload a generated report to an existing server.
1. Open the Report Wizard dialog. On the main menu, click Tools > Report Wizard. Proceed
through each step by selecting a report template, report data, and Element scope. You will be at
the Output options step. In the Report Wizard dialog, click in the Publish to server
5. You are now back to the Report Wizard dialog. Select the newly created server from the Select
server drop-down list. Click Generate to generate the report to upload it to the newly created
server. Once the report has been generated, it will be uploaded to the server previously created.
1. Open the Report Wizard dialog. On the main menu, click Tools > Report Wizard. Proceed
through each step by selecting a report template, report data, and Element scope. You will be at
the Output options step. Select an existing server from the Select server drop-down list.
2. Click Generate to generate the report to upload it to the chosen existing server. Once the report
has been generated, it will be uploaded to the server previously selected.
3. If the report has been successfully uploaded, a message box informing that the resources have
been uploaded successfully opens. Click OK.
Related pages
Adds a new profile to the list of existing Profiles. You can neither create a profile with a
blank name, nor with a name that already been used. You can add and edit multiple
Profiles. However, these profiles will not be saved until you click the Save
Profiles button.
Removes the currently selected profile. Note that you cannot remove the "No Upload"
profile.
Saves all profiles. If new profiles have been added or existing Profiles have been
modified, then these changes will be saved. All profiles will be checked for consistency
or information correctness. You will be asked to fix issues, if any. It is not possible to
save profiles as long as invalid information is detected. See Profile Management dialog
fields (see page 0) below for the description of "valid profile".
The Address field is URL sensitive, and can hold protocol as well as username information. If the
protocol or username information is found in the Address field, the corresponding fields, namely the
Protocol and Username fields, will be updated with the values from the Address field. At the very least,
a profile must have a hostname in the Address field.
You cannot save a profile unless this condition is met. The Username and Password fields contain
sensitive data and, therefore, are optional. If these fields are empty in a profile, you will be prompted
for your username and password when the server asks for your authentication.
• Profile name: This drop-down list holds all the existing Profiles. They are alphabetically sorted.
The "No upload" profile is always available, and you can neither modify, nor remove it. Select the
"No Upload" profile if you do not want to upload a report.
• Protocol: Five different protocols are supported: FTP, FTP over SSL (Secure Socket Layer), Webdav,
Webdav over SSL, and SSH (Secure Shell). You can either choose to select a protocol from the
protocol drop-down list, or fill in the scheme in the address part of the profile. Certificates that
are sent by servers using secure traffic (FTP over SSL, Webdav over SSL, and SSH) are silently
accepted. The scheme identifiers and default port numbers of the five supported protocols are
listed in the table below.
The table below lists Scheme Identifier and Default Port Numbers of Five Supported Protocols
[scheme://][username@]hostname[:port][path]
1. scheme:
The supported schemes are ftp, ftps, http, https, ssh, or sftp. A scheme must be followed by “://”.
2. username:
A username is needed for user authentication. It must be followed by “@”.
3. hostname:
Must be either an IP address (for example, 10.1.1.195) or a human readable URL (for
example, www.ftpserver.com336), and a valid address.
4. port:
A port number where the server is listed. It is only necessary if the port number is different from
the default port for well-known services. It must be preceded by ":".
5. path:
The predefined path will start from the home directory of the specified username. Therefore, the
report will be generated at the home directory of the username, e.g., if the address is ssh://
10.1.1.97:22/mymodel/publish, and the username is developer, the report will be generated at the
home directory of the developer username. The designated path will be /home/developer/
mymodel/publish.
Examples of valid addresses:
• Password
A profile with a password must always be accompanied by a username. A Profile with a password,
but not a username, is invalid and, therefore, cannot be saved. The password field uses an '*' to
represent a character in a password. Saving a profile with a password will save the password in an
336 http://www.ftpserver.com/
337 ftp://www.ftpserver.com/
338 mailto:[email protected]
339 mailto:[email protected]
Contents
To generate reports and schedule report printing, type the command in the terminal. This feature
allows you to generate reports without opening the MagicDraw application and using Report Wizard.
Related pages
Contents
On this page
Description
The Generate command creates a report document with a received set of information from arguments
and parameters. The information will then be generated as a report document to the specified output
file. By default, an argument is the specified data of the invoked parameters. If the -properties option is
specified, the argument is the name of a properties file. A properties file contains other parameters,
along with the specified data of each parameter.
Synopsis
Command Function
Note
• The template must exist in MagicDraw prior to
using this command, otherwise an error will
occur.
• If the template name is not specified, the
template specified in the Report Data (specified
in -report reportName) will be used instead.
-templatePath templatePath Specifies a template path used to generate a report document. Both
absolute and relative paths are allowed for this command. The
specified template file must have proper structure as it has been
added through the Report Wizard dialog.
Note
If both -template and -templatePath are specified in the
same command, the error will occur.
-package packageNameList Specifies the name of one or more packages in a MagicDraw project
to be included in the report. Multiple package entries must be
separated by a semicolon (;).
-element elementNameList Specifies the name of one or more elements from a MagicDraw
project to be included in a report. Element entries must be
separated by a semicolon (;).
Note
• You can get an element ID by using
$element.elementID.
• The element ID will change when the local project
is added to Teamwork Cloud. Please make sure
the element ID is up-to-date.
-properties This command specifies the name of a properties file to utilize. Use
propertiesFileName only with -properties.
Options
The command line feature supports a set of options useful in adding additional configuration
possibilities.
-report This command specifies the name of a Report Data (see page 0) file or Report Data
reportName element. The Report Data file must exist in MagicDraw prior to using this command,
otherwise an error will occur. If the reportName is not specified, the previous Report
Data will be set and used instead.
-autoImage 0|1| This command specifies how an image will be shown in a report document. The
2|3 default value for this argument is 1.
• 0 – No resize.
• 1 – Fit image to paper (large only).
• 2 – Fit and rotate image (clockwise) to paper (large only).
• 3 – Fit and rotate image (counter-clockwise) to paper (large only)
-imageFormat This command specifies an image format in a report document. The default value for
jpg|png|svg|emf| this argument is jpg.
wmf
• jpg – Joint Photographic Expert Group
• png – Portable Network Graphics
• svg – Scaling Vector Image
• emf – Microsoft Windows Enhanced Metafile
• wmf – Windows Metafile
-recursive true| This command specifies how to select a package in a MagicDraw project. The default
false value for this argument is true.
- This command is used to select packages, including auxiliary packages. The default
includeAuxiliary value is false.
true|false
- This command will show a string value in a blank field in a report document. The
outputOnBlankFie default value for this argument is “”.
ld stringValue
-server This command specifies the name or IP Address of a Teamwork Server project.
serverName|
IPAddress
-login loginName This command specifies a login name to log on to Teamwork Server.
-spassword This command specifies an encrypted password to log on to the server. This option is
encryptedPasswor available only in a properties file.
d
You can get encrypted password by entering this command below in command line
prompt.
-upload This command specifies a serverAddress consisting of a scheme, userInfo, host, port,
serverAddress and path to connect and upload a generated report to a server (see Upload generated
report to server (see page 1723)).
-overwrite true| This command overwrites any previously generated files. The default value for this
false argument is true.
• true – Overwrites all files automatically (removes any existing file before
generating a report.)
• false – If the file exists, the following prompt message will open:
If you type ‘y’ or ‘yes’, the Report Wizard will generate a new report that replaces the
previous one. If you type ‘n’ or ‘no’, the Report Wizard will not generate a report and
terminate the process.
-servertype tw | This command specifies a type of server to connect. The default value is tw.
twcloud
• tw - Connect to Teamwork Server
• twcloud - Connect to Teamwork Cloud
-ssl true | This command specifies if a Secured Connection (SSL) is used. The default value is
false false.
-tag tagValue This is an additional argument to generate reports from a server project by specifying
a server project tag name. The tagValue is non-case sensitive. More than one project
version may be returned from specifying one tag value. Hence, one report generation
process may generate multiple reports. You cannot use this command with –pversion.
1. Run a command line console. In the Console window, go to the local installation of the
MagicDraw application.
2. Go to the plugins\com.nomagic.magicdraw.reportwizard folder, and type the command line
there.
1. Run a terminal (command line console). In the Console window, go to the local installation of the
MagicDraw application.
2. Go to the plugins\com.nomagic.magicdraw.reportwizard folder, and type the command line
there.
See the following examples of command line on Windows and Linux or Unix respectively.
On Windows
On Linux or Unix
Note
Template, output, package, and project are the required data for each property file.
Related pages
Contents
340 https://docs.nomagic.com/display/MD190SP2/The+Generate+command+to+generate+reports
• -server, -login, and -password are key arguments to log on to Teamwork Server. You will be
prompted for a password when trying to enter -server and -login without -password.
• If -spassword is used with a properties file, an encrypted password must be used for this
property.
• -pversion is a key argument to specify a Teamwork project version. You can specify a project
version after -pversion. If either you do not specify any version, or the version you specify does
not match any version in Teamwork Server, Report Wizard will generate the latest project
version.
• -tag is an option to specify a Teamwork project. You can specify tagName to search for a project
version. The returned project version may be more than one. You may use this command
argument with "-incremental true".
• You can specify a project name and its branch after -project. For example:
• "MyProject" means generating MyProject without specifying its branch.
• "MyProject##release" means generating MyProject from the branch ["release"].
• "MyProject##release##sp1" means generating MyProject from the branch and sub-branch
["release", "sp1"].
See the following for more examples of how to generate a project from a specific branch and/or a
specific version.
Generating a project without specifying its generate -project "MyProject" -template "Web Publisher 2.0"
branch. -output "D:\output\output.html" -package "Model" -server
"localhost" -login "Administrator" -password
"Administrator"
Generating a project from the branch release. generate -project "MyProject##release" -template "Web
Publisher 2.0" -output "D:\output\output.html" -package
"Model" -server "localhost" -login "Administrator" -password
"Administrator"
Generating a specific version of a project generate -project "MyProject" -pversion "2" -template "Web
without specifying its branch. Publisher 2.0" -output "D:\output\output.html" -package
"Model" -server "localhost" -login "Administrator" -password
"Administrator"
Generating a specific version of a project from generate -project "MyProject##release" -pversion "2" -
the branch release. template "Web Publisher 2.0" -output "D:
\output\output.html" -package "Model" -server "localhost" -
login "Administrator" -password "Administrator"
Generating a set of reports from a specific tag. generate -project "MyProject" -tag "Finish" -incremental true
-ouput "C:/output/out.docx" -template "Class Specification
Report" -package "Model" -server "localhost" -login
"Administrator" -password "Administrator"
Contents
Apart from the mandatory commands described in using the Generate command to generate reports
(see page 1712), you can use the following command arguments in the command line to generate a report
from the Teamwork Cloud (TWCloud) server.
Note
For TWCloud projects, -package / -element is used to select one or more packages/
elements only in the Primary Model of TWCloud projects. To select packages/elements in
Project Usages, specify -usagepackage / -usageelement. You can also set -
includeAuxiliary as true if you want to make auxiliary resources available for selection.
This -usagepackage / -usageelement argument can be used with -package / -element
to select packages/elements in both Primary Model and Project Usages.
If, for example, you want to generate a Web Publisher 2.0 report from a TWCloud project by getting the
latest project version of the trunk branch, type the following:
The following code generates a Class Specification Report report from the TWCloud project by getting
the project version number 10 from MyBranch branch of the MyProject project.
Tip
The specified project version would be used to generate the report as a first priority, in case the
specified project version does not belong in the specified branch.
Note
If the project version specified is not the latest, the -updatemodule option would not affect the
generate command.
Related pages
Properties filename
Contents
On this page
Four parameters are needed to specify data for a report: project, output, template, and package.
There are five more parameters called options, which are additional configuration information such as
report, autoImage, imageFormat, recursive, and outputOnBlankField. All nine parameters are
described in Generate - the Command to Generate Reports (see page 1712).
A properties file is a simple text file. You can create and maintain a properties file with any text editors
(see the following example).
In the figure above, the command lines begin with a pound sign (#). The other lines contain key-value
pairs. The key is on the left side of the equal sign, and the value is on the right. For instance, template is
the key that corresponds to the value of the Class Specification Report.
The string representing the key and value in the properties file has a special character. The special
character is an escape character. It must be used to prevent interpretation errors. Each escape
character starts with a backslash.
\t tab
\b backspace
\r return
\” “ (double quote)
\’ ‘ (single quote)
\\ \ (backslash)
Properties DTD:
Example
Related pages
Contents
341 https://docs.nomagic.com/display/MD190SP2/The+Generate+command+to+generate+reports
-upload
"{scheme}://[{userInfo}@]{host}[:{port}][/{path}][?{query}][#{fragment}]"
• {scheme}
The {scheme} defines the namespace, purpose, and the syntax of the remaining part of a URL.
This field is mandatory. A scheme must be followed by “://”. The supported schemes are:
• ftp
• ftps
• sftp
• http
• https
• {userInfo}
The {userInfo} defines the username and password for authentication. The syntax is displayed as
follows.
{username}[:{password}]
This optional password must be predicated by “:”, and it can be an empty string. If the password
is omitted, the command line will prompt for the password.
UserInfo must be followed by “@”, and this field is optional.
Warning
{username} and {password} should not contain special characters such as “:”, “/”, and “@”
for they may cause an invalid result or error when the uploaded command is parsed.
• {host}
The {host} defines a host name or an IP address that gives the destination location of a URL. This
field is mandatory.
• {port}
The {port} defines a port number where the server is listed. The port value has to be a value from
1 to 65535. It is necessary when the port number is different from the default port for well-
known services. If the port is omitted, the default port will be used to connect to the server. The
table below shows a port number for each scheme.
The table below lists the Default Port Numbers for Schemes
ftp 21
ftps 990
sftp 22
http 80
https 443
The port must be preceded by ":". This field is optional.
• {path}
The {path} defines a remote location where the report will be saved. Paths are Unix-style paths;
therefore use “/” (forward-slash) as delimiters. This field is optional.
• {query}
The {query} defines a query string that contains data to be passed to software running on the
server. It may contain name or value pairs separated by ampersands.
• {fragment}
The {fragment} defines a fragment identifier that, if present, specifies a part or a position within
the overall resource or document.
Info
For this feature, the parser ignores query and fragment. Both fields are included in {path}.
• ftp://magicreport:[email protected]:25/report
Scheme ftp
Password 1234
Host 10.1.2.4
Port 25
Path report
• ftp://10.1.2.4:25/report
Scheme ftp
Host 10.1.2.4
Port 25
Path report
• ftp://10.1.2.4
Scheme ftp
Host 10.1.2.4
Port 25
Path report
Tip
The command line prompts for password.
• ftp://magicreport:@10.1.2.4:25/report
Scheme ftp
Password
Host 10.1.2.4
Port 25
Path report
Tip
The command line uses an empty password.
Related pages
Syntax rules
Contents
• Command parameters containing spaces must be enclosed in quotes, for example, "UML
Standard Profile".
• Command parameters are case sensitive, except project, imageFormat and recursive which are
not case-sensitive.
• Blank spaces (“ “) separate commands and parameters.
• To specify a package name that contains a semicolon (;), you can use a backslash (\). For example,
the package name “com;nomagic” can be typed by using “com\;nomagic”. The backslash followed
by a semicolon (\;) is not considered to be a character separator.
• For a parameter that contains unicode characters such as Thai, you can use the xml properties
file to generate a report. The properties file does not support the unicode encoding.
• A field entry consists of a name-value pair. The name and value formats are specified by
[name=value] pattern strings. A valid name must start with a letter (a-z or A-Z) and can be
followed by any letter, digit, or underscore.
• You can specify a field name that consists of brackets ( [ ] ) by using backslashes ( \ ). For example,
"[author=NoMagic][Revision=[1.0]]" will be typed as "[author=NoMagic][Revision=\[1.0\]]".
• Either -package or -element can be used with the Generate command. For example, you can use
-package without -element.
• If -upload is specified to the command line. Its value is validated and executed after a report has
been generated.
Related pages
Contents
The Report Wizard environment options in the MagicDraw Environment Options dialog allow you to
configure the report engine. There are three things that you can configure: (i) Report engine properties,
(ii) Template mappings, and (iii) Template folder.
Template mappings associate a template type with the template engine. The Report engine allows you
to determine how to handle different types of files, such as JS or DOCBOOK files. All you have to do is
specify a filename extension and select an engine name. The Report engine also allows developers to
add a user custom engine to this option.
You can either select or clear the Monitor template folder check box in the Report Wizard environment
options in the MagicDraw Environments Options dialog to enable or disable the option to deploy an
MRZIP template file. If you select the check box, Report Wizard will automatically deploy the MRZIP
template file to the Report Wizard dialog whenever the file is added to your folder.
• MagicDraw allows you to configure the report engine settings in three levels: (i)
Environment option, (ii) global config.xml, and (iii) template config.xml.
• The template config.xml configuration settings will override the environment option
configuration settings, which will override the global config.xml configuration settings.
Tip
You can select a report property in the Configure report properties pane, and click to
see its description.
1. Click Options > Environment. The Environment Options dialog will open.
2. Select Report Wizard from the tree view. The Configure template mappings pane will open.
3. Click:
to edit a selected filename extension and template type in the Template
mappings dialog, and click .
to create a filename extension and template type in the Template mappings dialog,
and click .
to delete a selected filename extension and template type from the Configure
template mappings pane.
File extension The filename extension (not case- Blank Text Yes
sensitive).
Template type The template type. You can select any Blank Text Yes
of the following: html, odp, docbook,
dbk, odt, ods, docx.
Warning
Deleting a template mapping from the Environment Options dialog will cause the file
extension mapping to be removed from MagicDraw. To restore the default setting, restart
MagicDraw.
Reset to defaults
MagicDraw allows you to configure the report engine settings in three levels: Environment Options,
global config.xml, and template config.xml. The template config.xml configuration settings will override
the Environment Options configuration settings, which will override the global config.xml configuration
settings.
If you have made changes to the settings in the Report Wizard's Environment Options dialog, but
would then like to cancel them, you can click to reset data to the default settings.
Contents
The default report data directories for operating systems are as follows:
• For Windows:
C:\Users\<username>\AppData\Local\.magicdraw\<version>\data\reports
• For Linux:
Report Wizard provides a configuration to add more report data directories by creating a
report.properties file in the Report Wizard plugin directory,
<MagicDraw>\plugins\com.nomagic.magicdraw.reportwizard.
You can declare the template_loc parameter in the report.properties file to specify another report
data directory as follows:
template_loc=C:/Users/MD_user/AppData/Local/.magicdraw/new Location
You can also specify the template_loc parameter for multiple report data directories by using a
semicolon (;) to separate each of the directories.
template_loc=//template_server/MagicReport/;C:/Users/MD_user/AppData/
Local/.magicdraw/new Location
All of templates in the default report data directory and other locations specified in the
report.properties file are available for generating in the Report Wizard dialog (see page 1470) and can be
called through the -template parameter in command line report generation.
Note
The template names defined in the template.xml file in each report data directory must be
unique.
Related pages
Contents
The Debug Report template features warning messages that describe template errors. A warning
message will appear in a Messages Window while the report template is being processed. Warning
messages have no effect on the output report, thus can be ignored. They are intended for informative
purposes only.
1. Invalid Property
2. Invalid Reference
3. Invalid Method Reference
4. Exception
5. Invalid Syntax
Related pages
Invalid property
The warning, see figure below will open when an invalid property is encountered during the report
generation. For example, getting a text property from the $package variable, when the text property is
not a valid property for $package, is a variable with an invalid property that will trigger a warning.
Invalid reference
The warning will open, see the figure below, whenever using a variable, for example, $empty that has
not been specified.
Exception
The warning message, see the figure below, will open whenever an exception, such as
IndexOutOfBoundException, occurs during the report generation.
Invalid syntax
The warning message, see the figure below, will open whenever a template contains any invalid syntax,
such as using #forrow without #endrow.
Modifying config.xml
To modify the config.xml file
Exception <template.warn.exception>
Set this boolean value to:
Contents
Report Wizard provides a set of templates to support the Use Case Driven approach methodology. A
MagicDraw project that creates the Use Case Driven approach development steps can generate a report
to capture elements.
Report Wizard provides 3 templates for the Use Case Driven approach:
The report shows a class diagram and a list of all classes in the diagram. The list contains attributes and
methods for each class. The report also shows the method specification, parameters, and algorithms.
The use case point technique is applied to reestimate the project size. All the use cases used in the
example below are based on the use case diagram. The following weight criteria are used:
Classifying Actors
The table below lists Actors Classifications
Reference Documents
Project characteristics
The Technical and Environmental factors are associated with the weight of the project. You have to
assign a value to each factor. The value assigned to a particular factor depends on the degree of
influence a factor has. The relevance values range from 0 to 5, where 0 means no influence, 3 is the
average level of influence, and 5 means a strong influence.
Environmental Factors
The Table below lists Environmental Factors
Environmental Factor
Environmental Factor (EF) is obtained with the addition of 1.4 to the sum of EFactor multiplied by -0.03.
Z months = Y / d Month
Contents
Javadoc is the industry standard for documenting Java classes. Javadoc can be documented inside the
documentation field, see figure below.
/**
* A base class realizing from interface {@link Itool}.
* This class provides default implementation for
* {@link Itool}. The extended class from this class may
* send message or object to observer class by invoking
* {@link #notifyObservers(Object)} of class <code>
* Observable</code>. The observer class such as
* {@link AbstractTemplateEngine} or graphical user
* interface can catch notified object and interact with
* user.
*
* @author Siri Chongasamethaworn ([email protected])
* @since Aug 3, 2007
*/
Comment:
A base class realizing from interface Itool. This class provides default
implementation for Itool. The extended class from this class may send message or
object to observer class by invoke #notifyObservers(Object) of class Observable. The
observer class such as AbstractTemplateEngine or graphical user interface can catch
notified object and interact with user.
Author:
Siri Chongasamethaworn ([email protected])
The Javadoc Syntax tool is implemented based on Custom tool (See Appendix A: report extensions (see
page 1749)).
Related pages
• Leading asterisks
When Javadoc Tool parses a doc comment, leading asterisk (*) characters on each line are
discarded.
• First sentence
The first sentence of each doc comment is a summary sentence.
This sentence can be retrieved from $doc.firstSentenceTags.
The first sentence tags are a collection of inline tags until full stops (.).
• Comment and tag sections
A comment is the main description which begins after the starting delimiters /** and
continues until the tag section. A tag section starts with the first block tag. The comment can be
retrieved by $doc.comment
• Comments written in HTML
Text is written in HTML and will be rendered as HTML support before being printed to a report.
(See Appendix D: HTML Tag Support (see page 1902))
• Block and in-line tags
A tag is a special keyword within a doc comment that Javadoc Tool can process. There are two
kinds of tags:
(i) Block tags
They can be placed only in the tag section. The block tag form is @tag.
The block tag can be accessed directly from the root document such as $doc.param and
$doc.author.
The $doc.tags will provide a collection of all the tags appearing in this Javadoc.
(ii) Inline tags
They can be placed anywhere in the main description or in the block tags. The inline tag
form is {@tag}.
The table below lists Current Supported Tags
Contents
On this page
JavaDocTool
JavaDoc Tool is a custom tool class used for creating a Document node.
• create() - Return a new instance of a Document node. Each JavaDoc comment must start with /**
and ended with */.
• createForText() - Return a new instance of a Document node. This method allows in-complete
JavaDoc (comments without /** and */) to be loaded with JavaDocTool.
Document
Document is an interface representing a Comment Document.
Tag
Tag is an interface representing a simple documentation tag, such as @since, @author, and @version
TagImpl
TagImpl is a default tag implementation.
ParamTag
ParamTag represents a @param documentation tag.
• getName() - Return the name of the parameter associated with this tag.
• getComment() - Return the parameter’s comment.
ThrowsTag
ThrowsTag represents a @throws or @exception documentation tag.
• getName() - Return the name of the exception associated with this tag.
• getComment() - Return the exception’s comment.
SeeTag
SeeTag represents a user-defined cross-reference to related documentation. The reference can be
either inline with the comment using {@link} or a separate block comment using @see.
SerialFieldTag
SerialFieldTag represents a @serialField tag.
#import ("javadoc",
"com.nomagic.reportwizard.tools.doc.JavaDocTool")
#set ($doc = $javadoc.create($comment))
$doc.comment
$doc.author
• Print a raw comment (plain text without a document parser or HTML renderer):
$doc.rawComment
Reference Documents
• Javadoc specification
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#javadoctags
• Writing Javadoc
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
• Javadoc Tool API
<install.dir>/plugins/com.nomagic.magicdraw.reportwizard/api/javadoc.zip
Contents
Import tool is a module of functions that allows importing documents to be in generated reports.
Import tool enables you to dynamically import whole or parts of documents into reports, giving you
greater flexibility when generating reports that require dynamic resources. You can now include
documents whose location is only known at the actual translation time.
• Parse and import RTF, DOCX, HTML, and text templates from any location in the file system
• Reuse the #sectionBegin (see page 0) and #sectionEnd (see page 0) syntax to import any part of a
document. The Import tool uses the predefined syntaxes #sectionBegin and #sectionEnd,
introduced with the #includeSection Directive (see page 0).
Related pages
Import syntax
Contents
$import
This part names the alias assigned to Import tool when declaring it to the template.
$import.include(FileName)
FileName in $import.include(FileName) (see page 1758) specifies the location of a file in the file system.
FileName can be either an absolute or relative path to a file in the file system. The FileName
parameter can be set either statically or dynamically. If the file is not found in the file system, FileName
would be searched as an Attached File element in a MagicDraw project in the File property.
$import.includeSection(FileName, SectionName)
FileName in $import.includeSection(FileName, SectionName) (see page 1759) functions the same as in the
sub-section above. FileName can be either an absolute or relative path to a file in the file system.
SectionName denotes a paragraph in the document named FileName, which is delimited by the
#sectionBegin(SectionName) and #sectionEnd identifiers. The SectionName variable can also be set
either statically or dynamically. If the file is not found in the file system, FileName would be searched
as an Attached File element in a MagicDraw project in the File property.
Related page
Import usage
This section explains the examples of usage of the master and child templates. These examples allow
you to create documents as the master template and reuse the content of child templates into it.
Preparatory Step
Define a child template that you will use as in Examples 1, 2, and 3. This child template contains the
header line and named sections (Section A and Section B). Type the following lines in the document
that you want to define the child template:
Usage in Example 1
This example shows how to statically include the complete child template as shown in the Preparatory
Step. To include it, call the $import.include('child.docx') method. Note that there is no specified path.
This path to the child template shows you that the master and child templates reside in the same
directory. Type the following lines in the document that you want to include all of its content to the
report:
The output right below will include the entire text from the master template (right above) and from the
child template minus the template directives. The included content will be then parsed and stripped of
all velocity directives. The output is as follows:
Usage in Example 2
This example shows how to statically include a section of the child template as shown in the
Preparatory Step. To include the section named Section A from the child template, call the
$import.includeSection('templates/child.rtf', 'Section A') method. In this example, the master and
child templates reside in different directories, which means that the child template will reside in a
subdirectory called templates. This templates directory will thus reside in the same directory as the
master template. Type the following lines in the document that you want to include its content in
Section A to the report:
Usage in Example 3
This example shows how to dynamically include the section of a child template as shown in the
Preparatory Step. Before dynamically including the section of the child template named Section B, set a
variable for the file location of the child template [#set ($child = "C:/ImportTool/child.rtf")] and another
one for the section name to be included [#set ($section = "Section B")]. To include the Section B
section from the child template, call the $import.includeSection($child, $section) method. In this
example, the child's template location is provided by an absolute path. Note that dynamic values must
not be specified in a pair of quote marks, otherwise the section will not be included. Type the following
lines in the document that you want to include its content in Section B to the report:
The Import tool supports DOCX, RTF, HTML, XML, and text files only.
Usage in Example 4
This example shows how to include a document as an Attached File element in a project. First, you need
to create an Attached File (see page 208) element in a project. The File property will then be used as a
parameter to make a reference to the Attached File element. Type the following lines in the document
that you want to include the content of the Attached File element to the report:
Contents
The general concept behind this JavaScript feature is to separate complex business logic from
presentation logic. Complex logic should be executed by JavaScript, and presentation logic should be
executed by Velocity code.
Like other Custom tools, the JavaScript tool 'scripttool.jar' must be installed in the 'extensions' folder of
the Report Wizard plugin, and 'js.jar' must be included in any class path or the 'extensions' folder. For
further information about Custom tools and the installation, see Custom tool (see page 1869).
#import('js', 'com.nomagic.reportwizard.tools.script.JavaScripttool')
Related pages
'eval' Method
eval(String script)
This method will evaluate a JavaScript code from a string and return the result.
$js.eval('script')
This method will evaluate a JavaScript code with a single binding object. The code will be evaluated from
a string. The "importer" name will be used as a binding name for this object.
This method will evaluate a JavaScript code with a single binding object and specified binding name.
The code will be evaluated from a string. The binding name will be used as the name for this object.
This method will evaluate a JavaScript code with a set of binding arguments (a name and an object). The
code will be evaluated from a string. The binding map consists of key-value pairs for this binding name
and binding object.
'execute' Method
execute(String filename)
This method will execute a JavaScript file. The filename parameter is a file path to the JavaScript file.
This method will execute a JavaScript file with a single binding object. The filename parameter is a file
path to the JavaScript file. The "importer" name will be used as the binding name for this object.
// filename.js
importer.getName();
This method will execute a JavaScript file with a single binding object and specified binding name. The
filename parameter is a file path to the JavaScript file. The binding name will be used as the name for
this object.
// filename.js
cls.getName();
This method will execute a JavaScript file with a set of binding arguments (a name and an object). The
filename parameter is a file path to the JavaScript file. The binding map consists of key-value pairs for
this binding name and binding object.
// filename.js
first + ' ' + last;
'call' Method
call(String function)
This method will provide a short and reusable method to call a JavaScript function. This function must
be defined before calling this method. This function can be defined by 'eval' or 'execute'.
$js.execute('javascript.js')
$js.call('calc(1, 3)')
// javascript.js
function calc(var1, var2)
{
return var1 + var2;
}
This method will provide a short and reusable method to call a JavaScript function with a single binding
object. The "importer" name will be used as the binding name for this object. This function must be
defined before calling this method. This function can be defined by 'eval' or 'execute'.
$js.execute('javascript.js')
$js.call('calc(1, 3)', 10)
// javascript.js
function calc(var1, var2)
{
var f = Number(importer ? importer : 0);
return f + var1 + var2;
}
This method will provide a short and reusable method to call a JavaScript function with a single binding
object and specified binding name. This binding name will be used as the name for this object. This
function must be defined before calling this method. This function can be defined by 'eval' or 'execute'.
// javascript.js
function calc(var1, var2)
{
var f = Number(factor ? factor : 0);
return f + var1 + var2;
}
This method will provide a short and reusable method to call a JavaScript function with a set of binding
arguments (a name and an object). The binding map consists of key-value pairs for this binding name
and binding object.
// filename.js
function hello()
{
return 'hello ' + first + ' ' + last;
}
References to elements
References to elements are implicitly inserted into the JavaScript context when calling eval(), execute(),
or call(). Examples of implicit variables include, for instance, $Class, $UseCase, $sorter, etc.
For example:
A "functions.js"
A template code
Example:
A "functions.js"
A template code
Reference Documents
Contents
Groovy Script tool enables report templates to evaluate or run Groovy codes from templates and
external Groovy files.
Like other Script tools, the Groovy Script tool 'scripttool.jar' must be installed in the 'extensions' folder of
the Report Wizard plugin, and 'groovy-all-1.7.9.jar' must be included in any class path or the 'extensions'
folder. For further information about Custom tools and the installation, see Custom tool (see page 1869).
Related pages
'eval' Method
eval(String script)
This method will evaluate a Groovy code from a string and return the result.
This method will evaluate a Groovy code with a single binding object and specified binding name. The
code will be evaluated from a string. The binding name will be used as the name for this object.
This method will evaluate a Groovy code with a set of binding arguments (a name and an object). The
code will be evaluated from a string. The binding map consists of key-value pairs for the binding name
and the binding object.
Or
The second code contains curly brackets; '{' and '}' characters, which are not allowed to be used
in any RTF template. For the RTF template, use the first code instead.
'execute' method
execute(String filename)
This method will execute a Groovy file. The 'filename' parameter refers to a name of the Groovy file or
an absolute path to the Groovy file.
$groovy.execute("filename.groovy")
This method will execute a Groovy file with a single binding object and specified binding name. The
'filename' parameter is a file path to the Groovy file. The binding name will be used as the name for this
object.
File filename.groovy
This method will execute a Groovy file with a set of binding arguments (a name and an object). The
'filename' parameter is a file path to the Groovy file. The binding map consists of key-value pairs for the
binding name and the binding object.
File filename.groovy
• Absolute Path: If the 'filename' is provided with an absolute path, Groovy Tool will read
the Groovy file from an absolute location such as $groovy.execute('c:/mycode/
readclass.groovy').
• Relative Path: If the 'filename' is provided with a relative path, Groovy Tool will read the
template from a relative location. This relative location starts from the current directory
in which the template is located such as $groovy.execute('readclass.groovy').
File 'AllAbstractClass.groovy'
Contents
Ruby Script tool enables report templates to evaluate or run Ruby codes from templates and external
Ruby files.
The Ruby tool includes 2 methods:
(i) ‘eval’ method: This method will evaluate Ruby text, and then return the result.
(ii) ‘execute’ method: This method will execute a Ruby file, and then return the result.
Like other Script tools, the Ruby Script tool ‘scripttool.jar’ must be installed in the ‘extensions’ folder of
the Report Wizard plugin, and ‘jruby-complete-1.6.3.jar’ must be included in any class path or the
‘extensions’ folder. For further information about Custom tools and the installation, see Custom tool (see
page 1869).
Related pages
def supplierList
result = [];
$Dependency.each do |item|
item.supplier.each do |supplier|
result << supplier;
end
end
return result;
end
‘eval’ Method
eval(String script)
This method will evaluate a Ruby code from a string and return the result.
This method will evaluate a Ruby code with a single binding object and specified binding name. The
code will be evaluated from a string. The binding name will be used as the name for this object.
This method will evaluate a Ruby code with a set of binding arguments (a name and an object). The
code will be evaluated from a string. The binding map consists of key-value pairs for the binding name
and binding object.
The second code contains curly brackets; “{“ and “}” characters, which are not allowed to be used in any
RTF template. For the RTF template, use the first code instead.
‘execute’ Method
execute(String filename)
This method will execute a Ruby file. The ‘filename’ parameter is a name of the Ruby file or an absolute
path to the Ruby file.
After executing the Ruby file, the result of the execution will be stored in the single context for each
report generation. If the Ruby file contains Ruby functions, you can recall the functions with the use of
‘eval()’ methods.
def deCamelCase(str)
return str.gsub!(/(.)([A-Z])/,'\1 \2')
end
$ruby.execute("String.rb")
#foreach ($c in $Class)
$ruby.eval('deCamelCase($c.name)')
#end
This method will execute a Ruby file with a single binding object and specified binding name. The
‘filename’ parameter is a file path to the Ruby file. The binding name will be used as the name for this
object.
File 'filename.rb'
puts c.name
This method will execute a Ruby file with a set of binding arguments (a name and an object). The
‘filename’ parameter is a file path to the Ruby file. The binding map consists of key-value pairs for the
binding name and binding object.
File 'filename.rb'
• Absolute Path
If the ‘filename’ is provided with an absolute path, Ruby tool will read the Ruby file from
an absolute location such as $ruby.execute(‘c:/mycode/readclass.rb’).
• Relative Path
If the ‘filename’ is provided with a relative path, Ruby tool will read the template from a
relative location. This relative location starts from the current directory location of the
template, such as $ruby.execute(‘readclass.rb’).
Contents
The purpose of a Dialog tool is to enable report templates to call functions for creating dialogs to
interact with users during the report generation process. To modify the report templates, you can use
the Dialog tool.
• message
This method will create message dialogs.
• confirm
This method will create confirmation dialogs and return the Boolean value ‘true’ when you click
the OK button or return ‘false’ when you click the Cancel button.
• input
This method will create input dialogs and return the input value as a string.
• sort
This method will create Sort and Enable dialogs and return a collection of newly-sorted results.
Like other Custom tools, the Dialog tool (dialogtool.jar) must be installed in the ‘extensions’ folder of the
Report Wizard plugin.
#import('dialog','com.nomagic.reportwizard.tools.Dialogtool')
Related page
Contents
On this page
‘message’ Method
message(String message) : void. This method will create a Message dialog.
‘confirm’ Method
confirm(String message) : boolean. This method will create a Confirmation dialog. It will return the
Boolean value ‘true’ when you click or ‘false’ when you click in the dialog.
‘input’ Method
the input values as Strings when you click or ‘null’ when you click in the
dialog.
initial value in an Input dialog. It will return the input values as Strings when you click or
value arrays in an Input dialog. It will return the input values as Strings when you click or
will return a collection of the newly sorted results when you click or return the original
collections. It will return a collection of the newly sorted results when you click or return
'select' Method
in the collection will be listed in the Selection dialog. You can select the items and click to
items will not be selected. You can select the items and click to return a collection of the
is null. You can select the items and click to return a collection of the selected items or
Contents
A Text tool provides extra functions to convert or format text such as change text to bold, italics, add an
underline, equals sign etc. The following figure shows a class diagram to represent the Texttool API.
1. Place the jar file in the extensions folder of the Report Wizard plugin folder.
#import('text', 'com.nomagic.reportwizard.tools.TextTool')
Related pages
Contents
On this page
noLineBreak(String text)
This method removes all control characters such as U+0009 (Tab), U+000A (Line Feed), and U+000D
(Carriage Return) from a given text. This method also filters text under the category "Cc" in the Unicode
specification.
toInteger(String text)
This method converts a string argument to a signed decimal integer.
toDouble(String text)
This method converts a string argument to a signed decimal double.
italic(String text)
This method forces a report to render a given text in the italic style.
bold(String text)
This method forces a report to render a given text in the bold style.
underline(String text)
This method forces a report to render a given text in the underlined style.
html(String text)
This method forces a report to render a given text as HTML.
For more information on supported HTML tags, see Appendix D: HTML Tag Support (see page 1784).
getString(String text)
This methods converts text from RTF to a Java String.
getPureText(htmlString HTMLString)
This method gets plain text from an HTML documentation. All HTML tags that are applied to the text will
be removed from the text. Only plain text would be returned.
• Invoke the Validation menu and validate the models from suite names
• Set the severity.
• Retrieve validation results.
To import a Model Validation tool to a template, type this code in the template.
#import('validator', 'com.nomagic.reportwizard.tools.ModelValidationtool')
Contents
On this page
Methods:
Methods:
• +getElement( ) : Element
• +getSeverity( ) : String
• +getAbbreviation() : String
• +getMessage( ) : String
Validate Methods
validate(suiteName : String) : List<ValidationResult>
Uses only a suite name to validate a model from the whole project with default “debug” as severity.
Uses a suite name and a severity type to validate a model from the whole project. The severity types are
“debug”, “info”, “warning”, “error” and “fatal”.
To validate all classes by using ‘UML completeness constraints’ suite and the severity type is warning,
for example, type the following code:
getSuiteNames() : List<String>
Prints all Metrics names and their values of all Classes, for example, type the following code:
getElement() : Element
To print all validated elements' names, for example, type the following code:
getSeverity() : String
getAbbreviation() : String
Gets an abbreviation.
getMessage() : String
Gets a message.
isIgnored() : Boolean
Gets an isIgnored value to check whether the validated element is ignored or not.
To print all validation results from a project by using the “UML completeness constraints” suite, for
example, type the following code:
To print only the validation results from the Class by using the “UML Correctness” suite and the
"warning" severity, for example, type the following code:
#import('validator', 'com.nomagic.reportwizard.tools.ModelValidationTool')
#set ($results = $validator.validate("UML Correctness", $Class, "warning"))
#foreach ($result in $results)
Element: $result.element.name
Abbreviation: $result.abbreviation
Message: $result.message
IsIgnored: $result.isIgnored
#end
• Invoke the Metrics menu and calculate the Metric from its suite names.
• Set a filter.
• Retrieve row elements and the Metric value.
To import the Metrics tool to a template, type this following code in the template:
Contents
On this page
Methods:
Methods:
Calculation Methods
calculate(suiteName : String) : MetricResult
Uses only the suite name to calculate the Metric from an entire project.
Example code:
Uses a suite name and filter to calculate the Metric from an entire project. "filter" is a filter name
displayed in the Metric dialog.
If the language used in the MagicDraw interface changes, the filter name needs to be replaced
with a target language, for example: French will be "Violations de Paquetage” for "Package
Violations".
To calculate the Metrics from all classes by using the ‘System Metrics’ suite, for example, type the
following code:
Specifies a suite name and Element list to calculate the Metric with a specific filter name.
To calculate the Metric from all classes by using the ‘System Metrics’ suite with the package violations
filter, for example, type the following code:
To calculate the Metric from the Actor name “Template Author”, for example, type the following code:
Calculates the Metric from a single element with the recursive option. If the recursive option is true, it
will calculate the result from a given root element and recursive to all children; otherwise (false),
calculates the result from the single element.
To calculate the Metric from a root element and recursive to all children. The result is similar to the
calculated result from all elements in a project, for example, type the following code:
Calculates the Metric from a single element with the recursive option and a filter name. If the recursive
option is true, it will calculate the result from a given root element and recursive to all children;
otherwise (false), calculate the result from the single element.
getAllMetrics() : List<Metrics>
To print all numbers of attribute (NA) value of all elements, for example, type the following code:
This is the shortcut method to get the specified Metrics value of a target element. The Metric name is
the abbreviation of Metric, for example, NA, NC, NO, RFC, etc. This value is case-sensitive. See 21.1.3
Getting Metric Values.
The Metric name is the abbreviation of Metric, for example, NA, NC, NO, and RFC. This value is case-
sensitive.
To return the number of attributes (NA) from Class SwingUtilities, for example, type the following code:
The user can use the Velocity technique for a shortcut when retrieving value from a Metrics name. The
Metrics name is case-sensitive.
To return the number of an attribute (NA), for example, type the following code:
You can format an output value as string. The Metric name is the abbreviation of Metric, for example,
NA, NC, NO, and RFC. This value is case-sensitive. If the Metric contains no value, the returned string will
be an empty string.
Symbol Meaning
0 Digit
, Grouping separator
• Since the symbol contains # (hash character), which is a special character for Velocity
Template Language, you needs to use a pair of single quotes instead of double quotes to
pass the hash character into the parameter.
• The following code is not in the correct format:
$elementMetric.getValueAsString("NA", "#.##")
The code written above will return an unexpected result. Use the following code to
get the formatted text.
$elementMetric.getValueAsString("NA", '#.##')
However, this method cannot use a single quote character in formatted text.
getMetricNames() : List<String>
Or
To print all Metric names and all of their classes’ values, for example, type the following code:
To print all Metric names and their values of all Classes, for example, type the following code:
Getting the Result Attribute “is above limit” from a Metrics Name
The “is above limit” is a Boolean value that indicates that a value is larger than the value configured in
the Metrics menu. The $elementMetric represents a Metric class and $metricsResults represents a
MetricsResults class.
Getting the Result Attribute “is below limit” from a Metric Name
The “is below limit” is a Boolean value that indicates that a value is less than the value configured in the
Metric menu.
Example code:
Change the text color to red if the number of responses for the class “Customer” is less than the limit.
(i) Printing all Metric names and their values of all elements under the package “Design” by using the
“System Metrics” suite.
#import('metrics', 'com.nomagic.reportwizard.tools.MetricsTool')
#set ($package = $report.findElementInCollection($Package, "Design"))
#set ($metricsResults = $metrics.calculate('System Metrics', $package))
Package $package.name contains the following metrics
#foreach ($metricName in $metricsResults.metricNames)
$metricName value $metricsResults.getValue($package, $metricName)
#end
#import('metrics', 'com.nomagic.reportwizard.tools.MetricsTool')
#macro (next $e)
#set ($metricsResults = $metrics.calculate('System Metrics', $e))
Element $e.name
#foreach ($metricName in $metricsResults.metricNames)
$metricName value $metricsResults.getValue($e, $metricName)
#end
#foreach ($child in $e.ownedElement)
#next($child)
#end
#end
#next ($project.model)
(iii) Creating a Metric table for Classes by using the “System Metrics” suite and formatting the result by
using two-decimal digits.
#import('metrics', 'com.nomagic.reportwizard.tools.MetricsTool')
#set ($metricsResults = $metrics.calculate('System Metrics', $Class))
#foreach ($cls in $Class)
Class $cls.name
#set ($elementMetric = $metricsResults.getMetrics($cls))
#foreach ($name in $elementMetric.metricNames)
$name : $elementMetric.getValueAsString($name, '##.00')
#end
#end
Contents
To import the Generic Table tool to a template, for example, type the following code in the template.
#import('generic', 'com.nomagic.reportwizard.tools.GenericTableTool')
Related pages
Contents
On this page
GenericTableTool diagram.
Class GenericTableTool:
Methods:
Methods:
• +getRows() : List<Element>
• +getRow( rowNumber : int ) : Element
• +getFilteredRows() : List<Element>
• +getColumn( columnId : String) : String
• +getColumn( columnNumber : int) : String
• +getColumnNames() : List<String>
• +getColumnIds() : List<String>
• +getValue( rowElement : Element, columnIdOrName : String ) : Object
• +getValue( rowElement : Element, columnNumber : int ) : Object
• +getValue( rowNumber : int, columnNumber : int ) : Object
• +getValueAsString( rowElement : Element, columnIdOrName : String ) : String
• +getValueAsString( rowElement : Element, columnNumber : int ) : String
• +getValueAsString( rowNumber : int, columnNumber : int ) : String
• +getVisibleColumnIds() : List<String>
• +getVisibleColumn( columnNumber : int) : String
• +getVisibleValue( rowElement : Element, columnNumber : int ) : Object
• +getVisibleValue( rowNumber : int, columnNumber : int ) : Object
• +getVisibleValueAsString( rowElement : Element, columnNumber : int ) : String
• +getVisibleValueAsString( rowNumber : int, columnNumber : int ) : String
Use the following method to get the Generic Table instance. We use Generic Table instances to retrieve
table information such as row elements and column names.
#set($table = $generic.getTable($diagram))
Example code:
#set($table = $generic.getTable($diagram))
Example code:
Closing tables
Use the following method to close a table diagram.
$generic.closeTables()
$generic.closeTable($diagram)
$generic.closeTable($diagramName)
$table.getRows()
The returned value is a list of Elements. The following shows an example of how to print all row element
names.
#foreach($row in $table.rows)
$row.name
#end
$table.getFilteredRows()
The returned value is a list of Elements that have been filtered by the Filter field.
#foreach($row in $table.getFilteredRows())
$row.name
#end
The figure below shows the rows returned after applying the filter.
$table.getRow($rowNumber)
The methods in this section retrieves column names from the list returned by Show Columns
menu item from generic table diagram. The methods in the preceding section, however,
retrieves column names from the diagram itself and not from the list returned by Show
Columns menu item.
$table.getColumn($columnId)
• columnId – the ID of a column. Using column IDs has a benefit of consistency between different
languages, for example, French and English. The column ID can be retrieved by the method
getColumnIds().
The returned value is the name of a column.
$table.getColumn($columnNumber)
• columnNumber – a column number starts with 1. The column number 0 is the row number.
The returned value is the name of a column.
$table.getColumnNames()
Example code:
#foreach($colname in $table.getColumnNames())
$colname
#end
$table.getColumnIds()
Example code:
#foreach($colid in $table.getColumnIds())
$table.getColumn($colid)
#end
$table.getValue($rowElement, $columnId)
$table.getValue($rowElement, $columnName)
$table.getValue($rowElement, $columnNumber)
$table.getValueAsString($rowElement, $columnId)
$table.getValueAsString($rowElement, $columnName)
$table.getValueAsString($rowElement, $columnNumber)
$table.getValueAsString($rowNumber, $columnNumber)
$table.getCellValueAsString($object)
For example:
$table.getVisibleColumnIds()
$table.getVisibleColumn($columnNumber)
• columnNumber – a column number starts with 1. The column number 0 is the row number.
The returned value is the name of a visible column.
$table.getVisibleValue($rowElement, $columnNumber)
$table.getVisibleValue($rowNumber, $columnNumber)
$table.getVisibleValueAsString($rowElement, $columnNumber)
$table.getVisibleValueAsString($rowNumber, $columnNumber)
The code shown below prints the row, column, and its value in the form of an HTML table.
Contents
To import the Dependency Matrix tool to a template, type the following code in the template:
Related pages
Contents
On this page
You can use the following Dependency Matrix tool API in the template.
Class DependencyMatrixTool
Class Matrix
Use the following methods to use diagrams to get row elements, column elements, and relations
between row and column elements.
• +getRows() : List<Element>
• +getColumns() : List<Element>
• +getRelation( row: Element, column : Element) : List<Relation>
Class Relation
• +getName() : String
• +getElement() : Element
• +getSemanticType() : String
• +getDirection() : String
#set($matrix = $depmatrix.getMatrix($diagram))
For example:
#set($matrix = $depmatrix.getMatrix($diagram))
Example code:
$matrix.getRows()
To print all row elements' names, for example, type the following code:
#foreach($row in $matrix.rows)
$row.name
#end
$matrix.getColumns()
To print all column elements' names, for example, type the following code:
#foreach($col in $matrix.columns)
$col.name
#end
Use this method to retrieve the relations between row and column elements.
$matrix.getRelation($row, $column)
• getSemanticType : String
Return the semantic type
• getElement : Element
Return a relationship element or null if the relationship is not an element, for example,
tag name.
• getName : String
Return a relationship name. If the relationship is a tag name, it will return the tag name. If
the relationship is NamedElement, it will return the element name; otherwise, return a
human name.
• getDirection : String
Return the direction.
To print the row, column, and its relationship name, for example, type the following code:
#foreach($row in $matrix.rows)
#foreach($col in $matrix.columns)
#foreach($rel in $matrix.getRelation($row, $col))
$row.name has $rel.name with $col.name
#end
#end
#end
To print rows, columns, and relations in a spreadsheet file format, for example, type the following code:
#import('depmatrix','com.nomagic.reportw
izard.tools.DependencyMatrixTool')
#forpage ($diagram in
$report.filterDiagram($Diagram,
["Dependency Matrix"]))
#set($matrix=$depmatrix.getMatrix($diagr
am))
$bookmark.create($diagram.name)
#forcol ($col in
$matrix.columns)
$col.name#endcol
#endpage
Contents
#import('query', 'com.nomagic.reportwizard.tools.QueryTool')
Related pages
Constructor
• QueryTool()
Creates the Query tool from your selected element scope. This method will use a default
scope from the variable $elements.
• QueryTool( scope : Collection<Element>)
Creates the Query tool from a specific element scope.
Methods
Methods
Pattern Meaning
E An element of type E.
EF An F element descendant of an E
element.
Query by Type
A pattern allows a template to query elements from a given type name, for example:
class
Retrieve all classes from a selected package scope.
[attr]
Matches an element with an attr attribute regardless of the value of the attribute.
[attr=value]
Matches an element with an attr attribute whose value is exactly val.
The Query tool matches against case sensitivity of attribute names and values in a pattern. A VTL
property syntax (Camel case without space) will be used for the attribute names. You can use spaces in
writing values.
When the value of an attribute is NamedElement, the element’s name will be used as a default value.
An asterisk (*) can be used to match any element type when combined with the other patterns, for
example:
*[name=foo]
Retrieve any element whose name attribute is exactly foo. Use an asterisk to match any
element.
actor[name=foo]
Retrieve all actor elements whose name attribute is exactly foo.
actor[name=]
Retrieve all actor elements whose name attribute is empty.
class[owner=foo]
Retrieve class elements whose owner attribute name is exactly foo.
class[owner=foo][name=bar]
Retrieve class elements whose owner attribute name is exactly foo and name attribute is
exactly bar.
[attr^=val]
Matches an element with an attr attribute whose value begins with the prefix val. If val is an empty
string, the query returns nothing.
[attr$=val]
Matches an element with an attr attribute whose value ends with the suffix val. If val is an empty string,
the query returns nothing.
The Query tool matches against case sensitivity of attribute names and values in a pattern. A VTL
property syntax (Camel case without space) will be used for attribute name. You can use spaces in
writing values.
When value of attribute is NamedElement, the element name will be used as default value, for example:
*[name^=foo]
Retrieve any element whose name attributes begins with foo. Use an asterisk to match
any element.
actor[name$=foo]
Retrieve all actor elements whose name attribute is ends with foo.
class[qualifiedName*=nomagic]
Retrieve class elements whose qualifiedName attribute contains string nomagic.
package:empty
Retrieve any package whose ownedElement attribute is empty.
package[name=foo]:empty
Retrieve any package whose name attribute is exactly foo and ownedElement attribute
is empty.
Query by Element ID
A pattern allows a template to query elements from a given element’s ID. An element’s ID is unique in a
project, for example:
#17_0_3_8e9027a_1325220298609_477646
Retrieve an element whose ID is exactly 17_0_3_8e9027a_1325220298609_477646.
Query by Descendent
A pattern allows a template to query an element that is the descendant of another element, for
example, an Actor that is contained within a Package. A descendant query is one or more white-spaces
that separate(s) two sequences of patterns.
You can use an asterisk (*) to match any element type when combined with the other patterns, for
example:
You can use an asterisk (*) to match any element type when combined with the other patterns, for
example:
An end statement is required to separate an element and its child, or grandchild, for example:
$query.get("class[attr] property")
Retrieve a property element that is a grandchild or a later descendant of a class
element that contains an attr attribute.
$query.get("class[attr]property")
An invalid query pattern.
• Characters = , ^=, $=, and *= are keywords and all strings except ] that are written next to these
keywords mean the attribute values.
• Attribute names are mandatory.
• An attribute name cannot contain white-space, =, ^=, $=, *=, and ], for example:
If an attribute value is not in any double quotes or single quotes, all strings, except ], after a keyword
mean an attribute value, for example:
$query.get("*[name=bean]")
Retrieve all elements whose name attribute is bean
$query.get("#17_0_3_8e9027a#17_0_3_8e9027b") is equivalent to
$query.get("#17_0_3_8e9027a #17_0_3_8e9027b")
Retrieve an element ID #17_0_3_8e9027b that is a grandchild or a later descendant of
an element ID 17_0_3_8e9027a.
$query.get("#17_0_3_8e9027a > *")
Retrieve all elements that are the children of an element ID #17_0_3_8e9027a.
$query.get("#") or
$query.get("#[name=a]#17_0_3_8e9027a")
An invalid query pattern.
$query.get("*:empty") or
$query.get("*:empty#17_0_3_8e9027a") or
$query.get("*:empty > class") or
$query.get("*:empty[name*=class]")
A valid query pattern but the result of some patterns will be an empty list.
$query.get("*[name=:emptyx]")
Retrieve all elements whose name attribute is :emptyx
$query.get("*:emptyx") or
$query.get("*:em")
An invalid query pattern.
Query methods
Contents
On this page
$query.get(query)
• Parameters: query : String (the query string as described in section Recognizable Query
Patterns.
• Returns: java.util.List<Element> (a list or a collection of MagicDraw Elements or an empty List if
there is no matching element).
• The sample code to print all Use Case elements under a packagable element named foo is as
follows:
$query.get(query).first()
• Returns: Element (the first element from a query result collection or a null value if there is no
matching element).
• A Sample code to print the first package is as follows:
$query.get("package").first()
$query.get(query).last()
• Returns: Element (the last element from a query result collection or a null value if there is no
matching element).
• A sample code to print the last package is as follows:
$query.get("package").last()
$query.get(query).get(index)
$query.get(query).unique()
This method is equivalent to the one in section Getting the First Element from a Collection.
• Returns: Element (a unique element from a query result collection or a null value if there is no
matching element).
• A sample code to print a single package is as follows:
$query.get("package").unique()
$query.getElementsByName(name)
Retrieve an element from a selected package scope whose element name exactly equals a given
parameter. This method is equivalent to query pattern *[name=var].
$query.getElementsByName("foo").unique()
Retrieving Elements by ID
$query.getElementById(id)
Retrieve an element from a selected package scope whose element ID exactly equals a given
parameter. This method is equivalent to query pattern #id.
$query.getElementById("17_0_3_8e9027a_1325220298609_477646").unique()
(i) Example 1
Without QueryTool:
With QueryTool:
#import("query", "com.nomagic.reportwizard.tools.QueryTool")
#foreach ($c in $query.get("class[qualifiedName^=com.nomagic.reportwizard]"))
$c.name
#end
(ii) Example 2
Print any classes whose containing in model Design and name ends with Bean.
Without QueryTool:
With QueryTool:
#import("query", "com.nomagic.reportwizard.tools.QueryTool")
(iii) Example 3
Matches any property element which owner element is class whose name attributes value is exactly
equal to foo.
Without QueryTool:
With QueryTool:
#import("query", "com.nomagic.reportwizard.tools.QueryTool")
Introduction
Contents
This user guide demonstrates how to create a report template using Report Wizard and use it in
MagicDraw. To make the most of Report Wizard, you need to understand Apache Velocity and
MagicDraw elements. Report Wizard uses Apache Velocity, this means that you will need to know how
to create a Velocity template and that every rule that applies to Velocity will also apply to MagicDraw
Report Wizard.
Velocity is a Java-based template engine that processes templates and references Java objects to
produce output documents. A basic Velocity template can contain static text, layouts, conditional
statements, and placeholders for each referenced Java object. When a template is being read by
Velocity, conditional statements will be processed and placeholders will be replaced with the value from
the referenced Java objects. You can use Velocity, for example, to generate web pages, emails, and read
XML documents, but with Report Wizard it is now possible to use Velocity to read other types of
templates, such as Rich Text Format documents. This user guide covers some basic aspects of Velocity,
MagicDraw elements, and Report Wizard directives.
Related page
What is a Template?
A template, in Velocity, is a text file that tells Velocity what the output should look like. It contains a
document page style, layout, header, footer, and static text just like any other template that comes with
most of the Word Processor programs. However, a Velocity template also contains specific placeholders
for Java objects and Velocity Template Language scripts which will tell the Velocity Engine what and how
to print the information in the output.
Contents
Contents
On this page
1. First you need to know the element type and attributes. Open the Specification dialog to see the
type and attributes.
The example above shows that $Class is an array that contains all the Class elements in
a Selected Element Scope (see Report Wizard user guide342 for more information). $class is the
individual Class element inside the array. To access the value of a property in $class,
type: $class followed by "." and the attribute's name (".name", ".visibility", and ".isAbstract" are
the names of the $class attribute). The syntax for accessing the attribute value can be
represented by: $[Referenced object].[Attribute's name].
When you generate the output of the template for a project with a single Class element, the result will
be shown as follows:
342 https://docs.nomagic.com/display/MD190SP1/Report+Wizard
Glossary
• Array
An array is a container object that holds a fixed number of values of a single type. The length of
an array is established when the array is created. After it is created, its length is fixed.
• Attribute
Attribute defines values that can be attached to instances of the class or interface. For example,
an attribute of a class represents the characteristics of the class.
• Class
Class is the concrete realization of EncapsulatedClassifier and BehavioredClassifier. The purpose
of a class is to specify a classification of objects, and to specify the Features that characterize the
structure and behavior of those objects.
• Element
Element is a constituent of a model. Every element has the inherent capability of owning other
elements. When an element is removed from a model, all its ownedElements are also removed
from the model. The abstract syntax for each kind of element specifies what other kind of
elements it may own. Every element in a model must be owned by exactly one other element of
that model, with the exception of the top-level Packages of the model.
Contents
On this page
Opening the Report Wizard dialog and creating a new custom template by clicking the New
button.
3. In the New Template dialog, type the name and description. Select a category, and then click
.
Entering the new template name and description, and then selecting a template file in the New
Template dialog.
4. Find the template file that you have created, and click .
Glossary
• Report template
Ready-made report configurations that you can use to quickly create a specific type of report in
Report Wizard.
Contents
Velocity Template Language is a scripting language used only by Velocity Engine to determine what the
output should look like. This section is divided into three parts:
• Velocity Variable
• Velocity Directive
• Comment and unparsing code
For more information on the Velocity Template Language, visit http://velocity.apache.org/engine/1.6.2/
user-guide.html.343
Related pages
Velocity variable
A Velocity variable can be either a referenced Java object or a declared variable inside a template. A
Velocity variable begins with $ followed by the name of the variable. Depending on what is added to the
Velocity Context (MagicDraw automatically adds its element to the Velocity Context) the variable can
either be a local variable or a reference to a Java object.
343 http://velocity.apache.org/engine/releases/velocity-1.6.2/user-guide.html+
If a Velocity variable is a reference to a Java object, you can call its methods and value by:
• Directly calling the object method with the Velocity variable, for example, $object.method().This
is useful if you want to use a Java object's method to process data and print it out.
• Calling the object properties, for example, $object.name.
Velocity allows you to call the referenced Java object's method directly like you would in Java. This is very
useful as you can create methods in Java that can help you create a more flexible Velocity template. For
instance, if you need to perform a complex operation, such as sorting a list according to certain
variables, you can create a sorting method in Java, and then call that method from a Java object.
Report Wizard provides a collection of complex statements in standard tool methods. You can find
more information on the standard tool in the Helper Modules (see page 1543) section, Report Wizard User
Guide. You can also create your own custom tool, deploy, and use it inside a template. For more
information on the custom tool, see Appendix A: Report Extensions (see page 1868), Report Wizard User
Guide.
Note
• Report Wizard does not support calling variables in double quotes.
#set($newVTL = "$vtl")
#set($newVTL = "text $vtl")
#aMacro("text $vtl")
#aMacro("$vtl")
#if("$text.name" == "class")
Contents
A Velocity directive is a keyword used by Velocity to perform certain tasks such as looping and
controlling the output of the document based on values from MagicDraw.
With directives you can make dynamic templates and you can do more than just print out MagicDraw
elements and attributes. A Velocity directive begins with # and followed by the directive name. Some of
the frequently used Velocity directives are as follows:
1. #if, #elseif, and #else: these directives are used to decide whether or not text should be
included in the output based on the conditional statement.
2. #set: this directive is used to assign a value to a variable.
3. #foreach: this directive is used to iterate through a list of variables.
4. #macro: this directive is used as a means to create a reusable script. It is especially useful if you
need to call a certain line of scripts repeatedly.
Related pages
#if ($condition)
Hello World
#end
The variable: $condition is evaluated to determine whether it is true, which will happen under certain
circumstances:
The #elseif or #else element can be used with the #if element. Note that Velocity Engine will stop at the
first expression that is found to be true. The following example shows you how to add #elseif and
#else to the #if statement:
From the above example, let us assume that $condition1 is false, $condition2 is true, and $condition3 is
true. The output for this conditional block will be Content 2 because $condition2 comes before
$condition3 even though both of them are true.
Comparing Values and Logical Operators
So far, $condition in the #if directive is assumed to be a Boolean value, however just like Java, Velocity
supports the syntax to compare (greater than (>), less than (<), and is equal to (==)) two variables and
the Logical Operators logical AND (&&), logical OR (||), and logical NOT (!) which will return a Boolean
value.
In Velocity, the equivalent operator ("==") can be used to compare string, value, and objects. Note that
the semantics of the equivalent operator ("==") are slightly different than those of Java where the
equivalent operator ("==") can only be used to test object equality. In Velocity the equivalent operator
("==") can be used to directly compare numbers, strings, or objects. When comparing two objects with
different classes, the string that represents the objects is compared. The following example compares
two variables to see whether or not they are equal:
The comparison operators ("<" and ">") is the same as the ones used in Java. The following example
shows how to use the comparison operators to compare two values in which the #if statement will be
evaluated 'true' and "Var1 is less than Var2" will be printed out in the generated report:
#set ( $var1 = 6 )
#set ( $var2 = 7 )
#if ( $var1 < $var2 )
Var 1 is less than Var2
#end
The logical AND, in Velocity, is represented by && and it must have at least two arguments. To write a
conditional statement with the logical AND type, for example:
To better understand the above example, let us assume that $var1 < $var3 is argument 1 and $var3 >
$var2 is argument 2 (argument 1 and argument 2 will be evaluated separately and will return true/
false). The #if() directive will be evaluated 'true' if both argument 1 and argument 2 are true. If
argument 1 is false, the expression will be evaluated false and argument 2 will not be evaluated.
If argument 1 is true, Velocity Engine will then check the value of argument 2. If the value is true, the
entire expression is true and Content 1 becomes the output. If the value is false then there will be no
output as the entire expression is false.
Logical OR operators work the same way as Logical AND, except for one of the references that needs to
be evaluated 'true' for the entire expression to be considered true, for example:
To better understand the above example, let us assume that $var1 < $var3 is argument 1 and $var3 <
$var2 is argument 2. According to the example, argument 2 is false because $var2 is less than $var3 not
the other way around. Since argument 1 is true, Velocity Engine does not need to look at argument 2,
whether argument 2 is true or false, the expression will be true, and Content 1 will be the output.
Basically, a Logical OR operator requires only one argument to be true (either argument 1 or argument
2) to make an expression true. In the case that both argument 1 and argument 2 are false, there will be
no output because the expression is false.
As shown in the above example, !$bool is evaluated true and Content 1 is the output. But if $bool is
true, then !$bool is false and there will be no output.
#set statement
In Velocity, you can declare a variable and set its value by using the #set directive, for example:
The above example shows that $var has a string value, $var2 has a Boolean value, and $var3 has a
numerical value. The #set directive can also set an array to a declared Velocity variable. To assign an
array to a variable type, for example:
#foreach statement
The #foreach directive will iterate through a list of variables and assign it to a local variable, for
example:
The above example shows that $Class is a list of class elements in MagicDraw. The #foreach directive
will iterate through the $Class list and assign the value in the list to $localClass in each iteration. The
code between #foreach and #end will be processed and the result will print the class name in each
iteration. For example, if $Class contains class elements named "a", "b", and "c", the output from the
above example will be:
a
b
c
#macro statement
Under certain circumstances, you might find that you often repeat several lines of a VTL code in multiple
areas inside your template. To solve this problem, Velocity provides the #macro directive that allows
you to repeat a segment of VTL codes. The first thing you have to do is to declare or create the macro
itself, for example:
#macro (HelloWorld)
Hello World! It is such a beautiful world!
#end
Then within the template, you can call this macro and it will print "Hello World! It is such a beautiful
world!"
#HelloWorld()
When the macro in the above example is passed on to the Velocity Template Engine, "Hello World! It is
such a beautiful world!" will be printed out as a result. You may wonder why this is important, but
imagine having to print a note with 10 lines of text in different parts of the document. The Velocity
macro helps you save the space and time. It also allows you to pass the value from a variable on to a
method parameter as you would using a Java method. To do this you have to create a macro, for
example:
In the above example, you have created a macro called "myMacro" that accepts two variables, the first
variable is supposed to be a string and the second variable called "somelist" is supposed to be a list
(note that when creating a macro that accepts variables always remember what types of variables it
accepts, otherwise an error will occur during report generation). To call myMacro type, for example:
The above example shows that "myMacro" has been called and there are two variables in the brackets,
$color and $list, separated by a space. The result of the example:
A Rose is red.
Blood is red.
Strawberry is red.
Comment
Comment is used for explaining or making notes regarding the code. You can include text comments in
the report. The report engine will not parse comments.
• Type ## before the comment. The report engine will skip all the text in the line, as follows:
• Type #* followed by the multi-line comments and end them with *#. The report engine will skip
all the lines between these symbols, as follows:
#*
Comment line1
Comment line2
Comment line3
*#
Unparsing code
You can declare the code in Velocity template without parsing it into the report. The report engine will
not parse the code.
To unparse code
• Type #[[ followed by the code to unparse and end it with ]]#, as follows:
<html>
<body>
#[[
<?php
session_start();
YOUR CODE HERE
?>
]]#
</body>
</html>
Contents
Report Wizard introduces three directives: #forrow, #forcol, and #forpage. These directives allow you
to use Velocity to generate outputs other than web documents. With these directives, you can eliminate
#forrow
This directive is used in the Rich Text Format, OpenDocument text, and OpenDocument spreadsheet,
Microsoft Word Document (DOCX), and Microsoft Excel spreadsheet (XLSX) documents. Whenever
#forrow iterates through a list, it creates a row in a table.
#forcol
This directive is used only in Microsoft Word document (DOCX), Microsoft PowerPoint presentation
(PPTX), OpenDocument spreadsheet, and Microsoft Excel spreadsheet (XLSX). Whenever #forcol iterates
through a list, it creates a column in a table.
#forpage
This directive is used in Rich Text Format document, OpenDocument Text, OpenDocument spreadsheet,
OpenDocument presentation, Microsoft Word document (DOCX), Microsoft Excel spreadsheet (XLSX),
and Microsoft PowerPoint presentation (PPTX). Whenever #forpage iterates through a list, it creates a
new page in Rich Text Format, OpenDocument text or Microsoft Word (DOCX). It also creates a new
sheet in OpenDocument spreadsheet or Microsoft Excel spreadsheet (XLSX), or a new slide in
OpenDocument presentation or Microsoft PowerPoint presentation (PPTX).
Related pages
#forrow directive
Contents
The Velocity Template Language does not support loops inside the table structure. However, the Report
Wizard engine introduces a new custom syntax to allow loops in the table structure in order to clone
the table rows. In the following example, we will create a table that will print out the name of a Use
Case element and its owner in a table.
Related page
#forcol directive
This directive is designed only for the OpenDocument Spreadsheet, Microsoft Word document (DOCX),
Microsoft PowerPoint presentation (PPTX), and Microsoft Excel Spreadsheet (XLSX) templates. This
directive allows loops over the column.
Based on the example shown in figure above, the engine will generate a report with different columns
for each Use Case name. The output from this example will appear as shown in the figure below:
You can combine both #forrow and #forcol, and produce a more complex output report (see figure
below).
In the figure below, the output generated from the Magic Library sample project is shown.
Contents
#forpage($dia in $Diagram)
$uc.name
#endpage
The example above will create many pages each containing a Use Case element's name. The number of
pages created depends on the number of Use Case elements in the $UseCase list.
Related page
#forpage($dia in $Diagram)
$dia.name
$dia.image
#endpage
344 http://OpenOffice.org
Contents
By now you should know how to write a basic template that makes a simple reference to a MagicDraw
element. But how will you know if the element is referenced or not? This section shows you how
elements are referenced and how to call them.
Contents
In Velocity, whenever you want to reference to a Java object you need to manually add the object to the
Velocity template and name it. In Report Wizard, however, this process is done automatically. What you
need to understand is how it is done as it will help you to call the MagicDraw elements.
All MagicDraw elements in MagicDraw such as Class, Use Case, and Activity are the sub-classes of
elements. During report generation, the report engine will get all the elements from a project within a
selected scope that you have defined in Report Wizard, and then classify and add them to a list of the
same type. The list will then be added to the Velocity Context with its type as its name. For instance, in a
project where there are two types of Element, Class, and Use Case, all the elements that are identified
as Classes will be kept on the same list and the list will be added to the Velocity Context and labeled as
"Class" during report generation. This process also applies to the Use Case elements. To reference to a
specific Class element, first you will have to make a reference to $Class (list of Class elements), and
then iterate through the list to find that particular Class element by using the #foreach, #forrow,
#forcol, or #forpage directive, followed by the #if directive to search for the name of the class.
This section will use part of the "Inventory Control System.mdzip" file in <install.root>/samples/casestudies
as an example to show you how to reference to MagicDraw elements.
The "Use Case View" package contains three element types: (i) Actor, (ii) UseCase, and (iii) Diagram that
you can call in a template by typing "$Actor," "$UseCase," and "$Diagram" respectively.
In this example you will create a report that will print the names of the Actors, UseCases, and diagram
image.
Creating a report including the Actor, Use Cases, and diagram image names
Contents
On this page
The 'Use Case View' package contains three element types: Actor, UseCase, and Diagram that you can
name in a template by typing "$Actor," "$UseCase," and "$Diagram" respectively. The following
example shows you how to create a report that will print the names of the Actors, UseCases, and
diagram images.
To create a report that includes the names of Actor, Use Cases, and diagram images
345 http://OpenOffice.org
Contents
Besides generating Rich Text Format templates and Rich Text Format reports, Report Wizard also
generates other types of document:
Related pages
• When you generate a report from a particular template, Report Wizard will automatically
create an HTML, text, an XML, or a DocBook document depending on a given template
filename extension.
• The #forrow, #forcol, and #forpage directives do not support HTML, text, XML, and
DocBook format files.
1. The beginning and end of a statement must be declared within a single cell. A #macro statement
must be declared in a single cell.
2. You can use #foreach in a single cell record only. To create data for multiple rows, use the
#forrow directive instead, see figure below.
3. You can use #forcol to create data for multiple columns, see figure below. You can use the
statement in conjunction with #forrow.
On this page
346 http://OpenOffice.org
• Statement
VTL statements that maintain a sequence order, such as #if and #foreach, must begin and end
the statements inside the same text box.
347 http://OpenOffice.org
The end result of using #if and #foreach with #forpage statement.
Glossary
• VTL
The Velocity Template Language (VTL) is meant to provide an easy, simple, and clean way to
incorporate dynamic content in a web page. A VTL statement begins with the # character and
contains a directive: set.
More information about working with Velocity Template Language (VTL)
To learn more about working with Velocity Template Language (VTL), visit the following pages:
Creating a template for a Rich Text Format or OpenDocument Text document, or Microsoft Word
Document (DOCX)
Contents
On this page
To create a template for a Rich Text Format or OpenDocument Text document, or Microsoft Word
Document (DOCX)
1. Open OpenOffice.org Writer or Microsoft Word for an *.odt, *.rtf, or *.docx file. (To save a file as
an *.odt file in Microsoft Word, an add-on is required. You can get the add-on at http://odf-
converter.sourceforge.net/.)
2. Add the Velocity Template Language codes to the template file.
3. Save the template file.
4. Add the template to MagicDraw.
When generating a document, Report Wizard will apply the text format used in writing the Velocity
code.
Creating a template for an HTML, a text, an XML, or a DocBook document (see page 1857)
Creating a template for a Rich Text Format or OpenDocument Text document, or Microsoft Word
Document (DOCX) (see page 1862)
Creating a template for an OpenDocument spreadsheet or Microsoft Excel spreadsheet (see page 1857)
Contents
On this page
348 http://www.apache.org/
349 http://velocity.apache.org/engine/index.html
350 http://www.apache.org/licenses/LICENSE-2.0.txt
Documentation:
Attributes
• The layout of the report should look like the example below.
Instructions
The first and most important step in creating a report is setting up the document and its layout.
The layout for a class description table in a Word document containing the name of the class, the
attributes, and the relationships.
As shown in the preceding figure, a diagram will appear at the top of the report followed by a class
description table. Accordingly, each diagram on the Class diagrams list has a class description table
describing each component in the diagram. Follow the next steps to create the document template:
The steps listed above contain two #foreach loops: the outer loop that iterates through a list of
diagrams, and the inner loop that iterates through a list of Class elements. The list of diagrams in
a MagicDraw project is represented by $Diagram.
6. Next, you need to get all the elements contained in the diagram by using $report. $report is a
standard tool containing helpful methods such as getDiagramElements() that returns a list of
elements inside a diagram.
7. In the example above, $eList has been assigned with a list of Elements inside $diagram. Now,
you need to create an inner loop that will cover the table that you created earlier, and then filter
out the elements inside the diagram whose type is not Class element.
The Class Name and Documentation values are obtained by referencing the name and
documentation attributes of $e.
9. Use the #forrow directive as the attribute to print rows of the class attribute type
($att.type.name351) and the class attribute name ($att.name352).
10. Save the file as Rich Text Format. Open MagicDraw and draw a simple class diagram.
351 http://att.type.name
352 http://att.name
Glossary
• Class diagram
A class diagram is a diagram in which the primary symbols in the contents area are class
symbols.
More information about working with report templates using Report Wizard
To learn more about working with report templates, visit the following pages:
Creating a report including the Actor, Use Cases, and diagram image names (see page 1852)
Contents
To install the extension, copy the .jar file into the extensions directory under the Report Wizard plugin
directory or template directory. The archives stored within subdirectories will not be loaded in Report
Wizard, see figure below.
Related pages
Custom tool
A Custom tool is a template library written in Java to encapsulate functions in context. The Custom tool,
see figure below, is extended from the report API. The tool can be used to develop custom context
properties that are presentation centric or that can take advantage of the existing ‘tool’ extensions or by
document authors familiar with Java.
Report Wizard uses the word 'tool' meaning an object encapsulating dynamic functions on the
JavaBean. A tool is a "carrier" of data between the Java and template layers. In other words, the tool
simplifies template development and maintenance.
Context Name
A Context name is a name for variables or references in the template. Report Wizard uses the Velocity
Template Language (VTL) as a standard syntax for the template. VTL uses “$” as a leading character
followed by an identifier for the variable.
For example:
$UseCase
$foo.name
Context Object
A Context object is a Java Object representing a variable. A Context object is modeled on the JavaBean
specifications defined by Sun Microsystems.
For example, if a String represents the variable $foo.name in context, the value of the String will be
printed out in the output report as follows.
Foo Name
Tool interface
Custom Tool is written in the Java language. The tool implements a specialized interface called ITool.
The Report API provides both an interface and a class to support interface realization and class
generalization. As mentioned earlier, a Tool is modeled on the JavaBean specifications. Functions
implemented in this class must be defined in a series of setter or getter methods. The following sample
shows the source code for the ITool interface that you must implement:
All tools must implement the ITool interface (or one of its subclasses) as it defines the methods the
template engine calls to execute. The table below provides a description of the methods in the ITool
interface.
Method Description
Class Tool
A Class Tool is a base class realizing the interface ITool. This class provides the default implementation
for ITool.
This class also provides methods derived from the java.util.Observable class, which can be used to
notify the observers. An observer class, such as a template engine or a graphical user interface class,
can receive the notification message from the tool and manage to display or interact with the user.
Concurrent Tool
A Concurrent Tool provides concurrent tasks running in the template engine. This class implements an
unbounded thread-safe queue, which arranges the elements in a first-in-first-out (FIFO) order. New
tasks are inserted at the tail of the queue, and the queue retrieval operations obtain elements at the
head of the queue.
The tool extends from this class and is ideal for processing a long task that does not want other tasks to
wait until the process is complete. The following code shows the sample usage of Concurrent Tool.
An example of Concurrent Tool is FileTool. The root template that calls the file tool method will create a
subprocess, offer the subprocess into a queue, and continue the root template until finished. The
template engine will later call the consume method to complete the subprocess once the consumer
queue is available. The number of concurrent processes available for the execution is declared in the
template engine property (See TemplateConstants.TEMPLATE_POOL_SIZE for detail.).
package mytool;
import com.nomagic.magicreport.engine.Tool;
public class HelloTool extends Tool
{
public String getHello() {
return "Hello World";
}
public String getHello(String name) {
return "Hello " + name;
}
}
The sample shows two methods following the getter concept defined by the JavaBean specification.
The extension package is delivered in a JAR file. JAR (Java ARchive) is a file format based on the popular
ZIP file format and is used for aggregating many files into one. To create a JAR file, you can store *.class
with the Java package folder structure in a ZIP file format or creating from a JAR tool.
In this example, all the class files in the current directory are placed in the file named "MyTool.jar". A
manifest file entry named META-INF/MANIFEST.MF is automatically generated by the JAR tool. The
manifest file is the place where any meta-information about the archive is stored as named: Value pairs.
Please refer to the JAR file specification for more details.
The example above shows that all the class files in the directory mytool are placed in the file named
"MyTool.jar".
• http://java.sun.com/docs/books/tutorial/deployment/jar/
• http://java.sun.com/javase/6/docs/technotes/tools/windows/jar.html
An example of a directive:
#import('prefix', 'name')
The import directive declares that the template uses the custom tool, names the tool that defines it,
and specifies its tag prefix before the custom tool is used in a template page. You can use more than
one import directive in a template, but the prefix defined in each template page must be unique.
Attributes
name (type:String)
The uniform or full qualified class name that locates the Tool class, for example,
mytool.HelloTool
prefix (type:String)
The prefix that precedes the custom tool name such as a string in $hello.getHello(). Empty
prefixes are not allowed. When developing or using custom tools, do not use tag prefixes
#import('hello', 'mytool.HelloTool')
Get Hello
$hello.getHello()
Get Hello Foo
$hello.getHello('foo')
Get Hello
Hello World
Get Hello Foo
Hello foo
To enable Report Wizard to automatically import a Template Tool, you have to use the existing template
variable inside “template.xml” and “report.xml”.
<variable>
<name>Variable Name</name>
<description>Variable Description</description>
<type/>
<value xml:space="preserve">Variable Value</value>
</variable>
Add "com.nomagic.magicreport.engine.Tool" to a type value where the name is a variable name and the
value is a full-qualified template tool class, for example:
The result is a template code that can access com.nomagic.reportwizard.tools.TextTool from $text.
$text.noLineBreak($diagram.name)
Once you have edited a template variable, you have to restart MagicDraw prior to generating a
report through MagicDraw.
Contents
Office Open XML (also referred to as OOXML or Open XML) refers to the standardized file formats of
spreadsheets, charts, presentations, and word processing documents for Microsoft Office. These
standardized file formats become free and open as ECMA-376 Office Open XML File Formats - 2nd
edition (December 2008) and ISO/IEC 29500:2008.
The most common Open XML file formats that Report Wizard supports include:
Note
Support Office Open XML (DOCX, XLSX, and PPTX) and Microsoft Office 2007 and newer
versions.
Related pages
#forcol may create different number of columns in each row. See the example below.
Template Code:
#forcol must be defined as the first statement in a column because it is parsed and processed
before other statements in the column except #forrow. See the example below.
Template Code
Template Code:
#forcol will create dynamic columns in a row. This directive does not create columns for the
whole table. See the example below.
Template Code:
Output:
1. $tableprop.mergeColumns(int number)
• number - the number of columns to merge. This value has to be of type integer and start from 2.
For example:
Template Code:
Project $tableprop.mergeColumns($Package.size())Packages
#forcol($p in $Package)$p.name#endcol
• stringNumber - the string value of number of columns to be merged. This value has to be of type
integer string and start from “2”.
For example:
Template Code:
#forcol($p in $Package)$p.name#endcol
Output:
Template Code:
Project $tableprop.mergeColumns($gValue)
#set($gValue = $Package.size() + 1)Packages
Template Code:
$tableprop.mergeColumns(“5”)Packages
#forcol($p in $Package)$p.name#endcol
Output:
The beginning and ending statements must be declared within a single cell. The figures below show
samples of invalid usage of the #if and #foreach statements between cells respectively.
The following two figures demonstrate samples of valid usage of the #if and #foreach statements
respectively.
The following figure demonstrates a sample of valid usage of the #macro statement.
The error message from running the code in the figure above.
Since the PPTX template does not provide the statement order, the template will not be
interpreted as the order of the displayed images (text boxes). For example, $uc.name
may not be processed after #foreach($uc in $UseCase) has been completely processed.
The following code demonstrates a sample of valid usage of the #foreach statement.
2. A VTL Macro must be declared within a single text box. Do not insert the multi-cell recorded
macros in a single text box. See the following code example.
Since each text box does not have any sequence order, the macro cannot record any content between
the text boxes. The following code example demonstrates a valid usage of the #macro statement.
To avoid this problem, you can use the $report.filterElement($elements, $types) method. This helper
method provides the element filter for the specified type. In this case, use the following code.
For more details on $report.filterElement($elements, $types), see Section Helper Modules (see page 1543).
Contents
The OpenDocument format (ODF) is an open file format for office documents, such as spreadsheets,
presentations, and word processing documents. The standard was developed by the Open Office XML
technical committee of the Organization for the Advancement of Structured Information Standards
(OASIS) consortium.
The version 1.0 manifestation was published as an ISO/IEC International Standard, ISO/IEC 26300:2006
Open Document Format for Office Applications (OpenDocument) v1.0.
• ODT
for word processing (text) documents
• ODS
for spreadsheets
• ODP
for presentations
Related pages
OpenDocument text
Report Wizard supports most OpenDocument Text (ODT) features. It enables you to input the VTL codes
inside meta-data, styles, and text content. All syntax usable inside RTF can be used with ODT.
OpenDocument spreadsheet
All multi-line directives such as #if, #else, #elseif, #foreach, and #macro must be used under the
following conditions:
1. The beginning and ending statements must be declared within a single cell. The two figures
below show two samples of invalid usage of the multi-line statements between cells.
Since the body of the #if statement is contained in the cell A2, this cell will not be
generated if the condition is not true (the element type is not “usecase”). Due to the
constraints of spreadsheet document structure, the number of cells in a column must be
equal to the number of cells in all columns, and the number of cells in a row must be
equal to the number of cells in all rows.
The codes in the figure above will break the structure of a spreadsheet document. The
two figures below demonstrate two samples of valid usage of the multi-line statements.
2. VTL Macro must be declared within a single cell. Do not insert the multi-cell recorded macros in a
single cell, see figure below.
The #forrow directive being used to create data for multiple rows.
As shown in figure below, the output will be:
OpenDocument presentation
A presentation document is a special document template. This template does not contain a content
order. The text content used within this document is inserted inside a text box. A text box is an image
structure (An image structure keeps the position of each image in x, y coordinates).
You can change the position of a Text box. You can also place Text boxes in the same positions as
others, see figure below.
• The beginning and ending statements must be declared within a single text box. The figure below
shows the sample of invalid usage of the multi-line #foreach statement between the text boxes.
The figure below shows the sample of valid usage of the #foreach statement.
353 http://uc.name
To solve this problem you can use the $report.filterElement($elements, $types) method. This helper
method provides the element filter for the specified type. The codes are shown in the figure below:
OpenOffice.org354
OpenOffice.org355 is an office suite that can open and save documents in many formats. This tool can
also open RTF documents and save them as ODF documents.
OpenDocument references
ISO/IEC 26300:2006 Information Technology - Open Document Format for Office Applications
(OpenDocument) v1.0.
• http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=43485
Application Supports for the OpenDocument Format
• http://opendocumentfellowship.com/applications
Microsoft expands List of Formats Supported in Microsoft Office
• https://news.microsoft.com/2008/05/21/microsoft-expands-list-of-formats-supported-in-
microsoft-office/#sm.001yabsye3akd17114x1uf5dn16oa
OpenOffice.org357
• http://www.openoffice.org/
Microsoft Office ODF Extensions
• http://odf-converter.sourceforge.net/
354 http://OpenOffice.org
355 http://OpenOffice.org
356 http://OpenOffice.org
357 http://OpenOffice.org
Whenever the report engine encounters HTML content, it will automatically convert the content into a
valid output format style.
Contents
On this page
Font tags
A font tag consists of three attributes: Size, Face, and Color.
Size
The Size attribute determines the font size. Possible values are integers from 1 to 7. The default base
font size is 3. The greater the value is, the larger the size becomes.
• The base font size for RTF documents is 24 dot (equivalent to 12 pt).
• The base font size for ODF documents is 12 pt.
• The base font size for OOXML documents is 12 pt.
• The base font size for HTML documents is determined by the web browser.
Each value will be multiplied by two. Shown below is an example of the size attribute:
<font size="5">
It will be rendered as font size 16 pt
<font size="3">
It will be rendered as font size 12 pt
<font size="1">
It will be rendered as font size 8 pt
If the size attribute is specified without the face attribute, the default font will be determined by the
template or document editor, unless the font tag is covered by other HTML elements, such as <code>
or <tt>.
Face
The Face attribute defines the font name. If the face attribute is specified without the size attribute, the
default size will be determined by the template or the document editor.
Color Hexadecimal
code
Black #000000
Silver #C0C0C0
Gray #808080
White #FFFFFF
Maroon #800000
Red #FF0000
Purple #800080
Fuchsia #FF00FF
Green #008000
Lime #00FF00
Olive #808000
Yellow #FFFF00
Navy #000080
Blue #0000FF
Teal #008080
Aqua #00FFFF
For example:
Tag Description
name
TT Renders teletyped or
monospaced text.
U Renders underlined
text.
• TT
This tag will be rendered as <font face=”Courier New”>
• I
This tag is supported by the existing HTML conversion component.
• B
This tag is supported by the existing HTML conversion component.
• BIG
This tag will be rendered as <font size=”5”>
• SMALL
This tag will be rendered as <font size=”1”>
• STRIKE and S
This tag will be rendered in a strikethrough text.
Phrase elements
The table below lists assorted Phrase elements:
Tag Function
name
The report engine supports both unordered and ordered lists without attributes. The list tag attributes
will be ignored in the report output. The list tag attributes are type, start, value, and compact.
Neither unordered nor ordered lists are supported in XLSX and ODS templates.
Ordered lists
An Ordered List is defined by the <OL> element. This element contains one or more <LI> elements that
define the actual items of the list.
Unlike unordered lists (UL), items in an ordered list have a definite sequence. A conversion will
render each item in the list with a number. All <OL> attributes will be ignored in the report output. An
example of an Ordered List tag is shown in the figure below.
As shown in the figure below, the outputs in RTF, ODF, or HTML will be:
Unordered lists
An Unordered List is defined by the UL element. This element contains one or more LI elements that
define the actual list items.
A conversion will render the UL element with a bullet preceding each list item. All UL attributes will be
ignored in the report output. The figure below shows an example of an Unordered List tag:
As shown in the figure below, the outputs in RTF, ODF, or HTML will be:
HTML conversion should attempt to present a small filled-in circle to the first level, a small circle outline
to the second level, and a filled-in square to the third level. Bullets after the third level are filled-in
squares. An example of the Nested Unordered List tag is shown in the figure below.
As shown in the figure below, the outputs in RTF, ODF, or HTML will be:
A definition list can have multiple terms for a given definition, as well as multiple definitions for a given
term. Authors can also give a term without a corresponding definition, and vice versa, but such a
structure rarely makes sense.
A conversion will render DT as a non-indent item and DD as a single indent item. The Definition List tag
is not supported in the XLSX template. The figure below shows an example of a Definition List tag:
Line and paragraph tags
A line break is defined by the <BR> element. This element inserts a single line break. It is an empty tag,
meaning that it has no end tag. The line attributes will be ignored in the report output.
A paragraph is defined by the <P> element. The element automatically creates some space before and
after itself. The paragraph attributes will be ignored in the report output. The figure below shows an
example of a Line Break and Paragraph tag:
As shown in the figure below, the outputs in RTF, ODF, or HTML will be:
As shown in the following two figures, the outputs in RTF/ ODF and HTML will be, respectively:
Heading tags
A heading is defined by the <H1>, <H2>, <H3>, <H4>, <H5>, or <H6> element. In this report, all heading
tags will be rendered as <b> for ODT, RTF, and OOXML document outputs. The heading attributes will be
ignored in the report output. The figure below shows an example of Heading tags.
As shown in the following two figures, the outputs in RTF / ODF and HTML will be, respectively:
As shown in the following three figures, the outputs in RTF, ODF, and HTML will be, respectively:
Table tags
A table is defined by the <TABLE> element. A table consists of multi-dimensional data arranged in rows
and columns.
• border
Specifies the width in unit of the border of a table.
• bgcolor
Specifies the table background color. Applying the background color here will affect the whole
table.
Table elements are not supported in XLSX, PPTX, ODS, and ODP templates.
As shown in the following two figures, the outputs in RTF / ODF and HTML will be, respectively:
Border width in HTML is specified in pixels. When the table attributes are converted into RTF, ODF, or
OOXML, 1 pixel will be equal to 1 pt.
Color
The attribute value type "bgcolor" refers to color definitions as specified in [SRGB]. A color value may be
either a hexadecimal number (prefixed by a hash mark) or one of the following sixteen colors. Colors
are case-insensitive.
Color Hexadecimal
Code
Black #00000000
Silver #C0C0C0
Gray #808080
White #FFFFFF
Maroon #800000
Red #FF0000
Purple #800080
Fuchsia #FF00FF
Green #008000
Lime #00FF00
Olive #808000
Yellow #FFFF00
Navy #000080
Blue #0000FF
Teal #008080
Aqua #00FFFF
Row elements
The <TR> elements act as a container for a row of table cells. The <TR> elements must be contained
within a <TABLE>.
<TR> contains <TH> or <TD> elements, which in turn contain the actual data of the table. <TR> takes
presentational attributes for specifying the alignment of cells within the row and the row's background
color. The row attributes will be ignored in the report output, except for the following attributes:
Align
This attribute specifies the alignment of data and the justification of text in a cell. Possible values are:
• left - Left-flushed data/Left-justified text. This is the default value for table data.
• center - Centered data/Center-justified text. This is the default value for table headers.
• right - Right-flushed data/Right-justified text.
• justify - Double -justified text.
• char - No text alignment set.
Valign
This attribute specifies the vertical position of data within a cell. Possible values are:
Cell elements
The <TD> elements define a data cell in a table. <TD> elements are contained within a <TR> element (a
table row). The cell attributes will be ignored in the report output, except for the following attributes:
• align
specifies the horizontal alignment for each cell in the row. See Align in Row Elements for more
details.
• valign
specifies the vertical position of a cell's contents. See Valign in Row Elements for more details.
Row span
This attribute specifies the number of rows spanned by the current cell. The default value of this
attribute is one ("1"). For an RTF output, the result of row span (*.rtf) is readable only in Word on Mac,
and MS Word.
Column span
This attribute specifies the number of columns spanned by the current cell. The default value of this
attribute is one ("1"). The figure below shows an example of a column span:
As shown in the following two figures, the outputs in RTF / ODF and HTML will be, respectively:
For example:
<table>
<tr>
<td width="25%">25%</td>
<td width="75%">75%</td>
</tr>
</table>
Using Stylesheet:
<table style="width:50%">
<tr>
<td style="width:70%">70%</td>
<td style="width:30%">30%</td>
</tr>
</table>
DOCX, RTF and ODT templates retain their width values. The column width in the report is the same as
defined in the Advanced HTML Editor dialog.
If the defined values exceed the paper margins, the table column widths will be converted to a
percentage format so that the table appears within the page margins.
Header elements
The <TH> elements define a header cell in a table. <TH> elements are contained within a <TR> element
(a table row). The header attributes will be ignored in the report output, except for the following
attributes:
The following two figures show the outputs in RTF / ODF and HTML, respectively.
src
The src attribute specifies the location of an image resource. The value of this attribute can be one of
the following types:
• A URL. The recognized scheme types are HTTP, HTTPS, and FILE
• An absolute path such as c:/user/image.png. The path separator can be either /(slash) or \
(blackslash)
The output image format will depend on the format of the image source.
width
The width attribute specifies the width of an image in pixel units. For example, width = “100” or width =
“100px”
height
The height attribute specifies the height of an image in pixel units. For example, height = “100”, or
height = “100px”
Note
If the width or height attribute of an image is not specified, the size of the image will be
calculated according to the following rules:
• For an image file that contains the width and height properties, such as JPG, PNG, and
GIF, the size of the image output will be calculated from the size of the image.
• For an image file that has no width and height properties, such as SVG, EMF, and WMF, the
size of the image output will be calculated from the size of the paper.
alt
The alt attribute specifies the alternate text of an image in case the image cannot be displayed.
Note
• The alternate text of image tags in DOCX, XLSX, and PPTX is available only in Microsoft
Office.
• The alternate text of image tags in RTF files is shown only in the Description field, rather
than the Title field in Microsoft Word and OpenOffice Writer.
• The alternate text of image tags in RTF files is not supported in LibreOffice.
Superscript
The <sup> tag defines a supersript, which is a very small letter, figure, or symbol, and printed above the
line. Superscript characters can be used to write footnotes, like www[1], for example:
Subscript
The <sub> tag defines a subscript, which is a very small letter, figure, or symbol, and printed below the
line. For example, subscript characters can be used to write chemical formulas, such as H2O:
Contents
On this page
Background
The shorthand property for the background property is 'background', which is used for setting an
individual background style. Such attribute can be used in RTF, ODT, and DOCX report templates.
For example:
The RGB specification Integer and Percentage form is "rgb" followed by RGB values in the same format
in brackets. You cannot use both integer and percentage at the same time. In the case that an RGB
value is more than a maximum value (255 or 100%) or less than a minimum (0 or 0%), the value will be
set to the maximum or minimum value instead, for example:
Supported Tags
The ‘background-color’ property can be used in the following tags:
b, i, u, h1, h2, h3, h4, h5, h6, tt, code, samp, kbd, pre, big, small, strike,
s, em, cite, dfn, var, strong, font, a, dl, dt, dd, ul, ol, li, table, tr, td,
th, p, div, span, sup, and sub.
For example:
Border
The shorthand property for the border property is 'border', which is used for setting the same width,
color, and style of all four borders on four sides of a box. Border can be used in RTF, ODT, and DOCX
report templates.
Border Width
Border width properties specify the width of border areas. The value of the border property is length.
The border width properties that can be used with a longhand property are as follows:
• 'border-top-width'
• 'border-right-width'
Length Specification
The format of a length value is a real number immediately followed by a unit identifier. There are two
types of length units: relative and absolute. Relative length units specify a length relative to another
length property of the displaying device.
• px
pixels, relative to the displaying device.
Absolute units are:
• in
inches, 1 inch is equal to 2.54 centimeters.
• cm
centimeters.
• mm
millimeters.
• pt
points - the points used by CSS 2.1 are equal to 1/72nd of an inch.
• pc
picas - 1 pica is equal to 12 points.
Border Color
Border color properties specify the border colors of a box. The value of the border color has two
meanings:
• Color
Specifies a border color. See Color Specification (see page 2200) for more details on color.
• Transparent
Referred to as a transparent border.
The border color properties that can be used with a longhand property are as follows:
• 'border-top-color'
• 'border-right-color'
• 'border-bottom-color'
• 'border-left-color'
Border Style
The Border style properties specify the style of a box's border lines. The border style may take one of
the following 10 values:
1. none
This value will create no border because the computed border width is zero.
2. hidden
The same as 'none'.
• The supported border values for ODF documents are none, hidden, solid, and double.
• The supported border values for RTF documents are none, hidden,dotted, dashed,
solid, and double.
• The supported border values for DOCX documents are none, hidden,dotted, dashed,
solid, double, outset, and inset (groove and ridge will be rendered as solid).
The border style properties that can be used with a longhand property are as follows:
• 'border-top-style'
• 'border-right-style'
• 'border-bottom-style'
• 'border-left-style'
Supported Tags
Border properties can be used in the following tags:
h1, h2, h3, h4, h5, h6, td, th, p, and div.
For example, if you want to have a red border, type the following line of code, see the figure below.
The result of using the above example will be as shown in the figure below.
The margin properties that can be used with a longhand property are as follows:
• 'margin-top'
• 'margin-right'
• 'margin-bottom'
• 'margin-left'
Supported Tags
The supported tags for margins are as follows:
h1, h2, h3, h4, h5, h6, table (supported only in RTF, ODT, and DOCX), p, and
div.
For example, if you want to set a specific margin width for your cells, type the lines of code as shown in
the figure below.
The padding properties that can be used with a longhand property are as follows:
• 'padding-top'
• 'padding-right'
• 'padding-bottom'
• 'padding-left'
Supported Tags
The supported tags for padding are as follows:
h1, h2, h3, h4, h5, h6, td, th, p, and div.
• The supported border values of table tags for RTF documents are margin-left and
margin-right.for more details.
• The supported border values of table tags for DOCX documents are margin-left and
margin-right.
• The supported border values of all tags for PPTX documents are margin-left, margin-top
and margin-bottom.
For example, if you want to create specific padding styles for your cells, type the lines of code shown in
the figure below.
The result of using the above example will be as shown in the figure below.
Supported Tags
The supported tags for colors are as follows:
b, i, u, h1, h2, h3, h4, h5, h6, tt, code, samp, kbd, pre, big, small, strike,
s, em, cite, dfn, var, strong, font, a, dl, dt, dd, ul, ol, li, table, tr, td,
th, p, div, span, sup, and sub.
For example, if you want to have a green text color, type the lines of code indicated in figure.
The result of using the above example will be as shown in the figure below.
Display
The 'display' property specifies how text will be displayed. The possible display values are:
• block: This value will make an element appear in the output report.
• none: This value will make an element disappear from the output report.
Supported Tags
The supported tags for the display property are:
br, b, i, u, h1, h2, h3, h4, h5, h6, tt, code, samp, kbd, pre, big, small,
strike, s, em, cite, dfn, var, strong, font, a, dl, dt, dd, ul, ol, li
(supported only in RTF, DOCX, and PPTX), table, tr, p, div, span, sup, and sub.
For example, if you want to display an element but do not want to display the other(s), type the lines of
code as shown in the figure below.
• 'font family'
• 'font-style'
• 'font-variant'
• 'font-weight'
• 'font-size'
Font Family
Specify a prioritized list of font family names and/or generic family names.
Font Style
Specify either normal or italic face (within the specified font family).
Font Variant
Specify either normal or small-caps of variant (within the specified font family). Font variant is not
supported in XLSX report templates.
Font Weight
Specifies the weight of the font. The following values are defined:
• normal, lighter, 100, 200, 300, and 400 will be rendered as ‘normal’.
• bold, bolder, 500, 600, 700, 800, and 900 will be rendered as ‘bold’.
Font size
Specify the font size. Possible values include xx-small, x-small, small, medium, large, xx-large, and the
integer number from 1 to 7.
Supported Tags
The supported tags for the font property are as follows:
b, i, u, h1, h2, h3, h4, h5, h6, tt, code, samp, kbd, pre, big, small, strike,
s, em, cite, dfn, var, strong, font, a, dl, dt, dd, ul, ol, li, table, tr, td,
th, p, div, span, sup, and sub.
For example, if you want to have bold fonts in small caps, type the lines of code as displayed in the
figure below.
Text Align
The 'text align' property describes how inline content of a block is aligned. Possible values of the text
align property include: left, right, center and justify. The ‘text align’ property can be used in RTF, ODT,
ODP, DOCX, and PPTX report templates.
Supported Tags
The supported tags for the text align property are as follows:
The result of using the above example will be as displayed in the figure below.
Text Transform
The 'text transform' property controls capitalization effects of an element's text. Possible values of the
'text transform' property include:
1. capitalize
This will write the first character in an uppercase letter. Other characters will not be affected.
2. uppercase
This will write each word in upper case letters.
3. lowercase
This will write each word in lower case letters.
4. none
This will not create any capitalization effects.
b, i, u, h1, h2, h3, h4, h5, h6, tt, code, samp, kbd, pre, big, small, strike,
s, em, cite, dfn, var, strong, font, a, dl, dt, dd, ul, ol, li, table, tr, td,
th, p, div, span, sup, and sub.
For example, if you want to make all letters in a paragraph become uppercases, type the line of code
displayed in the figure below.
The result of using the above example will be as shown in the figure below.
White-Space
The 'white-space' property affects the vertical position of white-space inside a lined box. White-space
can be used in RTF, ODT, DOCX and PPTX report templates. Possible values of the 'white-space' property
include:
1. normal
To collapse sequences of white-space and break lines as necessary to fill line boxes.
2. pre
To prevent from collapsing sequences of white-space. Lines are only broken at newlines in the
source or at occurrences of "\A" in the generated content. Report Wizard will render this value as
the <pre> tag.
3. nowrap
To collapse white-space as for 'normal' but suppressing line breaks within text.
4. pre-wrap
To prevent user agents from collapsing sequences of white-space. Lines are broken at newlines in
the source, at occurrences of "\A" in the generated content, and as necessary to fill line boxes.
This value will not be rendered as pre.
5. pre-line
To direct user agents to collapse sequences of white-space. Lines are broken at newlines in the
source, at occurrences of "\A" in the generated content, and as necessary to fill line boxes. This
value will not be rendered as pre.
Supported Tags
The supported tags for the 'white-space' property are as follows:
b, i, u, h1, h2, h3, h4, h5, h6, tt, code, samp, kbd, pre, big, small, strike,
s, em, cite, dfn, var, strong, font, a, table, tr, td, th, p, div, span, sup,
and sub.
For example, if you want to preserve some white-space, type these lines of code as shown in the figure
below.
Width
The 'width' property specifies the contents width of each box generated by a block-level. The value of
the width property is length (See Length Specification (see page 1923) for more details). Width can be used
in RTF, ODT, and DOCX report templates.
For example, if you want to have a specific table width, type the lines of code as described in the figure
below.
The result of using the above example will be as shown in the figure below.
• none
To produce no text decoration.
• underline
To underline each line of text.
• overline
To add a line above each line of text.
• line-through
To add a line that strikes through each line of text.
• blink
To add the blinking effect to text (being visible and invisible alternatively). The blink text
decoration supports only the ODT report template.
Report Wizard does not currently support the overline text decoration.
Supported Tags
The supported tags for the text decoration property are:
b, i, u, h1, h2, h3, h4, h5, h6, tt, code, samp, kbd, pre, big, small, strike,
s, em, cite, dfn, var, strong, font, a, dl, dt, dd, ul, ol, li, table, tr, td,
th, p, div, span, sup, and sub.
For example, if you want to create a line-through text, type the line of code as displayed in the figure
below.
The result of using the above example will be as indicated in the figure below.
• baseline
This value will align the baseline of a box with the baseline of the parent box. Leave the vertical
alignment to be default when you encounter this value.
• middle
This value will align the vertical midpoint of a box.
• top
This value will align the top of the aligned sub-tree with the top of a line box.
• bottom
This value will align the bottom of the aligned sub-tree with the bottom of a line box.
The supported tags for the vertical align property are: table, tr, td, and th, for example, see figure below:
The result of using the above example will be as shown in the figure below.
Contents
DocBook was built as an application to write technical documents related to computer hardware and
software. It is a semantic markup language that was extended from XML language. As an open source
application, DocBook has been adopted as a standard to write other types of documentation as well.
The current version of DocBook, published by O'Reilly Media and XML Press, is 5.1.
The Report Wizard’s DocBook engine enables you to input the VTL codes inside DocBook’s document
content. It also allows you to convert HTML into DocBook tags, rearrange tags, and escape special
characters. Report Wizard uses “dbk” and “docbook” file extensions to save DocBook files. The figure
below shows the DocBook’s document content.
1.1.1 Paragraph
1.1.2 Preformatted Text
Paragraph
The Paragraph element (<p>) defines a paragraph. The <p> element shown in the first figure will be
rendered in a DocBook format in the second figure below.
Preformatted Text
The Preformatted text element (<pre>) displays the text exactly as you expected it to. The <pre> tag
preserves both spaces and line breaks. The <pre> element shown in the first figure below will be
rendered in a DocBook format in the second figure below.
1. Teletype Text
2. Italics
3. Bold
4. Strikethrough
5. Underline
Italics
The HTML Italics element (<i>) renders text slanted to the right. The <i> element shown in the first
figure below will be rendered in a DocBook format as in the second figure below.
Bold
The HTML Bold element (<b>) renders bold text. The <b> element shown in the first figure below will be
rendered in a DocBook format as in the second figure below.
Strikethrough
The HTML Strikethrough element (<strike> or <s>) renders text with a horizontal strike or a line through
the middle. The <strike> element shown in the first figure below will be rendered in a DocBook format
as in the second figure below.
Underline
The HTML Underline element (<u>) underlines text. The underline <u> element shown in the first figure
below will be rendered in a DocBook as in second figure below.
1. Emphasis
2. Strong
3. Citation
4. Definition
5. A Fragment of Computer Code
6. Sample Text
7. Keyboard Input
8. Variable
Emphasis
The Emphasis element (<em>) emphasizes text content and displays it in italics. The <em> element
shown in the first figure below will be rendered in a DocBook format as in the second figure below.
Strong
The Strong element (<strong>) strongly emphasizes text content. It renders the text in bold. The
<strong> element shown in the first figure below will be rendered in a DocBook format as in the second
figure below.
Citation
The Citation element (<cite>) presents a citation or a reference to other sources. The <cite> element
shown in the first figure below will be rendered in a DocBook format as in the second figure below.
Sample Text
The HTML Sample Text element (<samp>) designates sample output of programs or scripts. The
<samp> element shown in the first figure below will be rendered in a DocBook format as in the second
figure below.
Keyboard Input
The HTML Keyboard Input element (<kbd>) indicates user input or text to be entered by the user. The
<kbd> element shown in the first figure below will be rendered in a DocBook format as in the second
figure below.
Variable
The HTML Variable element (<var>) indicates an instance of a variable or program argument. The <var>
element shown in the first figure below will be rendered in a DocBook format as in the second figure
below.
The <a> element shown in the first figure below will be rendered in a DocBook format as in the second
figure below.
1. Unordered Lists
2. Ordered Lists
3. Definition Lists
Unordered Lists
An unordered list is defined by the <ul> element. An unordered list element <ul> contains one or more
<li> elements that define the actual items of the list in bullets. The Unordered List element shown in the
first figure below will be rendered in a DocBook format as in the second figure below.
The <table>, <tr>, <td>, and <th> elements support two attributes: (i) align and (ii) valign.
(i) align
You use align to horizontally arrange items within a table cell. The possible values are as follows:
You use valign to vertically arrange items within a table cell. The possible values are as follows:
1. Font
2. Text Align
3. Text Decoration
Font
The “font” property is a shorthand property for setting the “font-style”, and “font-weight” properties.
Font Style
The “font-style” property defines that the font be displayed either in normal way or in italics within a
specified font family. The font-style shown in the first figure below will be rendered in a DocBook format
in the second figure below.
Font Weight
The “font-weight” property specifies the weight of the font. The values “100” to “900” form an ordered
sequence where each value indicates the font weight. The keyword ‘normal’ is synonymous with “400”,
and “bold” is synonymous with “700”.
• normal, lighter, 100, 200, 300, and 400 will be rendered as ‘normal’.
• bold, bolder, 500, 600, 700, 800, and 900 will be rendered as ‘bold’.
The font-weight property shown in the first figure below will be rendered in a DocBook format in the
second figure below.
Text Decoration
The text-decoration property specifies decorations that are added to text. The values of this property
are none, underline, or line-through. The text-decoration property shown in the first figure below will be
rendered in a DocBook format as in the second figure below.
The MagicDraw UML tool provides the ability to use the DSL engine to adapt domain-specific profiles,
enabling you to create your own custom diagrams, custom specification dialogs, custom real-time
semantic rules, etc. In other words, you can create a low-budget specialized domain-specific tool and
hide the UML underneath.
Related pages
Customization element An element in which the customization data is specified. Create the
customization element by using a Profile diagram.
Related Pages
Related pages
• From the File menu, choose Use Project358 and select the project file. Only shared packages of
the module will be loaded into the project.
Tip
If you don’t want to see particular information, move elements from shared packages into the
root model or other non-shared packages in your module.
Related Pages
In these cases, you only want to mark the model, not make an impact on existing diagrams.
Tag definitions are properties of stereotype in UML2. UML does not allow using tagged values without
assigning stereotype. Your diagrams will be changed when some tags are added into the model.
358 https://docs.nomagic.com/display/MD190/Managing+used+projects
The stereotype you want to make invisible must be inherited from «InvisibleStereotype» found in
the modeling tool (e.g., MagicDraw) profile.
Example
It is not desirable to see an author tag in diagrams. To accomplish this, follow these steps:
1. Create a stereotype «copyrighted» that extends the Element metaclass.
2. Create a property “author: String” for a «copyrighted» stereotype.
3. Inherit this stereotype from «InvisibleStereotype» (create generalization in the model or
diagram).
Now you may enter the tagged value “author” for any element in your model.
The stereotype «copyrighted» will be automatically applied but will be invisible in diagrams.
Hidden Tags
All hidden tags will be invisible on the symbols of stereotyped elements.
Example:
The stereotype «identification» has two tags: ID and Description. The user would like to see a
Description value on elements in diagrams, but ID should be hidden as it is used in some
external model transformation tools or similar activities.
Apply «InvisibleStereotype» on the ID property of the «identification» stereotype and it will be
not visible on stereotyped elements on diagrams.
Example:
When «dog» Rex is set as a pet for «human» Tom, Tom will be automatically set as “master” for
Rex:
Related pages
A modeling tool provides the ability to create a stereotype, which uses different icons depending on a
stereotype “kind." For example, PseudoState can be represented by different notations that depend on
PseudoStateKind.
1. Create an Enumeration (see page 666) (in our example, supercarKind) to define all stereotype
“kinds."
2. Apply the «iconHolder» stereotype to the enumeration.
3. Create as many EnumerationLiterals of as many different kinds as you need (in our example, it is
“ferrari” and “audi”).
4. Apply stereotypes with different icons to every EnumerationLiteral (in our example, «ferrari» and
«audi»).
5. Create a Stereotype (in our example, supercar) with a property (tag definition), with type
enumeration (supercarKind). You could also select a default value.
6. Assign the created stereotype to an element and select one of the enumeration values in tags. A
stereotyped element will change its icon to the enumeration value.
Related Pages
To group tags
1. Open the Specification window (see page 882) of the stereotype property.
2. Click the Tags property group.
3. Select the groupName property and assign a value for it:
.
4. Repeat these steps for every stereotype property.
Related Pages
When the stereotype is applied, mandatory tags will be automatically created and default values will be
assigned.
Once the tag definition is created, you can apply the stereotype with this tag definition on an element in
your model. Then, in the Specification window of the element, click the Tags property group, select the
structured expression tag, and click the Create Value button to define the value.
Tags
The structured expression tag can also be represented as a regular property in the Specification
window and Properties tab of the element. You must then create a customization data (see page
1985) for the stereotype with this tag definition.
To extend UML symbol styles by creating new styles for stereotyped elements
1. In the Project Options dialog (see page 213), expand the Stereotypes property group (Stereotypes
is under the Symbol styles group). The list of stereotypes appears.
2. Select the desired stereotype and click the Apply button.
3. In the Select Diagrams dialog, select the diagram to include the Stereotypes property group.
Click OK after the selection.
Customized style
Your customized style will be used only in diagrams of a type you have selected.
4. In the open Select Properties to Apply dialog, select properties you want to apply and click OK.
Quick search
Use the Quick search (see page 888) feature to find a desired property.
5. Set the stereotype style properties in the options list of the Project Options dialog. After you
finish, click OK.
The best practice is to create styles for stereotypes in the Profile, loading it as a project. When a project
uses the Profile, styles for stereotypes will also be loaded and used. These styles will be applied right
after applying the stereotype to an element and will be used in all diagrams.
• The custom diagram wizard allows specifying styles for stereotyped elements.
Contents
A stereotype (see page 827)defines how an existing metaclass may be extended. The stereotype enables
the use of the platform or domain-specific terminology or notation in place of, or in addition to, the
ones used for the extended metaclass.
When a stereotype is applied to a model element, the values of the properties may be referred to as
tagged values (see page 835).
• In the corresponding element's Specification window (see page 1960), click the Applied Stereotype
property specification cell, then click , and select stereotypes from the open list. After you have
selected, click Apply.
• In the element's shortcut menu, select Stereotype and select a stereotype that you wish to
apply. Click Apply when you are done.
• On the diagram pane, select an element and in that element's name area, type the stereotype
name between brackets « ». The element's name comes after the stereotype.
If you want to name the element Books and assign it the «table» stereotype, in the
element's name area type the following: «table» Books. The name completion for the
stereotypes works in the name editing mode, press Ctrl+Spacebar or Ctrl+Backspace to
get a list of available stereotypes.
You can change the order of the stereotypes applied to the element. The symbol style of the first
stereotype in the list will be applied to the element.
Related pages
• In the Browser, from the used Profile shortcut menu, choose Project Usages > Open.
• On the File menu, click Open Project to open the Profile as a simple Project.
Using the profile in the read-write mode is the fastest way to add changes when you are not in
teamwork and do not care if there are possible editing conflicts. It helps to perform basic refactoring of
your shared projects by moving the elements directly from one project to the other. You may choose
read-write usage mode when trying to use a profile as a project.
3.3.1 Content
s
You can create your own diagram types for specific domains, platforms, technology, or other purposes
using the Customize Diagram Wizard. This powerful engine enables the creation of custom elements
in the diagram toolbar, custom symbol styles, and other customizations.
The Reset to default button in the Customize Diagrams dialog restores the default configuration for
diagrams bundled with MagicDraw installation. It does not work with user-defined diagrams.
Do either:
• In the Customize Diagrams dialog, select a diagram type and click Edit.
Related pages
The custom diagram could use stereotyped elements. Profiles defining these stereotypes must be used
by the custom diagram. The selected used projects or profiles load when a user creates a custom
diagram in a project. You can choose a stereotype for the diagram by clicking the Diagram Stereotype
button.
You can:
Click Add and select standard UML elements or click Add and then New Button to create your own
buttons to create customized or stereotyped elements.
• List as element – select this check box to add the button as a command in the Create
Element command list.
• Opposite – this check box is only available for relationship buttons. Select it to add the opposite
relationship button.
You can change the appearance of standard symbols, symbols of stereotyped elements, and the
custom diagram itself. The customized element style will be used only in the appropriate custom
diagram type.
You can configure the kind of relationship suggested when a custom shape or path is selected on a
diagram.
1. Create a new configuration (or modify an existing one). Select the element to customize. The
smart manipulators configuration can be related to:
• Element, displayed as [Element name]
• Element + stereotype(s)
• Symbol, displayed as {Symbol name}
• Symbol + stereotype(s)
• Stereotype(s), displayed as «Stereotype name»
2. Select suggested relationships for the selected configuration.
3. Select target elements for the selected relationship.
If several configuration settings could be applied to the same selected element on the diagram, only
one configuration will be used according to this priority:
# Configuration Comment
2 Stereotype
3 Symbol
5 Element
If several configurations are created for a few stereotypes (for example, Stereotype1 and
Stereotype2) in the same diagram, when both stereotypes are applied to one symbol on that
diagram pane, the first configuration (in this case, Stereotype1) is used, unless you specify a
symbol+ stereotype(s) configuration.
Inheritance of configurations
All diagrams inherit their configurations from a base diagram (example: in this hierarchy: Any diagram >
Static diagram > Class diagram > Generic DDL diagram).
If you add a new configuration to a class diagram (for example, Symbol A + stereotype B), the
configuration will be used in the generic DDL diagram, as the class diagram is its base diagram. Any
static diagrams will not have such configurations.
• From the Configurations list, select the configuration by the element type and choose
the Specify own configuration button. This overwrites the inherited configuration.
Creating new dependency matrix types is available in Standard, Professional, Architect and
Enterprise editions.
The Customize Dependency Matrix Wizard contains the following steps for creating a
new dependency matrix type or modifying a chosen one.
• Step 1: Specify Name for a New Matrix Type and Icons (see page 1971)
• Step 2: Specify Used Projects (see page 1971)
• Step 3: Specify Dependency Matrix Properties (see page 1972)
Do not remove the UML Standard Profile, which is selected by default, from the list. It must be
used by any custom dependency matrix type.
All the selected used projects or profiles load when a dependency matrix of the custom matrix type is
created in the project.
Property Description
name
Dependency Matrix
Legend Select to choose the location of the legend (Top-Left Corner or Above Column Header) or set
Location the Do Not Display mode to keep it hidden.
Direction Select a direction of relationships for the relation analysis and representation in the
dependency matrix. Be aware that new relationships will be created with the selected
direction.
Dependency Select an expression type and specify the expression to be used as the relation criteria.
Criteria
Show Select to show only related (by a selected dependency criteria), only non- related, or all
Elements elements.
Show Inner Set to true to show the number of relationships in every owning element cell.
Dependencies
Read Only Set to true to make the matrix read-only. You will not be able to create or delete relationships.
Description Type the description for the dependency matrix. The text will be displayed in the description
Area area of the matrix.
Hide Types Set to true to hide the Row Element Type and Column Element Type boxes from the Criteria
area.
Hide Scope Set to true to hide the Row Element Scope and Column Element Scope boxes from the
Criteria area.
Hide Set to true to hide the Dependency Criteria and Direction boxes from the Criteria area.
Dependency
Criteria
Column
Column • Select the Compact tree mode to display elements with their direct and
Owner common owners in the column header. The data will be represented as a tree.
Display Mode • Select the Complete tree mode to display elements with all their owners in the
column header. The data will be represented as a tree.
• Select the Hidden mode to display elements without any owners in the column
header. The data will be represented as a list.
• Select the Full qualified name mode to display elements with their owners in
the column header. The data will be represented as a list.
Column Text Specify the direction of the text in the column header. Be aware that this property value can
Direction be applied only when the Column Owner Display Mode property value is Hidden or Full
qualified name.
Column Specify the element types to show in the columns of the dependency matrix.
Element Type
Column Select Containment or Custom to specify the expression to collect column elements.
Query
Column Select properties and their values to create more specific filters for column elements.
Property
Filter
Column Select Ascending or Descending to sort elements alphabetically. You can also select the
Sorting Mode Custom sorting mode to use your own order.
Column Types Set to true to display subtypes of selected element types. For example, if a class is selected,
Include then all its subtypes (such as component or custom subtypes like SysML block) and
Subtypes requirements will be displayed.
Row
Row Types Set to true to display the subtypes of selected element types. For example, if a class is
Include selected, all its subtypes (such as component or custom subtypes like SysML block) and
Subtypes requirements will be displayed.
Row Element Specify the element types to show in the rows of the dependency matrix.
Type
Row Query Select Containment or Custom to specify the expression to collect row elements.
Row Property Select properties and their values to create more specific filters for row elements.
Filter
Row Sorting Select Ascending, Descending, or a Custom sorting order to sort elements alphabetically.
Mode
Contents
You can simply add the appropriate button to the palette of any desired diagram type for a new DSL
element type. To do this, you must make certain changes in the customization profile.
To add the button for creating a DSL element on the palette of a relevant diagram type
6. In the Specification window of the Place on Diagram Palette attribute, select the cell of the
Place property value, and click .
7. In the open dialog, select the diagram type of the palette to customize.
8. In the same dialog, use the Up and Down buttons to change the position of the new button on
the palette.
9. If you want to add several new buttons and organize them into a group on the palette, create a
new Group package by clicking the Create Group button (shown below, on the left). The button
of the DSL element type appears under the Group package (see the screenshot on the right).
If you repeat the procedure to add more buttons within the same group on the diagram palette, you
can see the appropriate changes (shown in the following figure).
Related pages
You can apply the stereotype for your Relation Map diagram by clicking the Diagram Stereotype
button.
Property Description
Name
Cut Element Set to true to cut element names that are too long and make the Relation Map difficult to read.
Names
Include Set to true to display subtypes of the selected elements. For example, if a class is selected, then
Subtypes all its subtypes (such as component or custom subtypes like SysML block) are displayed.
Show Set to true to show the element number before its name.
Element
Numbers
Show Set to true to show the parameters' signatures of operation and behavior on symbols.
Parameters
Show Single Set to true to show a single node per element when the graph has more than one
Node Per representation of that element in the Relation Map.
Element
Relation Click ... to select and specify criteria in order to represent relations between elements.
Criterion
Layout Select Tree or Radial from the drop-down menu to customize the layout of your Relation Map.
Depth Type the number to specify the level of the relation map branches that will be expanded
automatically.
Make Set to true to make the selected element the core of the Relation Map.
Selected As
Context
Show Full Set to true to show full element types in the Relation Map.
Types
Show Scope Set to true to display the Relation Map scope, that is, to see the fragment of the model (or whole
model) from which the Relation Map is built.
Show Set to true to show the Context field in the diagram toolbar.
Context
Show Set to true to show the element type specification box in the diagram toolbar.
Element
Type
Custom Diagrams are oriented to a new specific domain, technology or platform, and are often based
on a custom profile.
Click the Diagram Stereotype button to apply the specific stereotype to your Generic Table.
This step allows you to specify the appearance of the new relation map diagram.
Property Description
Name
Custom Click ... to select and specify operations for calculating/gathering values of the custom
Columns column.
Display Mode Click ... to select one of the visualization options: Complete tree (the table will represent the
entire model), Compact tree (the table will combine grouping elements), or List (selected
model elements will be organized into a list).
Show Scope Set to true to show scope as a root node in the tree display mode.
As Root
Show Set to true to display the element number in the name column.
Element
Number
Row Element Click ... to select the type of elements to be shown as row elements.
Type
Query Click ... to select and specify operations to query the model.
Row Filters Set to true to display filtered rows in the Generic Table.
Show Set to true to show classifiers next to properties in the column name.
Detailed
Column
Name
Hide Columns Click ... to select columns that will not be displayed in the Generic Table.
Show Filter Set to true to show the filter applied in the Generic Table.
Show Set to true to show the element type specification box in the criteria area of the Generic Table.
Element Type
Show Scope Set to true to display the scope in the criteria area of the Generic Table.
The modeling tool's DSL customization engine is able to process user defined rules for DSL elements
and reflect this in MagicDraw GUI and diagrams behavior.
The topics in this section show you how to create a new DSL element, how to customize its Specification
window, shortcut menu, how to create customization rules for relationships drawing, how to customize
possible owned elements, how to create numbering customization, how to extend metamodel with
derived properties and others.
Related Pages
Related pages
Contents
We will demonstrate the recommended step-by-step instructions on how to customize an element, how
to begin to create customization, how to create customization data, and how the customization data
will be represented on the DSL element.
Stereotypes
The purpose of the Profile named Stereotypes is to store all the stereotypes. Later we will
share the package in order to use the stereotypes in the customization project.
The Profile Diagram pallet contains all the necessary for the customization creation
buttons.
4. In the Profile Diagram, create a Stereotype element (see page 827) and name it Company.
5. Apply the Class metaclass to the Company Stereotype.
• You can see how customization rules will be passed to the DSL element by using
the stereotype.
• We selected the Class metaclass, because the «Company» stereotype will be
applied to a class element. In other words, the type of the DSL element will be the
class.
• You can also assign an icon to the stereotype. The icon will be represented on the
DSL element.
6. Share the stereotypes package (see page 236). The Organization_Stereotypes.mdzip project becomes
a shared project.
Only the content of the shared stereotypes package will be visible in the project that will
use the project.
7. Save the Organization_Stereotypes.mdzip project.
8. Create a new project (see page 103) and name it Organization_Customizations.mdzip.
9. Create a package (see page 771) and name it customizations.
The purpose of the customizations package is to store all the customization data. Later
we will share the package.
10. Create a profile diagram (see page 450) and name it Customizations.
On a diagram, you can see that the customization element is a class with the applied
«Customization» stereotype.
20. In the Organization project, create a Package and in that package, create a class element and
name it NoMagic.
21. Apply the Company stereotype to the NoMagic class element.
22. Save and reopen the project.
In the following figure, you can see the Containment tree of the project with the
used Organization_Stereotypes.mdzip and Organization_Customizations.mdzip projects.
Create Element
If you do not want the new DSL element to appear on the Create Element menu, you can hide
the appropriate command when customizing your modeling tool perspective (see page 67).
Related pages
Customization Elements
Use the customization element properties to customize:
Tip!
The properties in the Customization Specification window are listed in the following two
locations:
1. General specification pane
2. Tags property group
Specify properties in either location. Changes made in the general specification pane reflect in
the Tags property group and vice versa.
Related Pages
Customization
To Do Specifies the To Do text of the Customization element. Use the To Do property for
adding notes about work to be done. Then, you can quickly search for the
elements that have the To Do properties defined (see page 226).
Connection Rules
Allowed Drag and Drop Specifies elements that describe allowed drag-and-drop operations for
customized elements (see page 2023).
Allowed Relationships Specifies the types of relationships allowed to connect to the DSL element. For a
more detailed description, see Creating Custom Rules for Relationships (see page
2028).
Disallowed Relationships Specifies types of relationships not allowed to connect to the DSL element. For a
more detailed description, see Creating Custom Rules for Relationships (see page
2028).
Types For Source Specifies metaclasses or stereotypes allowed to connect as the source of the
relationship. Types cannot conflict with UML permitted types for this relationship.
For a more detailed description, see Creating Custom Rules for Relationships (see
page 2028).
Types For Target Specifies metaclasses or stereotypes allowed to connect as targets of the
relationship. Types cannot conflict with UML permitted types for this relationship.
For a more detailed description, see Creating Custom Rules for Relationships (see
page 2028).
Content
Additional Content (see page Stores a rule (in a form of derived property expression) for gathering the
2002) additional content of the DSL element.
Sub Element Contents Specifies whether the content of the DSL element includes only directly related
Included (see page 2004) elements or both directly and indirectly related ones.
General
Customization Target (see Specifies a stereotype or a metaclass to customize. See a case study in Creating
page 1997) your First Customization (see page 1987).
Do No Suggest As Type (see Excludes customized elements from being suggested as a type in the list dialogs.
page 1998)
Hide Metatype (see page Indicates whether the DSL element will be recognized as a new type.
1999)
Preferred Metatype (see Specifies a preferred metatype, if there is more than one Customization Target (see
page 2030) page 1997) defined in the Customization Specification window. For more
information, see Creating Property Groups and Subgroups (see page 2042).
Quick Applying For Specifies an element to which the created customization can be applied directly
from the element shortcut menu.
Customization Target (see Specifies whether or not the name auto completion list is displayed when
page 1997) entering name for the DSL element on the diagram. If the Do Not Suggest Name
Auto Completion property value is true, then the auto completion drop-down list
is not displayed.
Model Initialization Specifies stereotypes that can be automatically applied to elements (source or
target) after connecting those elements with customized relationships. The
condition is that the customization target must be a stereotype for relationship.
For more information, see Initializing Custom Model (see page 2031).
Apply to Source Specifies stereotypes that will be applied on the source element of the
relationship after connection.
Apply to Target Specifies stereotypes that will be applied to the target element of the relationship
after connection.
Super Types Specifies the element that will be the super type of the DSL element. The
generalization relationship will be created from the DSL element to the specified
super type.
Naming
Category Creates a category to group DSL elements in various shortcut menus, if the Hide
Metatype property is true. For more information, see Creating a DSL Element
from the Customized Category in the Shortcut Menu (see page 2033).
Representation Text Defines the text that will be used in status bars, dialogs, logs, and others. See an
example of the Representation Text property usage in a drag-and-drop operation
customization (see page 2023).
Do Not Suggest Name Auto Specifies a short name for the DSL element. When creating the DSL element, the
Completion (see page 2000) short name will be added automatically.
Owned Elements
Hidden Owned Diagrams Specifies the diagram types that will hidden for the DSL element. For example, if
the property value is Any Diagram, all diagrams will be hidden and unavailable
from the DSL element shortcut menu, under the Create Diagram command in the
Model Browser. For more information, see Customizing Possible Owned Elements
(see page 2034).
Hidden Owned Types Specifies the metaclass or the stereotype that will be hidden for the DSL element.
For example, if the property value is the Element metaclass, then all standard
UML elements will be hidden in the DSL element shortcut menu, under the Create
Element command in the Model Browser. For more information, see Customizing
Possible Owned Elements (see page 2034) .
Possible Owners Specifies the metaclass or stereotype that can own the DSL element (specifies
types of elements that can be owners of the DSL element). For example, to create
a DSL element inside standard packages in the Model Browser, you must specify
the Package metaclass as the Possible Owners property value. For more
information, see an example in Creating Your First Customization (see page 1987)
and for a more detailed description, see Customizing Possible Owned Elements
(see page 2034) .
Suggested Owned Specifies types of diagrams that will appear in the DSL element shortcut menu
Diagrams when creating possible inner diagrams. For more information, see Customizing
Possible Owned Elements (see page 2034).
Suggested Owned Types Specifies types of elements that can be owned by the DSL element. For example, if
the property value is Section, then the Section elements can be owned by the
customized element. For more information, see Customizing Possible Owned
Elements (see page 2034).
Properties
Check Spelling Specifies the properties for which the spell checker is enabled.
Help ID Defines a string value referring to an element-specific help topic (see page 2036),
which can be opened for the DSL element.
In Shortcut Menu Specifies properties that will be displayed in the DSL element shortcut menu. For
more information, see Quick property editor (see page 2214) .
Multi Line Text Properties Specifies properties for which multi line text editor will be used. Note only
properties of string type is listed in editor of this property. For more information
about creating properties in the DSL element Specification window, see
Customizing Specification Window. (see page 2009) For more information about
editing property values in the Specification window, see the Editing Property
Values (see page 890).
Show Properties When Not Customizes the stereotype properties to be visible in the element Specification
Applied window even if the stereotype is not yet applied on the element. For more
information, see Always Visible Properties (see page 2011) .
Show Properties When Not Customize the stereotype properties to be visible in the DSL element Specification
Applied Limited By window dependent on another stereotype or metaclass. For more information,
Element Type see Always Visible Properties (see page 2011) .
Show Properties When Not Customize the stereotype properties to be visible in the DSL element Specification
Applied Limited By Profile window dependent on the corresponding profile application. For more
Application information, see Always Visible Properties (see page 2011) .
Standard Expert Specifies properties visibility mode in DSL element Specification window.
Configuration (see page
2005)
Used UML Properties Allows to select UML element properties that will be visible in DSL element
Specification window. For more information, see Using Standard UML Properties
(see page 2010).
Symbol
Default Shape Size Defines default size of the shape when the symbol is created on a diagram. For
more information, see Setting default symbol size (see page 2039)
Symbol Standard Expert Specifies properties visibility mode in DSL element Symbol Properties dialog (see
Configuration (see page page 943), in the symbol shortcut menu and in menus that open after clicking the
2006) Compartments or Create Element smart manipulators.
Related pages
Customization Target
The Customization Target property is a mandatory property in customization creation. It specifies the
stereotype or metaclass you want to customize.
1. In the Customization Specification window (see page 882), click the Customization Target
property.
Tip
All standard metaclasses are stored in the UML Metamodel. You can also filter elements
(see page 230) to find a desired element quicker.
Related Pages
1. In the Customization Specification window (see page 882) , click the Customization Target
property.
Related Pages
Hide Metatype
Indicates whether the customized stereotype is recognized as a new type. If the Hide Metatype
property value is false, the DSL element is not considered as a new type element and will not be
displayed in the shortcut menus (see the Possible Owners property).
1. In the Customization Specification window (see page 2009), click the Customization Target (see page
1997) property and then select a customization target.
2. Set the Hide Metatype property to true.
3. Reopen the project.
The property is useful when you do not want to display the name auto completion list for DSL elements
typically displayed only in one diagram, or if the names of the DSL elements are full sentences or
fragments of sentences.
1. In the Customization Specification window (see page 2009), click the Customization Target (see page
1997) property and then select a customization target.
2. Set the Do Not Suggest Name Auto Completion property to true.
3. Reopen the project.
Example of name auto completion list that appears when typing a DSL element name.
Abbreviation
The Abbreviation property enables creation of a DSL element with an abbreviated name. You can enter
the default name while specifying the customization element.
To define an abbreviation
1. In the Customization Specification window (see page 882), click the Customization Target
property and then select a stereotype or metaclass for which the abbreviation will be used.
2. Click the Abbreviation property and then type the text.
3. Reopen the project.
Case Study
Related Pages
Additional Content
Use the Additional Content property to specify custom content for a desired element in addition to
the standard one defined by the UML ownership. The custom content of an element is a collection of
elements related to this element by some user-defined rule, such as some type of relationship.
1. Create a customization element for the DSL element or select an existing one.
2. Create a derived property (see page 2064) for this customization element.
3. Specify a rule for gathering the additional content of the DSL element by creating an expression
(see page 2067)for the derived property.
4. Define the derived property as a value of the Additional Content property.
5. Find the property in the general property group of the Specification window (see page 882) of the
customization element, under the Content category.
The custom content of the element will then be visible in the following places:
Case Study
Let’s say we need UML Packages to display not only their owned elements, but also the elements
related to the Packages by the Element Import relationship. In order to obtain this, we must specify the
rule for gathering the custom content of the Package. Then we will analyze the contents of the
customized Package in the Containment tree.
1. Create a profile diagram (see page 302) and add a customization element name (e.g.,
PackageCustomization) to it.
2. Define the Package metaclass as the customization target (see page 1997) of the customization
element.
3. Create a derived property specification (see page 2064) for the customization element, name it
importedElements, and define the simple expression (see page 1191) as shown in the following figure.
4. In the general property group of the Specification window of the customization element, under
the Content category, find the Additional Content property and click the cell of the property
value.
5. Define the importedElements derived property as a value of the Additional Content property.
Property
• The Additional Content property can store a single value which can be only a derived
property specification.
• Select the derived property specification from either the same customization element or
another one with more abstract customization target. In this case, for example, this
could also be the customization element with the Element metaclass as a customization
target.
When you are done, the shape of the PackageCustomization element should look like the one depicted
in the following figure.
To see how the Additional Content property affects the contents of the Package
4. Now take a look at the Containment tree. The package P contains both owned classes A and B as
well as the class C, which is not owned, but related to the package P by the Import Element
relationship.
Related Pages
• All: the content includes both directly and indirectly related elements.
Related Pages
1. Create a customization element (see page 1987) for the DSL element or select an existing one.
2. In the element Specification window, click the Standard Expert Configuration property and
then click the button.
3. In the Customize Properties dialog (see page 71), click to select the mode in which the property will
be displayed in the DSL element Specification window.
Tip!
• The Customize Properties dialog contains the list of used UML properties and custom
properties. You can select which UML properties and DSL specific properties will be
displayed in the DSL element Specification window.
• You can also customize property groups. In the Customize Properties dialog, property
groups are displayed at the end of the list.
1. Create a customization element for the DSL element or select an existing one.
2. In the element Specification window (see page 882), click the Symbol Standard Expert
Configuration property and then click the button.
3. In the Customize Properties dialog (see page 71), click to select the mode to display the property in
the DSL element Symbol Properties dialog and in other places.
4. Reopen the project.
Related Pages
Contents
Properties
There are two property meanings used in customization elements: properties specifying the
element (in the Specification window (see page 882)), and properties as element attributes. The
latter is described in this section.
You can create a property in the customization element, then apply the particular stereotype and create
customization rules.
Place on «placeOnPalettePr
Diagram operty»
Palette
Meta Property «metaProperty» Changes the name of the default meta property.
Property Group «propertyGroup» Creates your own groups and subgroups to group the properties either
of standard UML metaclasses or stereotypes.
Auto «AutoNumber» Creates property used to specify numbering rules for a DSL element.
Numbering
Property
Derived «derivedPropertyS Creates a derived property that is the property whose values are
Property pecification» calculated automatically from the other properties’ values.
Specification
Related pages:
• Only one DSL stereotype (with Hide Metatype=true) may be applied to an element. For example,
if «Block» is already applied, the «Requirement» stereotype will not appear in the stereotype
shortcut menu.
• In order to apply a new DSL stereotype (e.g. when changing from «Requirement» to
«businessRequirement»), clear the currently applied stereotype and apply the change. The
stereotype shortcut menu will then snow all DSL stereotypes.
Tip!
Quickly change the stereotype by converting one element type to other (in the DSL
element shortcut menu, click Refactor and then Convert).
• DSL ownership rules are checked and it is not allowed to apply a stereotype not allowed in the
parent element of DSL element.
• DSL relationship rules are checked and it is not allowed to apply a stereotype if a relationship
exists and the source or target element violates DSL rules for the existing DSL relationship.
• DSL rules are also checked when drawing new relationships in a diagram.
Related Pages
For example, to create your own subtype of SysML «Requirement», named, let's say, Performance
Requirement, it is enough to define a new stereotype «Performance Requirement» and add a
generalization between the SysML «Requirement» and «Performance Requirement».
All predefined symbol properties (style) and semantics rules of SysML «Requirement» will be reused on
elements stereotyped by «Performance Requirement».
The subtypes could have their own customization with some basic properties (for example, human
name, etc.). Customizations will be merged, and only additions should be defined.
Related Pages
Additional resources
359 https://www.youtube.com/watch?v=3IBv3922a-A&feature=youtu.be
Related Pages
Generally, stereotype properties become visible in an element’s Specification window (see page 882) only
after the stereotype is applied on the element. However, you may customize stereotype properties to
be visible in the element Specification window even if the stereotype is not yet applied to the element.
Case Study
Use the C# Profile (see page 239) (C#_Profile.mdzip) in your project and you will see the C# Language
Properties appear in a class Specification window (see page 882). C# properties will appear in the
Specification window of a class even though no profile-specific stereotype is applied to the class.
Related Pages
• Profile application. Properties will be visible only when the owning package of an element has a
corresponding profile application.
• Another stereotype and / or metaclass. Properties will be visible only when:
• Another stereotype is already applied to an element.
Case Study
Let’s analyze the customization element of the «OraUser» stereotype in the Oracle Customization profile
(Oracle_Profile.mdzip). This profile belongs to the Cameo Data Modeler plugin and can be used for
database modeling.
If the «User» stereotype is selected as the Show Properties When Not Applied Limited By Element
Type property value, properties of the «OraUser» stereotype will be visible only for elements that have
the «User» stereotype applied.
If the Show Properties When Not Applied Limited By Profile Application property value is set
to true, properties of the «OraUser» stereotype will be visible only for elements whose owning package
has the Oracle Customization profile application, such as elements inside the Oracle schema.
In conclusion, Oracle-specific properties will be visible only for users inside the Oracle schema.
Related Pages
Case study
In the DSL element Specification window (see page 882), rename the Name property to blockName.
Case study
1. Create a new description attribute (see page 2006) in the customization element.
2. Apply the «metaProperty» stereotype (see page 1960) on the attribute.
3. Type a new description in the customization element Specification window, under the description
attribute, Documentation/Hyperlinks property group.
Related Pages
To specify properties to add to the shortcut menu, use the In Shortcut Menu property in the element
Specification window (see page 882). The element specification window specifies properties displayed in
the DSL element shortcut menu.
Only the following property types can be edited from the shortcut menu:
Important
Properties of all other types are ignored.
Use the Quick Applying For property in the element Specification window (see page 882) to add
stereotypes to the DSL element shortcut menu. This property specifies a stereotype or a metaclass to
apply customizations directly from the element shortcut menu. For example, if the Quick Applying For
property value is the Class metaclass, the customization will be available for the class elements.
On this page
Related Pages
Customizing Drag-and-Drop
The drag-and-drop customization allows you to create relationships or assign property values by
dragging and dropping one element onto another right in the diagram pane. By using the DSL engine,
you may set up your own drag-and-drop specifications between elements:
Property Description
Source Element Specify the element type to drag to the target element. Specify a class (see page 633),
metaclass, or stereotype (see page 827).
Relation Action Specify a relationship created between the source and target elements after drag-and-
Result drop.
Property Action Specify a property assigned to the target element after drag-and-drop.
Result
Append Mode Change the append mode for the property assignment. The possible Append
Mode property value is true or false.
If true, properties are assigned one by one. If false, the created property overwrites the
former property.
Related Pages
New Button
There is a new button in the Profile diagram pallet - Drag and Drop Specification. Use this
button to create a class element with the assigned «DragAndDropSpecification»
stereotype.
5. In the Customization Specification window, under the General category, for the Customization
Target property, assign the Class metaclass.
7. Reopen the project. Drag the class to the other class, the Generalization relationship will be
created between these classes.
Related Pages
7. In the Classifier on Property Specification window, specify the following property values:
• For the Source Element property, specify the Classifier metaclass.
• For the Property Action Result property, specify Type.
• For the Representation Text property, type the name of the rule, for example, Assign
Type.
8. Reopen the project. The classifier is assigned as a property type after dragging it to the property.
Related Pages
To select a rule
Tip
In a modeling tool developed by NoMagic, Inc., there are a number of predefined drag-and-
drop rules.
Related Pages
Types for Source Specifies metaclasses or stereotypes (see page 827) allowed to connect as the source of
the relationship. Types cannot conflict with UML permitted types for this relationship.
Note
The Types For Source property is intended for relationships only. The
Customization Target property can be a relationship or a metaclass of a
relationship.
Types for Target Specifies metaclasses or stereotypes (see page 827)allowed to connect as the target of the
relationship. Types cannot conflict with UML permitted types for this relationship.
Note
The Types For Source property is intended for relationships only. The
Customization Target property can be a relationship or a metaclass of a
relationship.
In the following table, see properties that are used for customizing non-relationships:
Property Description
Related Pages
The DSL customization engine allows specification of a preferred metatype if more than one metatype
is defined for the DSL element.
1. Select the appropriate customization element (see page 1990) and open its Specification window (see
page 882).
2. Click the value specification cell of the Preferred Metatype property and do one of the
following:
• Select the property value from the open list (see page 894) and close the Specification
window.
• Click the button to create a new one (see page 998). In the element Selection dialog (see
page 994), select the created metatype and click OK. Close the Specification window.
The selected metatype will be assigned as the Preferred Metatype property value.
After updating the customization element specification, you must either reuse the DSL Customization
profile (see page 239) in the model or reopen the model.
From now on, all DSL elements will be created with the preferred metatype specified in the
customization.
Default values
Tags (see page 835) have default values. Use the default values when you create the tag, making sure its
definition has multiplicity greater than zero. In this case it is automatically created when applying a
stereotype.
Property Description
Apply to Source Specifies stereotypes that must be applied to the source element of
this relationship after connection.
Apply to Target Specifies stereotypes that must be applied to the target element of
this relationship after connection.
Example
The following is an example of customization. Every JAVA class will be a subclass of
the Object class. In other words, every Class marked with the «JAVAClass» stereotype is inherited
from the Object.
1. Create a customization element.
2. In the customization Specification window, specify the Customization Target property
as the «JAVAClass» stereotype.
3. In the customization Specification window, specify the Super Types property as
the Object class.
On this page
Creating a DSL Element from the Customized Category in the Shortcut Menu
The Create Element menu in the Model Browser allows you to group elements into categories. You can
also use various menus in dialogs and specifications to group elements. Use the Category property of a
customization element to create categories.
Case Study
The following example demonstrates how to create a category for a new requirement element within a
Package element. This example refers to the project described in Case Study: Creating Your First
Customization (see page 1987).
1. Assign the custom stereotype (in this case the «Company» stereotype) as a Customization Target
property in the customization element Specification window. Specify the Package metaclass as a
Possible Owners property value. Please see the Case Study: Creating Your First Customization
(see page 1987) for more details.
2. In the customization element Specification window:
• specify the name of a new category as the Category property value (for
example, Requirements).
• specify the name of an element to create as the Representation text property value (for
example, Business Requirements).
To create several items under the same category, you must create a customization element for
each item. Specify the same name of the Category property.
Related Pages
Property Description
Suggested Owned Types Specifies the list of stereotypes and metaclasses used when
creating inner elements in the DSL element.
Hidden Owned Types Specifies the list of stereotypes and metaclasses not used as inner
elements.
You cannot customize a standard element when you use standard UML (rather than DSL) to create
certain stereotyped elements (such as a package). In this case, you must specify possible owners using
the Possible Owners property from the customization element Specification window. The Possible
Owners property specifies the list of stereotypes and metaclasses used when creating owned
elements.
Property Description
Suggested Owned Specifies types of diagrams appearing in the DSL element shortcut menu when creating
Diagrams possible inner diagrams.
Hidden Owned Specifies types of diagrams owned by the DSL element. For example, if the property
Diagrams value is Section, then the Section elements are owned by the customized element.
Version
Until version 17.0.3, the Suggested Owned Type and Hidden Owned Types properties did not
function if the customization target was a metaclass.
• If a DSL relationship has no connection rules for restricted end types and the Hide
Metatype property value specified is true, the DSL relationship will be added into all lists where
the extended UML type is selected. For example, the «allocation» relationship in SysML model will
be used everywhere Dependency is used.
• If a DSL relationship has connection rules, then it will be created only from or to these restricted
types.
On this page
Related Pages
• By clicking the Help button in the element’s Specification window (see page 882).
• By pressing F1, when the element’s symbol is selected.
1. Select the appropriate customization element and open its Specification window.
2. In the general specification pane, select the Help ID property and type the help topic ID.
3. Click Close when you are done.
DSL Customization
After updating the customization element specification, you must either reuse the DSL
Customization profile in the model or reopen the model.
If the DSL type customization does not have the Help ID property defined, the help topic ID derives
from the more general stereotype customization (ancestor) of the Help ID property. If there is no
ancestor, the metaclass help opens.
Related Pages
Creating a DSL Element from the Shortcut Menu and Other Locations
The Creating your First Customization (see page 1987) section introduced the step-by-step process of
creating a custom element. Following are tips to create custom elements.
Use the Possible Owners property to define the possible owner for a customized element. You can
also quickly create a customized element from the possible owner shortcut menu in the Model Browser
(see page 29) and in other locations. For example, you can add a package as a possible owner for a
customized use case element.
Use the Possible Owners property to quickly create a customized element from the following locations:
• The possible owner’s shortcut menu, under the Create Element command, in the Model
Browser (see page 29)
• The Inner Elements property group under the possible owner’s Specification window.
• The Select Element dialog (see page 994), when the element creation mode is turned on.
Examples of creating the Business Requirement element in Creating a DSL Element from the Customized
Category in the Shortcut Menu (see page 2033) are shown below:
1. In the package shortcut menu (in the Model Browser) under the Create Element command.
Related Pages
Customizing Symbols
• The first value is the width (x) in pixels. Value= 0 is used if a default symbol width should stay, but
the height should change.
• The second value is a height (y) in pixels.
A default shape size is used everywhere a new symbol is created - using drag-and-drop (see page 2023),
diagram toolbar button, diagram wizards, etc.
Symbol Properties
Change the line width and the rest of the path properties in the Symbol Properties dialog (see
page 943).
On this page
1. In the Model Browser, right-click a customization element and choose Create Element >
Property Group.
2. Type the attribute’s name (used to name the property group).
3. Open the attribute’s Specification window.
4. Edit the property values in the general specification pane. Each property is described in the
description area in the Specification window.
5. Click Close.
A stereotype «propertyGroup» (see page 2045) has been automatically applied to the newly created
attribute.
1. Choose the customization element you want to create a property subgroup for. The
customization element must have at least one attribute with the stereotype «propertyGroup»
applied.
2. Right-click the attribute with a stereotype «propertyGroup» and choose Create Element >
Property Group.
3. Type the attribute’s name (used to name the property subgroup).
4. Open the attribute’s Specification window.
Note
The stereotype «propertyGroup» is applied when creating either a property group or a
subgroup.
Depending on the attribute hierarchy, the attribute will either be a property group or subgroup:
«propertyGroup» properties
All properties of a stereotype «propertyGroup» are described in «propertyGroup» Properties
(see page 2045).
Related Pages
Demo
360 https://www.nomagic.com/files/viewlets/md_viewlets_propertygroup_viewlet_swf.html?ml=1&iframe=1
Property Description
Show Group In This property allows for displaying the element properties in the Compartment Edit
Compartment Edit dialog > the Element Properties tab and in a note on a diagram either within the
property group/subgroup or without it. If the value is true, the property name is
displayed as follows: <property_group_name>::<property_name>. If the value is
false, the property name is displayed as follows: <property_name> .
Show Group In If the value is true, the property group/ subgroup is visible in the element’s
Element Specification Specification window (see page 882).
Show Group In Go To If the value is true, the property group/ subgroup is visible in element’s shortcut
menu as a submenu under the Go To menu.
Show Group In Quick If the value is true, the property group/ subgroup is visible in the element’s
Properties Properties panel.
Show Group In If the value is true, the property group/ subgroup is visible in the Criterion Editor
Relation Map dialog (see page 337), when you create or edit a Relation Map diagram (see page 336).
Use As Node If the value is true, the property group is displayed in a separate tab in the element’s
Specification window and/ or Properties panel.
If the value is false, the property group is displayed as a group in the general
(default) pane of the element’s Specification window and/ or Properties panel.
Do not set this property value to true for the property subgroup.
Properties Stores a list of properties that is visible in the property group or subgroup.
Do not set this property value to true for the property subgroup.
Columns Stores the specified table columns for showing the values of a multivalued property
in the element’s Specification window, for example, ownedOperation in Class.
Filter Stores the element types (UML metaclasses and custom stereotypes) that will be
displayed as property values.
• If the type is a stereotype, all subtypes (sub stereotypes) are also accepted. For example, if the
type is Requirement361, BusinessRequirement362 is also accepted.
• If the type is an abstract metaclass, all subclasses are accepted. For example, if the type is
Classifier, Class (see page 633), Component (see page 654) and other are accepted. DSL elements are
also accepted.
Related Pages
361 https://docs.nomagic.com/display/SYSMLP185/Requirement
362 https://docs.nomagic.com/display/SYSMLP185/Business+Requirement
Example
Let’s say we have two customizations of the same element type, the actor. The first
customization has the property group My Group with the subgroup Subgroup 1 containing the
property Prop 1 . The second customization has the same property group with the same
subgroup specified, but the subgroup Subgroup 1 contains the property Prop 2 .
As a result, the actor element type will have My Group, with Subgroup 1 containing both Prop 1
and Prop 2.
Related Pages
If the customization target is a stereotype and the Hide Metatype property is set to true, the specified
property group in this customization is visible only for the elements with this stereotype applied.
If the customization target is a metaclass, the specified group in this customization will be visible for the
elements of this particular type. This group is also visible for the elements with applied stereotypes,
except when the Hide Metatype property in this stereotype customization is set to true.
The table below lists the default property group visibility in the element’s Specification window (see page
882).
Customization Property group visibility in element’s Specification window and Properties panel
target
Related Pages
Contents
On this page
The Generic Numbering Mechanism (see page 1003) consists of the Numbering Customization and
Numbering Scheme, shown in the figure below.
You can create one or more numbering schemes for the same DSL element. You can also apply the
same numbering scheme to several DSL elements. In this case, instances of different DSL elements will
be numbered in sequence. For example, if you use the same numbering customization for both actors
and use cases, all actors and use cases in a use case diagram will be numbered in sequence. Another
example of numbering different DSL elements in sequence is shown in the figure below. The start
events, end events, tasks, and gateways in the BPMN Process diagram are numbered using the same
numbering scheme.
363 https://docs.nomagic.com/display/SYSMLP190SP2/SysML+Plugin+Documentation
364 https://docs.nomagic.com/display/CBMP190SP2/Cameo+Business+Modeler+Plugin+Documentation
365 https://docs.nomagic.com/display/UAFP190SP2/UAF+Plugin+Documentation
Concept Description
Numbering scheme Defines a numbering style as well as number parts used to compose a DSL
element number. A numbering schema can have one or more number
parts. A numbering scheme is represented as a class with the
«NumberingScheme» stereotype applied.
Number part Represents a rule for calculating an individual part of the whole element
number, as the element number is composed of one or more individual
number parts. It can be a number, character, separator, or other. Number
part is represented as a numbering scheme property with the
«NumberPart» stereotype applied.
Numbering property Indicates a DSL element property to store the element number and
defines a numbering scheme used for the DSL element numbering. The
numbering property is represented as a customization element property
with the «AutoNumber» stereotype applied.
binary;Binary;com.nomagic.magicdraw.autoid.LinkedDUCBinary;
Related pages
Contents
So we need to create a numbering scheme and use it in the numbering customization for Package (see
page 771) elements.
Perform this task in the Quick Start perspective (see page 68).
1. Creating a stereotype to customize a desired element
Make the «Numbered Package» stereotype invisible if you want the stereotype and its
properties to be hidden in a diagram.
To add a new attribute for storing package numbers to the «Numbered Package» stereotype
1. Select the shape of the «Numbered Package» stereotype on the Profile diagram pane.
2. Add a new stereotype attribute of the String type named No.
The name of the numbering scheme will be displayed in the Element Numbering dialog
(see page 1009). We recommend giving it a short and meaningful name.
366 https://docs.nomagic.com/display/MD190/Creating+Numbering+Customizations
1. Open the Specification window (see page 882) of the newly created numbering scheme.
2. Click the Numbering Style value cell to open the list of available numbering styles. Select
the Multi-level numbering style in this list. Use the Multi-level numbering style (remember: you
must have three numbering levels for numbering packages).
3. Click Close when you are done.
The following table shows number parts that should be used to create the numbering formats
described in the preceding table.
<number> Level 1
<separator> Dot 1
<character> Level 2
<separator> Dot 2
<number> Level 3
Numbering scheme with number part defined for first numbering level.
To specify a number part for the first separator
Numbering scheme with number parts defined for the second numbering level.
As there are no number parts specified for the fourth (and beyond) numbering levels, packages
will be numbered using the number parts of the third numbering level. For example, “1.A.1.1”,
“1.B.1.2”, and so forth.
4. Creating a customization element for the stereotype that customizes the desired element
In order to use the scheme for numbering packages, you must define it in the numbering customization
for package elements. First, create a customization element.
Related pages
Contents
On this page
Multi-level Select this style to number elements in several numbering levels. Specify at
least one number part for each numbering level.
Top level elements will be numbered using the first number part. Elements in
subsequent levels (directly or indirectly contained in the top level element)
will be numbered using successive number parts.
If you specified fewer number parts than there are element levels,
both the last element number part of the separator type and the
last element number part of the non-separator type (numeric or
character) will be reused to number subsequent level elements. For
instance, if number parts are specified only for two numbering
levels, and elements in the second level are numbered as “1.A”,
“1.B”, and “1.C”, elements in the third numbering level will be
numbered as “1.A.A”, “1.A.B”, etc.
Consecutive Select this style to number elements in one numbering level. Specify only
one number part.
Numeric Select this type to use only positive numbers for calculating a value of
the number part.
Character Select this type to use only Latin letters for calculating a value of the
number part.
Expression Select this type to use a Binary (Reference to a code class) expression
for calculating a value of the number part. Use the Expression Editor
dialog to define the expression.
Separator Select this type to specify a separator between two number parts.
OwnerNumber Select this type to use the number of an owner numbered using
another numbering customization for calculating a value of the
number part.
Related pages
Contents
DSL customization allows extending the UML metamodel or its profile (such as SysML or UPDM)
by creating new read-only derived properties.
A derived property's values are automatically calculated from the other properties’ values.
Derived properties are calculated on the fly. The modeling tool analyzes the derived properties
and calculates them for existing model elements (when loading a model) and
dynamically updates them according to model changes.
Derived properties can be added either to the standard UML elements, or to the ones extended with
stereotypes. To extend the metamodel with the derived properties, there is no need to apply
the stereotypes: the metamodel is extended in runtime.
Define derived properties using different expression types: Simple, Meta Chain, OCL, and
Binary (reference to java code).
Easily access derived properties of a select model element, navigate to its specifications, or use the
derived properties in model analysis tools (dependency matrices, report templates, and relation maps).
367 https://www.nomagic.com/files/viewlets/md_viewlets_derivedproperties_viewlet_swf.html?ml=1&iframe=1
Contents
1. Select the customization element for which you want to create a derived property.
The derived property will be created for the stereotype or metaclass, defined as a
customization target in the selected customization element specification.
2. Select Create Element > Derived Property Specification from the shortcut menu. The attribute
is created.
3. Type the attribute name. Your Model Browser should look like this at this stage:
4. Edit property values specifying the derived property in the attribute's Specification window.
All properties are specified in the general specification pane. Some are also specified in
the Tags specification pane. For detailed information, see the properties description
table (see page 2065).
If you do not see the newly created derived property in the element’s Specification window (see
page 882), please read the following:
• In the element’s Specification window (see page 882), the specified derived property is
visible by default only in the All properties mode. First, try switching to this mode. Also
try changing the mode in which you want the derived property to be visible (click the
Customize button).
• If you have specified the derived property for the element (with the Used UML
Properties property of DSL customization specified) you must add the newly created
derived property to the element’s visible properties list. For detailed information, please
refer to Derived properties visibility (see page 2069).
The following table describes the properties specified for the derived property.
Property Description
Type The type of the derived property values. You may set a model
element type or a data type (e.g., string, boolean, orintegerfrom the
UML Standard Profile) as a property value.
Is Read Only If true, the derived property is read-only. You cannot edit the result
elements for the derived property value.
If false, the property is read-write. You can edit the result elements
for the derived property according to the expressions defined.
Is Ordered If true, the property values are always displayed in the same order.
If false, the property values are displayed in nonpredictable order.
Is Unique If true, the property values are unique. The same element is
displayed only once.
If false, the property values may be displayed more than once.
The criterion for selecting the result elements can also be any
combination of the expression types above.
For the detailed information, see Defining expressions (see page 2067).
customizationTarget The specified derived property will be added to one or more element
types (stereotypes and/ or metaclasses).
Defining expressions
Contents
Each derived property must have one or more expressions defining the criteria for searching the
result elements.
It is strongly recommended that you specify the customization target in the customization
element before defining the expression for its derived property.
1. Select the attribute with the stereotype «derivedPropertySpecification» (see page 2064).
2. Open the attribute’s Specification window (see page 882).
3. In the general specification pane (opened by default), click the Expression property and
then click the ... button. The Expression dialog opens, and you can then construct predefined
expressions or define your custom operation for calculating derived property values.
Related pages
Recursive properties
Contents
• All elements directly or indirectly related to a specific element through the abstraction and other
types of relations.
Related Pages
Contents
Suppose you have two customization elements extending the same UML element (for example, the
same element specified as a customization target in both customization elements). Each customization
element has a derived property. If the derived properties’ names, types, and multiplicities are the same,
then the expressions defined for these derived properties are merged. Consequently, the extended
UML element will have only one derived property instead of two and the property values will be
calculated according to the union of expressions defined in both derived properties.
This occurs when the derived property (already specified in, for example, the UML Standard Profile) is
also specified in a project. Note that in contrast to the example above the real-life expression merge can
be performed in more complex situations with more than two derived properties having more than
one expression defined. The expression merge can combine different types of expressions.
Related Pages
Contents
• General specification pane of the DSL element’s Specification window (see page 882).
• Properties panel of the DSL element.
• Compartment Edit dialog.
To see derived properties of customized elements that have the Used UML Properties
property specified, ensure that derived properties are assigned as values for the Used
UML Properties property.
• Criterion Editor dialog for editing relation criteria in a Relation Map diagram.
• Select Dependency Criteria dialog for editing the dependency criteria in a Dependency Matrix
diagram.
Additionally, DSL customization allows more precision when specifying a derived property’s visibility,
as this can be done through the specification of the DSL element’s properties group or subgroup to
which the derived property is assigned. As a result, the derived property will be visible in the group or
subgroup according to this group’s or subgroup’s visibility settings.
1. Open the Specification window (see page 882) of the customization element.
2. In the general specification pane, select Used UML Properties and assign one or more derived
property values.
3. Save and reopen the project.
You can also assign a derived property to a property group not specified in the same
customization element if both customization elements extend the same UML element.
Related Pages
You can distribute profiles with included customization data in the following two ways:
Related pages
4 Developer Guide
This guide describes the Open Java API of MagicDraw or a Cameo Suite product, such as Cameo
Systems Modeler, and provides instructions on how to implement custom plugins, add actions to the
menus or toolbars, change UML model elements as well as create new patterns. Though MagicDraw is
used in examples mainly, other modeling tools, since they are based on the MagicDraw modeling
platform, performs the same.
The program core code and used libraries are packaged in jars files that are located in <modeling tool
installation directory>\lib (and its subdirectories).
Some plugins also exposes Open API. Plugins libraries can be located in <modeling tool installation
directory>\plugins\<plugin_name>
The code can be divided into the following three API scope groups:
• OpenAPI – a code for public usage, stable through builds and versions.
• InternalAPI – a code for the internal NoMagic usage only, may change through builds and
versions without any restrictions.
• NotAPI – not an API code, it may change in each build.
Java annotations are used to distinguish which API scope in the provided code belongs to. Annotations
of the type (class, interface, enum) declaration:
Only code from the OpenAPI scope should be used to extend the modeling tool. All the InternalAPI and
NotAPI scope code are additionally annotated with the @Deprecated annotation. This allows seeing the
illegal API usage in all modern IDEs without an additional configuration.
In the generated javadoc368, you will find the detailed description of classes, their attributes, and
operations. JavaDoc is located in <modeling tool installation directory>\openapi\docs.
4.1 Plugins
Plugins are the only one way to change the functionality of a modeling tool. The main purpose of the
plugin architecture is to add a new functionality to your modeling tool. Although there is a limited ability
to remove an existing functionality using plugins.
A plugin must contain the following resources:
• A directory
• Compiled java files, packaged into a jar file
• A plugin descriptor file
• Optional files used by the plugin
Typically a plugin creates some GUI components allowing a user to use the plugin functionality.
Generally, this is not necessary because the plugin can listen for some changes in a project and activate
itself on the desired changes.
368 http://jdocs.nomagic.com/190beta/
• If a subdirectory contains the plugin descriptor file, the plugin's manager reads the descriptor
file.
• If requirements specified in a descriptor file are fulfilled, the plugin's manager loads a specified
class (the specified plugin class must be derived from the
com.nomagic.magicdraw.plugins.Plugin369 class). Then a method init()370 of the loaded class is
called. The init()371 method can add GUI components using the actions architecture or do other
activities and return from the method. The init()372 method is called only if isSupported()373
returns true.
The following figure illustrates how do plugins work.
369 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html
370 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html#init--
371 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html#init--
372 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html#init--
373 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html#isSupported--
package myplugin;
import com.nomagic.magicdraw.plugins.Plugin;
import javax.swing.*;
public class MyPlugin extends Plugin
{
@Override
public void init()
{
JOptionPane.showMessageDialog(null, "My Plugin init");
}
@Override
public boolean close()
{
JOptionPane.showMessageDialog( null, "My Plugin close");
return true;
}
@Override
public boolean isSupported()
{
//plugin can check here for specific conditions
//if false is returned plugin is not loaded.
return true;
}
}
374 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html
For more information on the classpath specification details, see Classpath (see page 2076).
The compiled code must be packed to a .jar file.
For detailed information about the plugin descriptor, see Plugin descriptor (see page 2078).
Related pages
The correct classpath must be specified when compiling your (plugin) code or running *.jar files from
<modeling tool installation directory>\lib, as well as all its subdirectories must be included into
the classpath.
You can open the properties file in <modeling tool installation directory>\bin and check the
CLASSPATH property to be sure what files must be included.
1. patch.jar
2. brand.jar (if the file exists). This file is needed if the Cameo Enterprise Architecture program is
used. MagicDraw does not requires this file.
3. brand_api.jar (if the file exists)*
4. Rest *.jar files. Order of them is not important
Make sure that only the *.jar files coming with the current program version you are included. If
you have upgraded your modeling tool from an earlier version, the lib directory may contain
files from the earlier version. Do not include these obsolete *.jar files.
Plugins libraries
Keep in mind that some Open API classes may come from plugins (like the SysML plugin for example).
In these case, make sure that jar files from a plugin directory are added into the compiled classpath.
To check messages
1. Restart MagicDraw (or other modeling tool you are using). On startup, a message should appear:
LOAD PLUGINS:
com.nomagic.magicdraw.plugins.PluginDescriptor@edf730[ id = my.first.plugin, name =
My First Plugin, provider = Coder, version = 1.0, class = myplugin.MyPlugin, requires
api = 1.0, runtime = \[Ljava.net.URL;@ff94b1\] (mailto:@ff94b1)
INIT PLUGINS:
[com.nomagic.magicdraw.plugins.PluginDescriptor@edf730[ id = my.first.plugin, name =|
http://Ljava.net.URL/] My First Plugin, provider = Coder, version = 1.0, class =
myplugin.MyPlugin, requires api = 1.0, runtime = [Ljava.net.URL;@ff94b1]
Also all plugins and their statuses are listed in the program EnvironmentOptions dialog, in the Plugins
tab.
Looking at the file is the best way to find problems when the plugin does not work.
Plugin descriptor
A plugin descriptor is a file written in XML and named plugin.xml. Each descriptor contains properties of
the one plugin. The descriptor file should contain the definitions of elements of the one plugin.
plugin
name A plugin name. There is no strict rules applied to this attribute. For example,
Example plugin.
version A plugin version. The version can be used to check other plugins
dependencies, if internalVersion is not defined.
class A full qualified class name. The class must be derived from
com.nomagic.magicdraw.plugins. A plugin and stored in plugin runtime
library. This class will be loaded and initialized by the plugin's manager. For
example, myplugin.MyPlugin.
class-lookup Optional; possible values are LocalFirst, GlobalFirst, the default value is
GlobalFirst.
Specifies the priority of a "parent" class loader, if a plugin uses
ownClassloader. LocalFirst forces to load classes from the plugin class
loader even if such classes exist in the modeling tool core class path. This
option should be used, if, in your plugin, you want to use different versions
of same libraries that are used in the core.
Nested elements
requires A modeling tool API version required by the plugin. Plugins and their
versions required by the plugin.
requires
Nested elements
api
Attribute Description
Attribute Description
runtime
Nested elements
Attribute Description
name A name (path) of the required library. The path is relative to the plugin
descriptor directory (slash should be used to separate files in path).
Plugin classes
com.nomagic.magicdraw.plugins.Plugin375 is the base abstract class for any modeling tool plugin. A plugin
written by a user must be extended from this class. Every plugin has its own descriptor set by a plugin's
manager. A plugin has three special methods:
• a init()376 method is called on a program startup. The plugin must override this method and
implement its own functionality there.
• a close()377 method is called on a program exit. The plugin must override this method and return
the value true if the plugin is ready to exit. In other case, it should return the value false. If the
plugin returns false, the program exit is canceled.
• a isSupported()378 method is called before the plugin initialization. If this method returns false, the
plugin is not initialized. isSupported()379may be used to check if the plugin can be started, for
example, on this OS.
375 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html
376 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html#init--
377 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html#close--
378 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html#isSupported--
379 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html#isSupported--
380 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/PluginUtils.html
381 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/PluginDescriptor.html
382 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html#getDescriptor--
383 http://jdocs.nomagic.com/190beta/
An optional property "class-lookup" controls how classes are loaded, if the plugin has its own
classloader. If the value of this property is LocalFirst, the class is loaded from the plugin classpath even if
such class is already loaded in the global core classloader of your modeling tool. This property is
important if you want to use different versions of the same classes (libraries) used in the program core.
Plugins directories
Plugins are loaded from two locations on the program startup.
Installation directory
Plugins are loaded from the program installation directory (a global plugin directory) <modeling tool
installation directory>\plugins.
This directory can be changed using a md.plugins.dir java system property and specifying paths
separated with a semicolon (;) symbol. For example:
md.plugins.dir="C:\Program Files\MagicDraw\plugins;D:\MyPlugins"
384 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/ResourceDependentPlugin.html
package myplugin;
import ...
public class MyPlugin extends Plugin implements ResourceDependentPlugin
{
@Override
public void init()
{...}
@Override
public boolean close()
{...}
@Override
public boolean isSupported()
{...}
@Override
public boolean isPluginRequired(Project project)
{
return ProjectUtilities.findAttachedProjectByName(project,
"my_profile_filename") != null;
}
@Override
public String getPluginName()
{
return this.getDescriptor().getName();
}
@Override
public String getPluginVersion()
{
return this.getDescriptor().getVersion();
}
}
This plugin is required for a project, if the project contains a used project "my_profile_filename". The
plugin name and version will be saved into the project's XMI file.
385 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/ResourceDependentPlugin.html
386 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/
ResourceDependentPlugin.html#isPluginRequired-com.nomagic.magicdraw.core.Project-
387 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/
ResourceDependentPlugin.html#isPluginRequired-com.nomagic.magicdraw.core.Project-
388 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
389 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/
ResourceDependentPlugin.html#getPluginName--
390 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/
ResourceDependentPlugin.html#getPluginVersion--
391 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/ResourceDependentPlugin.html
On this page
392 http://www.junit.org/
393 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html
394 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/TestEnvironment.html
395 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
ProjectsComparator.html
396 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestRunner.html
397 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/ParametrizedMagicDrawTestRunner.html
On this page
MagicDrawTestCase401 provides default and specific constructors for creating a test case instance with a
specific custom name for the specific test case method. Test cases with specific names might be helpful
when several instances of the same test case are created and analyzed.
398 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html
399 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html
400 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html
401 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html
402 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html
403 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html#setUpTest--
404 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html#tearDownTest--
@Override
protected void setUpTest() throws Exception
{
super.setUpTest();
//do setup here
}
@Override
protected void tearDownTest() throws Exception
{
super.tearDownTest();
//do tear down here
}
MagicDrawTestCase405also provides methods for opening, saving, and closing MagicDraw projects. It also
performs the memory leak test after the test case has been completed and after the project has been
closed. The memory leak test for the whole test case can be disabled using the
setMemoryTestReady(boolean)406 method, while the setSkipMemoryTest(boolean)407 method can be used
to disable the memory leaks test on closing the MagicDraw project.
The list of required MagicDraw plugins for the test case can be configured by overriding the
getRequiredPlugins()408 method of MagicDrawTestCase409. The overridden method implementation should
405 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html
406 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/
MagicDrawTestCase.html#setMemoryTestReady-boolean-
407 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/
MagicDrawTestCase.html#setSkipMemoryTest-boolean-
408 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/
MagicDrawTestCase.html#getRequiredPlugins--
409 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html
Textual information about the test process can be logged using the Log4j logger. The test case logger
for the TEST category can be accessed using the getLogger()412 method of MagicDrawTestCase413. More
information about the Log4j logger configuration and usage can be found at http://logging.apache.org/
log4j/1.2/manual.html.
@RunWith(MagicDrawTestRunner.class)
public class MyTest
{
@Before
public void beforeTestBegins()
{
//do setup here
}
@After
public void afterTestDone()
{
//do tear down here
}
@Test
public void testSomething()
{
//implement the unit test here
}
}
410 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/
MagicDrawTestCase.html#getRequiredPluginsDescription--
411 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/
MagicDrawTestCase.html#isRequiredPluginsLoaded--
412 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html#getLogger--
413 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestCase.html
414 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestRunner.html
415 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/MagicDrawTestRunner.html
416 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
ProjectsComparator.html
417 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
ProjectsComparator.html#compare-com.nomagic.magicdraw.core.Project-
com.nomagic.magicdraw.core.Project-
418 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
419 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
ProjectsComparator.html#compare-com.nomagic.magicdraw.core.Project-
com.nomagic.magicdraw.core.Project-
420 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
421 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
ProjectsComparator.html#compare-com.nomagic.magicdraw.core.Project-
com.nomagic.magicdraw.core.Project-
422 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
ProjectsComparator.html
423 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/
MagicDrawTestCase.html#createProjectComparator-java.lang.String-
424 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
ModelComparator.html
425 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
ModelComparatorFilter.html
426 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
ProjectsComparator.html
Developers may create their own comparators for the custom diagrams and model elements
comparison by implementing ModelComparator430and DiagramComparator431interfaces. The custom
Model and Diagram comparators implementation can be set to ProjectComparator432using appropriate
setter methods.
Test cases may produce some resources as a test output. The output directory for a specific test case
can be created using TestEnvironment.getOutputDir(java.lang.Class)435. The class here specifies a class
of the test case which output directory should be accessed.
There are also methods for working with output files. An output file for a specific project can be simply
created by changing the project file extension (TestEnvironment.getFileWithExtension(java.io.File,
427 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
DiagramComparator.html
428 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
DiagramComparator.html#saveDiffToImageFiles-java.io.File-
429 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
DiagramComparator.html
430 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
ModelComparator.html
431 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
DiagramComparator.html
432 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/comparators/
ProjectsComparator.html
433 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/
TestEnvironment.html#getResourceDir--
434 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/
TestEnvironment.html#getProjects-java.io.File-
435 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/
TestEnvironment.html#getOutputDir-java.lang.Class-
The program installation directory should be also specified using the install.root system property which
can be passed to JVM as a runtime argument -Dinstall.root=path_to_modeling_tool_installation_directory.
It is possible to setup the program installation to force using the floating license server. The following
properties should be passed to JVM as runtime arguments:
-DFL_FORCE_USAGE=true
-DFL_SERVER_ADDRESS=flexnet_license_server_address
-DFL_SERVER_PORT=license_server_port
-DFL_EDITION=magicdraw_edition
Test cases may use external resources such as configuration files and projects during tests. It is
recommended to keep external test resources apart from test case implementation class files. The test
framework provides methods for retrieving test resources from the one specific resource directory. The
resource directory for test cases can be configured by specifying the tests.resources system property of
JVM. The tests resource property can be passed to JVM as a runtime argument
-Dtests.resources=path_to_resources_directory
The Log4j logger used in test cases can be configured by specifying the test.properties file which should
be placed in <modeling tool installation directory>\data.
The program is started in a "silent" mode when running tests - the user interference requiring dialogs
are not shown, instead the warning "WARN GENERAL - TRYING TO DISPLAY "<dialog title>" DIALOG IN SILENT
MODE" is logged. The stack trace is logged too if a special system property -
DprintSilentDialogStackTrace=true is set.
Related Pages
436 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/
TestEnvironment.html#getFileWithExtension-java.io.File-java.lang.String-
437 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/tests/common/
TestEnvironment.html#createFileNameWithPrefix-java.io.File-java.lang.String-
Related pages
Development in Eclipse
The preconfigured Eclipse projects for two sample plugins and a batch mode (see page 2285) (command-
line) tool are provided with a program installation. These projects can be found in <modeling tool
installation directory>\openapi\ide\eclipse.zip.
1. Start Eclipse IDE. To install Eclipse SDK, from the main menu, select Help > Install New
Software. The Install dialog opens. In the Work with list, select All Available Sites, and, in the
filter box, type eclipse sdk and press Enter. All available Eclipse versions are listed. Click to
select Eclipse SDK and go Next. Follow the installation wizard steps to proceed software
installation process.
In case you have Eclipse IDE for Eclipse Committers, Eclipse SDK is already available in
your IDE and you can skip this step.
438 http://www.eclipse.org/
439 http://www.jetbrains.com/
Be sure the link points to your MagicDraw (or other according to a modeling tool you are
using) installation directory (see the following figure). Installation directory must not
contain spaces.
The launch configuration is designed to load plugins from the MagicDraw (or other
according to a modeling tool you are using ) installation directory (see step #3 (see page
2095)) and two plugins from the Eclipse Workspace. Thus, if the md.plugins.dir java system
property is not defined (see Plugins directories (see page 2084)), developing plugins are not
loaded.
The libraries (jar files) of the plugin must be added to the development class path throughout
the plugin dependency hierarchy if the developing code depends on that plugin.
For example, if the code depends on plugin A; plugin A depends on plugins B and C; plugin B
depends on plugin D, the libraries of all plugins (A, B, C, and D) must be added to the class path.
Even if the plugin descriptor file contains information about the runtime plugin .jar file, it is not
necessary to build and deploy this .jar file to a plugin directory while the plugin is developed
under Eclipse.
To setup the IntelliJ IDEA environment for the MagicDraw (or other program according to a modeling
tool you are using) development
3. Open the extracted IntelliJ IDEA project MagicDraw development.ipr from that folder.
The launch configuration is designed to load plugins from the program installation directory
(see step #1) and two plugins from the IDEA project. Thus, if the md.plugins.dir java system
property is not defined (see Plugins directories (see page 2084)), developing plugins are not
loaded.
After projects are imported and the launch configurations are prepared, the IDEA project are ready for
the source code development and running/debugging.
The libraries (jar files) of the plugin must be added to the development class path throughout
the plugin dependency hierarchy if the developing code depends on that plugin.
For example, if the code depends on plugin A; plugin A depends on plugins B and C; plugin B
depends on plugin D, the libraries of all plugins (A, B, C, and D) must be added to the class path.
Launching tests
A custom test launching mechanism is used to launch MagicDraw tests, because of an Eclipse OSGi
environment (which is not officially supported by the recent version of IntelliJ IDEA).
The test launcher classes are defined at the end of VM options (without prefix -D) and the classpath to
those classes is additionally defined as CLASSPATH variable in Environment variables section of the run
configuration. These settings should be used for any test configuration for MagicDraw on IntelliJ IDEA
by default (see the picture below and the provided sample configuration).
An IntelliJ IDEA module that is used for classpath in the test configuration should include all contents of
the <modeling tool installation directory>\lib directory recursively as it's dependencies.
.iws or .idea/workspace.xml
...
<component name="PropertiesComponent">
<property name="recentsLimit" value="5" />
...
<property name="dynamic.classpath" value="true" />
4.2.1 Content
s
In this section, you will find information about how to share your created resources with other users.
The easiest way to distribute data is to store resources in the one zip archive and import files to your
modeling tool with the MagicDraw Resource Manager (see page 1107).
• Custom Diagrams
• Profiles
• Templates
• Samples and Documentation
• Plugins
You can distribute the one resource type or you may distribute the whole set of resources.
Related pages
For more information about the MagicDraw Resource Manager, see MagicDraw
UserManual.pdf.
For each resource file, there should be a created folders structure, which should match the folders
structure of the program installation folder.
To distribute resources, you must create a resource manager descriptor file (see page 2106).
For more information about creating new diagram types, see the section “Diagram Types” in
MagicDraw UserGuide.pdf or see the UML Profiling and DSL UserGuide.pdf for the custom
diagrams creation.
For more information about working with Profiles see MagicDraw UserManual.pdf and UML
Profiling and DSL UserGuide.pdf.
Distributing Templates
Files for the template distribution are as follows:
Distributing Plugins
Required files for a plugin distribution are as follows:
Related pages
For more information about importing resources with Resource Manager, see MagicDraw
UserManual.pdf.
You can also distribute custom diagrams, profiles, templates, or samples separately, you only need to
change the “type“ value.
<resourceDescriptor
critical="false"
date="2007-12-24+02:00"
description="My Plug-in"
homePage="http://www.nomagic.com"
id="3001"
mdVersionMax="higher"
mdVersionMin="15.0"
name="CustomPlugin"
product="CustomPlugin"
type="Plugin">
<edition>Enterprise</edition>
<edition>Architect</edition>
<edition>Standard</edition>
<edition>Professional Java</edition>
<edition>Professional C++</edition>
<edition>Professional C#</edition>
<edition>Professional ArcStyler</edition>
<edition>Reader</edition>
<edition>OptimalJ</edition>
<installation>
<file from="data/defaults/data/diagrams/CustomDiagram/descriptor.xml"
to="data/defaults/data/diagrams/CustomDiagram/descriptor.xml" />
<file from="profiles/CustomProfile.xml.zip" to="profiles/
CustomProfile.xml.zip" />
<file from="templates/CustomTemplate.xml.zip" to="templates/
CustomTemplate.xml.zip" />
<file from="samples/CustomPluginSample.mdzip" to="samples/
CustomPluginSample.mdzip" />
<file from="manual/CustomPluginManual.pdf" to="manual/
CustomPluginManual.pdf" />
<file from="plugins/customPlugin/*.*" to="plugins/customPlugin/*.*" />
<file from="data/resourcemanager/MDR_Plugin_CustomPlugin_3001_descriptor.xml"
to="data/resourcemanager/MDR_Plugin_CustomPlugin_3001_descriptor.xml" />
</installation>
</resourceDescriptor>
Element Description
id A unique plugin id. id is used to form a descriptor file name. This id must
be unique. To prevent duplicates, use a number starting from 3000 or
contact the No Magic support at http://www.nomagic.com/support.html.
name A plugin name. A name is used to form a descriptor file name. The plugin
name must be unique between all program resources.
product A product name. Used only for the “Plugin (commercial)” resource type.
type A type may be one of the following types: Custom Diagram, Plugin, Plugin
(commercial), Profile, Sample, Template.
version resource This number is used to identify the resource build/release. For example, a
new resource build must be released, while the resource human and
internal versions should not change. A suggested value is a version
internal value multiplied by 10. version resource should be a number.
version internal This version number is not visible to the user and may be used for an
internal count. version internal should be a number.
version human A human readable version number of the resource. This version number is
visible to users. The version human number may consist of numbers and/
or words.
installation installation includes files, which will be copied from the custom plugin
archive to the program folder.
Do not use "*.*" ! If a file name includes “*.*“, all defined files will
be removed when uninstalling the plugin. For example, if
"samples/*.*" is defined, all files from the “samples” folder will
be removed after uninstalling the resource.
This can be useful for distributing a set of resources accompanied with custom resources or in a locked
down environment where the resource bundle is hosted in a local network.
1. Install the Development Tools plugin using your tool using Resource Manager.
2. Restart the modeling tool.
3. In the modeling tool main menu, click Tools > Development Tools > Build Resource
Distribution File.
4. Browse and select the resources folder, choose the output location and click OK. A resource
distribution file will be built in the output folder.
The Development Tools plugin can either be installed from the NoMagic Resource Server or
can be found in the no-cost resource distribution file.
In case the process of building a resource distribution files should be automated, it can be done
using command line tool.
com.nomagic.magicdraw.resourcemanager.distribution.GenerateResourceDistributionFileTa
sk "E:\myResources" "E:\myBundles" "myCustomResourceDistributionFile"
Resource distribution file creator checks for validity of each resource. Only valid resources are
included in the resource distribution file. The resources must meet the required folder/file
structure and must contain appropriate descriptor file. For more information about the folder/
file structure visit Creating required files and folders structure (see page 2102)
Related pages
Main menu
Main toolbar
Diagram pallet
Diagram toolbar
Diagram shortcut
menu
Smart manipulator
toolbar
Keyboard shortcuts This action cannot be represented in GUI. Create a new action and assign a
keyboard shortcut to invoke that action.
JOptionPane.showMessageDialog(MDDialogParentProvider.getProvider().getDialogParent(),
"This is:" + getName());
}
}
440 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/MDAction.html
441 http://jdocs.nomagic.com/190beta/
442 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/MDAction.html
443 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/browser/actions/DefaultBrowserAction.html
444 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/actions/DefaultDiagramAction.html
445 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/PropertyAction.html
446 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/MDAction.html#actionPerformed-
java.awt.event.ActionEvent-
JOptionPane.showMessageDialog(MDDialogParentProvider.getProvider().getDialogParent(),
text);
}
}
Property Function
447 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/ActionsID.html
448 http://jdocs.nomagic.com/190beta/
Shortcut and mnemonic Every action can have an assigned keyboard shortcut. Shortcuts can
be customized from the Environment Options dialog box.
Icon Every action can have a small and large icon. A small icon is described
as javax.swing.Action.SMALL_ICON and can be used in menu items. A
large icon is used in toolbar buttons. The action for a toolbar must
have a large icon, otherwise it is displayed as a button with an action
name.
ImageIcon(getClass().getResource("main_toolbar_ico
n.gif") ) );
Example:
Here you may describe all conditions when an action must be enabled and disabled. Example of
the updateState()450 method for the browser shortcut menu action:
If the action is not added to any group, the updateState()451 method for all such actions will be invoked
after executing any command and after closing/opening a project or window.
When some actions need to refresh their state, all actions without a group can be updated manually:
ActionsStateUpdater.updateActionsState();
Categories are added into the com.nomagic.actions.ActionsManager454 class, which is some kind of an
actions container. One ActionsManager 455represents one GUI element – a menu bar, a shortcut menu,
or a toolbar.
The following table explains how classes of a modeling tool maps into GUI elements:
ActionsManager Category Action
449 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/MDAction.html#updateState--
450 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/MDAction.html#updateState--
451 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/MDAction.html#updateState--
452 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsCategory.html
453 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsCategory.html
454 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsManager.html
455 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsManager.html
Shortcut menus are created on every invoking, so ActionsManagers are created and configured every
time and actions can be added or removed every time.
456 http://jdocs.nomagic.com/190beta/com/nomagic/actions/AMConfigurator.html
457 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/BrowserContextAMConfigurator.html
458 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/DiagramContextAMConfigurator.html
// Create an action.
final MDAction someAction = ...
AMConfigurator conf = new AMConfigurator()
{
public void configure(ActionsManager mngr)
{
// Searching for an action after which an insertion should be done.
NMAction found= mngr.getActionFor(ActionsID.NEW_PROJECT);
459 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/ActionsConfiguratorsManager.html
460 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/ActionsConfiguratorsManager.html
ActionsConfiguratorsManager.getInstance().addContainmentBrowserContextConfigurator(br
Cfg);
MAIN_TOOLBAR
MAIN_SHORTCUTS
CUSTOMIZABLE_SHORTCUTS
CONTAINMENT_BROWSER_CONTEXT
CONTAINMENT_BROWSER_TOOLBAR
INHERITANCE_BROWSER_CONTEXT
INHERITANCE_BROWSER_SHORTCUTS
INHERITANCE_BROWSER_TOOLBAR
DIAGRAMS_BROWSER_SHORTCUTS
DIAGRAMS_BROWSER_TOOLBAR
EXTENSIONS_BROWSER_CONTEXT
EXTENSIONS_BROWSER_SHORTCUTS
EXTENSIONS_BROWSER_TOOLBAR
SEARCH_BROWSER_CONTEXT
SEARCH_BROWSER_SHORTCUTS
SEARCH_BROWSER_TOOLBAR
As of version 18.2, modeling tools support HiDPI/Retina monitors and chooses dynamically which icon
to load - a lower or higher resolution. All this logic is encapsulated
in com.nomagic.ui.ScalableImageIcon462. IconsFactory463adds additional caching and ensures that icon
from the same URL will be loaded just once.
The HiDPI/Retina compatibility requires two images - for a normal resolution and for a high resolution.
Use the SVG format for a high resolution image. Put both icons with the same name (but a different
extension) at the same location. Use a normal icon URL to load the icon, but the SVG icon will be loaded
on the high resolution monitor.
Icon classes
Class Description
461 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/icons/IconsFactory.html
462 http://jdocs.nomagic.com/190beta/com/nomagic/ui/ScalableImageIcon.html
463 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/icons/IconsFactory.html
464 http://jdocs.nomagic.com/190beta/com/nomagic/ui/ResizableIcon.html
com.nomagic.ui.SquareIcon467 An icon which fits another icon into a square of a given size.
Utility classes
Class Description
465 http://jdocs.nomagic.com/190beta/com/nomagic/ui/ResizableIconAdapter.html
466 http://jdocs.nomagic.com/190beta/com/nomagic/ui/ResizableIcon.html
467 http://jdocs.nomagic.com/190beta/com/nomagic/ui/SquareIcon.html
468 http://jdocs.nomagic.com/190beta/com/nomagic/ui/ScalableImageIcon.html
469 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/icons/IconsFactory.html
470 http://jdocs.nomagic.com/190beta/com/nomagic/ui/IconUtilities.html
Class Description
com.nomagic.ui.DoubleIcon473 An Icon for painting two wrapped icons on a top of each other.
com.nomagic.ui.RetinaImageIcon474 A retina friendly image icon implementation. The icon (and the
image returned by this icon) is twice smaller then the wrapped
icon itself.
com.nomagic.ui.DoubleSizeImageIcon475 An icon combines two other icons and chooses which one to
paint depending on the graphics scaling.
com.nomagic.ui.ResizableIconImageIcon476 An image icon which wraps other icon and provides an image
for a wrapped icon. The provided image is HiDPI/Retina
friendly. On Mac, a special instance of java.awt.Image
(sun.awt.image.MultiResolutionToolkitImage) is returned
which supports multi-resolution.
On this page
Related pages
471 http://jdocs.nomagic.com/190beta/com/nomagic/ui/AlphaCompositeIcon.html
472 http://jdocs.nomagic.com/190beta/com/nomagic/ui/BorderIcon.html
473 http://jdocs.nomagic.com/190beta/com/nomagic/ui/DoubleIcon.html
474 http://jdocs.nomagic.com/190beta/com/nomagic/ui/RetinaImageIcon.html
475 http://jdocs.nomagic.com/190beta/com/nomagic/ui/DoubleSizeImageIcon.html
476 http://jdocs.nomagic.com/190beta/com/nomagic/ui/ResizableIconImageIcon.html
Usage samples:
• Use the mdp protocol in the HTML based model element documentation to point to some image
from a plugin jar.
• Use the mdp protocol in the HTML based model element documentation to point to some
attached image from a project.
URL syntax
mdp:// Use the "resource" host to load resources from jars/classpaths. For example, to load the
resource/ activitydiagram.png icon from MagicDraw jar, use such URL:
mdp://resource/com/nomagic/magicdraw/icons/diagrams/
activitydiagram.png
mdp:// Use the "attachedFile" host to load resources from the attached file into the active project. For
attachedFi example, to load the icon from the attached file element with ID
le/ "_18_2_8ca0285_1436339188295_24687_13288", use such URL:
mdp://attachedFile#_18_2_8ca0285_1436339188295_24687_13288
Related pages
477 http://jdocs.nomagic.com/190beta/com/nomagic/task/RunnableWithProgress.html
478 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/MagicDrawProgressStatusRunner.html
479 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/task/BackgroundTaskRunner.html
Multiple projects can be opened at the same time, but just one Project can be active in UI. Data from
one project can not reference data in other opened project. The active (current) project can be
accessible in the following way:
The project keeps references to a root Model(s), also has references to all diagrams.
Project always have one primary root Model and may have zero or more attached Models from used
projects. Attached models are available only in projects loaded from the Cameo Enterprise Dataware
server (see page 1320). Locally stored projects or projects loaded from Teamwork Server (see page 1409) has
only a primary root model.
Related pages
480 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
481 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
482 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html
• A local project descriptor. It represents a local ordinary project. A descriptor can be created for
a project or file object.
• A remote project descriptor. It represents a project stored in the server.
A server project has both descriptors (local and remote) because it can be saved locally.
Every ProjectDescriptor484provides the following properties:
• URI. The location is a specific java.lang.String value that holds all information that is needed to
access a project.
• Representation String. A string used for a project identification in the user interface (GUI).
• Remote flag. The remote flag indicates if the project descriptor represents a server project.
com.nomagic.magicdraw.core.project.ProjectDescriptorsFactory485 can create an appropriate
ProjectDescriptor486object,
483 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectDescriptor.html
484 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectDescriptor.html
485 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectDescriptorsFactory.html
486 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectDescriptor.html
487 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/teamwork/application/TeamworkUtils.html
488 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectsManager.html
489 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectsManager.html
Related pages
• saveProject(494ProjectDescriptor495, boolean)496
490 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectsManager.html
491 http://com.nomagic.magicdraw.core.Project
492 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Application.html
493 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectsManager.html
494 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectsManager.html#saveProject-
com.nomagic.magicdraw.core.project.ProjectDescriptor-boolean-
495 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectDescriptor.html
496 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectsManager.html#saveProject-
com.nomagic.magicdraw.core.project.ProjectDescriptor-boolean-
“Save” and “Load” means “Commit” and “Update” for the server project.
A project cannot be saved using a descriptor, if the project isn’t specified, and a project cannot be
loaded, if the file isn’t specified. In such cases java.lang.IllegalStateException is thrown.
The silent mode means that during the saving or load process no GUI interruptions for a user input is
used, for example, there is no the Commit Project dialog box while committing a server project or
there is no the Save dialog box while saving a new project (a project is saved into the last used
directory).
Save participant
Use com.nomagic.magicdraw.core.SaveParticipant 500to plugin into a save/commit operation.
Register it using com.nomagic.magicdraw.core.Application.addSaveParticipant(501SaveParticipant502).
// Save a project
projectsManager.saveProject(projectDescriptor, true);
497 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectsManager.html#loadProject-
com.nomagic.magicdraw.core.project.ProjectDescriptor-boolean-
498 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectDescriptor.html
499 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectsManager.html#loadProject-
com.nomagic.magicdraw.core.project.ProjectDescriptor-boolean-
500 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/SaveParticipant.html
501 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Application.html#addSaveParticipant-
com.nomagic.magicdraw.core.SaveParticipant-
502 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/SaveParticipant.html
503 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/SaveParticipant.html#isReadyForSave-
com.nomagic.magicdraw.core.Project-com.nomagic.magicdraw.core.project.ProjectDescriptor-
504 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
505 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectDescriptor.html
Related pages
506 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectsManager.html
ProjectsManager projectsManager =
Application.getInstance().getProjectsManager();
File file = new File(moduleFilePath);
// update project options only when using local project
String moduleDir = file.getParent();
ProjectOptions projectOptions = project.getOptions();
List<String> directories = projectOptions.getModulesDirectories(true);
if (!directories.contains(moduleDir))
{
projectOptions.addModuleDirectory(moduleDir);
}
ProjectDescriptor projectDescriptor =
ProjectDescriptorsFactory.createProjectDescriptor(file.toURI());
// Use a project
projectsManager.useModule(project, projectDescriptor);
507 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/teamwork/application/TeamworkUtils.html
// Share a package
projectsManager.sharePackage(project, Arrays.asList(aPackage), "my used
project");
// Save a project
ProjectDescriptor projectDescriptor =
ProjectDescriptorsFactory.getDescriptorForProject(project);
projectsManager.saveProject(projectDescriptor, true);
Advanced management
508 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/ProjectUtilities.html
509 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/modules/ModulesService.html
510 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectsManager.html
The Open API provides Teamwork Server (see page 1409) accessing methods. The example of the code:
511 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/teamwork/application/TeamworkUtils.html
SessionManager.getInstance().createSession("Rename Model");
// change a name
model.setName("MyModel");
SessionManager.getInstance().closeSession();
// unlcok and commit (because do not discard)
TeamworkUtils.unlockElement(project, model, false, false);
projectsManager.closeProject();
// logout
TeamworkUtils.logout();
512 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/esi/EsiUtils.html
You can find the code examples in <modeling tool installation directory>\openapi\examples\cedw
Use com.nomagic.magicdraw.core.modules.ModulesService515
or com.nomagic.magicdraw.core.project.ProjectsManager516 classes for managing attached projects.
Related pages
513 http://jdocs.nomagic.com/190beta/
514 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/ProjectUtilities.html
515 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/modules/ModulesService.html
516 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectsManager.html
517 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/Property.html
518 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/PropertyManager.html
The following example shows, how to add the project option’s configurator at the plugin’s init()520
method in order to have the additional project option ”Test Property” for every project.
519 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html#getOptions--
520 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html#init--
// Add a property
projectOptions.addProperty(ProjectOptions.PROJECT_GENERAL_PROPERTIES,
property);
}
}
}
Related pages
Save participant
Use com.nomagic.magicdraw.core.SaveParticipant524 to plugin into a save/commit operation.
Register it
using com.nomagic.magicdraw.core.Application.addSaveParticipant(525SaveParticipant526)527.
Related pages
You should use UML model interfaces from the com.nomagic.uml2.ext.magicdraw package.
521 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectsManager.html#addProjectListener-com.nomagic.magicdraw.core.project.ProjectEventListener-
522 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectEventListener.html
523 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/plugins/Plugin.html#init--
524 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/SaveParticipant.html
525 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Application.html#addSaveParticipant-
com.nomagic.magicdraw.core.SaveParticipant-
526 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/SaveParticipant.html
527 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Application.html#addSaveParticipant-
com.nomagic.magicdraw.core.SaveParticipant-
528 http://jdocs.nomagic.com/190beta/
All structure derived from the Element531you can see in the OMG-UML 2.5.1 Superstructure
Specification.
All attributes described in the UML specification are implemented and accessible through setters and
getters.
The UML model is thread safe for reading, but still the UML model writing (modification) is
not thread safe (see page 2305).
Related pages
Session management
com.nomagic.magicdraw.openapi.uml.SessionManager532 is the singleton manager used for editing model
Elements. All modifications to model elements should be performed between
the createSession(533Project534, java.lang.String)535 and closeSession(536Project537)538 method calls.
529 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
530 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html
531 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
532 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/SessionManager.html
533 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
SessionManager.html#createSession-com.nomagic.magicdraw.core.Project-java.lang.String-
534 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
535 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
SessionManager.html#createSession-com.nomagic.magicdraw.core.Project-java.lang.String-
536 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/SessionManager.html#closeSession-
com.nomagic.magicdraw.core.Project-
537 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
538 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/SessionManager.html#closeSession-
com.nomagic.magicdraw.core.Project-
539 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
The following code can be used for accessing, checking, and creating the session:
Editing permissions should be checked if primitive Element properties are modified (like a name, for
example) or references are modified (like a Property type).
Check the adding permission if you are going to modify some containment property (like
Element.ownedElement).
Checking adding permission
Use BaseElement.canAddChild()544 to check if children can be added into the Element.
540 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
SessionManager.html#createSession-com.nomagic.magicdraw.core.Project-java.lang.String-
541 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
542 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
SessionManager.html#createSession-com.nomagic.magicdraw.core.Project-java.lang.String-
543 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html#isEditable--
544 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html#canAddChild--
Plugging custom permissions handler
Use com.nomagic.magicdraw.uml.permissions.ElementPermissionsManager.addPermissionsHandler(547Elem
entPermissions548) to register a custom element permissions handler. Using this API you can handle
custom rules for putting a permission on the top of some specific elements.
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.NamedElement el = ...;
String name = el.getName();
el.setName("new name");
Container Properties
Modeling tools developed by No Magic Inc. uses a composite structure of the model.
Every model element is a container and contains its own children and knows about its own parent.
545 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html#canAdd-
com.nomagic.magicdraw.uml.BaseElement-
546 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html#isEditable--
547 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/permissions/
ElementPermissionsManager.html#addPermissionsHandler-
com.nomagic.magicdraw.uml.permissions.ElementPermissions-
548 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/permissions/ElementPermissions.html
549 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/
Element.html#getOwner--
550 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/
Element.html#getOwnedElement--
The container properties modification and iteration is straightforward using the java.util.Collection
interface. Property change events are fired automatically when container properties are modified.
Containers implement subsets and unions constraints from the UML metamodel specification. This
explains how the modification of one container can affect other containers. Make sure you understand
subsets and unions in the UML metamodel. If you want to add some inner Element to the union
collection, you need to add it into a specific subset of union.
Some containers are read-only. This is true for the most of DERIVED UML metamodel properties.
It is enough to set one UML meta-association property value and an opposite property will be set too.
For example, adding a Class into a Package can be done in two ways:
or
myPackage.getOwnedElement().add(myClass);
Element el = ...;
if (el.hasOwnedElement())
{
for(Element element : el.getOwnedElement())
{
// work with element
}
}
551 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/
Element.html#getOwnedElement--
modelElement.get<SomeContainer>().add(child);
modelElement.get<SomeContainer>().remove(child);
Related pages
The create<model element type>Instance() method creates a new model element instance. The figure
above shows only a subset of all available create<...>Instance() methods.
All changes in the UML model will be registered and, on the session closing, will be added into the
command history.
552 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/impl/ElementsFactory.html
553 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/SessionManager.html
• com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Relationship554,
• com.nomagic.uml2.ext.magicdraw.activities.mdbasicactivities.ActivityEdge555,
• com.nomagic.uml2.ext.magicdraw.statemachines.mdbehaviorstatemachines.Transition556,
• com.nomagic.uml2.ext.magicdraw.activities.mdextrastructuredactivities.ExceptionHandler557,
• com.nomagic.uml2.ext.magicdraw.compositestructures.mdinternalstructures.Connector558.
For checking if the model element is a relationship, call
the com.nomagic.uml2.ext.jmi.helpers.CoreHelper.isRelationship(559Element560)561 method.
For getting supplier and client elements of a relationship, use CoreHelper562 class
getSupplierElement(563Element564)565, getClientElement(566Element567)568 methods.
554 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Relationship.html
555 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/activities/mdbasicactivities/
ActivityEdge.html
556 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/statemachines/
mdbehaviorstatemachines/Transition.html
557 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/activities/mdextrastructuredactivities/
ExceptionHandler.html
558 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/compositestructures/
mdinternalstructures/Connector.html
559 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#isRelationship-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
560 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
561 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#isRelationship-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
562 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html
563 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#getSupplierElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
564 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
565 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#getSupplierElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
566 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#getClientElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
567 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
568 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#getClientElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
Related pages
569 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html
570 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#setSupplierElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
571 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
572 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
573 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#setClientElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
574 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
575 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#setClientElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
576 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
577 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#setClientElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
578 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html
579 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#setSupplierElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
580 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
581 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
582 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#setClientElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
583 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
584 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#setClientElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
585 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
586 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/CoreHelper.html#setClientElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
587 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/
Element.html#setOwner-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
588 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
All changes in the UML model will be registered and, on the session closing, will be added into the
command history.
It is the programmer responsibility to ensure that the modified element is not read-only by checking
element editing permissions.
Related pages
• Use com.nomagic.magicdraw.openapi.uml.ModelElementsManager591
• Call direct functions on Elements
The ModelElementsManager592 is the singleton utility class which checks
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element593 editing permissions and the session
existence before executing the function. Also, it performs a check, if an element can be added to a
parent. If the ModelElementsManager 594is not used, a programmer must perform these checks in the
code explicitly.
Adding and moving functions are similar with mostly one - move functions does more checking such as
checking for a name conflict if com.nomagic.uml2.ext.magicdraw.classes.mdkernel.NamedElement595 is
moved. The general rule would be to use an adding function for newly created Element596(s) and use a
moving function for already existing elements in the model.
589 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
590 http://com.nomagic.magicdraw.openapi.uml.SessionManager
591 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/ModelElementsManager.html
592 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/ModelElementsManager.html
593 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
594 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/ModelElementsManager.html
595 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/NamedElement.html
596 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
597 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
598 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
ModelElementsManager.html#addElement-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
599 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
600 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
601 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/ModelElementsManager.html
602 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Operation.html
603 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Package.html
604 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Operation.html
605 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Class.html
606 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/ReadOnlyElementException.html
607 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
608 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
ModelElementsManager.html#moveElement-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
609 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
610 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
611 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/ModelElementsManager.html
612 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Operation.html
613 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Package.html
614 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Operation.html
615 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Class.html
616 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/ReadOnlyElementException.html
On this page
Related pages
617 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/Refactoring.html
sessionManager.closeSession(project);
618 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/Refactoring.Extracting.html
619 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/refactor/extract/ExtractSource.html
620 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/refactor/extract/ExtractTarget.html
621 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/refactor/extract/
ExtractManager.html#extract--
622 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/refactor/extract/ExtractSource.html
623 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/refactor/extract/ExtractTarget.html
// Choose target diagram type from allowed diagram types if the default type
does not suite.
List<String> allowedTargetDiagramTypes =
extractTarget.getAllowedTargetDiagramTypes();
extractTarget.setTargetDiagramType(allowedTargetDiagramTypes.get(0));
// Modify reference names which link the extract refactor source to the
target.
List<? extends ExtractReference> references = extractTarget.getReferences();
624 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/
Refactoring.RelationReversing.html#reverseRelationDirection-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
625 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
626 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/
Refactoring.Moving.html#moveElementsWithRelations-java.util.Collection-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
627 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
628 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
629 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
630 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Relationship.html
sessionManager.closeSession(project);
sessionManager.closeSession(project);
Related pages
Identifying elements
Two methods provide an identifier of an com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element.
Either method can be used depending on the situation. This section explains the difference between
the two:
1. com.nomagic.uml2.ext.magicdraw.base.ModelObject.getLocalID()631
2. com.nomagic.magicdraw.foundation.MDObject.getID()632
The meaning of the returned identifiers depends on the project type.
631 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/base/ModelObject.html#getLocalID--
632 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/foundation/MDObject.html#getID--
getID()634 returns UUID, which is unique both in the project and in the scope of the whole TWC server
repository.
The Teamwork Cloud imports (clones) the contents of used projects. This means copies of the elements
are created inside the project. While getLocalID()635 returns the same value for different
copies, getID()636 will return a unique value for each copy (project usage).
Example
If a project A is copied as a project A1, and a TWC project B uses both A and A1, getLocalID()637
returns the same value for corresponding elements of A and A1, but getID()638 returns different
identifiers for the same elements.
Tip
Both identifiers can be used to retrieve the element using the method
com.nomagic.magicdraw.core.Project.getElementByID(java.lang.String)639. Be aware that if
several elements exist in the project by the provided local ID, only a single one of them is
returned.
Related pages
633 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/base/ModelObject.html#getLocalID--
634 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/foundation/MDObject.html#getID--
635 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/base/ModelObject.html#getLocalID--
636 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/foundation/MDObject.html#getID--
637 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/base/ModelObject.html#getLocalID--
638 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/foundation/MDObject.html#getID--
639 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html#getElementByID-
java.lang.String-
For example:
Finding or creating Classifiers
A special utility class is available for search or creating Classifiers by metatype, simple or qualified name
- com.nomagic.magicdraw.uml.ClassifierFinder641
Related pages
640 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/Finder.html
641 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/ClassifierFinder.html
642 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
• byScope()644
• byType()645
• byTypeRecursively()646
Related pages
Visitors
Visitor design pattern is implemented in UML model structure. Every
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element647 has the accept(648AbstractVisitor649)
method for visiting it.
Just derive your class from com.nomagic.magicdraw.uml.InheritanceVisitor652 and override some visit...
methods and call accept(653AbstractVisitor654) for Elements655.
643 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/Finder.html
644 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/Finder.html#byScope--
645 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/Finder.html#byType--
646 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/Finder.html#byTypeRecursively--
647 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
648 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html#accept-
com.nomagic.magicdraw.uml.AbstractVisitor-
649 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/AbstractVisitor.html
650 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/impl/ModelVisitor.html
651 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
652 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/InheritanceVisitor.html
653 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html#accept-
com.nomagic.magicdraw.uml.AbstractVisitor-
654 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/AbstractVisitor.html
655 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
ModelHierarchyVisitor
The com.nomagic.uml2.impl.ModelHierarchyVisitor656 is an enhanced implementation of the Visitor
pattern and a subclass of com.nomagic.uml2.impl.ModelVisitor657, used for visiting model elements.
656 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/impl/ModelHierarchyVisitor.html
657 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/impl/ModelVisitor.html
658 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/reflect/VisitorContext.html
659 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/impl/ModelHierarchyVisitor.html#visitClassifier-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Classifier-com.nomagic.uml2.ext.jmi.reflect.VisitorContext-
660 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Classifier.html
661 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Classifier.html
662 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Class.html
663 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html#getClassType--
664 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/ClassTypes.html
665 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/RepresentationTextCreator.html
You can override default custom text creation for the specific element.
Related pages
666 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/RepresentationTextCreator.html
667 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/
RepresentationTextCreator.html#addProvider-
com.nomagic.magicdraw.uml.RepresentationTextCreator.RepresentationTextProvider-
668 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/
RepresentationTextCreator.RepresentationTextProvider.html
669 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/ElementIcon.html
670 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/ModelHelper.html
• The whole repository listener. You will get events about the changes in all the elements.
• The specific element listener. You will get events about the changes in any property of this
element.
• The element’s specific property listener. You will get events about the changes of this
property.
• The specific element type listener. You will get events about the changes in all the elements of
the specific metatype.
The transaction listener is notified, when all the changes within the session are done and the session is
closed.
671 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/InformationFlowHelper.html
672 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/InteractionHelper.html
673 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StateMachineHelper.html
674 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/UseCaseHelper.html
675 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/ConnectorsCollector.html
propertyChangeEvent.getPropertyName().equals(PropertyNames.NAME);
propertyChangeEvent.getNewValue() // will be new name of element;
propertyChangeEvent.getOldValue() // will be name of element before change.
propertyChangeEvent.getPropertyName().equals(UML2MetamodelConstants.INSTANCE_CREATED)
;
propertyChangeEvent.getNewValue() // will be new created element;
propertyChangeEvent.getOldValue() // will be null.
Related pages
676 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/impl/PropertyNames.html
677 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/impl/PrivatePropertyNames.html
• If the listener is registered at the whole repository, it receives events about the changes in all the
elements.
• If the listener is registered at the specific element, it receives events about the changes in any
property of this element.
• If the listener registered with the specific property at the element, it receives events about the
changes in this property.
• If the listener is registered with the specific property for the element type, it receives events
about the changes in all the elements of the specific type.
The java.beans.PropertyChangeListener should be registered to receive these events. There are several
different ways to register a listener:
project.getRepositoryListenerRegistry().addPropertyChangeListener(listener,
(RefObject)null);
This listener will get all the property change events from any element.
• To listen for any delete operation in the repository and get notified before the delete action is
performed, use:
project.getRepositoryListenerRegistry().addPropertyChangeListener(listener,
UML2MetamodelConstants.BEFORE_DELETE);
This listener will be notified, when any model element is set to be deleted.
element.addPropertyChangeListener(listener);
• To listen for any property changes of the specific element type, use:
678 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/UML2MetamodelConstants.html
This listener will be notified, when any property of any element in the project with this type is
changed. If “configs” is NULL, the listener will get all property change events.
project.getRepository().getEventSupport().isEnableEventFiring()
project.getRepository().getEventSupport().setEnableEventFiring(...)
These examples show, how to create the property change listeners to listen to the different kind of
properties.
element.addPropertyChangeListener(new PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent evt)
{
// evt.getPropertyName() is changed
}
});
Listener for listening to the specific property (NAME) of the specific element:
element.addPropertyChangeListener(new PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent evt)
{
if (PropertyNames.NAME.equals(evt.getPropertyName()))
{
// name is Changed
}
}
});
The SmartListenerConfig681class provides static methods for the default configuration of property chains.
This is useful, when listening for common property change events.
Example #2. Listen recursively to the owner's name and the "Is Abstract" property
679 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/smartlistener/
SmartPropertyChangeListener.html
680 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/smartlistener/SmartListenerConfig.html
681 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/smartlistener/SmartListenerConfig.html
682 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/smartlistener/
SmartPropertyChangeListener.html
683 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/smartlistener/SmartListenerConfig.html
SmartPropertyChangeListener.createSmartPropertyListener(element, new
PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent evt)
{
// the change event comes here
}
}, config);
684 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/transaction/TransactionCommitListener.html
685 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/transaction/TransactionCommitListener.html
686 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/transaction/
TransactionCommitListener.html#transactionCommited-java.util.Collection-
This “transaction commit listener” checks, if a new property is created in a classifier and updates the
classifier’s (a property owner) name. All changes are done in the same session.
Related pages
Using StereotypesHelper
Use utility class com.nomagic.uml2.ext.jmi.helpers.StereotypesHelper688 to work with profiles, stereotypes,
tagged values. Keep in mind that Tagged Values in this helper class are called Slots or stereotype
properties.
StereotypeHelper689provides API to check for stereotypes by a stereotype name. Try to avoid this
API and pass Stereotype as object if possible. In many models several profiles with stereotypes
with same names can be used and this "name based" API can cause unpredictable results.
So general rules are:
• Put URI for your profiles and find Profile in model by URI, not by profile name
• Find Stereotype element inside a specific Profile, not in a whole model
• Pass Stereotype element to StereotypesHelper690methods instead of passing a stereotype
name
687 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html
688 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html
689 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html
690 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html
StereotypesHelper.getProfile(694Project695, java.lang.String)696
StereotypesHelper.hasStereotype(702Element703)704
691 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getProfileByURI-com.nomagic.magicdraw.core.Project-java.lang.String-
692 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
693 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getProfileByURI-com.nomagic.magicdraw.core.Project-java.lang.String-
694 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html#getProfile-
com.nomagic.magicdraw.core.Project-java.lang.String-
695 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
696 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html#getProfile-
com.nomagic.magicdraw.core.Project-java.lang.String-
697 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html#getStereotype-
com.nomagic.magicdraw.core.Project-java.lang.String-com.nomagic.uml2.ext.magicdraw.mdprofiles.Profile-
698 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
699 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html#getStereotype-
com.nomagic.magicdraw.core.Project-java.lang.String-com.nomagic.uml2.ext.magicdraw.mdprofiles.Profile-
700 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/mdprofiles/Profile.html
701 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html#getStereotype-
com.nomagic.magicdraw.core.Project-java.lang.String-com.nomagic.uml2.ext.magicdraw.mdprofiles.Profile-
702 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html#hasStereotype-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
703 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
704 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html#hasStereotype-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
705 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html#hasStereotype-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
706 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
707 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html#hasStereotype-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
708 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html#hasStereotype-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
709 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html#hasStereotype-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
StereotypesHelper.hasStereotypeOrDerived(710Element711,712Stereotype713)714
Values of tagged values are returned as java.util.List even if upper multiplicity of tag 1. In this
case List will have zero or one object.
StereotypesHelper.getStereotypePropertyValue(715Element716,717Stereotype718, java.lang.String)719
StereotypesHelper.getStereotypePropertyFirst(720Element721,722Stereotype723, java.lang.String)724
710 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#hasStereotypeOrDerived-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
711 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
712 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#hasStereotypeOrDerived-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
713 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/mdprofiles/Stereotype.html
714 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#hasStereotypeOrDerived-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
715 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getStereotypePropertyValue-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-java.lang.String-
716 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
717 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getStereotypePropertyValue-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-java.lang.String-
718 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/mdprofiles/Stereotype.html
719 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getStereotypePropertyValue-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-java.lang.String-
720 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getStereotypePropertyFirst-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-java.lang.String-
721 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
722 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getStereotypePropertyFirst-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-java.lang.String-
723 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/mdprofiles/Stereotype.html
724 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getStereotypePropertyFirst-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-java.lang.String-
StereotypesHelper.getExtendedElements(730Stereotype731)732
For a concrete stereotype and derived stereotypes from it use
StereotypesHelper.getExtendedElementsIncludingDerived(733Stereotype734)735
StereotypesHelper.canApplyStereotype(736Element737,738Stereotype739)740
725 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#setStereotypePropertyValue-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-java.lang.String-java.lang.Object-
726 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
727 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#setStereotypePropertyValue-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-java.lang.String-java.lang.Object-
728 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/mdprofiles/Stereotype.html
729 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#setStereotypePropertyValue-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-java.lang.String-java.lang.Object-
730 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getExtendedElements-com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
731 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/mdprofiles/Stereotype.html
732 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getExtendedElements-com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
733 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getExtendedElementsIncludingDerived-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
734 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/mdprofiles/Stereotype.html
735 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#getExtendedElementsIncludingDerived-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
736 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#canApplyStereotype-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
737 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
738 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#canApplyStereotype-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
739 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/mdprofiles/Stereotype.html
740 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#canApplyStereotype-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
Sample
Element element = ....; //Element for which we add stereotype, set tag value and then
remove the stereotype.
Project project = ...; //Project
String tagValue = "test value";
Profile profile = StereotypesHelper.getProfile(project, "ProfileNameExample");
Stereotype stereotype = StereotypesHelper.getStereotype(project,
"StereotypeNameExample", profile);
StereotypesHelper.addStereotype(element, stereotype); //We add stereptype to element
StereotypesHelper.setStereotypePropertyValue(columnIds, stereotype, "TagName",
tagValue); //we set stereotype tag named "TagName"
StereotypesHelper.removeStereotype(element, stereotype); //we remove stereotype from
element
741 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#removeStereotype-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
742 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
743 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#removeStereotype-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
744 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/mdprofiles/Stereotype.html
745 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#removeStereotype-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
746 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#addStereotype-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
747 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
748 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#addStereotype-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
749 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/mdprofiles/Stereotype.html
750 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/
StereotypesHelper.html#addStereotype-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype-
751 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/helpers/StereotypesHelper.html
To create your own custom profile implementation you need to follow these steps
It is highly recommended to assign URI to Profile element in the UML model before generation.
URI is an unique Profile identifier and helps to avoid conflicts if model has several profiles with
same name applied.
Usages example
Related pages
MagicDraw plugins (like SysML) can also expose implementations of profiles. Check their APIs.
752 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/MagicDrawProfile.html
753 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/StandardProfile.html
754 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ValidationProfile.html
Related pages
In version 17.0.1, an element created using the EMF factory will be placed in the repository that does
not belong to any project. The created object will be automatically added into the project’s repository
after it will be added into the container that is in the project’s repository.
All UML model elements are directly or indirectly contained by EMF resources. Resource of an element
can be retrieved in the standard way:
Element element;
org.eclipse.emf.ecore.resource.Resource resource = element.eResource();
There is no strict definition how EMF resources are organized in MagicDraw project. It depends on the
project type (local, from Teamwork Server or from the Teamwork Cloud server).
Related pages
755 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/metadata/UMLPackage.html
756 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/metadata/UMLFactory.html
There are 17 predefined types of diagrams (13 creatable and 4 not). Creatable diagrams are:
• Class
• Use Case
• Object
• Communication
• Sequence
• State Machine
• Protocol State Machine
• Activity
• Composite Structure
• Component
• Deployment
• Package
• Profile
• Interaction
• Behavior
• Any
• Static
Communication and Sequence diagrams are subdiagrams of the Interaction diagram. Activity,
Interaction, State Machine, and Protocol State Machine diagrams are subdiagrams of the Behavior
diagram.
Related pages
• getDiagramTypeId()759– this method must return a diagram type id, which is used to identify the
diagram
• getSingularDiagramTypeHumanName()760 – the method returns the diagram type human name
• getPluralDiagramTypeHumanName()761 – the method returns the diagram type human name in a
plural form
• getSuperType()762 – this method must return a super type (super diagram) of this diagram type
• isCreatable()763 – returns the flag indicating if this diagram type is creatable
• getSVGIcon()764 – returns a large icon for this type of the diagram (see Adding New Functionality
(see page 2110))
• getSmallIconURL()765 – returns a small icon URL for this type of the diagram (see Adding New
Functionality (see page 2110))
• getDiagramActions()766 – returns the manager of actions used in the diagram
• getDiagramToolbarConfigurator()767 – returns the action manager configurator which configures
the described diagram toolbar (see Adding New Functionality (see page 2110))
757 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/DiagramDescriptor.html
758 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/DiagramDescriptor.html
759 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/DiagramDescriptor.html#getDiagramTypeId--
760 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/
DiagramDescriptor.html#getSingularDiagramTypeHumanName--
761 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/
DiagramDescriptor.html#getPluralDiagramTypeHumanName--
762 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/DiagramDescriptor.html#getSuperType--
763 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/DiagramDescriptor.html#isCreatable--
764 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/DiagramDescriptor.html#getSVGIcon--
765 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/DiagramDescriptor.html#getSmallIconURL--
766 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/
DiagramDescriptor.html#getDiagramActions--
767 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/
DiagramDescriptor.html#getDiagramToolbarConfigurator--
For the full source code, see the Open API examples in <program installation
directory>\openapi\examples.
768 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/
DiagramDescriptor.html#getDiagramShortcutsConfigurator--
769 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/
DiagramDescriptor.html#getDiagramContextConfigurator--
/**
* Let this diagram type be a sub type of a class diagram type.
*/
public String getSuperType()
{
return DiagramType.UML_CLASS_DIAGRAM;
}
/**
* This is a creatable diagram.
*/
public boolean isCreatable()
{
return true;
}
/**
* Actions used in this diagram.
*/
public MDActionsManager getDiagramActions()
{
return SpecificDiagramActions.ACTIONS;
}
/**
* A configurator for a diagram toolbar.
*/
public AMConfigurator getDiagramToolbarConfigurator()
{
return new SpecificDiagramToolbarConfigurator();
}
/**
* A configurator for diagram shortcuts.
*/
public AMConfigurator getDiagramShortcutsConfigurator()
{
return new ClassDiagramShortcutsConfigurator();
}
/**
* A configurator for a diagram shortcut menu.
*/
public DiagramContextAMConfigurator getDiagramContextConfigurator()
{
return new BaseDiagramContextAMConfigurator();
}
/**
* A diagram type human name.
*/
public String getSingularDiagramTypeHumanName()
{
return "Specific Diagram";
}
/**
* A diagram type human name in a plural form.
*/
public String getPluralDiagramTypeHumanName()
{
return "Specific Diagrams";
}
/**
* Resizable svg icon for diagram.
*/
public ResizableIcon getSVGIcon()
{
ResizableIcon icon = null;
try
{
icon = IconsFactory.getSvgIcon(new File("icons/
specificdiagram.svg").toURI().toURL());
}
catch(Exception e){e.printStackTrace();}
return icon;
}
/**
* URL to a small icon for a diagram.
*/
public URL getSmallIconURL()
{
return getClass().getResource("icons/specificdiagram.svg");
}
}
For the full source code, see the Open API examples in <program installation
directory>\openapi\examples\specificdiagram.
770 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Application.html#addNewDiagramType-
com.nomagic.magicdraw.uml.DiagramDescriptor-
771 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/DiagramDescriptor.html
Related pages
A current version of Open API provides just a basic structure of presentation elements:
772 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
773 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
774 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html
775 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
776 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramPresentationElement.html
777 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
778 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#getBounds--
779 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
780 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#getElement--
781 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
782 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/shapes/TextBoxView.html
783 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#getPresentationElements--
784 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#getProperty-java.lang.String-
785 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#getPropertyManager--
786 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/shapes/ShapeElement.html
787 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#isSelected--
788 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#setSelected-boolean-
Related pages
The purpose of this presentation element is to manage all other presentation elements used in a
Diagram:
Shapes
Shapes are presentation elements created for such model elements as classes, packages, models,
subsystems and others.
789 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/paths/PathConnector.html
790 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/paths/
PathConnector.html#getConnectedPathElements--
791 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramPresentationElement.html
792 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
793 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
794 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramPresentationElement.html
795 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html#getDiagram-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
796 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
797 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html#getDiagram-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
798 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#getPresentationElements--
799 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#open--
800 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/PresentationElementsManager.html
Contents
Paths are presentation elements created for such model elements as Relationships. Path has the
following attributes:
Contents
Use only getter in Presentation elements’ classes even if setters are available. Setters are not part of
OpenAPI and in most cases should not be called directly.
801 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/paths/
PathElement.html#getSupplier--
802 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/paths/PathElement.html#getClient--
803 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/paths/
PathElement.html#getSupplierPoint--
804 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/paths/
PathElement.html#getClientPoint--
805 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/paths/
PathElement.html#getBreakPoints--
806 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/PresentationElementsManager.html
PresentationElementManager809can be used only in already loaded and active project. In other cases,
results can be unpredictable.
Related pages
Related pages
807 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/PresentationElementsManager.html
808 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/SessionManager.html
809 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/PresentationElementsManager.html
810 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/PresentationElementsManager.html
811 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
PresentationElementsManager.html#getInstance--
812 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/shapes/ShapeElement.html
813 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramPresentationElement.html
Related pages
814 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/paths/PathElement.html
815 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
PresentationElementsManager.html#createPathElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.uml.symbols.PresentationElement-
com.nomagic.magicdraw.uml.symbols.PresentationElement-
816 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
817 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
818 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
819 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
PresentationElementsManager.html#createPathElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.uml.symbols.PresentationElement-
com.nomagic.magicdraw.uml.symbols.PresentationElement-
820 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
821 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
822 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
Every shape element has a preferred size. The shape size cannot be smaller than the preferred size. If
you will try to set smaller bounds, these bounds will be increased to the preferred size.
If shape has the Autosize property set to TRUE, bounds will be reduced to the preferred size.
Related pages
PresentationElementManager.getInstance().movePresentationElement(PresentationElement
view, Point location)
823 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/shapes/ShapeElement.html
824 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
PresentationElementsManager.html#reshapeShapeElement-
com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement-java.awt.Rectangle-
825 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/shapes/ShapeElement.html
826 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
PresentationElementsManager.html#reshapeShapeElement-
com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement-java.awt.Rectangle-
Related pages
Related pages
The order of points in the list must be from the supplier to client connection point. The list may or may
not include the client and supplier connection points. At first the given points list will be adopted for the
current path style (Rectilinear, Bezier. or Oblique) and only then applied for the path.
Related pages
827 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
PresentationElementsManager.html#changePathBreakPoints-
com.nomagic.magicdraw.uml.symbols.paths.PathElement-java.util.List-
828 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/paths/PathElement.html
829 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
PresentationElementsManager.html#changePathBreakPoints-
com.nomagic.magicdraw.uml.symbols.paths.PathElement-java.util.List-
830 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
831 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
PresentationElementsManager.html#deletePresentationElement-
com.nomagic.magicdraw.uml.symbols.PresentationElement-
832 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
Related pages
• To check if an element has some properties (or uses properties from its parent), use the method
com.nomagic.magicdraw.uml.symbols.PresentationElement.useParentProperties()833.
• To get all properties of this element, use the method PresentationElement.getPropertyManager()834.
• To get a property of this element with a given ID, use the method
com.nomagic.magicdraw.uml.symbols.PresentationElement.getProperty(java.lang.String)835.
• To change element properties, use the method
com.nomagic.magicdraw.openapi.uml.PresentationElementsManager.setPresentationElementPropertie
s(836PresentationElement837, PropertyManager838). The given
com.nomagic.magicdraw.properties.PropertyManager839 can have only few element’s properties (for
example, just properties you want to change).
The Ids of all used properties are defined in the class com.nomagic.magicdraw.properties.PropertyID840.
Look at Properties (see page 2214) page for more details about properties structure.
There is no information about what exactly properties every presentation element has. Use
java debugger and analyze PresentationElement.getPropertyManager()841 object. You can also
guess property ID from the Symbol Properties name.
If you want to change a value of existing property, recommendation would be clone that
property, change value for a clone and set it. Don't use constructor if possible.
833 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#useParentProperties--
834 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#getPropertyManager--
835 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#getProperty-java.lang.String-
836 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/openapi/uml/
PresentationElementsManager.html#setPresentationElementProperties-
com.nomagic.magicdraw.uml.symbols.PresentationElement-
com.nomagic.magicdraw.properties.PropertyManager-
837 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
838 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/PropertyManager.html
839 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/PropertyManager.html
840 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/PropertyID.html
841 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElement.html#getPropertyManager--
PresentationElementsManager.getInstance().setPresentationElementProperties(element,
properties);
SessionManager.getInstance().closeSession(project);
The properties must be new instances. You cannot do something like this:
PresentationElementsManager.getInstance().setPresentationElementProperties(ele
ment, properties);
SessionManager.getInstance().closeSession(project);
Related pages
Managing compartments
Some presentation elements displays information in so called compartments. For example UML Class
shape has attributes, operations, ports compartments.
Compartments can show only a subset of information. The rest information can be hidden. For
example show only a couple of specific Operations on a Class shape in the diagram.
842 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/CompartmentManager.html
843 http://jdocs.nomagic.com/190beta/
Keep in mind that diagrams in MagicDraw uses lazy content loading approach. It means that content
(presentation elements) are loaded only on demand. For example when diagram is opened.
Use SymbolElementMap
Presentation elements can be collected only from loaded diagrams. If diagram is not loaded,
presentation elements of this diagram are not registered in a map.
Load diagram using
com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.ensureLoaded()845
Find element usages in loaded and not loaded diagrams (do not load diagrams)
Use this approach if you are not sure if presentation element exists in a diagram. This approach checks
existing of presentation elements without loading a diagram.
DiagramPresentationElement846 API provides very useful methods for that. This API works both in loaded
and not loaded diagrams.
844 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html#getSymbolElementMap--
845 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#ensureLoaded--
846 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramPresentationElement.html
847 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#getUsedModelElements-boolean-
848 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#isElementInDiagram-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
849 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
Use this approach only if you are sure that presentation element of Element exists in diagram, because
diagram will be loaded always.
850 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#isElementInDiagram-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
851 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
852 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#ensureLoaded--
853 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#ensureLoaded--
854 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html#getSymbolElementMap--
855 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#findPresentationElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-java.lang.Class-
856 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
857 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#findPresentationElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-java.lang.Class-
858 http://jdocs.nomagic.com/190beta/
859 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DisplayRelatedSymbols.html
PresentationElement view = ...; // A symbol for which you need to invoke the
displaying related symbols action.
DisplayRelatedSymbols.displayRelatedSymbols(view, info);
sessionManager.closeSession(project);
Related pages
• com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement.layout(boolean)860
• DiagramPresentationElement.layout(boolean,861DiagramLayouter862)863
860 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#layout-boolean-
861 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#layout-boolean-
com.nomagic.magicdraw.uml.symbols.layout.DiagramLayouter-
862 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/layout/DiagramLayouter.html
863 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#layout-boolean-
com.nomagic.magicdraw.uml.symbols.layout.DiagramLayouter-
Make sure the diagram is opened and the session is closed before doing a diagram layout.
These are the current limitation of layout API
Related pages
1. Renderer provider API, which allows to provide a custom renderer for the specific presentation
element.
2. Renderers, which can modify the default presentation element appearance.
In this section, we will review, how to register the specific presentation element views provider and give
the example covering the custom renderers for the package, slots, and dependency link symbols.
Related pages
864 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#layout-boolean-
com.nomagic.magicdraw.uml.symbols.layout.DiagramLayouter-
com.nomagic.magicdraw.core.options.AbstractDiagramLayouterOptionsGroup-
865 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/layout/DiagramLayouter.html
866 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#layout-boolean-
com.nomagic.magicdraw.uml.symbols.layout.DiagramLayouter-
com.nomagic.magicdraw.core.options.AbstractDiagramLayouterOptionsGroup-
867 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/options/
AbstractDiagramLayouterOptionsGroup.html
868 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
DiagramPresentationElement.html#layout-boolean-
com.nomagic.magicdraw.uml.symbols.layout.DiagramLayouter-
com.nomagic.magicdraw.core.options.AbstractDiagramLayouterOptionsGroup-
To make your provider start working, you must register it into the
com.nomagic.magicdraw.uml.symbols.PresentationElementRendererManager873 using:
PresentationElementRendererManager.getInstance().addProvider(new RendererProvider());
• A custom renderer for the package. (see page 2201) The package without inner elements is filled
with a green color.
• A custom renderer for the slot. (see page 2201) The slot values are rounded.
• A custom renderer for the dependency link. (see page 2202) The dependency link is a blue thicker
line with custom line ends.
This example shows, how to create custom renderers for the preceding pointed symbols.
869 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElementRendererProvider.html
870 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElementRendererProvider.html#getRenderer-
com.nomagic.magicdraw.uml.symbols.PresentationElement-
871 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
872 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
873 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElementRendererManager.html
874 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElementRenderer.html
The custom slot renderer (used in the instance specification symbol). The slot values are rounded:
The custom dependency link renderer. The dependency link is a blue thicker line with custom line
ends:
875 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/
PresentationElementRendererManager.html
RendererProvider()
{
slotRenderer = new SlotRenderer();
dependencyRenderer= new DependencyRenderer();
packageRenderer = new PackageRenderer();
}
return null;
}
};
PresentationElementRendererManager.getInstance().addProvider(new
RendererProvider());
Project project = ;
DiagramPresentationElement diagram = project.getActiveDiagram();
List<PresentationElement> selected = diagram.getSelected();
presentationElement.setSelected(true);
Presentation element selection events (see page 2208) page describes selection change events
Related pages
876 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
new DiagramListenerAdapter(propertyChangeListener)
To start using the adapter, install it. Uninstall it when it is no longer necessary, that is, you do not need
to receive any events about diagram changes anymore.
adapter.install(project);
877 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramListenerAdapter.html
878 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramListenerAdapter.html
879 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramListenerAdapter.html
880 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/ExtendedPropertyNames.html
Project prj = ;
prj.addPropertyChangeListener(new PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent evt)
{
if (evt.getPropertyName(). equals(Project.SELECTION_CHANGED))
{
// was selected
List old = (List)evt.getOldValue();
// now selected
List news = (List)evt.getNewValue();
// do something
}
}
});
881 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/SymbolDrawNotification.html
882 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramSurface.html
883 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramSurface.html
Application.getInstance().addProjectEventListener(new ProjectEventListenerAdapter()
{
public void projectOpened(Project project)
{
project.addPropertyChangeListener(new PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent evt)
{
if(evt.getPropertyName().equals(Project.DIAGRAM_OPENED))
{
DiagramPresentationElement diagram =
Application.getInstance().getProject().getActiveDiagram();
diagram.getDiagramSurface().addPainter(new DiagramSurfacePainter()
{
public void paint(Graphics g, DiagramPresentationElement diagram)
{
g.setColor(Color.BLUE);
List symbols = diagram.getPresentationElements();
for (int i = 0; i < symbols.size(); i++)
{
PresentationElement o = (PresentationElement)symbols.get(i);
if( o instanceof ShapeElement)
{
Rectangle bounds = o.getBounds();
bounds.grow(5,5);
((Graphics2D)g).draw(bounds);
}
}
};
});
}
}
});
}
});
To create an image from the whole diagram, use the export(886DiagramPresentationElement887, int,
java.io.File)888method.
These default handlers creates new presentation elements, changes the properties of elements and
etc. Same is true if presentation elements are dropped on top of other presentation elements.
API allows to register a custom DnD handler for doing some specific things using DnD mechanism.
• Use com.nomagic.magicdraw.ui.dnd.CustomDropDiagramHandlerFactory.register(892CustomDragAnd
DropHandler893) to register a handler for dropping elements from browser(trees).
884 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/export/image/ImageExporter.html
885 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/export/image/ImageExporter.html
886 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/export/image/ImageExporter.html#export-
com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement-int-java.io.File-
887 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramPresentationElement.html
888 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/export/image/ImageExporter.html#export-
com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement-int-java.io.File-
889 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/export/image/ImageExporter.html#export-
com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement-int-java.io.File-boolean-
890 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/DiagramPresentationElement.html
891 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/export/image/ImageExporter.html#export-
com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement-int-java.io.File-boolean-
892 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/dnd/
CustomDropDiagramHandlerFactory.html#register-
com.nomagic.magicdraw.ui.dnd.CustomDragAndDropHandler-
893 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/dnd/CustomDragAndDropHandler.html
Use com.nomagic.magicdraw.ui.ElementActivationManager.addActivator(897ElementActivator898)899 for
that purpose.
It is also possible to register your own hyperlink handler for some custom hyperlink type.
894 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/dnd/
CustomShapeMoveHandlerFactory.html#register-
com.nomagic.magicdraw.ui.dnd.CustomDragAndDropHandler-
895 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/dnd/CustomDragAndDropHandler.html
896 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/dnd/
CustomShapeMoveHandlerFactory.html#register-
com.nomagic.magicdraw.ui.dnd.CustomDragAndDropHandler-
897 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/ElementActivationManager.html#addActivator-
com.nomagic.magicdraw.ui.ElementActivator-
898 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/ElementActivator.html
899 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/ElementActivationManager.html#addActivator-
com.nomagic.magicdraw.ui.ElementActivator-
Related pages
MDEL hyperlink
MagicDraw has a functionality to expose every element as URL. Later this URL can be added into
external documents. Also that URL can be used to open/activate an element in a project.
Use com.nomagic.magicdraw.hyperlinks.HyperlinksHandlersRegistry.addHandler(903HyperlinkHandler904)905
to add a custom handler.
900 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/hyperlinks/HyperlinkUtils.html
901 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/hyperlinks/Hyperlink.html
902 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/hyperlinks/HyperlinkUtils.html
903 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/hyperlinks/
HyperlinksHandlersRegistry.html#addHandler-com.nomagic.magicdraw.hyperlinks.HyperlinkHandler-
904 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/hyperlinks/HyperlinkHandler.html
905 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/hyperlinks/
HyperlinksHandlersRegistry.html#addHandler-com.nomagic.magicdraw.hyperlinks.HyperlinkHandler-
4.8 Properties
In modeling tools, No Magic Inc. Open API provides a set of classes used as properties for diagrams’
symbols, project or environment options and etc.
Every property has two major attributes – the ID and value. A property has a value of the type
java.lang.Object. Every specific property has a value of the specific type. For example, the value of
com.nomagic.magicdraw.properties.BooleanProperty906 is java.lang.Boolean, the value of
a com.nomagic.magicdraw.properties.StringProperty907 is java.lang.String.
For more details about every specific kind of a property, see javadoc915.
Related pages
906 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/BooleanProperty.html
907 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/StringProperty.html
908 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/PropertyResourceProvider.html
909 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/PropertyResourceProvider.html
910 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/
PropertyResourceProvider.html#getString-java.lang.String-com.nomagic.magicdraw.properties.Property-
911 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/Property.html
912 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/
PropertyResourceProvider.html#getString-java.lang.String-com.nomagic.magicdraw.properties.Property-
913 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/PropertyManager.html
914 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/PropertyManager.html
915 http://jdocs.nomagic.com/190beta/
The following sample presents the content of the configuration file. It configures the logger to print
INFO category messages to a console with a specific pattern.
log4j.appender.SO=org.apache.log4j.ConsoleAppender
log4j.appender.SO.layout=org.apache.log4j.PatternLayout
log4j.appender.SO.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.rootCategory=INFO,SO
You can add custom environment options for your modeling tool.
916 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/options/AbstractPropertyOptionsGroup.html
4.11 Browser
The Model Browser (Containment tree, Diagrams tree, etc.) is a based GUI part for displaying various
model trees and panels
The browser has five trees by default (some of them are be default hidden):
• containment
• diagrams
• inheritance
• extensions
• search results
The browser has 3 panel by default
• documentation
• properties
• zoom
Every tree is based on Swing JTree and all manipulations can be done by using the API provided by
Swing:
Related pages
The text can be changed using a custom representation provider as described in Creating textual
element representation (see page 2158). Using this approach, the text will be changed everywhere in UI,
not just in trees.
Use com.nomagic.magicdraw.ui.browser.TreeNodeAdornmentManager.addIconAdornment(922IconAdornme
nt923) to register a node icon customizer.
917 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/browser/Browser.html#getContainmentTree--
918 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/browser/Tree.html#openNode-
com.nomagic.magicdraw.uml.BaseElement-
919 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/browser/Browser.html#addBrowserInitializer-
com.nomagic.magicdraw.ui.browser.Browser.BrowserInitializer-
920 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/browser/Browser.BrowserInitializer.html
921 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/browser/Browser.html#addBrowserInitializer-
com.nomagic.magicdraw.ui.browser.Browser.BrowserInitializer-
922 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/browser/
TreeNodeAdornmentManager.html#addIconAdornment-com.nomagic.magicdraw.ui.IconAdornment-
923 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/IconAdornment.html
924 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/browser/
TreeNodeAdornmentManager.html#addTextAdornment-com.nomagic.magicdraw.ui.browser.TextAdornment-
925 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/browser/TextAdornment.html
926 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/browser/
TreeNodeAdornmentManager.html#addTextAdornment-com.nomagic.magicdraw.ui.browser.TextAdornment-
927 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/dialogs/specifications/
SpecificationDialogManager.html
928 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/dialogs/specifications/configurator/
ISpecificationNodeConfigurator.html
929 http://jdocs.nomagic.com/190beta/
Error dialog
Use GUILog.showError(java.lang.String)931
930 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html
931 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#showError-java.lang.String-
932 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#showError-java.awt.Frame-
java.lang.String-java.lang.Throwable-
Use GUILog.showWarning(java.lang.String)933
Question dialog
Use GUILog.showQuestion(java.lang.String)934
Message dialog
Use GUILog.showMessage(java.lang.String)935
See Showing notifications, adding text into Message Window (see page 2220) for more information about
showing Notifications and appending text into a Message Window
Related pages
• Showing notifications, adding text into Message Window (see page 2220)
NotificationManager
This is an entry point to display notifications in MagicDraw. Two types of notifications can be displayed:
application level and container level. Container lever notifications are displayed in special container that
implements com.nomagic.ui.notification.NotificationsContainer940 interface.
Use com.nomagic.magicdraw.ui.notification.NotificationManage.941
933 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#showWarning-java.lang.String-
934 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#showQuestion-java.lang.String-
935 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#showMessage-java.lang.String-
936 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#showHTMLMessage-
java.lang.String-com.nomagic.magicdraw.core.GUILog.URLActionHandler-
937 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.URLActionHandler.html
938 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#log-java.lang.String-
939 http://jdocs.nomagic.com/190beta/
940 http://jdocs.nomagic.com/190beta/com/nomagic/ui/notification/NotificationsContainer.html
941 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/notification/NotificationManager.html
GUILog
Related pages
942 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#log-java.lang.String-
943 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/notification/Notification.html#getContext--
944 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#log-java.lang.String-
945 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#log-
com.nomagic.magicdraw.ui.notification.Notification-boolean-
946 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/notification/Notification.html
947 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#log-
com.nomagic.magicdraw.ui.notification.Notification-boolean-
948 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/GUILog.html#openLog--
949 http://jdocs.nomagic.com/190beta/
950 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/
MenuCreatorFactory.html#getMenuCreator--
Related pages
• Use com.nomagic.magicdraw.ui.ProjectWindowsManager.ConfiguratorRegistry.addConfigurator(959Pro
jectWindowsConfigurator960) to register project window configurator.
• Implement com.nomagic.magicdraw.ui.ProjectWindowsConfigurator961 and add window using
ProjectWindowsManager.addWindow(962ProjectWindow963)964.
951 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsMenuCreator.html#createPopupMenu-
com.nomagic.actions.ActionsManager-
952 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsManager.html
953 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsManager.html
954 http://jdocs.nomagic.com/190beta/com/nomagic/actions/NMAction.html
955 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsCategory.html
956 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsManager.html
957 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsMenuCreator.html#createPopupMenu-
com.nomagic.actions.ActionsManager-
958 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsManager.html
959 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/
ProjectWindowsManager.ConfiguratorRegistry.html#addConfigurator-
com.nomagic.magicdraw.ui.ProjectWindowsConfigurator-
960 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/ProjectWindowsConfigurator.html
961 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/ProjectWindowsConfigurator.html
962 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/ProjectWindowsManager.html#addWindow-
com.nomagic.magicdraw.ui.ProjectWindow-
963 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/ProjectWindow.html
964 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ui/ProjectWindowsManager.html#addWindow-
com.nomagic.magicdraw.ui.ProjectWindow-
The Open API of modeling tools developed by No Magic Inc. provides the
com.nomagic.generictable.GenericTableManager965 class for creating and manipulating generic tables.
This API is used for creating a generic table, adding, editing, and removing table columns and rows, as
well as getting cell values.
965 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html
966 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#createGenericTable-
com.nomagic.magicdraw.core.Project-java.lang.String-
967 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
968 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#createGenericTable-
com.nomagic.magicdraw.core.Project-java.lang.String-
969 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/
GenericTableManager.html#setTableElementTypes-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-java.util.List-
970 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
971 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/
GenericTableManager.html#setTableElementTypes-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-java.util.List-
List<Object> setElementTypes =
GenericTableManager.getTableElementTypes(createdDiagram);
To get all possible columns from the generic table, use the
GenericTableManager.getPossibleColumnIDs(977Element978) method. To get set columns for the generic
table, use the GenericTableManager.getColumnIds(979Diagram980) method.
972 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/
GenericTableManager.html#getTableElementTypes-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
973 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
974 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#addColumnsById-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-java.util.List-
975 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
976 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#addColumnsById-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-java.util.List-
977 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/
GenericTableManager.html#getPossibleColumnIDs-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
978 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
979 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#getColumnIds-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
980 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
981 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#getColumnIds-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
982 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
983 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#getCellValue-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-java.lang.String-
984 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
985 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#getCellValue-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-java.lang.String-
986 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
987 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#getCellValue-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-java.lang.String-
988 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#getColumnNames-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
989 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
990 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#getColumnNames-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
To get visible row elements from the generic table, use the
GenericTableManager.getVisibleRowElements(996Diagram997) method:
991 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/
GenericTableManager.html#getColumnNameById-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-java.lang.String-
992 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
993 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/
GenericTableManager.html#getColumnNameById-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-java.lang.String-
994 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#getRowElements-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
995 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
996 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/
GenericTableManager.html#getVisibleRowElements-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
997 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
GenericTableManager.addRowElement(createdDiagram, element);
The element you want to add must be of the same type as one of generic table filter types.
GenericTableManager.removeRowElement(createdDiagram, element);
On this page
998 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#addRowElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
999 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
1000 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#addRowElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
1001 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1002 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/GenericTableManager.html#addRowElement-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
1003 http://jdocs.nomagic.com/190beta/com/nomagic/generictable/
GenericTableManager.html#removeRowElement-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Diagram-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
1004 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Diagram.html
1005 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
Related pages
1. Create a new plugin to register components of the new dependency matrix type. (see page 2228)
2. Register the new dependency matrix type that it was added to modeling tool toolbars and menus
(see page 2229).
1006 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixConfigurator.html
@Override
public boolean close()
{
return true;
}
@Override
public boolean isSupported()
{
return true;
}
}
Remember the name of the new dependency matrix type that you pass as an argument while
creating a new instance of the DependencyMatrixConfigurator1007class (in the preceding
example, it is “Sample Extended Matrix”). You will have to specify the exact name when
registering a new diagram type.
1007 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixConfigurator.html
5. In the Abbreviation box, specify the abbreviation of the new dependency matrix type.
6. Click Finish.
For more information on how to customize a new dependency matrix type by using
the Customize Dependency Matrix Wizard dialog, see “Creating New Dependency Matrix
Type” in the MagicDraw UMLProfiling&DSL UserGuide.pdf.
1008 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixConfigurator.html
ActionsConfiguratorsManager.getInstance().addDiagramCommandBarConfigurator(
DependencyMatrixConfigurator.DEFAULT_DEPENDENCY_MATRIX_DIAGRAM_TYPE, new
AMConfigurator()
{
@Override
public void configure(ActionsManager mngr)
{
mngr.addCategory(new ActionsCategory("ID", "My Category"));
}
@Override
public int getPriority()
{
return AMConfigurator.HIGH_PRIORITY;
}
});
When customizing the default dependency matrix type, provide the name defined in the
com.nomagic.magicdraw.dependencymatrix.configuration.DependencyMatrixConfigurator.DEFAULT_D
EPENDENCY_MATRIX_DIAGRAM_TYPE1011 constant. And when customizing a custom dependency matrix
type, provide the name defined in the instance of the DependencyMatrixConfigurator1012class as well as
in the Customize Dependency Matrix Wizard dialog.
The same code example can be used for the shortcut key configuration:
ActionsConfiguratorsManager.getInstance().addDiagramShortcutsConfigurator(...)
1009 http://jdocs.nomagic.com/190beta/com/nomagic/actions/AMConfigurator.html
1010 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/actions/ActionsConfiguratorsManager.html
1011 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixConfigurator.html#DEFAULT_DEPENDENCY_MATRIX_DIAGRAM_TYPE
1012 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixConfigurator.html
The com.nomagic.magicdraw.dependencymatrix.configuration.DependencyMatrixAMConfigurator1014
interface has a single method that adds custom commands. The location of a new command depends
on the parameters, such as the following:
• If the collection of elements is empty, the command will be added to the shortcut menu of the
filter panel.
• If the collection of elements is not empty and forRow is true, the command will be added to the
shortcut menu of the row header element.
• If the collection of elements is not empty and forRow is false the command will be added to the
shortcut menu of the column header element.
1013 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixActionRegistry.html
1014 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixAMConfigurator.html
1015 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
DependencyExtractor.html
1016 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixConfigurator.html#configureDependencyHandlers-java.util.Collection-java.util.Collection-
1017 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
DependencyExtractor.html
1018 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixConfigurator.html#configureDependencyHandlers-java.util.Collection-java.util.Collection-
1019 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html
Dependency matrix cells with the default renderer can be displayed either as editable or as read-only. If
it is possible to create or delete at least one dependency in the cell, the cell is displayed as editable, that
is, filled with white.
1020 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
DependencyExtractor.html#getDependencies-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
1021 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1022 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1023 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
DependencyEntry.html
1024 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html
1025 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixConfigurator.html#configureDependencyHandlers-java.util.Collection-java.util.Collection-
1026 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
DependencyExtractor.html
1027 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixConfigurator.html#configureDependencyHandlers-java.util.Collection-java.util.Collection-
1028 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html
1029http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html#canCreate-
com.nomagic.magicdraw.dependencymatrix.persistence.PersistenceManager-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell-
1030 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/persistence/
PersistenceManager.html
1031 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1032 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1033 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
AbstractMatrixCell.html
1034http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html#createAddActions-
com.nomagic.magicdraw.dependencymatrix.persistence.PersistenceManager-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell-
com.nomagic.actions.ActionsCategory-com.nomagic.actions.ActionsCategory-
com.nomagic.actions.ActionsCategory-
1035 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/persistence/
PersistenceManager.html
1036 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1037 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1038 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
AbstractMatrixCell.html
1039 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsCategory.html
1040 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsCategory.html
1041 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsCategory.html
1042http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html#canEdit-
com.nomagic.magicdraw.dependencymatrix.persistence.PersistenceManager-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell-
1043 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/persistence/
PersistenceManager.html
1044 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1045 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1046 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
AbstractMatrixCell.html
1047http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html#createEditActions-
com.nomagic.magicdraw.dependencymatrix.persistence.PersistenceManager-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell-
com.nomagic.actions.ActionsCategory-com.nomagic.actions.ActionsCategory-
1048 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/persistence/
PersistenceManager.html
1049http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html#createEditActions-
com.nomagic.magicdraw.dependencymatrix.persistence.PersistenceManager-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell-
com.nomagic.actions.ActionsCategory-com.nomagic.actions.ActionsCategory-
1050 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1051http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html#createEditActions-
com.nomagic.magicdraw.dependencymatrix.persistence.PersistenceManager-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell-
com.nomagic.actions.ActionsCategory-com.nomagic.actions.ActionsCategory-
1052 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1053http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html#createEditActions-
com.nomagic.magicdraw.dependencymatrix.persistence.PersistenceManager-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell-
com.nomagic.actions.ActionsCategory-com.nomagic.actions.ActionsCategory-
1054 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
AbstractMatrixCell.html
1055http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html#createEditActions-
com.nomagic.magicdraw.dependencymatrix.persistence.PersistenceManager-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell-
com.nomagic.actions.ActionsCategory-com.nomagic.actions.ActionsCategory-
1056 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsCategory.html
1057http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html#createEditActions-
com.nomagic.magicdraw.dependencymatrix.persistence.PersistenceManager-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell-
com.nomagic.actions.ActionsCategory-com.nomagic.actions.ActionsCategory-
1058 http://jdocs.nomagic.com/190beta/com/nomagic/actions/ActionsCategory.html
1059http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/editing/
DependencyEditor.html#createEditActions-
com.nomagic.magicdraw.dependencymatrix.persistence.PersistenceManager-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element-
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell-
com.nomagic.actions.ActionsCategory-com.nomagic.actions.ActionsCategory-
• A cell renderer
• A column header cell renderer
• A row header cell renderer
To register a cell renderer component, use the instance of the
com.nomagic.magicdraw.dependencymatrix.configuration.DependencyMatrixConfigurator1060 class, created
while registering a custom dependency matrix. All these renderers should implement the standard
javax.swing.table.TableCellRenderer interface.
The cell renderer is used to represent dependencies in a dependency matrix. The renderer component
of a single cell gets either the value of the Integer class or the instance of the
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.MatrixCellView1061 class. The java.lang.Integer
class represents dependency count. And the MatrixCellView1062class has a reference to the
com.nomagic.magicdraw.dependencymatrix.datamodel.cell.AbstractMatrixCell1063 class, which has all the
information about the dependencies in the cell.
The row and column cell renderers works the same way. To get the particular row or column header
element inside the cell, use
the com.nomagic.magicdraw.dependencymatrix.ui.table.renderer.RendererHelper.getHeaderElement(javax.sw
ing.JTable, int, int)1064 method.
The MatrixDataHelper1066class has three methods that are to be used to access data of the matrix. First
of all you must check, if the matrix is already built (building the matrix means collecting all the needed
data from the model). In some cases, when settings are changed or a lot of model changes occur, you
have to rebuild the matrix to get the up-to-date information. Thus the best pattern to use is as follows:
1060 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
DependencyMatrixConfigurator.html
1061 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
MatrixCellView.html
1062 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
MatrixCellView.html
1063 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
AbstractMatrixCell.html
1064 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/ui/table/renderer/
RendererHelper.html#getHeaderElement-javax.swing.JTable-int-int-
1065 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
MatrixDataHelper.html
1066 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/configuration/
MatrixDataHelper.html
Do not forget to call AnnotationManager.update()1069, when you are done with adding or
removing in order to refresh UI.
1067 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/dependencymatrix/datamodel/cell/
DependencyExtractor.html
1068 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/annotation/AnnotationManager.html
1069 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/annotation/AnnotationManager.html#update--
1070 http://jdocs.nomagic.com/190beta/
• it is the OCL2.0 based validation rule, the OCL2.0 specification is valid, and the OCL2.0
specification does not use the “self” variable (explicitly or implicitly by using the property of a
constrained element only)
• it is binary based, has the specified implementation class name, and it has no specified
constrained elements.
A validation suite is a package with the stereotype «UML Standard Profile::Validation
Profile::validationSuite». The validation suite organizes several validation rules into a unit that can be
used for performing the validation. Validation rules can be added or imported into the validation suite.
An active validation suite is a package with the stereotype «UML Standard Profile::Validation
Profile::activeValidationSuite». Active validation rules can be checked constantly or on the model
elements change. OCL2.0 or binary validation rules can be used in the active validation. We suggest to
prefer binary, because they give the better performance.
An annotation defines the validation result. It contains information about what is incorrect, severity of
the problem, and possible actions that can be used to solve the problem.
Related pages
1. Create a constraint.
2. Set the stereotype «UML Standard Profile::Validation Profile::validationRule» for the validation
rule.
3. Set the severity level, error message, and abbreviation.
4. Specify constrained element(s).
Related pages
The OCL2.0 validation rule can be used in an active validation suite. In this case the validation rule will
be executed on any change of constrained elements that are from the validation scope. Executing of
the validation rule might be triggered even if no properties important to the validation rule actually
changed and this can slow down the active validating speed. In order to avoid degradation of the
performance you can create a binary validation rule that uses the OCL2.0 expression to validate model
elements but also provides additional information for the modeling tool that allows to optimize
triggering of executing after model elements change. For example, we want to check whether all
classes have names. This can be done by creating the OCL2.0 validation rule and specifying the OLC2.0
expression:
name <> ‘’
The problem is that such validation rule actually is interested in a class property name value change but
it will be executed on every property value of a class change. How we can fix this problem and inform
the modeling tool to execute the validation rule only on the class property name change:
1. Create a constraint.
2. Set the stereotype «UML Standard Profile::Validation Profile::validationRule» for the validation
rule.
3. Set the severity level, error message, and abbreviation.
4. Specify constrained element(s).
5. Specify the specification language OCL2.0
6. Enter the OCL2.0 expression as a body of the specification
7. Create a Java class that extends the
com.nomagic.magicdraw.validation.DefaultValidationRuleImpl1071 class
8. Override the method DefaultValidationRuleImpl.getListenerConfigurations()1072
1071 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/validation/DefaultValidationRuleImpl.html
1072 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/validation/
DefaultValidationRuleImpl.html#getListenerConfigurations--
The implementation class must be in the classpath of the modeling tool or if the
implementation class is in a plugin then the plugin’s classloader must be registered to the
validation system (see Binary validation rule in the plugin (see page 2248)).
1. Create a constraint
2. Set the stereotype «UML Standard Profile::Validation Profile::validationRule» for the validation
rule
3. Set the severity level, error message, and abbreviation
4. Specify constrained element(s)
5. Specify the specification language binary
6. Create a Java implementation class (see all possible cases (see page 2243))
7. Compile Java code, resulting in one or several classes.
8. Ensure that your modeling tool can find & load these classes. You can place them in the program
classpath or use the modeling tool plugins mechanism. The same rules as writing the code for
the open API are used here.
These steps are common to all possible binary validation cases and will not be repeated in each case
description.
The implementation class must be in the classpath of the program or if the implementation
class is in a plugin then the plugin’s classloader must be registered to the validation system (see
Binary validation rule in the plugin (see page 2248)).
Related pages
This case is not recommended for validating model elements because the validation rule provider must
implement not only validating of model elements but also other details that are provided by the
modeling tool validation engine. In this case, the validation rule provider must correctly implement
validating of model elements that are from the validation scope defined in project options, should take
care that implementation would respect the project property Exclude element from used read-only
project, and is responsible for implementing when the validation has to be executed.
Related pages
If you want to concentrate on implementation of validating model elements and delegate a task of
detecting model element changes and project property changes to the validation engine then you have
to create a Java class and implement com.nomagic.magicdraw.validation.ElementValidationRuleImpl1074
and the interface. The class must have the public no-arg constructor. The value of the implementation
property of the validation rule must be a qualified name of the implemented class. Note that If this rule
is used in active validation, then it will be repeatedly executed after every single change in the model.
This example shows how to add custom solver action and set dynamic error message to
validated element:
1073 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/validation/ValidationRule.html
1074 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/validation/ElementValidationRuleImpl.html
If the validation rule is designed for the active validation then the validation performance becomes very
important. In this case we want that the validation rule would be executed only when it is actually
required, so the implementation of the validation rule must somehow inform the active validation
engine which model element property changes are important to the validation rule. In order to create
such validation rule you have implement ElementValidationRuleImpl1075and
com.nomagic.magicdraw.validation.SmartListenerConfigurationProvider1076interfaces. The class must have
the public no-arg constructor. The value of the implementation property of the validation rule must be a
qualified name of the implemented class.
1075 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/validation/ElementValidationRuleImpl.html
1076 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/validation/
SmartListenerConfigurationProvider.html
1077 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/validation/
SmartListenerConfigurationProvider.html
configMap.put(com.nomagic.uml2.ext.magicdraw.classes.mdinterfaces.Interface.class,
configs);
return configMap;
}
For the given example, In the specification dialog of the Constraint element the Constrained
Element property should be set to Class and Interface metaclasses from the UML Standard
Profile.
1078 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Element.html
1079 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/jmi/smartlistener/SmartListenerConfig.html
1080 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/validation/DefaultValidationRuleImpl.html
parameterConfig.listenToNested(PropertyNames.OWNED_PARAMETER).listenTo(parameterPr
opertiesList);
SmartListenerConfig cfg = new SmartListenerConfig();
Collection<String> argumentCftList = new ArrayList<String>();
argumentCftList.add(PropertyNames.PARAMETER);
argumentCftList.add(PropertyNames.TYPE);
argumentCftList.add(PropertyNames.OWNED_TYPE);
cfg.listenTo(argumentCftList);
SmartListenerConfig argumentConfig = new SmartListenerConfig();
argumentConfig.listenTo(PropertyNames.NODE, cfg);
configs.add(parameterConfig);
configs.add(argumentConfig); configMap.put(Activity.class, configs); return
configMap;
}
Case D
If you want to create a validation rule that will not be used in the active validation and you do not need
to provide solving actions then you can create a Java class that contains the static method with the
signature:
The referred java method must be a static method and it must take exactly one parameter. Several
validating methods can be placed into the one Java class or use the one class per validating method –
this is irrelevant.
For the validation rules on stereotypes, use the same class as you would use when specifying the
validation rule for a metaclass of that stereotype. For validation rules on the classifiers of the model,
use com.nomagic.uml2.ext.magicdraw.classes.mdkernel.InstanceSpecification1082 as the type of the
parameter.
The Java code example of a trivial validation rule, which always returns true (that is, all elements are
valid):
package com.nomagic.magicdraw.validation;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.DataType;
public class TestRule
{
public static Boolean testMeta(DataType exp)
{
return Boolean.TRUE;
}
}
Compile such code into the Java bytecode, locate it where the modeling tool can load it (a classpath,
plugin), and then you can use it for the validation:
In case you need a validation rule that would check and annotate individual presentation elements
(symbols) in diagrams, then a Java class extending
com.nomagic.magicdraw.validation.DiagramValidator1083 should be implemented. This rule can be used
for example to annotate symbols with overlapping bounds, or to detect multiple representations of the
same model element in the same diagram in case only a single representation is desired.
1081 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/DataType.html
1082 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/
InstanceSpecification.html
1083 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/validation/DiagramValidator.html
1084 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/validation/DiagramValidator.html#getDiagrams--
EvaluationConfigurator.getInstance().registerBinaryImplementers(<PluginClassName>.
class.getClassLoader());
Related pages
1085 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/annotation/Annotation.html
1086 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/symbols/PresentationElement.html
1087 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/validation/OpenedDiagramValidator.html
if $THIS.isAbstract()
return $THIS.getOwner().isAbstract()
end
true
The rule validates operations in the model. If an operation is abstract, but its owning classifier isn't, the
rule fails. "$THIS" variable references the element being validated. It should be used at least once in the
code or in a comment.
Related pages
Related pages
1088 http://jdocs.nomagic.com/190beta/com/nomagic/actions/NMAction.html
1089 http://jdocs.nomagic.com/190beta/com/nomagic/actions/NMAction.html#actionPerformed-
java.awt.event.ActionEvent-
1090 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/annotation/AnnotationAction.html
1. The Java class should be implemented following the very same rules as when creating
implementation for a validation rule (see page 2243).
Each com.nomagic.magicdraw.annotation.Annotation1091 object returned by the rule will cause
the targeted model or presentation element to be adorned in the diagram (but only if the Legend
is used in that diagram).
2. Specify the full class name as the value of "Implementation" property for the Legend Item in the
modeling application.
3. Compile Java code, resulting in .class files possibly contained by a .jar file.
4. Ensure that your modeling tool can find and load these classes. You can place them in the
program classpath or use the modeling tool plugins mechanism.
Example
See AdornComponentsOfInterestInDiagramValidator.java example implementation in
the <program installation directory>\openapi\examples\legendItem directory.
• The IJavaNumberPart (see page 2251) interface produces a single part of a number generated by the
framework. It does not interfere with the execution of the framework, but simply provides a little
piece of information included in the numbering.
• The INumberingAction (see page 2252) allows for generating complete numbers for sets of
elements. All sorting and numbering is delegated to the implementing class. The framework will
only register the generated numbers internally.
Classes that implement these interfaces can be set as the expression value of an Expression
NumberPart. (see Numbering Scheme property values (see page 2060)).
These classes have to be specified with the complete package and class name, for
example, com.nomagic.magicdraw.autoid.sample.SquareNumberPart.
Related pages
1091 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/annotation/Annotation.html
This method should adhere to the contract that equal inputs must produce equal outputs. If,
for example, the input is ABC and the method computes a value of XYZ then the return value
for ABC must always be XYZ.
The return value of this method will be incorporated by the Numbering Framework to create a
complete number together with all other NumberParts that are part of the same NumberingScheme.
Example
Let's assume the SquareScheme is used as target for UML activities. According to this NumberingScheme,
the first part of a number will be taken from a numbered parent (in this case, the package sample as
shown in the following figure), then a dot is inserted and the final slice is generated by the
SquareNumberPart expression.
We have created a few activities inside the package named sample. The owning package is also
customized and has a generated number P1. If we number the activities with this NumberingScheme, the
SquareNumberPart class, being set as part3 of the type expression, will create the following sequence: 1,
4, 9, 16, 25... These pieces are then added to the results from the other NumberParts, resulting in the
activities being numbered as shown in the following figure.
1092 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/IJavaNumberPart.html
1093 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/IJavaNumberPart.html#generateNextId-
java.lang.String-
1094 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/INumberingAction.html
There are two parts to be explained that pertain to this interface. The actual interface that provides
access to customized numbering and an immutable support class which encapsulates the values as
defined in the AutoNumber and the associated NumberingScheme objects.
The INumberingAction1095Interface. The interface has one method, which is invoked whenever a new
Element is created or when Create or Renumber buttons are clicked in the Element
Numbering dialog. This applies of course only if the Element type equals the type for which the
AutoNumber has been customized. So at the time when a new element is created, this method receives
a java.util.List with a single entry. On the other hand, when the user navigates the Element Numbering
dialog, the method receives all elements that are currently listed in the right partition of the dialog. This
implies that all elements have the same owner. Since this will give access to the complete Model Tree, it
is possible to collect necessary information from other parts of the model and incorporate it. This
method must return a mapping of each element together with the value that was generated for it.
There is no need to number every element that the method receives. The Numbering Framework will
register the generated values internally and set the property value for each element.
1095 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/INumberingAction.html
1096 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/NumberingInfo.html
1097 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/INumberingAction.html
1098 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/NumberingInfo.html#getName--
1099 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/NumberingInfo.html#isDefaultNumber--
1100 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/NumberingInfo.html#getScheme--
1101 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/NumberingInfo.html#getProperty--
1102 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/NumberingInfo.html#getTarget--
Constraints
A NumberingScheme that references an expression which implements this interface, can have one and
only one NumberPart. Namely a NumberPart that references an INumberingAction1107.
Example #1
We shall now proceed to show a Java class that generates numbers for UML activities depending on
their getStructuredNode() value. Since this class implements the INumberingAction1108interface, it should
be set as the expression in the only NumberPart of this NumberingScheme.
We have created a few activities inside a sample Package. With the creation of each new activity, an ID is
generated and assigned to it. We then add some StructuredActivityNodes into two of the given activities.
Now, in order to assign Numbers to these Activities that includes the number of StructuredActivityNodes
children, we have to open the Element Numbering dialog (see page 1009) and renumber the Activities.
This will generate new numbers that reflect the ownership relation.
1103 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/
NumberingInfo.html#isDisplayedProperty--
1104 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/NumberingInfo.html#getProperty--
1105 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/NumberingInfo.html#getPrefix--
1106 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/NumberingInfo.html#getSeparator--
1107 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/INumberingAction.html
1108 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/INumberingAction.html
The interested Reader should consult the source code, in order to learn how such an algorithm has
been implemented.
1109 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/autoid/custom/
DirectedAssociationNumbering.html
1110 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/usecasescenarios/scenarios/Scenario.html
SessionManager.getInstance().createSession(...);
// Creates a use case scenario.
Scenario scenario = ScenarioManager.createScenario(useCase);
// Sets the scenario name.
scenario.setName("Extract money from ATM.");
1111 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/usecasescenarios/scenarios/
ScenarioFactory.html
1112 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/usecasescenarios/scenarios/
ScenarioManager.html
For more information about the use case scenario, see Use Case Scenario in MagicDraw
UserManual.pdf.
1. Discovering project changes (differences). The ancestor (in a 3-way merge only) and source
projects are loaded (if they are not loaded yet) for comparing.
2. Accepting / rejecting changes. All target changes that do not conflict source changes are
applied (source changes conflicting with target changes are rejected). A 2-way merge produces
source changes only.
3. Applying accepted changes. Changes are applied on the ancestor project (target and ancestor
projects are the same in a 2-way merge).
There are the API for the standard and advanced project merging. The standard API encapsulates all
three steps into a single call, while the advanced merge API allows for accessing the project differences
and controlling what changes are accepted or rejected.
1113 http://jdocs.nomagic.com/190beta/
1114 http://jdocs.nomagic.com/190beta/
Code engineering allows generation of the source code from the specific model, and source code
reversing into model elements. API is provided for:
Related pages
• Name. Represents a name of the code engineering set, visible in the Browser.
• Model elements. Represents elements that are added into the code engineering set from the
model.
• Working directory. Represents a code engineering directory where generated/reversed files are
located.
1115 http://jdocs.nomagic.com/190beta/
1116 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringSet.html
1117 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringSet.html
Model elements should be in the working package, otherwise the model element is not be
added to the code engineering set. The working package is set when creating a code
engineering set.
Reverse Engineering
Source code files are required to perform the Reverse Engineering. There are 2 methods available for
adding files into the code engineering set:
1. CodeEngineeringSet.addFilesToCodeEngineeringSet(java.util.List<java.io.File>)1122; This method
adds the given list of files to the code engineering set.
2. CodeEngineeringSet.addAllFilesRecursivelyToCES(java.io.File)1123; This method adds all specific
source code files to the code engineering set, starting from the given directory.
Source code files should be in the working directory, in order to have the successful reverse.
When creating the code engineering set, the following fields are required:
• Language and dialect IDs. All languages and dialects IDs are stored in the
com.nomagic.magicdraw.ce.CodeEngineeringConstants1126 class.
• The name of the code engineering set (see page 2260).
• The project, where code engineering set will be added.
• The working package.
• The working directory.
1118 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringSet.html
1119 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
CodeEngineeringSet.html#addElementsToCodeEngineeringSet-java.util.List-
1120 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html
1121 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
CodeEngineeringSet.html#addElementsToCodeEngineeringSet-java.util.List-
1122 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
CodeEngineeringSet.html#addFilesToCodeEngineeringSet-java.util.List-
1123 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
CodeEngineeringSet.html#addAllFilesRecursivelyToCES-java.io.File-
1124 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringManager.html
1125 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringManager.html
1126 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringConstants.html
The language and dialect can be selected from the CodeEngineeringConstants1133class. The dialect is
required for DDL and C++ languages.
1127 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringSet.html
1128 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringManager.html
1129 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
CodeEngineeringManager.html#createCodeEngineeringSet-java.lang.String-java.lang.String-java.lang.String-
com.nomagic.magicdraw.core.Project-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Package-
java.lang.String-
1130 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1131 http://jdocs.nomagic.com/190beta/com/nomagic/uml2/ext/magicdraw/classes/mdkernel/Package.html
1132 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
CodeEngineeringManager.html#createCodeEngineeringSet-java.lang.String-java.lang.String-java.lang.String-
com.nomagic.magicdraw.core.Project-com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Package-
java.lang.String-
1133 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringConstants.html
1134 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringSet.html
1135 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
CodeEngineeringManager.html#removeCodeEngineeringSet-com.nomagic.magicdraw.ce.CodeEngineeringSet-
1136 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringSet.html
1137 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
CodeEngineeringManager.html#getAllCodeEngineeringSets-com.nomagic.magicdraw.core.Project-
1138 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1139 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringSet.html
1140 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringManager.html#generate-
com.nomagic.magicdraw.ce.CodeEngineeringSet-
1141 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1142 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringManager.html#generate-
com.nomagic.magicdraw.ce.CodeEngineeringSet-
1143 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringManager.html#reverse-
com.nomagic.magicdraw.ce.CodeEngineeringSet-boolean-
1144 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1145 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/CodeEngineeringManager.html#reverse-
com.nomagic.magicdraw.ce.CodeEngineeringSet-boolean-
1146 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/JavaCodeEngineeringManager.html
1147 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
JavaCodeEngineeringManager.html#setJavaClasspath-com.nomagic.magicdraw.core.Project-java.lang.String:A-
1148 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1149 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
JavaCodeEngineeringManager.html#setJavaClasspath-com.nomagic.magicdraw.core.Project-java.lang.String:A-
1150 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
JavaCodeEngineeringManager.html#getJavaClasspath-com.nomagic.magicdraw.core.Project-
1151 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1152 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
CodeEngineeringManager.html#setResolveCollectionGenerics-com.nomagic.magicdraw.core.Project-boolean-
1153 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1154 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/ce/
CodeEngineeringManager.html#setResolveCollectionGenerics-com.nomagic.magicdraw.core.Project-boolean-
CodeEngineeringManager.generate(javaGenerationSet);
Here the null dialect is used for the java language, because java doesn't have any dialect.
This sets the given instance of the code engineering set working directory and adds all files from that
directory. Set java classpaths for the project:
CodeEngineeringManager.reverse(ces, false);
Knowledge of the Velocity Template Language is necessary for understanding, editing, or creating
templates. The Velocity documentation can be downloaded from http://click.apache.org/docs/velocity/
VelocityUsersGuide.pdf.
The modeling tool Oracle DDL generation consists of the following three components:
Related pages
This example shows the velocity macro for the Oracle VIEW object generation:
A model element with the stereotype “view” is passed to a macro function, and then all element
information is retrieved by the $oracleHelper utility class. The Oracle View stereotype has 3 properties.
These tagged values store information about the force, query restriction, and query statements.
We suggest to make a back up of the default template. The default template is stored in
<program installation folder>\ data\DB_engineering\Oracle_template folder. The template file can be
changed in the CG Properties Editor dialog box (in the Oracle DDL set shortcut menu, choose the
Properties command).
$CESList List<NamedEleme nt> The list of model elements that are added to the
code engineering set (see page 2260).
$oracleHelper.hasStereotype($element, $stereotypeName)
From the given element, stereotype name, and tag name returns a tag value as Boolean from the
Oracle profile.
$oracleHelper.getPropertiesListFromDefaultProfile($element, $stereotypeName,
$propertyName)
Returns a list of given property values, that exist on the given element with the applied stereotype
from the Oracle profile.
$oracleHelper.getFirstPropertyValueFromProfile($element, $stereotypeName,
$propertyName)
$oracleHelper.getDefaultValueAsBoolean($property)
Parameter $property com.nomagic.uml A boolean property to be check for the default value.
2.ext.magicdraw
.
classes.mdkerne
l.Property
$oracleHelper.getFirstPropertyValueFromGivenProfile($element, $profileName,
$stereotypeName, $propertyName)
Returns first given tag property value from given element, which has applied given stereotype from
profile.
$oracleHelper.getPropertiesListFromProfile($element, $profileName,
$stereotypeName, $propertyName)
Returns a list of given property values, that exist on a given element with an applied stereotype
from the given profile.
$oracleHelper.getStringValue($object)
$oracleHelper.isDataType($element)
$oracleHelper.getType($type, $modifier)
$oracleHelper.getTypeModifier($element)
$oracleHelper.getParameters($operation)
$oracleHelper.getColumnConstraint($column)
$oracleHelper.getCreate($element)
$oracleHelper.getReturnParameter($operation, $createIfNeeded)
$oracleHelper.getIndexNameDefinition($index)
$oracleHelper.isObjectPackage($element)
$oracleHelper.isPackageDatabase($package)
$oracleHelper.isPublic($element)
$oracleHelper.reverseList($list)
$oracleHelper.getRefName($element)
Returns a reference name description for the element with the "Ref:Element" tag.
4.22.4 Example
In this sample, we will extend the current Oracle View DROP statement. In the Default template, we
have the Oracle view drop function. In this sample, the simple macro is presented, and it generates the
following text:
We will add a new tag to identify the “CASCADE CONSTRAINTS” clause in the DROP VIEW statement. The
following script will be generated:
#set($cascadeOption =false)
##this line is required to for setting a new variable to the false state.
#set($cascadeOption = $oracleHelper.getBooleanValueFromDefaultProfile($data,
$VIEW_STEREOTYPE, "cascade_clause") )
This line retrieves a boolean value from the given tag in the given stereotype “$view_stereotype” and
sets it to a newly created $cascadeOption value.
Then add a new checking clause into the drop statement. See the final method:
Related pages
A Target1157owns:
• a classifier
• a classifier’s presentation element
• a diagram of a presentation element
A Target1158 is passed to the pattern’s
method com.nomagic.magicdraw.patterns.AbstractPattern.applyPattern(1159Target1160,
1161
AbstractPatternProperties1162)1163. It is also accessible from pattern’s properties
com.nomagic.magicdraw.patterns.AbstractPatternProperties1164.
1155 http://jdocs.nomagic.com/190beta/
1156 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/Target.html
1157 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/Target.html
1158 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/Target.html
1159 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPattern.html#applyPattern-
com.nomagic.magicdraw.patterns.Target-com.nomagic.magicdraw.patterns.AbstractPatternProperties-
1160 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/Target.html
1161 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPattern.html#applyPattern-
com.nomagic.magicdraw.patterns.Target-com.nomagic.magicdraw.patterns.AbstractPatternProperties-
1162 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPatternProperties.html
1163 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPattern.html#applyPattern-
com.nomagic.magicdraw.patterns.Target-com.nomagic.magicdraw.patterns.AbstractPatternProperties-
1164 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPatternProperties.html
• Pattern properties
• Pattern panels
• Pattern implementation
This information is encapsulated in the com.nomagic.magicdraw.patterns.PatternInfo1167 class.
Every pattern must provide main properties and optionally can have extended properties. Main
properties are used for the user input from the first pattern wizard page. Extended properties may be
used for storing the user input from other wizard pages.
A specific pattern must provide implementation of this abstract class and override the
AbstractPatternProperties.configurePropertyManager()1170 method. If a specific pattern has some
extended properties, it must override the
AbstractPatternProperties.configureExtendedPropertyManager()1171 method. Both these methods must
configure some property manager – add or remove properties from it.
Every pattern must provide one or more panels for the patterns wizard. The first wizard page is always
used for displaying main pattern properties. Other pages are optional and may be the pattern specific.
The com.nomagic.magicdraw.patterns.AbstractPanelContainer1172 class is used for providing the pattern
wizard information:
A specific pattern must provide a pattern implementation class. This class must extend
AbstractPattern1173 and implement AbstractPattern.applyPattern(1174Target1175,
1176
AbstractPatternProperties1177)1178 and AbstractPattern.getCategorizedName()1179 methods.
1165 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/PatternHelper.html
1166 http://jdocs.nomagic.com/190beta/
1167 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/PatternInfo.html
1168 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/PatternInfo.html
1169 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/PatternsManager.html
1170 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/
AbstractPatternProperties.html#configurePropertyManager--
1171 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/
AbstractPatternProperties.html#configureExtendedPropertyManager--
1172 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPanelContainer.html
1173 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPattern.html
1174 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPattern.html#applyPattern-
com.nomagic.magicdraw.patterns.Target-com.nomagic.magicdraw.patterns.AbstractPatternProperties-
1175 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/Target.html
1176 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPattern.html#applyPattern-
com.nomagic.magicdraw.patterns.Target-com.nomagic.magicdraw.patterns.AbstractPatternProperties-
1177 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPatternProperties.html
1178 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPattern.html#applyPattern-
com.nomagic.magicdraw.patterns.Target-com.nomagic.magicdraw.patterns.AbstractPatternProperties-
1179 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/
AbstractPattern.html#getCategorizedName--
The MyPattern class has only two main properties for displaying the not editable target classifier name
and for entering the method name.
import com.nomagic.magicdraw.plugins.impl.patterns.AbstractPatternProperties;
import com.nomagic.magicdraw.properties.StringProperty;
import com.nomagic.magicdraw.properties.PropertyManager;
/**
* Add two properties into main properties manager.
*/
protected void configurePropertyManager()
{
StringProperty p = new StringProperty(TARGET_CLASS,
getTarget().getTargetClassifier().getName());
p.setResourceProvider(MyResourceProvider.getInstance());
p.setEditable(false);
PropertyManager properties = getPropertyManager();
properties.addProperty(p);
Names of your modeling tool properties can be translated into other programming languages, so they
are not hard coded inside the properties. To get a property name from the property ID,
com.nomagic.magicdraw.properties.PropertyResourceProvider1181 is used.
1180 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/
AbstractPatternProperties.html#configureExtendedPropertyManager--
1181 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/PropertyResourceProvider.html
1182 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/properties/PropertyResourceProvider.html
/**
* Returns a shared instance of this provider.
* @return a shared instance.
*/
public static MyResourceProvider getInstance()
{
if(mInstance == null)
{
mInstance = new MyResourceProvider();
}
return mInstance;
}
/**
* Returns resource for given key.
* @param key a resource key.
* @return the resource for given key.
*/
public String getString(String key)
{
if(key.equals(MyPatternProperties.METHOD_NAME))
{
return "Method Name";
}
else
if(key.equals(MyPatternProperties.TARGET_CLASS))
{
return "Target Class";
}
return null;
}
}
1183 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPanelContainer.html
1184 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/impl/common/
PatternPropertiesPanel.html
1185 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/AbstractPanelContainer.html
Now we have MyPattern properties and panels. We just need the pattern implementation:
package com.nomagic.magicdraw.plugins.impl.examples.mypatterns;
import com.nomagic.magicdraw.core.Application;
import com.nomagic.magicdraw.openapi.uml.ReadOnlyElementException;
import com.nomagic.magicdraw.plugins.impl.patterns.AbstractPattern;
import com.nomagic.magicdraw.plugins.impl.patterns.AbstractPatternProperties;
import com.nomagic.magicdraw.plugins.impl.patterns.PatternHelper;
import com.nomagic.magicdraw.plugins.impl.patterns.Target;
import com.nomagic.magicdraw.properties.PropertyManager;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Operation;
import com.nomagic.uml2.impl.ElementsFactory;
/**
* Applies a design pattern to the target, using properties, passed as an
argument.
* @param target Target, the pattern is applied for.
* @param prop the pattern properties.
*/
public void applyPattern(Target target, AbstractPatternProperties prop)
throws ReadOnlyElementException
{
PropertyManager propManager = prop.getPropertyManager();
String methodName =
propManager.getProperty(MyPatternProperties.METHOD_NAME).getValue().toString();
ElementsFactory ef =
Application.getInstance().getProject().getElementsFactory();
Operation op = ef.createOperationInstance(); op.setName(methodName);
PatternHelper.addDistinctOperation(target.getTargetClassifier(), op);
}
}
Every pattern may provide an html file with a pattern description. We will provide Description.html one:
package com.nomagic.magicdraw.plugins.impl.examples.mypatterns;
import com.nomagic.magicdraw.plugins.Plugin;
import
com.nomagic.magicdraw.plugins.impl.patterns.impl.common.PatternPropertiesPanel;
import com.nomagic.magicdraw.plugins.impl.patterns.PatternInfo;
import com.nomagic.magicdraw.plugins.impl.patterns.PatternsManager;
/**
* Close this plugin always.
* @return false always
*/
public boolean close()
{
return true;
}
/**
* @see com.nomagic.magicdraw.plugins.Plugin#isSupported()
*/
public boolean isSupported()
{
return true;
}
}
class="com.nomagic.magicdraw.plugins.impl.examples.mypatterns.MyPatternPlugin">
<requires>
<api version="1.0"/>
<required-plugin id="com.nomagic.magicdraw.plugins.impl.patterns"/>
</requires>
<runtime>
<library name="mypatterns.jar"/>
</runtime>
</plugin>
Compile all classes and bundle them into the mypatterns.jar file. Also add Description.html into this jar
file. Create the subfolder mypatterns in <your modeling tool install>/plugins and copy mypatterns.jar
and plugin.xml into it.
For more details how to deploy plugin, see Plugins (see page 2073).
API provides two ways to run the tool in the batch mode depending on the required functionality.
1186 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/PatternsManager.html
1187 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/PatternsManager.html#addPattern-
com.nomagic.magicdraw.patterns.PatternInfo-
1188 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/patterns/PatternInfo.html
The application cannot be run on the headless device even in a batch mode. The graphical
environment is required.
For more information on the launching batch mode programs, see Specifying batch mode
program classpath (see page 2286).
Related pages
In order to launch the program, the launcher is started using a java command line which then starts the
program inside the framework. The initial classpath have to include only jars needed to start the
framework launcher. Here is the list of required jars on the classpath:
• lib/com.nomagic.osgi.launcher-<latest version>.jar
• lib/bundles/org.eclipse.osgi_<latest version>.jar
• lib/bundles/com.nomagic.magicdraw.osgi.fragment_<latest version>.jar
• lib/md_common_api.jar
• lib/md_common.jar
• lib/md_api.jar
• lib/md.jar
• lib/jna.jar
The rest of batch mode program is configured using system properties. MagicDraw or other modeling
tool jars are specified using the system property md.class.path. The preferred way to specify this
classpath is as follows:
1189 http://jdocs.nomagic.com/190beta/
1190 https://en.wikipedia.org/wiki/OSGi
In case the current directory is the MagicDraw or other modeling tool installation directory, the base
parameter does not have to be specified. The classpath property name for MagicDraw or other
modeling tool property file is CLASSPATH.
• -Dcom.nomagic.osgi.config.dir=configuration
• -Desi.system.config=data/application.conf
• -Dlogback.configurationFile=data/logback.xml
They here are specified as paths relative to <modeling tool installation directory> therefore you either
have to make your current directory before launching your program or to specify absolute paths for
above listed properties.
The following system properties depends on the type of the batch mode program.
The examples of complete command lines that launches the batch mode program:
> cd MagicDraw_183_no_install
> java -Xmx1200M -Xss1024K -XX:PermSize=60M -XX:MaxPermSize=200M \
-Dmd.class.path=file:bin/magicdraw.properties#CLASSPATH \
-Dcom.nomagic.osgi.config.dir=configuration \
-Desi.system.config=data/application.conf \
-Dlogback.configurationFile=data/logback.xml \
-
Dcom.nomagic.magicdraw.launcher=com.nomagic.magicdraw.examples.imagegenerator.ExportD
iagramImages \
-cp lib/com.nomagic.osgi.launcher-17.0.5-SNAPSHOT.jar:\
` `lib/bundles/org.eclipse.osgi_3.10.1.v20140909-1633.jar:\
` `lib/bundles/com.nomagic.magicdraw.osgi.fragment_1.0.0.201512211944.jar:\
` `lib/md_api.jar:lib/md_common_api.jar:lib/md.jar:lib/md_common.jar:lib/
jna.jar \
-Dmd.additional.class.path=openapi/examples/imagegenerator/imagegenerator.jar
\
com.nomagic.osgi.launcher.ProductionFrameworkLauncher
project_file=project.mdzip destination_dir=out
Plugin batch program command line for Mac OS-X and Linux
> cd MagicDraw_183_no_install
> java -Xmx1200M -Xss1024K -XX:PermSize=60M -XX:MaxPermSize=200M \
-Dmd.class.path=file:bin/magicdraw.properties#CLASSPATH \
-Dcom.nomagic.osgi.config.dir=configuration \
-Desi.system.config=data/application.conf \
-Dlogback.configurationFile=data/logback.xml \
-
Dcom.nomagic.magicdraw.launcher=com.nomagic.magicdraw.commandline.CommandLineActionLa
uncher \
-
Dcom.nomagic.magicdraw.commandline.action=com.nomagic.magicdraw.examples.commandlinep
lugin.CommandLineActionExample \
-cp lib/com.nomagic.osgi.launcher-17.0.5-SNAPSHOT.jar:\
` `lib/bundles/org.eclipse.osgi_3.10.1.v20140909-1633.jar:\
` `lib/bundles/com.nomagic.magicdraw.osgi.fragment_1.0.0.201512211944.jar:\
` `lib/md_api.jar:lib/md_common_api.jar:lib/md.jar:lib/md_common.jar:lib/
jna.jar \
com.nomagic.osgi.launcher.ProductionFrameworkLauncher argument1 argument2
In case the command line program is not started from MagicDraw, the command line becomes a little
bit more complex. The exemplary scripts that can be used to start the command line program are
shown in the following script examples. Additionally, the scripts can be used with multiple MagicDraw
versions since they construct a startup class path dynamically. In order to use them, the MagicDraw
installation location has to be specified by setting the MAGICDRAW_HOME environment variable.
The shell script that starts a command line program on Mac OS-X, Linux, and Windows cygwin/msys:
#!/bin/bash
if [ -z "$MAGICDRAW_HOME" ]; then
echo "MAGICDRAW_HOME environment variable not set, please set it to the MagicDraw
installation folder"
exit 1
fi
if [ "$OS" = Windows_NT ]; then
md_home_url_leader=$(echo "$MAGICDRAW_HOME" | sed -e 's/^/\//' -e 's/ /%20/g' -e
's/\\/\//g')
md_home_url_base=$(echo "$MAGICDRAW_HOME" | sed -e 's/:/%3A/g' -e 's/ /%20/g' \
-e 's/\//%2F/g' -e 's/\\/%5C/g')
cp_delim=";"
else
md_home_url_leader=$(echo "$MAGICDRAW_HOME" | sed -e 's/ /%20/g')
md_home_url_base=$(echo "$MAGICDRAW_HOME" | sed -e 's/ /%20/g')
cp_delim=":"
fi
md_cp_url=file:$md_home_url_leader/bin/magicdraw.properties?
base=$md_home_url_base#CLASSPATH
OSGI_LAUNCHER=$(echo "$MAGICDRAW_HOME"/lib/com.nomagic.osgi.launcher-*.jar)
OSGI_FRAMEWORK=$(echo "$MAGICDRAW_HOME"/lib/bundles/org.eclipse.osgi_*.jar)
MD_OSGI_FRAGMENT=$(echo "$MAGICDRAW_HOME"/lib/bundles/
com.nomagic.magicdraw.osgi.fragment_*.jar)
CP="${OSGI_LAUNCHER}${cp_delim}${OSGI_FRAMEWORK}${cp_delim}${MD_OSGI_FRAGMENT}$
{cp_delim}\
` `$MAGICDRAW_HOME/lib/md_api.jar${cp_delim}$MAGICDRAW_HOME/lib/md_common_api.jar$
{cp_delim}\
` `$MAGICDRAW_HOME/lib/md.jar${cp_delim}$MAGICDRAW_HOME/lib/md_common.jar${cp_delim}
\
` `$MAGICDRAW_HOME/lib/jna.jar"
java -Xmx1200M -Xss1024K \
-Dmd.class.path=$md_cp_url \
-Dcom.nomagic.osgi.config.dir="$MAGICDRAW_HOME/configuration" \
-Desi.system.config="$MAGICDRAW_HOME/data/application.conf" \
-Dlogback.configurationFile="$MAGICDRAW_HOME/data/logback.xml" \
-
Dcom.nomagic.magicdraw.launcher=com.nomagic.magicdraw.examples.imagegenerator.ExportD
iagramImages \
-cp "$CP" \
-Dmd.additional.class.path="$MAGICDRAW_HOME/openapi/examples/imagegenerator/
imagegenerator.jar" \
com.nomagic.osgi.launcher.ProductionFrameworkLauncher "$@"
@echo off
setlocal EnableExtensions
if "%MAGICDRAW_HOME%" == "" (
echo MAGICDRAW_HOME environment variable not set, please set it to the MagicDraw
installation folder
exit 1
)
setlocal enableDelayedExpansion
set md_home_url_leader=!MAGICDRAW_HOME: =%%20!
set md_home_url_leader=!md_home_url_leader:\=/!
set md_home_url_leader=/!md_home_url_leader!
set md_home_url_base=!MAGICDRAW_HOME::=%%3A!
set md_home_url_base=!md_home_url_base: =%%20!
set md_home_url_base=!md_home_url_base:/=%%2F!
set md_home_url_base=!md_home_url_base:\=%%5C!
setlocal disableDelayedExpansion
set md_cp_url=file:%md_home_url_leader%/bin/magicdraw.properties?
base=%md_home_url_base%#CLASSPATH
for /F %%a in ('dir /b "%MAGICDRAW_HOME%\lib\com.nomagic.osgi.launcher-*.jar"') do ^
set OSGI_LAUNCHER=%MAGICDRAW_HOME%\lib\%%a
for /F %%a in ('dir /b "%MAGICDRAW_HOME%\lib\bundles\org.eclipse.osgi_*.jar"') do ^
set OSGI_FRAMEWORK=%MAGICDRAW_HOME%\lib\bundles\%%a
for /F %%a in ('dir /b "%MAGICDRAW_HOME%
\lib\bundles\com.nomagic.magicdraw.osgi.fragment_*.jar"') do ^
set MD_OSGI_FRAGMENT=%MAGICDRAW_HOME%\lib\bundles\%%a
set CP=%OSGI_LAUNCHER%;%OSGI_FRAMEWORK%;%MD_OSGI_FRAGMENT%;^
%MAGICDRAW_HOME%\lib\md_api.jar;%MAGICDRAW_HOME%\lib\md_common_api.jar;^
%MAGICDRAW_HOME%\lib\md.jar;%MAGICDRAW_HOME%\lib\md_common.jar;^
%MAGICDRAW_HOME%\lib\jna.jar
java -Xmx1200M -Xss1024K ^
-Dmd.class.path=%md_cp_url% ^
-Dcom.nomagic.osgi.config.dir="%MAGICDRAW_HOME%\configuration" ^
-Desi.system.config="%MAGICDRAW_HOME%\data\application.conf" ^
-Dlogback.configurationFile="%MAGICDRAW_HOME%\data\logback.xml" ^
-
Dcom.nomagic.magicdraw.launcher=com.nomagic.magicdraw.examples.imagegenerator.ExportD
iagramImages ^
-cp "%CP%" ^
-Dmd.additional.class.path="%MAGICDRAW_HOME%
\openapi\examples\imagegenerator\imagegenerator.jar" ^
com.nomagic.osgi.launcher.ProductionFrameworkLauncher %*
In order to launch your application in the OSGI Framework you should create you application launcher
extending com.nomagic.magicdraw.commandline.CommandLine class. See Running programs in batch
mode (see page 2285) for further details. Starting MagicDraw or other modeling tool is achieved by
invoking one of com.nomagic.magicdraw.core.Application.start(...) methods from your application code.
For details on how to run your application see Specifying batch mode program classpath and required
system properties (see page 2286).
A project is a collection of xmi, text, and binary resources. A native file format contains all resources
saved as separate files. All these files are collected to one zip file.
com.nomagic.magicdraw.uml_model.model
com.nomagic.magicdraw.core.project.options.commonprojectoptions.
• Diagrams and other “binary” resources, entry names do not contain any meaningful information,
just resource id, like 80a7058a-91b1-41fb-9a3a-cd7a8c6be52d.
Version 17.0.1 saves the diagram element as a separate element extension named <modelExtension>.
This extension is stored in a place where the diagram element is serialized (inside a diagram owner). If
one owner has more than one diagram, they may be written in the one extension. In this extension, a
diagram element is saved as a normal model element, and all its attributes and references are saved
according xmi rules. A diagram element contains DiagramRepresentationObject, which contains
information about a diagram type, required features, and so on. DiagramRepresentationObject
contains DiagramContentsDescriptor, which describes used elements in a diagram and contains
BinaryObject. BinaryObject has the attribute “streamContentID” which identifies a zip entry for diagram
symbols. All information is stored in <mdOwnedViews>. The following schema presents finding diagram
symbols entry id:
Jython is an implementation of the high-level, dynamic, and object-oriented language Python which is
seamlessly integrated with the Java platform.
Using Jython you may access all java API and MagicDraw (or other modeling tool developed by No Magic
Inc.) open API. This allows to avoid compilation and to get the same results without a java code. Using
scripting you may do everything that you can achieve using a java plugin, and even more: you may
change your code without recompiling and restarting an application.
More information about Jython you can find at http://www.jython.org1191. Information about the python
language you can find at http://www.python.org1192.
1191 http://www.jython.org/
1192 http://www.python.org/
1. Creating a directory
2. Writing a script descriptor
3. Writing a script code
In the plugins/com.nomagic.magicdraw.jpython folder, create a scripts sub-folder, and then a folder for
the particular script. For example, plugins/com.nomagic.magicdraw.jpython/scripts/example
A script descriptor is a file written in XML and named script.xml. The script descriptor provides
information about a script file to run, version of script, ID, and other.
Element Description
script Attributes
Name Description
After saving files, restart your modeling tool. On a program startup, a message dialog should appear.
The program passes the one variable to the script pluginDescriptor. This variable contains information
from the parsed script.xml file. A variable is an instance of a
com.nomagic.magicdraw.jpython.PythonPluginDescriptor1193 class.
A script can retrieve the script directory and other necessary information from the pluginDescriptor
variable. There is no need to change any other fields for this variable.
1193 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/jpython/PythonPluginDescriptor.html
Sometimes it is enough to recompile plugin code with new libraries and adjust some minor API
changes. Sometimes more serious migration is needed.
We recommend to recompile a plugin with new libraries to see the incompatibilities if any.
Related pages
The changes that have been made to Open API are the following:
• UML metamodel changes. UML 2.4.1 specification introduced few changes in the UML
metamodel itself. Some metamodel classes were added, some of them were removed, some
metaclasses properties were changed. Most of these changes are not in a core UML, so they will
affect you if your plugin is oriented to complex things in UML. For the details of changes,
see Supported UML Specification Changes from Version 2.3 to 2.4.1.1197
1194 http://www.nomagic.com/news/new-noteworthy/magicdraw-noteworthy/magicdraw-18-2-fr/magicdraw-18-2-
fr-all.html#api
1195 http://www.nomagic.com/news/new-noteworthy/magicdraw-noteworthy/magicdraw-18-1-fr/magicdraw-18-1-
fr-all.html#API_changes
1196 http://www.nomagic.com/news/new-noteworthy/magicdraw-noteworthy/magicdraw-18-0-ltr/magicdraw-18-0-
ltr-all.html#Open_API_Changes
1197 http://www.nomagic.com/supported-uml-specification-changes.html
projectCreated(1206Project1207)1208
projectOpenedFromGUI(1209Project1210)1211
projectPreActivated(1212Project1213)
1214
projectPreClosed(1215Project1216)1217
projectPreDeActivated(1218Project1219)1220
1198 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/options/ProjectOptionsConfigurator.html
1199 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/options/
ProjectOptionsConfigurator.html#afterLoad-com.nomagic.magicdraw.core.options.ProjectOptions-
1200 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/options/ProjectOptions.html
1201 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/options/ProjectOptionsConfigurator.html
1202 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectEventListener.html
1203 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectActivatedFromGUI-com.nomagic.magicdraw.core.Project-
1204 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1205 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectActivatedFromGUI-com.nomagic.magicdraw.core.Project-
1206 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectCreated-com.nomagic.magicdraw.core.Project-
1207 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1208 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectCreated-com.nomagic.magicdraw.core.Project-
1209 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectOpenedFromGUI-com.nomagic.magicdraw.core.Project-
1210 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1211 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectOpenedFromGUI-com.nomagic.magicdraw.core.Project-
1212 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreActivated-com.nomagic.magicdraw.core.Project-
1213 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1214 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreActivated-com.nomagic.magicdraw.core.Project-
1215 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreClosed-com.nomagic.magicdraw.core.Project-
1216 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1217 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreClosed-com.nomagic.magicdraw.core.Project-
1218 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreDeActivated-com.nomagic.magicdraw.core.Project-
1219 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1220 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreDeActivated-com.nomagic.magicdraw.core.Project-
projectPreSaved(1226Project1227, boolean)1228
projectPreClosedFinal(1229Project1230)1231
• Changes in libraries jars have been made. New jar files have been introduced in the lib folder.
Do not forget to update your classpath (see page 2076).
Related pages
1221 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreReplaced-com.nomagic.magicdraw.core.Project-
com.nomagic.magicdraw.core.Project-
1222 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1223 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreReplaced-com.nomagic.magicdraw.core.Project-
com.nomagic.magicdraw.core.Project-
1224 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1225 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreReplaced-com.nomagic.magicdraw.core.Project-
com.nomagic.magicdraw.core.Project-
1226 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreSaved-com.nomagic.magicdraw.core.Project-boolean-
1227 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1228 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreSaved-com.nomagic.magicdraw.core.Project-boolean-
1229 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreClosedFinal-com.nomagic.magicdraw.core.Project-
1230 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/Project.html
1231 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/
ProjectEventListener.html#projectPreClosedFinal-com.nomagic.magicdraw.core.Project-
1232 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectEventListener.html
1233 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/project/ProjectEventListenerAdapter.html
The earlier than 17.0.1 project structure API made deprecated in version 17.0.1. The deprecated classes
from the com.nomagic.magicdraw.core.modules package are:
Committable
IProject
ModuleDescriptor
ModulesManager
MountHelper
MountInfo
MountTable
MountTableListener
1234 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IProject.html
1235 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IPrimaryProject.html
1236 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IAttachedProject.html
1237 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IPrimaryProject.html
1238 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IPrimaryProject.html
1239 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IAttachedProject.html
1240 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IAttachedProject.html
1241 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IAttachedProject.html
ShareTable
There is no straight one to one mapping, but the set of deprecated classes are now generally replaced
by the set of the following classes:
com.nomagic.magicdraw.core.ProjectUtilities1242
com.nomagic.ci.persistence.IProject1243
com.nomagic.ci.persistence.IPrimaryProject1244
com.nomagic.ci.persistence.IAttachedProject1245
com.nomagic.ci.persistence.decomposition.ProjectAttachmentConfiguration1246
com.nomagic.ci.persistence.mounting.IMountPoint
com.nomagic.ci.persistence.sharing.ISharePoint
1242 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/ProjectUtilities.html
1243 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IProject.html
1244 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IPrimaryProject.html
1245 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IAttachedProject.html
1246 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/decomposition/
ProjectAttachmentConfiguration.html
1247 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/ProjectUtilities.html
1248 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/core/modules/ModulesService.html
1249 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IAttachedProject.html
1250 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/decomposition/
ProjectAttachmentConfiguration.html
1251 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/IAttachedProject.html
1252 http://jdocs.nomagic.com/190beta/com/nomagic/ci/persistence/decomposition/
ProjectAttachmentConfiguration.html
Thereby we made a cleaner UML metamodel implementation API after the UML specification has been
updated. There are no big changes in Open API, so migration will not be a long and complicate task for
you.
The changes that have been made to Open API are the following:
BaseElement.getProject() Project.getProject(BaseElement)
MainFrame.getDialogParent() MDDialogParentProvider.getProvider().ge
tDialogParent()
MainFrame.setDialogParent(Frame) MDDialogParentProvider.getProvider().se
tDialogParent(Frame)
ElementListProperty.setStereotype(St ElementListProperty.setSelectableRestri
ereotype) ctedElements(Collection)
• Changes in libraries jars have been made. Open API classes now are packaged
into md_api.jar and md_common_api.jar (was md.jar and md_common.jar). If your plugin was using
API classes from some program build-in plugin, a plugin jar is also renamed with a
“ProgramInitials_api.jar” pattern.
• Changes in package names for build-in plugins have been made. In earlier program versions,
some build-in plugins exposed their Open API, for example, patterns, transformations, emf, and
etc. We have changed a package name pattern. Earlier API versions used
a com.nomagic.magicdraw.plugins.impl.** pattern, now these plugins are moved
to com.nomagic.magicdraw.*.*, for example com.nomagic.magicdraw.patterns.*. A simple import
statement change in your java source will solve this migration issue.
Related pages
The UML 2.1.2 (2.2) specification introduced few changes in the UML metamodel itself. Some
metamodel classes were added, some of them were removed, some metaclasses properties were
changed. Most of these changes are not in a core UML, so they will affect you if your plugin is oriented
to complex things in UML.
Most changes are made in UML Templates, Simple Time, Interactions. We suggest to look at UML 2.1.2
(2.2) specification for such changes if you see some compile errors.
Earlier UML metamodel API used several interface layers for every compatibility level described in the
UML specification. All these layers were merged into one using package merging, this is why earlier API
had so many interfaces for every metamodel element in a different package. Such structure was very
complicated and hardly understandable for new UML users.
MagicDraw version 15.0 and later UML metamodel API provides just one final merged layer. All
intermediate layers were dropped from API. This change reduced a UML metamodel API size in few
times.
UML metamodel interfaces use Java 5 generics, so it is much easier to understand types of various
collections in the metamodel.
4.30 Multi-threading
The majority of the application code (including OpenAPI) is not thread safe. Only the UML model is
thread safe for reading (the UML model can be queried safely by concurrent threads), but still the UML
model writing (modification) is not thread safe.
Related pages
1253 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/license/utils/LicenseUtils.html
1254 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/job/IdleJobService.html
1255 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/job/Job.html
1256 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/job/Job.html
IdleJobService.getInstance().addJob(job);
Related pages
Examples
You can find the code examples in
<modeling_tool_installation_directory>\openapi\examples\elementreferencingintext.
1257 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/elementreferenceintext/
ElementReferencingInTexts.html
• ElementReferencingInTexts.createReferencingText(1258BaseElement1259, java.lang.String)1260,
• ElementReferencingInTexts.createReferencingText(1261BaseElement1262, java.lang.String,
1263
DisplayMode1264)1265,
• ElementReferencingInTexts.createReferencingText1266(BaseElement1267, java.lang.String,1268
DisplayMode1269, UpdateMode1270)
1258 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/elementreferenceintext/
ElementReferencingInTexts.html#createReferencingText-com.nomagic.magicdraw.uml.BaseElement-
java.lang.String-
1259 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html
1260 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/elementreferenceintext/
ElementReferencingInTexts.html#createReferencingText-com.nomagic.magicdraw.uml.BaseElement-
java.lang.String-
1261 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/elementreferenceintext/
ElementReferencingInTexts.html#createReferencingText-com.nomagic.magicdraw.uml.BaseElement-
java.lang.String-com.nomagic.magicdraw.elementreferenceintext.DisplayMode-
1262 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html
1263 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/elementreferenceintext/
ElementReferencingInTexts.html#createReferencingText-com.nomagic.magicdraw.uml.BaseElement-
java.lang.String-com.nomagic.magicdraw.elementreferenceintext.DisplayMode-
1264 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/elementreferenceintext/DisplayMode.html
1265 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/elementreferenceintext/
ElementReferencingInTexts.html#createReferencingText-com.nomagic.magicdraw.uml.BaseElement-
java.lang.String-com.nomagic.magicdraw.elementreferenceintext.DisplayMode-
1266 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/elementreferenceintext/
ElementReferencingInTexts.html#createReferencingText-com.nomagic.magicdraw.uml.BaseElement-
java.lang.String-com.nomagic.magicdraw.elementreferenceintext.DisplayMode-
com.nomagic.magicdraw.elementreferenceintext.UpdateMode-
1267 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/uml/BaseElement.html
1268 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/elementreferenceintext/
ElementReferencingInTexts.html#createReferencingText-com.nomagic.magicdraw.uml.BaseElement-
java.lang.String-com.nomagic.magicdraw.elementreferenceintext.DisplayMode-
com.nomagic.magicdraw.elementreferenceintext.UpdateMode-
1269 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/elementreferenceintext/DisplayMode.html
1270 http://jdocs.nomagic.com/190beta/com/nomagic/magicdraw/elementreferenceintext/UpdateMode.html
5 Code Engineering
5.1 Content
s
Demos
• Code Generation1272
• Code Reverse1273
5.1.1 Abbreviations
• UML Unified Modeling Language
• GUI Graphical User Interface
• CE Code Engineering
• CES Code Engineering Set
• AST Abstract Syntax Tree
1271 http://jdocs.nomagic.com/190beta/com/nomagic/text/TextUtils.html#toLightHtml-java.lang.String-
1272 http://www.magicdraw.com/files/viewlets/MD_100_viewlets_CodeGeneration_viewlet_swf.html
1273 http://www.magicdraw.com/files/viewlets/MD_100_viewlets_CodeReverse_viewlet_swf.html
Functionality Availability
Code Engineering is available in Professional, Architect and Enterprise editions (see page
2308)only.
Code engineering provides a simple and intuitive graphical interface for merging code and UML models,
as well as preparing both code skeletons out of UML models and models from code.
There are several cases where code engineering may be very useful:
Code engineering supports Java, C++, CORBA IDL, DDL, XML Schema, WSDL, and C# languages. Your
models can be converted to any of those languages, or you can create UML models from the source
code written in those languages. Additionally, the tool supports reversing from Java Bytecode and CIL.
Related pages:
5.2.1 Content
s
1274 https://docs.nomagic.com/display/CDMP190SP2
1275 https://docs.nomagic.com/display/CDMP190SP2
• Right-click the selected set and choose Edit from the set shortcut menu.
• Select the set and press Enter.
The Round Trip Set dialog box allows you to manage entities to be added/removed to your set.
The Working Package box allows you to define any package for reverse output or code generation. A
model is reversed or code generated from this specified package.
You can only select or change the working package prior to the addition of files from the
working directory to the code engineering set.
The Round Trip Set dialog box has two tabs: Add Files and Add Data from Model.
All files Lists directories with the source files for the set.
Files of type Contains possible file name extensions for the chosen language.
The Add Data from Model tab helps you manage elements located in the UML model.
Round Trip Set dialog box. Add data from model tab.
The All Data list contains the hierarchy of UML model packages with model elements (or other
packages) inside. Your code engineering set can be combined out of model and code elements. The
following buttons are available in the Round Trip Set dialog box:
Add The selected file in the All Files or All Data list is added to the set.
Add All All files in the opened or selected directory are added to the set.
Add Recursively All files in the selected directory and its subdirectories are added to the set.
5.3.1 Content
s
Demo
• Code Generation1276
You can generate code for the selected and prepared set as well as directly for model elements.
• Choose Generate from the Code Engineering Sets item shortcut menu. It allows code
generating for all created sets.
• Choose Generate from the selected set shortcut menu. It allows code generating only for the
selected set.
The Code Generation Options dialog box appears.
1276 http://www.magicdraw.com/files/viewlets/MD_100_viewlets_CodeGeneration_viewlet_swf.html
Once you specify generating options for the set, code can be generated.
Output Type the directory where the generated files will be saved.
Directory
The Set Output Directory dialog box appears. Select the directory for the generated files.
Set as The output directory is set as a working directory and files are saved to the working directory.
Working
Directory
If element To influence the structure of generated code, click one of the following option buttons:
deleted
from • Delete code. The representation of deleted entities will be deleted from the code
model file.
• Comment code. Deleted entities will be commented in the code file.
Use When selected, spaces (instead of tabs) will be written to the code file.
spaces in
place of
tabs
OK The Messages Window appears, displaying how code files are being generated. The Messages
Window informs you about problems and errors (mainly file access and syntax errors) found in the
code generation process and generation summary. You are also prompted to confirm that you
wish to overwrite the file if the output directory already contains one with the same name.
All the classes contained in the component will be written to one file. However, code for the class can
be generated in a different way. Select the class to generate in the browser Data package and click
Generate in the class shortcut menu. For packages and components, you can also select Generate, but
you will not be able to specify the generation options. All the options related to that task will be set
according to the default values.
If you choose framework generation for a single class or for packages, the Code Generation Options
dialog box does not appear. The code is generated according to the default values.
If no errors occurred, you can view the results with your favorite file viewer or programming
environment. Look for the files in the directory you specified as your Working directory in the Round
Trip Set dialog (see page 2309) box or in the Project Options dialog (see page 2133) box. Additional sub-
directories could be created.
5.4.1 Content
s
Demo
• Code Reverse1277
On this page
• Choose Reverse from the Code engineering sets item shortcut menu.
• Choose Reverse from the selected set shortcut menu.
The UML model for the component can be reversed in the same way. Simply select the component you
are interested in from the browser and click Reverse on its shortcut menu. Models can be reversed
without creating a set.
1. Choose Quick Reverse from the Tools menu. The Round Trip Set dialog box (see page 2309)
appears. Quick Reverse is available only in Professional and Enterprise editions (see page 2316).
2. Select the files from the Round Trip Set dialog box, Add Files tab.
1277 http://www.magicdraw.com/files/viewlets/MD_100_viewlets_CodeReverse_viewlet_swf.html
Create Attributes Class (see page 633)fields are represented in a model as attributes (see page 639).
class
fields Associatio Class fields are represented in a model as association ends (see page 621).
as ns
According Association (see page 618)or Attribute creation on reverse is the ability to enter rules (see
to rules page 2321)that help decide if an association or attribute must be created on reverse.
Resolve Reverse engineering can create associations when one class has a collection of other
collection classes and uses Java generics (for example, List<String>). If selected, types of
generics collections will be resolved (property type will not be a collection, but a real type).
Predefined container types in Java language properties will be appended by all the
same containers in this form: ·java.util.List<$$type$$> where $$type$$ replaced by the
value of "type" property when the code is generated.
Reset Select this option if you want to keep previously created UML representation (attribute
already or association) for class fields.
created
fields
Model Merge The model elements are updated by code. Elements that do not exist in the code will
refresh Model and not be removed from the model.
type Code
Change The model will be created strictly by code. Entities in the model that do not match
Model entities in the code will be discarded.
According
to Code
Launch After reversing, the Model Visualizer dialog box (see page 1301) appears. It will assist you
Model in creating a Class diagram (see page 289) or Sequence diagram (see page 291) (Java only)
Visualizer for newly created entities.
Create After reversing, the Create Diagram dialog box appears. Create a new diagram where
new Class the created entities will be added.
Diagram
Add to After reversing, all created entities will be added to the current opened diagram.
active
diagram
Method bodies are not parsed on dependency search. Only static information is used.
If you have a code set combined from several files, you may see changes you wish to model without
reversing all the code. Only changed files should be reversed. You can do this type of reversing by
clicking the Refresh button on the set shortcut menu, or by performing model refresh from the Code
Engineering Sets dialog box (see page 2309).
To include (or import) a JAVA .JAR package with Java code generation
3. Name your new Java Bytecode engineering set and click OK. The new Java Bytecode engineering
set is created under Code Engineering Sets in the Containment tree.
4. Right-click your newly created Java Bytecode engineering set. Select Edit.
5. The Round Trip Set dialog (see page 2309) opens. In the Working Directory box, specify the root
directory of the .JAR file that you want to import.
Note
The file hierarchy of the imported .JAR file in the Containment tree will start from the
working directory you set. For example, if you set the working directory as the
MagicDraw installation directory, the whole file hierarchy that the imported .JAR file is in
the installation directory will be also imported into the Containment tree.
7. Select and click OK. The imported .JAR file is now in the Containment tree under the
Model Package, File View Package, and the rest of the file hierarchy of the imported .JAR file.
Contents
Association (see page 618) or Attribute (see page 639) creation on reverse is the ability to enter rules to help
decide if an association or attribute must be created on reverse.
1. In the Model Browser (see page 29), select the code engineering set for reverse.
2. Right-click the set and choose the Reverse command. The Reverse Options dialog box (see page
2316) opens.
The Class Field Creation Rules dialog box lists the described rules. If a type qualified name matches
any rule, a specified type is created. Rules described in this dialog are executed in order from top to
bottom. If one rule matches, no others are executed. The dialog allows you to add a new rule, edit or
remove an old one, and reorder rules.
• If no rules are matched, an attribute or association is created according the radio button choice
at the bottom of the dialog.
• Click Add to add an expression.
• Click Edit to edit a selected rule.
To define rules
You can define rules in the Rules dialog box. Click the Add or Edit button in the Class Field Creation
dialog box to open this dialog box.
• In the Create drop-down list, choose Attribute or Association on reverse if a property matches
a defined criterion.
• The Qualified Name text box supports simple search patterns, as well as '*' and '?' symbols.
• The Qualified Name pattern can contain a qualified name of the target element including a
separator of a UML separator style (::). The qualified name is counted to the first package with
the «ModelLibrary» stereotype.
• The Element Type drop-down list contains a subset of UML Type names: Any, Class, Interface,
DataType, Primitive, Enumeration, Stereotype values are displayed.
• If the <UNSPECIFIED> value is selected in the Element Type drop-down list, the element type is
matched by the qualified name expression.
Related Pages:
5.5.1 Content
s
Default Working Package Define any package for the reverse output or code generation.
Your model will be reversed or the code will be generated from
this specified package.
Default Paths for References Add specific profiles, used projects, or libraries to define where to
search for paths for references during reverse/code generation.
Default language When selected, the syntax checker of the selected language runs
while Code Engineering is executed.
Use Syntax Checker When selected, the syntax checker runs while Code Engineering is
executed.
Directory for Temporal Files You can specify Active Directory, System, or you can select
another directory.
The following table describes other Code Engineering options:
Code Generation Set code generation options using the fields listed in
the right side of the Project options dialog box. The
Code generation area contains boxes with the same
functionality as the Code generations options dialog
box. See Generating Code (see page 2313).
Reverse Set reverse options for all reverse actions of the project
using the options listed on the right side of the Project
options dialog box. The Reverse Options (see page 2316)
area contains boxes that have the same functionality
as in the Reverse options dialog box.
Java Language Generate opening bracket Opens a bracket in the new line being generated.
Options Set the in new line
generated code style
for Java
programming
languages in the
Default language
field found on the
right side of the
Project Options
dialog box.
Class count to generate Specify the number of classes imported from a single
import on demand package until all statements importing a single class
are substituted with a statement importing an entire
package.
Documentation Processor
After selecting the Java Doc processor, click
to open the Documentation Properties dialog box (see
page 2331).
Use CLASSPATH
The button is activated. Search a classpath
for importing sentence generation in the Set classpath
dialog box.
C++ Language Generate opening bracket Opens a bracket in the newly generated line.
Options in new line
Generate empty Comment brackets are placed in your code, unless the
documentation class in the model has no documentation.
Generate methods body Select check box to generate methods body into class.
into class
Header Add the specific header to all your code files. Click
and enter the header text in the Header
screen. You can also define $DATE, $AUTHOR, and
$TIME in the header.
Generate empty Comment brackets are placed in your code, unless the
documentation class in the model has no documentation.
Header “...” Add the specific header to all your code files. Click
and enter the header text in the Header
dialog. You can also define $DATE, $AUTHOR, and
$TIME in the header.
Functionality Availability
The variable $DOCUMENTATION is available
with MagicDraw 17.0 Service Pack 4 and later
versions.
Set Include Path Specify the path for the #include directives. Click
to open the Select Folder dialog box.
Generate documentation Comment brackets are placed in your code, unless the
class in the model has no documentation.
Header Add the specific header to all your code files. Click the
button and enter header text in the Header
dialog. You may also define $DATE, $AUTHOR, and
$TIME in the header.
Generate empty Comment brackets are placed in your code, unless the
documentation class in the model has no documentation.
namespace A
{
namespace B
{
Header Adds the specific header to all your code files. Click
and type the header text in the Header dialog
box. You can also define $DATE, $AUTHOR, and $TIME
in the header.
Related Pages:
Contents
Generate The selected tag will be placed in the generated code as a comment before a classifier (class or
interface), operation or attribute.
Related Pages:
Contents
The Round Trip feature keeps your code and model synchronized. Because Round Trip traces all model
and code changes, you can freely change entity specifications without discarding code changes made
outside the tool.
For example, Round Trip prevents a job from being damaged by code editions or changes when the
following steps are performed:
• If the source code is not changed, you are not allowed to refresh the UML model.
The Refresh command from the set shortcut menu is unavailable.
• If the model is changed but the code remains the same (new members were added or their
headers were changed), refresh is not allowed, and the Refresh command from the set shortcut
menu is unavailable. When generating code according to changes, all changes in the model are
written to the signatures of class members, leaving the old implementation in place.
• If the code is changed but the model remains the same, refresh can be executed; code will
reverse to the UML models. If the Code Generation Options dialog box appears when you
attempt to generate code, you can select a code action that differs from the UML model.
• If the code and model are changed while refreshing, all changes in the code are treated as new
items and added to the model.
• If data in the model file is deleted, it will be restored while refreshing, even when the code has
not been changed or the data itself is unimportant.
Related Pages:
Contents
Languages supported in our modeling tools have built-in types. One language’s type could either have
no matches or multiple matches in another language. Additionally, some names are interpreted
differently in different languages. Therefore, while performing code generation, problems may occur
when switching between different languages. To avoid this, type-mapping tables are used to manage
the mapping between distinct languages. The map describes the rules how one language’s built-in
types are converted to those of another language.
Related Pages:
5.6.1 Content
s
Code can be generated out of prepared UML models. Mapping should be implemented between the
identifiers used in the UML model and the language to which the model is being generated. This
mapping includes the following sections:
Java java.prop
C++ C++.prop
JAVABytecode javabytecode.prop
DDL ddl.prop
CIL cil.prop
C# c#.prop
WSDL wsdl.prop
Files of language properties are separated into sections where all related elements are grouped. You
can edit existing entities, add new ones, and change the default values.
We strongly recommend that you edit default values only. In general, all sections have a list of possible
and default values for the element.
Related Pages:
5.7.1 Content
s
This chapter describes how our modeling tool maps Java language elements to UML, helps choose
which profiles to use, and describes Java code engineering properties.
1. Java Mapping to UML (see page 2336) describes general rules our modeling tool uses to map each
Java element to UML and which profile is used. You will find an example and corresponding
model in MagicDraw with marked properties used in Java to describe mapping rules.
2. Java CE Options (see page 2358) introduces specific Java options.
3. Method Implementation Reverse (see page 2363) describes a functionality that switches Java from a
Sequence Diagram to our modeling tool.
Contents
Java Profile
Java Profile is used to map the Java language to UML.
UML specification does not provide elements to fully cover JLS; thus, a modeling tool uses UML
stereotypes to mark a UML class or interface to be a specific Java element.
Java stereotypes are provided in the Java_Profile.xml file in the profiles directory. Some stereotypes have
tagged values used for mapping special Java language elements or keywords that are not mapped to
Related Pages
Contents
Java built-in types are used from the UML Standard Profile, which is automatically loaded with every
new project.
Every referenced class from the other libraries (including JDK libraries) should be imported/created into
a project and referenced in the CES reference path (by default the reference path is Model package in
the model).
If a referenced class is not found in the model or the class path, the reference is created in the Default
package.
Java Profile defines the UML Class with the name "?". It is used for mapping parameterized types.
The figure below shows how the reverse result of the following java code is represented:
Example
Java code
Sample: The String, JFrame and CustomFrame classes location after reverse
Related Pages:
Contents
This section describes the general rules and profile our modeling tool uses to map each Java element is
mapped to UML. Please find examples and corresponding models in MagicDraw with marked
properties used in Java to describe mapping rules.
Related Pages:
Java Package
Contents
A Java package is mapped to the general UML Package (see page 771). It does not have any specific
stereotypes (see page 827)and properties. However, if the UML package represents the Java package, it
must not have a «modelLibrary» stereotype from a standard UML profile. The «modelLibrary»
stereotype is used to show the root package, where the Java package tree ends and no parent
packages, including «modelLibrary», are part of the Java package structure. The figure below shows
Package Structure
Related Pages:
Java Class
Contents
A Java class is mapped directly to the UML Class (see page 633)with the stereotype «JavaClass». This
stereotype is optional and if the UML Class has no stereotype, Java CE treats it as a Java class. If no
appropriate property is found in UML, class modifiers are mapped into UML Class properties or to the
Java language properties for Class.
Java class fields, operations and inner classes are mapped to the appropriate UML Properties, UML
Operations and UML Classes.
Class extends Clause Mapped to the UML Generalization relationship, where the supplier is an
extended class and the client is a mapped class
Class Implementation Mapped to the UML Interface Realization relationship, where the supplier is an
Clause extended class and the client is a mapped class.
/**
* Comment of the class MyList
*/
public final class MyList extends ArrayList implements Cloneable
{
}
UML model
Related Pages:
Java Field
Contents
A Java field is mapped directly to the UML Attribute (see page 639) with the stereotype «JavaField». This
stereotype is optional and if a UML Class has no stereotype, Java CE treats it as a Java field. If no
appropriate property is found in UML, field modifiers are mapped into the UML Property properties or
to the Java language properties.
Note that Java field type modifiers are mapped to the specific property Type Modifier, but not to the
UML Multiplicity.
Field Type Mapped to the UML Type property. It is a reference to the UML
Classifier; its package structure and name represent the referenced
Java class.
Examples
Java source code
UML model
Java Operation
Contents
The Java Operation mapped directly to the UML Operation is done with the stereotype «JavaOperation».
This stereotype is optional, so if the UML class has no stereotype Java CE treats it as a Java Operation. If
no appropriate property is found in UMLOperation, modifiers are mapped into UML Property
properties or to the Java language properties. The Java Operation return type is mapped to the UML
Type property of the UML Parameter with the “Return“ direction kind. Java Operation parameters are
mapped to the UML Parameters. The direction kind is set “In“ for “final” parameters. Note that Java
parameter type modifiers are mapped to the UML specific property “Type Modifier,“ but not to the UML
Multiplicity.
Return type Mapped to the UML Parameter type with “return“ direction kind, i.e.,
it resides in the UML Operation parameters list. It is a reference to the
UML Classifier; its package structure and name represent the
referenced Java class
Return type modifiers Mapped to the MagicDraw specified property “Type Modifier“
Throws list UML Operation “Raised Exception“ list. It is a list of references to the
UML Classes; its package structure and name represent the
referenced Java exception class.
Return type Mapped to the UML Type property. It is a reference to the UML
Classifier; its package structure and name represent the
referenced Java exception class.
Return type modifiers Mapped to the MagicDraw specified property “Type Modifier“
Examples
Java Source Code
UML Model
Related Pages:
Java Interface
Contents
Related Pages:
Java Enumeration
Contents
Java enumeration is mapped directly to the UML Class with the stereotype «JavaEnumeration». If no
appropriate property is found in UML, enumeration modifiers are mapped into UML Class properties or
to the Java language properties for the interface. Java enumeration literals are mapped to the UML
Property with the stereotype «JavaEnumerationLiteral». All contained fields, operations, and inner
classes are mapped to appropriate UML Properties, UML Operations, UML Classes. All mapping rules
used in Java class (see page 2341) mapping apply to the Java enumeration.
Example
Java source code
enum MyEnumeration
{
}
UML model
Example of Enumeration
Contents
Java Enumeration Literal is mapped directly to the UML Property with the stereotype
«JavaEnumerationLiteral». It does not require specific modifiers.
enum MyEnumeration
{
ONE, TWO, THREE;
int attribute1;
String attribute2;
}
UML model
Related Pages:
Contents
A Java annotation declaration is mapped directly to the UML Interface with the stereotype
«JavaAnnotation». Annotation modifiers are mapped into UML Interface properties. Annotation
members are mapped to the UML Interface operations with the stereotype «JavaAnnotationMember».
Example
Java source code
/**
* Comment of annotation
*/
public @interface Annotation
{
}
UML model
Related Pages:
Contents
A Java annotation member type is mapped to a UML Type property of a UML Parameter with the
“Return“ direction kind.
Annotation member type Mapped to the UML Parameter type with the “return“ direction
kind (resides in UML Operation parameters list)
Annotation member type modifier Mapped to the MagicDraw specified property “Type Modifier“
Example
Java source code
/**
* Comment of annotation
*/
public @interface Annotation
{
int id();
String name() default "[unassigned]";
}
UML model
Related Pages:
Contents
You can annotate Java elements. This annotation is mapped on top of the {JavaAnnotations} tagged
value of the stereotype «JavaElement». «JavaElement» is a base stereotype for all stereotypes used in
Java mapping, and can be used directly or with any other stereotype derived from it. Annotation is
mapped as a simple string value.
Example
Java source code
UML Model
Related Pages:
Contents
Type variables are mapped to the UML Template Parameter of a UML Class, Interface or UML
Operation, according to which Java element has type variables. If bound types are present, they are
mapped into the UML Class or UML Interface connected with the UML Generalization or UML Interface
Realization as a supplier. The client is a UML Class, which is a “Parametered Element” of the UML
Template Parameter.
Type variable declaration Mapped to the UML Template Parameter. This UML Template
Parameter is of the Class type from the UML Metamodel. The UML
Template Parameter has the property “Parametered Element“ of the
UML Template Parameter. The metamodel type “Class“ is taken from
the “UML Standard profile/UML 2 Metamodel”
Type variable name Mapped to the UML Class name. This UML Class is “Parametered
Element“
Type bounds If a bound type is a Java class, it is mapped to the General class of the
“Parametered Element“. If a bound type is a Java interface, than it is
mapped to the Realized Interface.
In this example, the Template Parameter “E” is a subtype of the Cloneable class (e.g.
“java.util.Cloneable“). “E” is used to type the “Test” public class attribute.
Contents
Parameterized types are mapped to the general UML Classifier connected with a UML Template Binding
to the UML Classifier. The supplier of this binding link is the UML Classifier with UML Template
Parameters and represents the Java generic type with type parameters. The client of the UML Template
Binding is the UML Classifier of the same UML type as the supplier. Java type parameters are mapped
directly to the UML Template Parameter Substitution of the UML Template Binding.
Parametrized type This is called bounded elements in UML, and is connected to the UML
Classifier by the UML Template Binding as a client. The client must be
of the same type as the supplier. The supplier must have at least one
UML Template Parameter.
Parameter for type Mapped to the UML Template Parameter Substitution of the UML
Template Binding. Each UML Template Parameter from the supplier
must be substituted by the UML Template Parameter Substitution.
The type of the type parameter is any reference to the UML Classifier
from the model set as “Actual“ value of the UML Template Parameter
Substitution.
Type modifiers of the parameter Mapped to the MagicDraw property “Type modifiers” of the UML
Template Parameter Substitution
Wildcard A UML Class with the name “?“ from the Java Profile is used as an
“Actual” value in the UML Template Parameter Substitution.
Wildcard with bounds Java bounding type is mapped to the UML Classifier and used as the
“Actual” value in UML Template Parameter Substitution. “? extends“
or “? super“ bounding is mapped to the appropriate tag
{JavaArgumentBount} value “extends“ or “super“ of the
«JavaTypeArgument» stereotype applied to the UML Template
Parameter Substitution.
Example
When you have a type with type variables represented in the model, you can create a
parameterized type for Java. For this you must create an empty UML Classifier of the same type
as the template classifier (type with type variables). Then create a UML Template Binding and
create a UML Template Parameter Substitution for the UML Template Parameters.
To create a “java.util.List<String>” type, you must create a UML Interface first, with a UML
Template Parameter representing “java.util.List”.
Figure 36 -- UML Interface representing “java.util.List” with template parameter
Then create another UML Interface and connect it with the List interface with UML Template
Binding.
Note that to draw a UML Template Binding, the client element must have at least one UML
Template Parameter created
Figure 37 -- UML Template Binding between template class and bounded element
You must open the UML Template Binding specification dialog and create a UML Template
Parameter Substitution for the appropriate UML Template Parameter.
For a created substitution element, you need to select actual value. In the current example, it is a UML
class representing “java.lang.String”.
Now we have created a parameterized type, which can be used in the model to represent type
java.util.List<String> parameters.
Java Imports
Contents
Type Import Mapped to the UML Element Import with the optional stereotype «JavaImport». The
supplier is an imported UML Classifier, representing the imported Java type, and the client
is a UML Classifier requiring an imported element.
Package Import Mapped to the UML Package Import with the optional stereotype «JavaImport». The
supplier is an imported UML Package, representing the imported Java package, and the
client is a UML Classifier requiring imported elements.
Static import for Mapped to the UML Element Import with the stereotype «JavaStaticImport». The
all static {JavaImportAll} tag of «JavaStat- icImport» must have a “true“ value. The supplier is an
members imported UML Classifier owner of imported static members, and the client is a UML
Classifier requiring imported elements.
Static import for Mapped to the UML Element Import with the stereotype «JavaStaticImport». The
single static {JavaImportAll} tag of «JavaStaticImport» must have a “false“ value and its tag
members {JavaImportedMember} must have reference to the imported member. The supplier is a
UML Classifier owner of an imported static member, and the client is a UML Classifier
requiring imported elements. If several static members are imported,
{JavaImportedMember} can list all of them.
Related Pages:
Reverse engineering allows you to find a Java parameterized collection and retrieves the Java type used
in a container. This type is set as a Type to the UML Property. The container type is set to the UML
Property/Java language property “Container“ as a simple string.
UML Model
Contents
Generate Spaces
By default it is turned on. If option is on - adds additional space after open bracket and before close
bracket in parameter declaration list.
Here is generated class header with options turned on. UML Class A doesn’t have documentation, but
still in code is added documentation elements.
/* *
*
Note, that if option is turned off, than no imports are created automatically and all imports, retrieved
from source code on reverse engineering, are mapped into UML relationships as described in Imports
(see page 2357).
This option is valid only, when “Automatic import generation“ is turned on.
Documentation
Java documentation has two options by itself. It has Processor and Style. Style is used to define how to
format documentation by adding some comments.
• Style 1
/* *
*
*/
• Style 2
/* *
*
*/
Processor is responsible for analyzing documentation context. There are two types <none> and Java
Doc. <none> options does nothing with documentation and just set it as is on element.
Java Doc is processing documentation by resolving parameter tags or on code generation building
documentation by collecting comments from the UML Parameters and adding missed tags for thrown
exceptions or return.
There are additional Java Doc options (button “...”). These options can be used to declare what tags
would not be generated or what order to use on code generation or perhaps to add some additional
tag to documentation for all elements.
Classpath
You can define classpath here by referencing jar files or class files directories.
This options is used by Java reverse engineering. If referenced element is not found in model for some
reasons, that it is searched in this defined path. And if class is matched by name, this class is added into
model.
Java Source
By default is Java 5.0. There are options 1.4 and 5.0. If you are reversing older specification source code,
where, for example “enum“ is not a keyword and can be a variable name, then you will need to choose
1.4 Java source, else MagicDraw parser can emit error.
Header
It is a header for a newly generated Java files. There can be added some template string which will be
preprocessed on writing to source code.
Template Strings
Contents
Java reverse to Sequence diagram functionality allows visualizing Java method implementation with
UML Sequence diagram. Created from method Sequence diagram cannot be updated, every time new
diagram should be generated.
To launch Sequence Diagram from Java Source Wizard and specify options needed for the reverse
• You are able to reverse any operation from the Browser: right click an operation, choose Reverse
Implementation and launch Sequence diagram from Java Source Wizard.
• From the Tools menu, choose Model VIsualizer, and then choose Sequence Diagram from Java
Source Wizard.
• When reversing, in the Reverse Options dialog box, choose Launch Model Visualizer and then
choose Sequence Diagram from Java Source Wizard.
The more detailed example of how this functionality works, see MagicDraw Tutorials.pdf, which is locate
in <MagicDraw installation directory>, manual folder.
Related Pages:
5.8.1 Content
s
Demo
C++ Code Engineering 1279
Supported dialects
C++ code engineering supports three dialects, set in our modelling tools:
Syntax
Syntax under the Managed dialect is deprecated in Microsoft Visual studio 2005.
1278 https://www.ecma-international.org/publications/standards/Ecma-372.htm
1279 https://www.nomagic.com/support/demos#cpp
Contents
The ANSI C++ profile is the base for all other C++ profiles. Other specialized C++ profiles must inherit
from this profile by creating a generalization in modeling tool.
Data Types
Fundamental types defined by ANSI are mapped to a UML data type. You can state each fundamental
type with a modifier (signed, unsigned, short, long) in a different order, but it is the same type. For
example, you can use either short int or int short. Only versions defined as type by ANSI simple-type-
specifiers are created as datatypes in the profile. If an UML synonym dataType is found during the
reverse process, a class is created with this name.
Each fundamental type has 3 corresponding cv-qualified versions: const, volatile, and Const Volatile
qualified type (see page 2391).
UML data types defined in the UML profile contain char, int, double, float, or void. We use these
datatypes for mapping C++ type.
These datatypes are specific. In UML 2, only Integer, Boolean, String, and UnlimitedNatural are defined;
they are not defined as datatypes, but as primitives. Our modeling tool does not define
UnlimitedNatural in any profile and Integer and boolean (b is lowercase) are datatypes.
char Char does not have a synonym Char types are represented as signed
char and unsigned char according to
the compiler implementation.
signed char Signed char does not have a synonym Char types are represented as signed
char and unsigned char according to
the compiler implementation.
unsigned char Unsigned char does not have a synonym
long int long, int long, signed lon, long signed, signed long
int, signed int long, long signed int, long int
signed, int signed long,int long signed
short int short, int short, signed short, short signed, signed
short int, signed int short, short signed int, short
int signed, int signed short, int short signed
Related pages
C++ Stereotypes
Contents
Constraints described in this chapter are for information only; syntax of these constraints must be
checked with the Object Constraint Language (see page 1104) interpreter.
C++Operation
«C++Operation» is an invisible stereotype used to include language properties for any C++ operation.
if isQuery then
stereotype-
>select(name=’C++Global’)->isEmpty()
inline a();
is generated.
void f();
virtual a();
Constraint: Only valid for member function and non static
stereotype-
>select(name=’C++Global’)
->isEmpty() and IsStatic =
false
C++Operator
Stereotype «C++Operator» is used to define a C++ operator function. This stereotype extends the
stereotype «C++Operation».
C++Constructor
Stereotype «C++Constructor» is used to define C++ Constructor. This stereotype extends the stereotype
«C++Operation».
C++Destructor
Stereotype «C++Destructor» is used to define C++ destructor. This stereotype extends Stereotype «C+
+Operation».
C++Parameter
«C++Parameter» is an invisible stereotype used to include language properties for any C++ function
parameter.
C++Parameter Parameter
C++ Attribute
An invisible stereotype «C++Attribute» is used to include language properties for any C++ variable.
C++Attribute Property Constraint for code generation: it is valid to have a default value for any
kind of attribute, but it is illegal to initialize a member variable within
its definition.
class A { int x = 1; };
if defaultValue.size() > 0 then
owner.stereotype-
>exists(name='C++Global') or (isStatic = true
and
typeModifiers.contains(“const”))
owner.stereotype-
>exists(name='C++Global')
int x:2;
Constraint: Only valid for member function
stereotype-
>select(name=’C++Global’) ->isEmpty()
enum Day x;
C++ style:
Day x;
container String[0..1] container of the attribute. $ character is replaced by the attribute type.
vector<$> x;
stereotype->select(name=’C++Global’)
->isEmpty()
int x[2][2];
C++LiteralValue
An invisible stereotype «C++LiteralValue» is used to include language properties for any C++ enum field.
C++LiteralValue EnumerationLiteral
C++Friend
Stereotype «C++Friend» is used to define C++ friend relationship.
(client.oclIsTypeOf(Class) or
client.oclIsTypeOf(Operation)) and
supplier.oclIsTypeOf(Class)
C++Struct
Stereotype «C++Struct» is used to define C++ struct.
C++Struct Class
C++Typedef
Stereotype «C++Typedef» is used to define C++ typedef.
feature->isEmpty()
A «C++BaseType» dependency is defined
C++Union
Stereotype «C++Union» is used to define C++ union.
C++Union Class
C++Global
Stereotype «C++Global» is used to define global functions and variables (functions and variables outside
a class/struct/union declaration).
owner.ownedElement->select(
stereotype->select(name=’C+
+Global’)).size()=1
All operations and attributes are public
feature->forAll(visibility = #public)
C++Namespace
Stereotype «C++Namespace» is used to define a C++ namespace.
C++Namespace Package
C++Extern
Stereotype «C++Extern» is used to define C++ extern variable.
extern “C”
C++FunctionPtr
Stereotype «C++FunctionPtr» is used to define C++ function pointer.
C++FunctionPtr Parameter,
Property
signature Operation The signature of the function (C++ function pointer definition
without the operation name)
member class Class The class used for pointer to member function.
C++FunctionSignature
Stereotype «C++FunctionSignature» is used as a container to model C++ function pointer.
properties->isEmpty()
C++Class
Stereotype «C++Class» is an invisible stereotype used to include language properties for any C++
variable.
C++Class Class
C++Include
Stereotype «C++Include» is used to keep information about the include type, for generating include and
forward class declaration.
• None
• User Include
• System Include
• Class Forward
• None
• User Include
• System Include
• Class Forward
The User Include tag value is used for generating user include, such as #include “test.h”.
The System Include tag value is used for generating system include, such as #include <string.h>
The Class Forward tag value is used for generating forward class declaration.
C++TemplateParameter
Stereotype «C++Template Parameter» is used to keep type keyword between class and typename for
template parameter declaration.
C++TemplateParameter TemplateParameter
• class
• typename
C++Generalization
Stereotype «C++Generalization» is used for information related to generalization and interface
realization.
Inheritance Visibility C++GeneralizationVisibility[1] = none The value of tag can be one of the following
• None
• public
• protected
• private
Example: class A : private B {};
C++Class
C++ class map to a UML class
Stereotype «C++Class» is an invisible stereotype used to include language properties for any C++
variable and belongs to Meta class Class.
Example
C++ source code
class A {
};
UML model:
Base class definition is mapped to UML generalization, a generalization is created between the base
class and the super class.
Access visibility (public, protected and private) and virtual properties of the base class are mapped to C+
+ language properties of the UML generalization.
UML model:
Class relations
Class member variables are mapped to UML attributes. See Variable (see page 2385) for more info.
class ClassVariable {
int age;
char* name;
};
UML model:
Example
C++ source code
class ClassFunction {
public:
void simpleFunc();
float paramFunc(int x,char y);
};
UML model:
C++Constructor
Stereotype «C++Constructor» is used to define C++ Constructor. This stereotype extends stereotype «C+
+Operation».
C++Destructor
Stereotype «C++Destructor» is used to define C++ destructor. This stereotype extends stereotype «C+
+Operation».
C++ class constructor and destructor are mapped to UML operation with stereotypes «C++Constructor»
and «C++Destructor»:
Example
C++ source code
class ConstructClass {
public:
ConstructClass();
~ConstructClass();
}
UML model:
1280 http://owner.name
Example
C++ source code
int age;
Pointer and reference
C++ type pointer and reference is mapped to property Type Modifier of the attribute. Character $ is
replaced by the type name.
int* ptrVar;
int& refVar
Array
Example
C++ source code
int arrayVar[5];
Constraint: only member variable can be Mutable (Global variable cannot be Mutable).
mutable int x;
Bit field
Bit field is mapped to tag value Bit field.
struct BitStruct {
int a:2;
};
UML model:
Variable Extern
C++ extern variable is mapped to stereotype «C++Extern». Tag Linkage value is used to specify the kind of
linkage C or C++, if linkage is not specified (or without value), extern variable without linkage is
generated.
UML model:
Variable Default Value
Variable initial value is mapped to UML attribute’s default value. Variable initial value set using function
style method is mapped to UML attribute’s default value and attribute’s language property
Tag Abbreviated Initialization set to true.
Constraint: only static const member variables can be initialized, and they cannot be initialized using
function style method.
int var = 5;
int var2(10);
For attribute const, the property Is Read Only is set to true during reverse.
Example
C++ source code
class CVModifiers {
const int* const constAttribute;
}
UML model:
Function
C++ function is mapped to UML operation, parameter of function is mapped to UML parameter with
property direction set to inout, return type of function is mapped to UML parameter with property
direction set to return. Type of parameter is mapped to type of UML parameter.
Pointer, reference and array type of parameter are mapped to property Type Modifier of parameter.
Example
C++ source code
Class FunctionClass {
public:
EllipsisFunc(radius);
};
UML model:
Example
C++ source code
Class FunctionClass {
public:
void voidParam(void);
};
UML model:
Register Parameter
C++ register parameter is mapped to UML parameter language property Register Depending on the
compiler, register can be limited on some types (int, char).
class RegisterParamClass {
void registerParam(register int x);
};
UML model:
Tag register
Function Modifiers
C++ function modifiers are mapped to Language properties of Operation.
Explicit function is mapped to Explicit modifier property. Constraint: explicit is only valid for constructor.
class FuncModifierClass {
explicit FuncModifierClass();
};
Tag explicit
Function Pointer
C++ function pointer type is mapped to attribute/parameter with «C++FunctionPtr» stereotype, a
dependency with «C++BaseType» stereotype link from the attribute/parameter to the operation in a
«C++FunctionSignature» class, and type modifiers of the dependency is set to *$. Member function
pointer use the same mapping, and member class tag of «C++BaseType» stereotype point to a class.
float (A*funcPtr)(int);
Tag explicit
Function Operator
C++ function operator is mapped to normal function with the C++ operator name mapped to UML
operation name. See C++Operator for more info.
Example
C++ source code
Class Op {
Public:
Op operator+(Op x);
};
UML model:
If raisedExpression is empty, and throw exception tag is set to none a throw without parameter is
generated.
If raisedExpression is empty, and throw exception tag is set to any throw keyword is not generated.
If the tag throw exception is not set, then generate specific raisedExpression, or do not generate throw if
raisedExpression is empty.
Example
C++ source code
Visibility
Variables and function visibility are mapped using the UML visibility property.
Members of C++ struct or union without access visibility specified are public.
class ClassVisibility {
int privateVar;
protected:
int protectedVar;
public:
int publicVar;
};
UML model:
Static members
Static variables and functions are mapped to UML Is Static property.
class StaticClass {
static int staticVar;
static void staticFunc();
};
UML model:
Property Is Static
class AbstractClass {
virtual abstractOperation()=0;
};
UML model:
Friend Declaration
C++ friend function is mapped with a «C++Friend» stereotyped dependency relationship between the
function (an UML operation) and the friendClass. This relationship grants the friendship to the
friendClass.
class ClassB {
public:
friend void friendFunc();
};
void friendFunc();
UML model:
C++ friend member function is mapped with a «C++Friend» stereotyped dependency relationship
between the member function and the friend class. This relationship grants the friendship to the friend
class.
Example
C++ source code
class ClassD {
void func(ClassC c);
};
class ClassC {
friend void ClassD::func(ClassC
c);
};
UML model:
C++ friend class are mapped with a «C++Friend» stereotyped dependency relationship between the
class and the friend class. This relationship grants the friendship to the friend class.
class FriendClass {
public:
friend class ClassA;
};
class ClassA {
};
UML model:
Struct
C++ struct are mapped to a UML class with stereotype «C++Struct». See C++Struct for more info.
Example
C++ source code
struct MyStruc {
};
UML model:
Union
C++ union is mapped to a UML class with stereotype «C++Union». See C++Union for more info.
union MyUnion {
};
UML model:
Enumeration
C++ enum is mapped to UML enumeration. C++ enum fields are mapped to UML enumeration literals.
C++ enum field with a specified value is mapped to tag value of «C++LiteralValue» stereotype.
Example
C++ source code
enum Day {
Mon,
Tue=2
};
UML model:
Typedef
C++ typedef is mapped to a class with «C++Typedef» stereotype. A «C++BaseType» dependency links to
the original type. Type modifiers tag of «C++BaseType» dependency is used to define type modifiers. $
character is replaced by the type name. A typedef on a function pointer is mapped by linking a «C+
+BaseType» dependency to an operation and type modifiers tag of «C++BaseType» dependency is set
to *$. Operation signature can be stored in a «C++FunctionSignature» class.
UML model:
Namespace
C++ namespace is mapped to a UML package with the stereotype «C++Namespace». Unnamed
namespace is named unnamed+index number of unnamed namespace (start at 1), and unique
namespace name tag is set to the source file path+:+index number of unnamed namespace (start at 0).
namespace n {
namespace m {
}
}
int var;
int func(int x);
UML model:
Example
C++ source code
namespace std {
int err;
void printf();
}
UML model:
Class Definition
Variables can be created after a class/struct/union declaration. These variables are mapped to UML
attribute, and placed in their respective namespace/global/class container.
class VarInitClass {
} c, d;
class OuterVarInit {
class InnerVarInit {
} e;
};
UML model:
UML model:
Template Parameters
UML model:
Template Parameters
Template Instantiation
Template instantiation are mapped to template binding relationship between the template class and
the instantiate class, the template parameter substitution of the binding relationship is set using the
template argument.
For template argument using template instantiation as argument, an intermediate class is created with
the specific binding.
For template argument using multiple template instantiations in an inner class (b<int>::c<char>), the
intermediate class instance is created in the outer class instance.
Example of complex template instantiation. Containment relationship are placed on diagram for
information only, these relationships are not created during a reverse process. Containment
relationship is modeled by placing a class into a specific class/package. See Containment tree below the
diagram.
Template Specialization
C++ Template specialization uses the same mapping as Template Instantiation.
class C;
class A {
private:
C* c;
};
UML model:
Template Parameters
Include Declaration
The example code is declared in A.h file. The «use» association is also applied to C++Include stereotype
shown in Forward class declaration.
#include "B.h"
#include <E.h>
class A {
private:
B* b;
E* e;
};
UML model:
User Include
Specification for #include <E.h>:
System include
#include <E.h>
class B;
class D {
private:B* b;
E* e;
}
UML model:
User Include
Specification for #include <E.h>:
Contents
This chapter describes the changes applied when loading a MagicDraw project with version 11.6 or
earlier.
Related Pages:
Contents
Some projects that use C++ language properties or C++ profile or have type modifier must be translated
with version 11.6 (or earlier) of a MagicDraw project, as shown below.
Related pages
Language Properties
Contents
In versions earlier than MagicDraw 11.6, language properties are stored in a specific format; however,
beginning with MagicDraw version 12, language properties are moved to a stereotype’s tag value.
In this section:
class no changes
public Apply the «C++Generalization» stereotype and set inheritance visibility tag value
to public.
protected Apply the «C++Generalization» stereotype and set inheritance visibility tag value
to protected.
private Apply the «C++Generalization» stereotype and set inheritance visibility tag value
to private.
nonvirtual Apply the «C++Generalization» stereotype and set virtual inheritance tag value to
false.
virtual Apply the «C++Generalization» stereotype and set virtual inheritance tag value to
true.
Constructor
Initialization list and Explicit modifier will be translated when it was set in Constructor. The
Constructor is an operation that has the same name as its owner or applies the «constructor»
stereotype in UML Standard Profile.
<empty> no change
not inline Apply the «C++Operation» stereotype and set inline tag value to false.
inline Apply the «C++Operation» stereotype and set inline tag value to true.
none no change.
const, operation doesn’t has parameter. Create one return type parameter and set
Type Modifier to const $.
const, operation has parameter but Create one return type parameter and set
Type Modifier to const $.
does not have return type parameter.
const, operation has return type parameter. Set Type Modifier in return type parameter to
const $.
Attribute
This example is AttributeClass class that has attribute named myAttribute, return type is int and type
modifier is [15].
There are Mutable, Bit field, Abbreviated Initializer and Container in Attribute Language Properties that
need to be translated and apply the «C++Attribute» stereotype. A Volatile in Attribute Language
Properties will move to Type Modifier.
Attribute - Mutable
Attribute - Volatile
false no change.
<empty> no change.
false no change.
true no change.
Attribute - Container
<empty> no change.
Contents
With version 12, type modifiers use the character $ to specify the type modifiers construct. This allows
mapping of complex type modifiers. For example, const int* const is mapped to const $* const.
Related pages:
Contents
«C++EnumerationLiteral»
This example shows an EnumClass class with a literal value named literal. This literal value applies the
«C++EnumerationLiteral» stereotype and sets C++Initializer tag value to 0.
Enumeration Literal applies the «C+ Apply the «C++LiteralValue» and set the value tag value to
+EnumerationLiteral» stereotype and sets C+ 0. Remove the «C++EnumerationLiteral» stereotype and
+Initializer tag value to 0. C++Initializer tag value from Enumeration Literal.
«C++Namespace»
This example is the MyPackage package. It applies the «C++Namespace» stereotype in the old profile
and sets the unique namespace name tag value to myNamespace.
Package applies the «C++Namespace» ste- reotype in Apply the «C++Namespace» stereotype in a new profile
the old profile (C++ Profile) and sets the unique (c++ ANSI profile) and set the unique namespace name
namespace name tag value to myNamespace. tag value to myNamespace. Remove the «C+
+Namespace» stereotype (C++ Profile) and unique
namespace name tag value.
«C++Typename»
The «C++Typename» stereotype can apply to Template Parameters. Therefore, Elements with template
parameters could apply this stereotype.
In version 12.0, all elements that have template parameters must apply the «C++TemplateParameter»
stereotype.
If elements from old version apply the «C++Typename» stereotype, the translation will apply the «C+
+TemplateParameter» stereotype and set the type keyword tag value to typename. If not, the
translation will apply the «C++TemplateParameter» stereotype and set type keyword tag value to class.
Template Parameter does not apply the «C++Typename» Apply the «C++TemplateParameter» stereotype
stereotype. and set type keyword tag value to class.
«constructor»
Operation applies the «constructor» stereotype in Apply the «C++Constructor» stereotype (c++ ANSI
UML Standard Profile. profile). Remove the «constructor» stereotype (UML
Standard Profile).
«destructor»
Operation applies the «destructor» stereotype in Apply the «C++Destructor» stereotype (c++ ANSI profile).
UML Standard Profile. Remove the «destructor» stereotype (UML Standard
Profile).
Related Pages:
Contents
In the modeling tool stereotype, «C++Operation» must apply all operations; the default throw exception
tag value is any.
C++ThrownExceptions tag value
Operation does not apply the «C++Operation» Apply the «C++Operation» stereotype in a new profile (c++
stereotype in an old profile (C++ Profile). ANSI profile) and set the throw exception tag value to any.
Operation applies the «C++Operation» stereotype Apply the «C++Operation» stereotype in a new profile (c++
in an old profile (C++ Profile) and set the C+ ANSI profile) and set the throw exception tag value to any.
+ThrownExceptions tag value to any. Remove the «C++Operation» stereotype (old profile) and
the C++ThrownExceptions tag value.
Operation applies the «C++Operation» stereotype Apply the «C++Operation» stereotype in a new profile (c++
in old profile (C++ Profile) and set the C+ ANSI profile) and set the throw exception tag value
+ThrownExceptions tag value to none. to none. Remove the «C++Operation» stereotype (old
profile) and the C++ThrownExceptions tag value.
Related Pages:
Contents
This example shows the Class myClass that has Operation myClass(), which is the constructor, and
Operation ~myClass(), which is the destructor.
To create a Destructor
Related Pages:
Contents
Attribute type
The old bool data type in an Attribute type is shown in the figure below.
Change to the new bool data type in new profile (c++ ANSI profile).
Parameter type
The old and new bool data types in the Parameter type are shown in the figures below.
Change to the new bool data type in new profile (c++ ANSI profile).
Return type
The old bool data type in the Return type is shown in the figure below.
Change to the new bool data type in new profile (c++ ANSI profile).
Actual in Template Parameter Substitution
The old bool data type in the Actual in Template Parameter Substitution is shown in the figure below.
Old bool data type in old profile (C++ Profile). Change to the new bool data type in new profile (c++ ANSI
profile).
The old bool data type in the Default in Classifier Template Parameter is shown in the figure below.
Old bool data type in old profile (C++ Profile). Change to the new bool data type in new profile (c++ ANSI
profile).
Related Pages:
Contents
This chapter describes how to customize tag values transformed from the stereotypes in old C++ profile
and language properties.
Related Pages:
Contents
The Inline and Virtual C++Language Properties translate to Operation tag values.
Related Pages:
Contents
The Abbreviated initialization, Bit field, Mutable and Container in Attribute Language Properties and
Array from Type Modifier translate to Attribute tag values.
Constructor
• operation with «C++Constructor» stereotype.
• Name should be the same as the owner’s name.
Destructor
• operation with «C++Destructor» stereotype.
• Name should be ‘~’ + the same name as the owner’s name.
Global
Class with «C++Global» stereotype:
Typedef
Class with «C++Typedef» stereotype:
Friend
Dependency with «C++Friend» stereotype:
Button Action
Add The Open dialog box appears for the select directory path.
Working with QT
To reverse engineer QT code, we recommend you set the Parse Includes option to "false". You must
also set the MagicDraw preprocessor to skip some QT macros ("Options"-> "Project"-> "C++ Language
Options"-> "Use explicit macros").
Microsoft Visual C++ has been called Managed C++, Visual Studio 2003. In Visual Studio 2005, the set of
keywords and constructs related to Managed features changed and is also known as C++/CLI.
Data type
The Microsoft Visual C++ profile includes only the data types that do not exist in the ANSI C++ profile.
Microsoft C/C++ supports sized integer types. Declaration of 8-, 16-, 32-, or 64-bit integer variables can
be done by using the __intn type specifier, where n is 8, 16, 32, or 64.
The types __int8, __int16, and __int32 are synonyms for the ANSI types that have the same size, and are
useful for writing portable code that behaves identically across multiple platforms.
Stereotype
Profile Table
The profile table and description in this section do not include the tagged value inherited from
C++ ANSI profile.
VC++Class Class
__virtual_inheritance.
VC++Struct Class
VC++Union
VC++Union Class
VC+ Enumeration
+Enumeration
VC++Typedef Class
VC++Attribute
VC++Attribute Proeprty
VC++Operation
VC++Operation Operation
VC++Parameter
VC++Parameter Parameter
VC++StorageClass
VC+ Element
+StorageClass
VC++Element
VC++Element Element
VC++Interface
VC++Event
isVirtualEvent boolean[1] = false Supports virtual event as shown in the example below.
Enumeration
inheritanceType
inheritanceType will be used as the value of the tag named "inheritance" under «VC++Class».
Literal Description
callingConvention will be used as the value of the tag named “calling convention” under «VC+
+Operation»
Literal Description
C++/CLI Profile
C++/CLI Profile
The profile table and description in this section do not include the tagged value inherited from
C++ ANSI profile.
C++/CLI Stereotypes
C++CLIClass
C++CLIClass Class
CLI Type CLI Type[1] = ref (Enumeration) Represents the utilization of ref class
or value class keywords for defining a
See CLI Type (see page 0) CLR class.
C++CLIStruct
C++CLIStruct Class
«VC++Element»
C++CLIEnumeration
C++CLIEnumeration Enumeration
C++CLIInterface
C++CLIInterface Interface
C++CLIClassMember
C++CLIAttribute
C++CLIAttribute Property
C++CLIOperation
C++CLIOperation Operation
«VC++Element»
C++CLIProperty
«C++CLIProperty» is used to define a CLR property, which has the appearance of an ordinary data
member, and can be written to or read from using the same syntax as a data member.
C++CLIDelegate
C+ Class
+CLIGenericParameteredElemen
t
C++CLIGeneralization
C+ Class
+CLIGeneralizationParameteredEl
ement
C++CLIGeneralization
C++CLIGeneralization Generalization
Enumeration
CLI Type
CLI Type will be used as value of tag named "CLI Type" under «C++CLIClass». The possible values are
ref and value.
Literal Description
operation OverrideSpecifier
Literal Description
new Indicates the use of a new keyword to qualify override behavior for derivation.
In VC++, new is a keyword indicating that a virtual member will get a new slot in
the table; the function does not override a base class method.
override Indicates the use of the override key to qualify override behavior for derivation.
In VC++, override is a keyword indicating that a member of a managed type
must override a base class or a base interface member. If there is no member to
override, the compiler will generate an error.
attributeField
Literal Description
initonly Represents the utilization of initonly keyword. initonly indicates that variable assignment can only
occur as part of the declaration or in a static constructor in the same class.
literal Represents the utilization of literal keyword. It is the native equivalent of static const variable.
Constraint: Is Static and Is Read Only must be set to true.
classKey
Literal Description
Remark:
CLIvisibilityKind
Literal Description
genericConstraintType
Literal Description
ref class Represents the usage of the ref class keyword in a generic constraint clause.
ref struct Represents the usage of the ref struct keyword in a generic constraint clause.
value class Represents the usage of the value class keyword in a generic constraint clause.
value struct Represents the usage of the value strict keyword in a generic constraint clause.
gcnew Represents the usage of the gcnew keyword in a generic constraint clause.
C++CLIGeneralizationVisibility
• none,
• public,
• protected,
• private,
• internal,
• protected public,
• public protected,
• private protected, and
• protected private.
Note
The profile table and description in this section does not include the tagged value inherited
from other profiles.
Stereotype
C++ManagedClass
C++ManagedStruct
C++ManagedOperation
C++ManagedOperation Operation
C++ManagedDelegate
Literal Description
__nogc Represent the usage of __nogc keyword, which is used to explicitly specify that
an object is allocated on the standard C++ heap.
__value Represent managed declaration with __value keyword. A __value type differs
from __gc types in that __value type variables directly contain their data,
whereas managed variables point to their data, which is stored on the common
language runtime heap.
ref class, ref struct, value class, value struct, interface class, interface struct
• class_access ref class name modifier : inherit_access base_type {};
Code:
UML model with applied Stereotype «C++CLIClass» and Tag value CLI Type = ref
Code:
UML model with applied Stereotype «C++CLIStruct» and Tag value CLI Type = ref
UML model with applied Stereotype «C++CLIClass» and Tag value CLI Type = value
Code:
UML model with applied Stereotype «C++CLIStruct» and Tag value CLI Type = value
Code:
UML model with applied Stereotype «C++CLIInterface» and Tag value declarationKeyword =
class
UML model with applied Stereotype «C++CLIInterface» and Tag value declarationKeyword =
struct
Code:
UML model with applied Stereotype «C++CLIEnumeration» and Tag value declarationKeyword =
class, enumerationType = int
UML model with applied Stereotype «C++CLIEnumeration» and Tag value declarationKeyword =
struct, enumerationType = int
Code:
UML model:
delegate
UML model:
event
Code:
UML model:
Generic Functions
[attributes] [modifiers]
([formal-parameters])
function-body
Parameters
attributes (Optional)
Additional declarative information. For more information on attributes and attribute classes, see
attributes.
modifiers (Optional)
A modifier for the function, such as static. virtual is not allowed since virtual methods may not be
generic.
return-type
The type returned by the method. If the return type is void, no return value is required.
identifier
type-parameter identifier(s)
formal-parameters (Optional)
Parameter list.
type-parameter-constraints-clauses
This specifies restrictions on the types that may be used as type arguments, and takes the form
specified in Constraints.
function-body
Code MD-UML
Generic Classes
[attributes]
[constraint-clauses]
class-body
} [declarators] [;]
Parameters
attributes (optional)
Additional declarative information. For more information on attributes and attribute classes, see
Attributes.
class-key
type-parameter-identifier(s)
constraint-clauses
constraint-list
class-or-interface[, ...]
accessibility-modifiers
modifiers (optional)
base-list
A list that contains the one base class and any implemented interfaces, all separated by commas.
class-body
declarators
Code MD-UML
Generic Interfaces
[type-parameter-constraints-clauses]
Parameters
Additional declarative information. For more information on attributes and attribute classes, see
Attributes.
class-key
class or typename
type-parameter-identifier(s)
type-parameter-constraints-clauses
accessibility-modifiers (optional)
identifier
base-list (optional)
A list that contains one or more explicit base interfaces separated by commas.
interface-body
declarators (optional)
Code MD-UML
[type-parameter-constraints-clauses]
([formal-parameters]);
Parameters
attributes (Optional)
Additional declarative information. For more information on attributes and attribute classes, see
Attributes.
type-parameter-identifier(s)
type-parameter-constraints-clauses
accessibility-modifiers (Optional)
result-type
identifier
formal-parameters (Optional)
Code MD-UML
Code MD-UML
literal
A variable (data member) marked as literal in a /clr compilation is the native equivalent of a static const
variable.
A data member marked as literal must be initialized when declared and the value must be a constant
integral, enum, or string type. Conversion from the type of the initialization expression to the type of
the static const data-member must not require a user-defined conversion.
Code MD-UML
Inheritance Keywords
__single_inheritance, __multiple_inheritance, __virtual_inheritance
Grammar:
Parameter
class-name
Code MD-UML
Grammar:
Code MD-UML
__delegate
Grammar:
__delegate function-declarator
A delegate is roughly equivalent to a C++ function pointer except for the following difference:
• A delegate can only be bound to one or more methods within a __gc class.
When the compiler encounters the __delegate keyword, a definition of a __gc class is generated. This
__gc class has the following characteristics:
__event
Grammar:
• __event method-declarator;
• __event __interface interface-specifier;
• __event member-declarator;
Native Events
Code MD-UML
class Source {
public:
__event void MyEvent(int i);
};
Com Events
The __interface keyword is always required after __event for a COM event source.
Code MD-UML
NOTE This mapping produces the exceptional case for syntax checker. The syntax checker has to allow
attribute without name for this case.
Code MD-UML
__event D* E;
NOTE __delegate is in C++ Managed Profile whereas __event is in Microsoft Visual C++ Profile.
Microsoft-Specific Modifiers
Based addressing with __based
The __based keyword allows you to declare pointers based on pointers (pointers that are offsets from
existing pointers).
Example
// based_pointers1.cpp
// compile with: /c
void *vpBuffer;
struct llist_t {
};
void *vpBuffer;
void __based(vpBuffer) *vpData;
The Visual C/C++ compiler provides several different conventions for calling internal and external
functions.
__cdecl
This is the default calling convention for C and C++ programs. Because the stack is cleaned up by the
caller, it can do vararg functions. The __cdecl calling convention creates larger executables than
__stdcall, because it requires each function call to include stack cleanup code. The following list shows
the implementation of this calling convention.
Code MD-UML
__clrcall
Specifies that a function can only be called from managed code. Use __clrcall for all virtual functions
that will only be called from managed code. However, this calling convention cannot be used for
functions that will be called from native code.
Example
Code
MD-UML
217
__stdcall
The __stdcall calling convention is used to call Win32 API functions. The callee cleans the stack, so the
com- piler makes vararg functions __cdecl. Functions that use this calling convention require a function
prototype.
Code MD-UML
class CmyClass2 {
void __stdcall mymethod();
};
__fastcall
return-type __fastcall function-name[(argument-list)]
The __fastcall calling convention specifies that arguments to functions are to be passed in registers,
when possible. The following list shows the implementation of this calling convention.
Example
class CmyClass3 {
void __fastcall mymethod();
};
219
Code MD-UML
Code MD-UML
class CmyClass3 {
void __fastcall mymethod();
};
__thiscall
return-type __thiscall function-name[(argument-list)]
Example
Code MD-UML
Code
class CmyClass4 {
void __thiscall mymethod();
};
MD-UML
220
__unaligned
type __unaligned pointer_identifier
When a pointer is declared as __unaligned, the compiler assumes that the type or data pointed to is not
aligned. __unaligned is only valid in compilers for x64 and the Itanium Processor Family (IPF).
Example
char buf[100];
int __unaligned *p1 = (int*)(&buf[37]); int *p2 = (int *)p1;
*p1=0; //ok
__try {
Code MD-UML
Code
__except(1) { puts("exception");
}}
MD-UML
221
__w64
Parameters
type
One of the three types that might cause problems in code being ported from a 32-bit to a 64-bit
compiler: int, long, or a pointer.
identifier
The identifier for the variable you are creating.
Example
Int_32 i0 = 5;
Int_Native i1 = 10;
i0 = i1; // C4244 64-bit int assigned to 32-bit int
222
Code MD-UML
Code
int __w64 i;
The extended attribute syntax for specifying storage-class information uses the __declspec keyword,
which specifies that an instance of a given type is to be stored with a Microsoft-specific storage-class
attribute listed below. Examples of other storage-class modifiers include the static and extern
keywords. However, these key- words are part of the ANSI specification of the C and C++ languages, and
as such are not covered by extended attribute syntax. The extended attribute syntax simplifies and
standardizes Microsoft-specific extensions to the C and C++ languages.
MD-UML
noalias
noinline
noreturn
nothrow
novtable
process property({get=get_func_name|,put=put_func_name}) restrict
selectany
thread uuid("ComObjectGUID")
Extended attribute grammar supports these Microsoft-specific storage-class attributes: align, allocate,
appdo- main, deprecated, dllexport, dllimport, jitintrinsic, naked, noalias, noinline, noreturn, nothrow,
novtable, process, restrict, selectany, and thread. It also supports these COM-object attributes: property
and uuid.
The dllexport, dllimport, naked, noalias, nothrow, property, restrict, selectany, thread, and uuid storage-
class attributes are properties only of the declaration of the object or function to which they are
applied. The thread attribute affects data and objects only. The naked attribute affects functions only.
The dllimport and dll- export attributes affect functions, data, and objects. The property, selectany, and
uuid attributes affect COM objects.
The __declspec keywords should be placed at the beginning of a simple declaration. The compiler
ignores, without warning, any __declspec keywords placed after * or & and in front of the variable
identifier in a declara- tion.
Note:
• A __declspec attribute placed after the class or struct keyword applies to the user-defined type.
Code MD-UML
Code MD-UML
224
Code MD-UML
Code MD-UML
__restrict
When __restrict is used, the compiler will not propagate the no-alias property of a variable. That is, if
you assign a __restrict variable to a non-__restrict variable, the compiler will not imply that the non-
__restrict variable is not aliased.
Generally, if you affect the behavior of an entire function, it is better to use the __declspec than the
keyword. __restrict is similar to restrict from the C99 spec, but __restrict can be used in C++ or C
programs.
Example
// __restrict_keyword.c
// compile with: /LD
// In the following function, declare a and b as disjoint arrays // but do not have same assurance for c
and d.
void sum2(int n, int * __restrict a, int * __restrict b,
}}
int * __restrict x;
double * __restrict y; };
Code MD-UML
Code
int * __restrict x;
226
__forceinline, __inline
The insertion (called inline expansion or inlining) occurs only if the compiler's cost/benefit analysis show
it to be profitable. Inline expansion alleviates the function-call overhead at the potential cost of larger
code size.
The __forceinline keyword overrides the cost/benefit analysis and relies on the judgment of the
programmer instead. Exercise caution when using __forceinline. Indiscriminate use of __forceinline can
result in larger code with only marginal performance gains or, in some cases, even performance losses
(due to increased pag- ing of a larger executable, for example).
Using inline functions can make your program faster because they eliminate the overhead associated
with function calls. Functions expanded inline are subject to code optimizations not available to normal
functions.
The compiler treats the inline expansion options and keywords as suggestions. There is no guarantee
that functions will be inlined. You cannot force the compiler to inline a particular function, even with the
__forcein- line keyword. When compiling with /clr, the compiler will not inline a function if there are
security attributes applied to the function.
The inline keyword is available only in C++. The __inline and __forceinline keywords are available in both
C and C++. For compatibility with previous versions, _inline is a synonym for __inline.
Grammar:
Code MD-UML
return a; return b;
}
MD-UML
C++ Attributes
Attributes are designed to simplify COM programming and .NET Framework common language runtime
development. When you include attributes in your source files, the compiler works with provider DLLs
to insert code or modify the code in the generated object files.
Code MD-UML
Override Specifiers
abstract
Code MD-UML
ref class MyAbstractClass abstract with «C++CLIClass» and tagged value abstract=true
{
};
new
Code MD-UML
override
Code MD-UML
sealed
// Symbian macro
#define _L(string) TPtrC((const TText*) string)
#define _LIT(name,s) const static TListC<sizeof(s)> name = {sizeof(s) -1,s}
#define _LIT8(name,s) const static TListC<sizeof(s)> name = {sizeof(s) -1,s}
#define IMPORT_C /*__declspec(dllimport)*/
#define EXPORT_C /*__declspec(dllexport)*/
#ut NONSHARABLE_CLASS(x) class x
#define NONSHARABLE_STRUCT(x) struct x
#define GLREF_D extern
#define GLDEF_D
#define LOCAL_D static
#define GLREF_C extern
#define GLDEF_C
#define LOCAL_C static
Documentation with doxygen @see tag is reversed with a link to the model. The documentation should
use one of the following special doxygen tag to describe an @see element.
• @see
• \see
• @sa
• \sa
The documentation must be in the form of “@see element”. Only one element follows @see will be
reversed as an element link in model documentation.
Functionality
This feature only works in import-code-only mode.
If a doxygen documentation after a member is reversed, the comment after the member should use
the special doxygen tag used to mark a documentation after a member.
• '/**<'
• '///<'
• '//!<'
Interactive mode If enabled, you will be questioned during the reverse process when the parser
cannot decide whether the symbol is a class or namespace.
For example:
class A {
B::X i;
};
The parser does not have enough information to decide whether B is a class or
namespace.
Default Mode
If you are using the default mode, rather than the interactive mode,
the reverse module will automatically give the best guess according
to the information in the code.
Parse error before stop Allows you to specify the number of errors to ignore before the reverse process
will be terminated. You can set the property to zero to allow CE to reverse all
code before stopping.
Parse Includes If set to false, the reverse module will reverse only the selected files and ignore
all #include statements.
Show message for not found Used to display messages in the message window when the reverse module
includes cannot find the files included in the #include statement.
Parse Includes
You must set the property Parse Includes to true in order to use the
property Show message for not found includes.
Related pages:
Related pages
Generics permit classes, structs, interfaces, delegates, and methods to be parameterized by the data
types they store and manipulate. Generic class declaration should be mapped to the UML classifier
(class or interface) with a Template parameter. Additionally, Generics still affect other parts of the
program structures such as Attribute, Operation, Parameter, Parent Class, and Overloading Operators.
In this chapter you will find how C# code structures are mapped to the UML model.
Generic Class
Class S has one template parameter named T. The default type of T is Class.
Example
Code:
Generic Struct
The type parameter of generic struct is created the same as generic class, but we apply «C#Struct»
stereotype to the model.
Generic Interface
Example
Code:
interface S<T>
{
}
Generic Delegate
To create a generic delegate, we create a class model and apply the «C#Delegate» to the model. We,
then, create an empty named method with delegate return type, and add template parameter like a
normal generic class.
Example
Code:
Generic Attribute
The type of attributes in the class can be generic binding (template binding) or template parameter of
owner class. The example code shows attributes that use template binding as its type
class C<T>
{
}
class D<T>
{
private C<int> c1;
private C<string[]> c2;
private C<T> c3;
private T c4;
}
..
Private C<int> c1;
..
Private C<string[]> c2;
..
Private C<T> c3;
..
Private T c4;
Generic Operation
Language extention Generic can be applied to Operation.
Example
Code:
Binding Types
We have to create or select the correct binding types.
In the example code, the type of parameter t is public void f1<T> (T t), it must be the Template
Parameter of the owner method, but type f1<T> is not the template parameter of the owner
Class S<T>.
In the second method, public void f1<U, V> (T t, U u), parameter t type must be the Template
Parameter of the owner Class, S<T>.
Example
Code:
class b
{
public T f1<T, U>(T t, U u)
whereU:T{returnt; }
}
Generic overloading
Methods, constructors, indexers, and operators within a generic class declaration can
be overloaded. While signatures as declared must be unique, it is possible that
substitution of type arguments results in identical signatures.
class X<T>
{
public static explicit operator X<T>(T value)
{ return null; }
public static implicit operator T(X<T> x)
{ return x.item; }
public static explicit operator
XXX<int>(X<T> x)
{ return null; }
public static explicit operator
X<T>(XXX<int> x) }
{ return null; }
public static X<T> operator ++(X<T> operand)
{ return null; }
public static int operator >>(X<T> i, int c)
{ return c; }
}
Example
Code:
Generic constraints
Generic type and method declarations can
optionally specify type parameter
constraints by including type-parameter-
constraints-clauses:
type-parameter-constraints-clause
type-parameter-constraints-clauses type-
parameter-constraints-clause
type-parameter-constraints-clause:
The list of constraints given in a where clause can include any of the following components, in this
order: a single primary constraint, one or more secondary constraints, and the constructor constraint,
new().
type-parameter-constraints:
primary-constraint
secondary-constraints
constructor-constraint
primary-constraint , secondary-constraints
primary-constraint , constructor-constraint
secondary-constraints , constructor-constraint
primary-constraint , secondary-constraints , constructor-constraint
A primary constraint can be a class type or the reference type constraint class or the value type
constraint struct.
class-type
class
struct
interface-type
type-parameter
secondary-constraints , interface-type
secondary-constraints , type-parameter
constructor-constraint:
new ( )
Each type-parameter-constraints-clause consists of the token where, followed by the name of a type
parameter, followed by a colon and the list of constraints for that type parameter. There can be at most
one where clause for each type parameter, and the where clauses can be listed in any order.
The given list of constraints in a where clause can include any of the following components, in this order:
a single primary constraint, one or more secondary constraints, and the constructor constraint, new().
Anonymous method
Anonymous method allow code blocks to be written in-line where delegate values are expected.
Anonymous methods are similar to lambda functions in the Lisp programming language. C# 2.0
supports the creation of closures where anonymous methods access surrounding local variables and
parameters.
In versions of C# previous to 2.0, the only way to declare a delegate was to use named methods. C# 2.0
introduces anonymous methods.
Creating anonymous methods is essentially a way to pass a code block as a delegate parameter.
For example:
By using anonymous method, you reduce the coding overhead in instantiating delegates by eliminating
the need to create a separate method.
Now, there is no direct mapping for Anonymous method, but it uses the mapping for delegate method
feature.
Partial types
Partial types allow classes, structs, and interfaces to be broken into multiple pieces stored in different
source files for easier development and maintenance.
Each part of a partial type declaration must include a Type modifier partial and must be declared in the
same namespace as the other parts.
Example 1
The partial modifier indicates that additional parts of the type declaration
may exist elsewhere, but the existence of such additional parts is not a
requirement. It is valid for just a single declaration of a type to include the
partial modifier.
All parts of a partial type must be compiled together such that the parts can
be merged at compile-time. Partial types specifically do not allow already
compiled types to be extended.
Example 2
Example 3
The type specified before the ? modifier in a nullable type is called the underlying type of the nullable
type. The underlying type of a nullable type can be any non-nullable value type or any type parameter
that is constrained to non-nullable value types (that is, any type parameter with a st r uct constraint).
The underlying type of a nullable type cannot be a nullable type or a reference type.
A nullable type can represent all values of its underlying type plus an additional null value.
The syntax T? is shorthand for System.Nullable<T>, and the two forms can be used interchangeably.
class class1 {
}
int? a = null;
System.Nullable a = null;
}
Accessor declarations
The use of accessor-modifiers is governed by the following restrictions:
Class A
{
private string text = “init value”;
public String Text
{
protected get{ return text;}
set{ text = value;}
}
}
Static Class
Static classes are classes that are not intended to be instantiated and which contain only static
members. When a class declaration includes a static modifier, the class being declared is said to be a
static class.
When a class declaration includes a static modifier, the class being declared is said to be a static class.
static class A
{
...
}
namespace N
{
public class A {}
public class B {}
}
Assembly a2.dll:
namespace N
{
public class B {}
public class C {}
}
class Test
{
N.A a;
N.C c;
}
The following program declares and uses two extern aliases, X and Y, each of which represent the root
of a distinct namespace hierarchy created from the types contained in one or more assemblies.
extern alias X;
extern alias Y;
class Test
{
X::N.A a;
X::N.B b1;
Y::N.B b2;
Y::N.C c;
}
A fixed size buffer is a member that represents storage for a fixed length buffer of variables of a given
type. A fixed size buffer declaration introduces one or more fixed size buffers of a given element type.
Fixed size buffers are only permitted in struct declarations and can only occur in unsafe contexts.
A fixed size buffer declaration that declares multiple fixed size buffers is equivalent to multiple
declarations of a single fixed sized buffer declaration with the same attributes, and element types.
unsafe struct A
{
public fixed int x[5], y[10], z[100];
}
is equivalent to
unsafe struct A
{
public fixed int x[5];
public fixed int y[10];
public fixed int z[100];
}
To declare fix size buffer, you need in C# Language Properties set Property Fixed value to true:
Related pages
Extension methods
Extension methods are static methods that can be invoked using instance method syntax. In effect,
extension methods make it possible to extend existing types and constructed types with additional
methods.
The following is an example of a static class that declares two extension methods:
It becomes possible to invoke the extension methods in the static class Extensions using instance
method syntax:
string s = "1234";
int i = s.ToInt32();// Same as Extensions.ToInt32(s)
int[] digits={0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int[] a = digits.Slice(4, 3);// Same as Extensions.Slice(digits, 4, 3)
Example
Code:
class K
{
Test (this int a)
{}
}
In this chapter summarizes the mapping between C# elements and UML elements in class diagrams.
Related pages
C# stereotypes
Contents
C#Attribute
«C#Attribute» is an invisible stereotype that is used to define C# attribute properties. This is used to
store the language properties of the attribute in C#.
C#Attribute Property
container String
unsafe struct A
{
public fixed int x[5];
}
Class A
{
public readonly int x;
}
Class A
{
public volatile int x;
}
C#Class Class
static Class A
{
public int x;
}
C#Delegate
«C#Delegate» is a stereotype that indicates that model class represents C# delegate.
C#Delegate Class
C#Element
«C#Element» is a stereotype that is used to define properties of all element in model.
C#Element Element This stereotype can be applied to all elements such as class,
attribute, operation and parameter.
class Test
{
X::N.A a;
}
partial String
C#EnumerationLiteral
«C#EnumeraltionLiteral» is a stereotype that is used to define enumeration.
C#EnumerationLiteral EnumerationLiteral
C#Event
«C#Event» is a stereotype that is used to indicate that operation represents C# event.
C#Event Operation
C#Generic
«C#Generic» is a stereotype that is used to define generic properties.
C#Generic Class
C#Indexer
«C#Indexer» is a stereotype that is used to indicate that operation represents C# indexer.
C#Indexer Operation
C#LanguageProperty
«C#LanguageProperty» is the parent of «C#Class», «C#Attribute», and «C#Operation», So the «C#Class»,
«C#Attribute» and «C#Operation» also have it’s tag definition.
C#LanguageProperty Element
internal boolean
new boolean
unsafe struct A
{
public fixed int x[5];
}
C#Operation
«C#Operation» is a stereotype which is used to define properties of the operation. This is used to store
the language properties of the operation in C#.
C#Operation Operation
conversion String
type
Class A
{
public extern int x();
}
initialization String
override boolean
partial String
virtual boolean
C#ExplicitInte Classif Defines C# explicit interface for explicit interface member implementation.
rface ier
C#Operator
«C#Operator» is a stereotype that is used to indicate that the operation represents C# operator.
C#Operator Operation
C#Parameter
«C#Parameter» is a stereotype that is used to indicate that the element represents C#Parameter.
C#Parameter Element
C#Params
«C#Params» is a stereotype that is used to indicate parameter arrays.
C#Params Parameter
Tag Type
extend String
params String
C#Property
«C#Property» is a stereotype that is used to indicate that the operation represents C# property.
C#Property Operation
C#Struct
«C#Struct» is a stereotype that is used to indicate that the model class represents C# structure.
C#Struct Class
C#Using
«C#Using» is a stereotype that is used to indicate that the usage dependency is C# Using directive.
C# data type
In addition to stereotype and tagged value, C# datatype should be created in the profile. The following
figure shows the data types of C# profile.
Related pages
Class
New Mapped to the tag “New” of «C#LanguageProperty» (The usage for this is
to apply «C# Class» and set value to tag “new”)
Internal Mapped to the tag “Internal” of «C#LanguageProperty» (The usage for this
is to apply «C# Class» and set value to tag “internal”)
Unsafe Mapped to the tag “Unsafe” of «C#LanguageProperty» (The usage for this
is to apply «C# Class» and set value to tag “unsafe”)
Attribute
New Mapped to the tag “New” of «C#LanguageProperty» (The usage for this is
to apply «C#Attribute» and set value to tag “new”)
Internal Mapped to the tag “Internal” of «C#LanguageProperty» (The usage for this
is to apply «C#Attribute» and set value to tag “internal”)
Unsafe Mapped to the tag “Unsafe” of «C#LanguageProperty» (The usage for this
is to apply «C#Attribute» and set value to tag “unsafe”)
Operation
C# Properties Customization
DSL Customization is adopted to hide UML mapping, so extensions in MagicDraw should look like they
are standard elements. DSL properties should appear in specifications as regular properties, not tags.
So we disable the extension C# language properties and then move them to tagged value in stereotype
of C# profile and DSL properties. The DSL properties will conform to tagged value of stereotype.
For an old project containing old C# language properties, after performing open or import, they will be
translated to the appropriate stereotype and tagged value.
Customization Class
All DSL specific custom rules should be stored as tag values in Classes, marked with «Customization»
stereotype.
This stereotype contains special tags that should be interpreted by “MD Customization Engine” in
special ways, to enable many possible customization in MD GUI and behavior:
C# Using Namespace
The following example shows the mapping of C# Using Namespace. The usage dependency for C#
Using namespace declaration that is not in the namespace will be created under File View component.
Example
Code:
using System;
using System.Collections.Generic;
using System.Text;
namespace n0
{
class using1 {}
}
Open usage dependency specification apply «C#Using» stereotype. For using namespace, leave the
name empty:
C# Using alias
The following example shows the mapping of C# Using alias. The usage dependency for C# Using alias
declared in the namespace will be created under that namespace.
Open usage dependency specification apply «C#Using» stereotype. For using alias, enter the alias
name:
C# Partial feature
For mapping C# Using directive in the C# Partial feature, add file component name into Partial Tag
value of usage link specification.
Example
Code for creating value partial1.cs
//partial1.cs
namespace n1 {
using LL =
System.Text.Encoder;
}
partial class using1
{
LL a;
}
Example
Code for creating value partial2.cs
//partial2.cs
namespace n1 {
using LL =
System.Text.Decoder;
}
partial class using1
{
LL b;
}
Related pages:
UML constraints
Code example
namespace N {
class A { .. }
class A<T> { .. }
class A<T, U> { .. } }
The user cannot create the model for these three classes in MagicDraw manually. They can only be
created in C# reverse engineering.
When creating manually Class A in the model, it would show the error message when trying to create
Class A.
Translation Constraints
Property Translation
From version 12.1 MagicDraw C# translates C#Property from operation to attribute. After translation,
the message window will show the following message:
Information message
Orphaned proxy found in module "C#_Profile.xml". Use search functionality
with option "Orphaned proxies only" to locate them.
After the project has been saved and reopened, the message will not appear again.
http://www.omg.org/technology/documents/profile_catalog.htm#UML_for_CORBA.
CORBA IDL mapping to UML is based on the UML Profile for CORBA Specification, Version 1.0, April
2002.
Availability
This functionality is available in the Enterprise edition only.
The differences between the UML Profile for CORBA specification and mapping in MagicDraw are listed
below.
• Constraints defined in the UML Profile for CORBA specification are not checked in MagicDraw.
• The stereotype CORBAAnonymousFixed is introduced. It is used to represent anonymous fixed
types of a stereotype. Fixed types without names are mapped to inner classes with the
stereotype CORBAAnonymousFixed. These classes are bound to CORBA::fixed classes.IDL Code:
struct baz
{
fixed <8, 4> high_scale;
fixed <8, 2> low_scale;
};
MagicDraw presents a CORBA IDL diagram that simplifies the creation of standard CORB IDL elements.
The following elements are available in the CORBA IDL diagram:
G Generalization
Truncatable Generalization
I Interface
• UML Class: a class as a base element for CORBA Interfaces appears in projects created in
MagicDraw version 17.0.1. The CORBA Interfaces are modeled as classes in these projects.
• UML Interface: an interface as a base element for CORBA Interfaces appears in projects created
in MagicDraw version 17.0.1 and later. The CORBA Interfaces are modeled as interfaces in these
projects.
Important!
The generalization relationship can be used only between CORBA Interfaces based on the same
element. Thus, you can use the generalization relationship between two CORBA Intarfaces
based on a class or between two CORBA Interfaces based on an interface, but not between a
CORBA Interface based on a class and a CORBA Interface based on an interface.
1. On the Options menu, click Project. The Project Options dialog opens.
3. In the General list, click the CORBA IDL and then CORBA Interfaces implemented as value cell. The
list of available values opens.
• Select UML Class to set a class as the base element for the CORBA Interface.
• Select UML Interface to set an interface as the base element for the CORBA Interface.
5. Click OK when you are done.
1. Select the CORBA Interface element in the Model Browser or its symbol on the diagram pane.
2. From the shortcut menu of the selected CORBA Interface, point to Refactor > Convert To, and then
do one of the following:
• Click Class if an interface is the current base element for CORBA Interface.
• Click Interface if a class is the current base element for CORBA Interface.
Important!
Convert the selected CORBA Interface only to the class or interface element. Conversion to
other elements changes the CORBA Interface element to the selected element but not to the
element the CORBA Interface is based on.
For more information about refactoring, see Refactoring (see page 905).
5.11 WSDL
Reference:
http://www.w3.org/TR/2001/NOTE-wsdl-20010315
MagicDraw UML supports WSDL code engineering: code generation, reverse and syntax checking. A
WSDL diagram is dedicated for WSDL modeling.
WSDL code engineering contains the WSDL Profile and XML Schema Profile.
• types, providing data type definitions used to describe the messages exchanged.
• message, representing an abstract definition of the data being transmitted. A message consists
of logical parts, each of which is associated with a definition within a type system.
• portType, a set of abstract operations. Each operation refers to an input message and output
messages.
• binding, specifying concrete protocol and data format specifications for the operations and
messages defined by a particular portType.
• port, specifying an address for a binding, thus defining a single communication endpoint.
• service, used to aggregate a set of related ports.
Related pages:
Defined stereotypes
This chapter describes how our modeling tool maps WSDL elements to UML and helps to choose which
stereotypes and Tag definitions to use.
targetNamespace - string
ElementImport WSDLimport
PackageImport
Definitions
A WSDL document is simply a set of definitions, with a definitions element at the root, and definitions
inside.
Example
Code:
Example
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/">
<import location="http://www.bbb.net/wsdl" namespace="http://
www.aaa.org/wsdl"/>
</definitions>
Messages
Messages consist of one or more logical parts. Each part is associated with a type from a type system
using a message-typing attribute. The set of message-typing attributes is extensible.
WSDL defines several such message-typing attributes for use with XSD:
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote.wsdl"
xmlns:tns="http://example.com/stockquote.wsdl"
xmlns:xsd1="http://example.com/stockquote.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace="http://example.com/stockquote.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="TradePriceRequest">
<complexType>
<all>
<element name="tickerSymbol"
type="string"/>
</all>
</complexType>
</element>
<element name="TradePrice"> <complexType>
<all>
<element name="price"
type="float"/>
</all>
</complexType>
</element>
</schema>
</types>
<message name="GetLastTradePriceInput">
<part name="body" element="xsd1:TradePriceRequest"/>
</message>
<message name="GetLastTradePriceOutput">
<part name="body" element="xsd1:TradePrice"/>
</message>
</definitions>
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote.wsdl"
xmlns:tns="http://example.com/stockquote.wsdl"
xmlns:xsd1="http://example.com/stockquote.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace="http://example.com/stockquote.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="SubscribeToQuotes">
<complexType>
<all>
<element name="tickerSymbol"
type="string"/>
</all>
</complexType>
</element>
<element name="SubscriptionHeader" type="uriReference"
/>
</schema>
</types>
</definitions>
Port types
A port type is a named set of abstract operations and the abstract messages involved.
The port type name attribute provides a unique name among all port types defined in the
enclosing WSDL document.
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote.wsdl"
xmlns:tns="http://example.com/stockquote.wsdl"
xmlns:xsd1="http://example.com/stockquote.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<message name="SubscribeToQuotes">
<part name="body" element="xsd1:SubscribeToQuotes"/>
<part name="subscribeheader" element="xsd1:SubscriptionHeader"
/>
</message>
<portType name="StockQuotePortType">
<operation name="SubscribeToQuotes">
<input message="tns:SubscribeToQuotes"/>
</operation>
</portType>
<binding name="StockQuoteSoap" type="tns:StockQuotePortType">
<soap:binding style="document" transport="http://example.com/smtp"/>
<operation name="SubscribeToQuotes">
<input message="tns:SubscribeToQuotes">
<soap:body parts="body" use="literal"/>
<soap:header message="tns:SubscribeToQuotes"
part="subscribeheader" use="literal"/>
</input>
</operation>
</binding>
<service name="StockQuoteService">
<port name="StockQuotePort" binding="tns:StockQuoteSoap">
<soap:address location="mailto:[email protected]"/>
</port>
</service>
<types>
<schema targetNamespace="http://example.com/stockquote.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="SubscribeToQuotes">
<complexType>
<all>
<element name="tickerSymbol"
type="string"/>
</all>
</complexType>
</element>
<element name="SubscriptionHeader" type="uriReference"/> </
schema>
Bindings
A binding defines the message format and protocol details for operations and messages defined by a
particular portType. There can be any number of bindings for a given portType.
The name attribute provides a unique name among all bindings defined in the enclosing WSDL
document.
A binding references the portType it binds using the type attribute. Binding extensibility elements are
used to specify the concrete grammar for the input, output, and fault messages. Per-operation binding
information as well as per-binding information can also be specified. See the example below for more
information.
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote.wsdl"
xmlns:tns="http://example.com/stockquote.wsdl"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
xmlns:xsd1="http://example.com/stockquote.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<message name="GetTradePriceInput">
<part name="tickerSymbol" element="xsd:string"/>
<part name="time" element="xsd:timeInstant"/>
</message>
<message name="GetTradePriceOutput">
<part name="result" type="xsd:float"/>
</message>
<portType name="StockQuotePortType">
<operation name="GetTradePrice">
<input message="tns:GetTradePriceInput"/>
<output message="tns:GetTradePriceOutput"/>
</operation>
</portType>
<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
<soap:binding style="rpc" transport="http://
schemas.xmlsoap.org/soap/http"/>
<operation name="GetTradePrice">
<soap:operation soapAction="http://example.com/
GetTradePrice"/>
<input>
<soap:body use="encoded" namespace="http://
example.com/stockquote" encodingStyle="http://schemas.xmlsoap.org/soap/
encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://
example.com/stockquote" encodingStyle="http://schemas.xmlsoap.org/soap/
encoding/"/>
</output>
</operation>>
</binding>
<service name="StockQuoteService">
<documentation>My first service</documentation>
<port name="StockQuotePort" binding="tns:StockQuoteBinding">
<soap:address location="http://example.com/stockquote"
/>
</port>
Services
A service groups a set of related ports together.
The name attribute provides a unique name among all services defined in the enclosing
WSDL document.
• None of the ports communicate with each other (e.g. the output of one port is not the input of
another).
• If a service has several ports that share a port type, but employ different bindings or addresses,
the ports are alternatives. Each port provides semantically equivalent behavior (within the
transport and message format limitations imposed by each binding).
• By examining its ports, we can determine a service's port types. This allows a consumer of a
WSDL document to determine if it wishes to communicate with a particular service based on
whether or not it supports several port types.
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote.wsdl"
xmlns:tns="http://example.com/stockquote.wsdl"
xmlns:xsd1="http://example.com/stockquote.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace="http://example.com/stockquote.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="TradePriceRequest">
<complexType>
<all>
<element name="tickerSymbol"
type="string"/>
</all>
</complexType>
</element>
<element name="TradePrice">
<complexType>
<all>
<element name="price" type="float"/>
</all>
</complexType>
</element>
</schema>
</types>
<message name="GetLastTradePriceInput">
<part name="body" element="xsd1:TradePriceRequest"/>
</message>
<message name="GetLastTradePriceOutput">
<part name="body" element="xsd1:TradePrice"/>
</message>
<portType name="StockQuotePortType">
<operation name="GetLastTradePrice">
<input message="tns:GetLastTradePriceInput"/>
<output message="tns:GetLastTradePriceOutput"/>
</operation>
</portType>
<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/
soap/ http"/>
<operation name="GetLastTradePrice">
<soap:operation soapAction="http://example.com/
GetLastTradePrice"/>
<input>
<soap:body use="literal"/>
Ports
The following rules describe the Ports element:
<definitions name="HelloService"
targetNamespace="http://www.ecerami.com/wsdl/
HelloService.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<message name="SayHelloRequest">
<part name="firstName" type="xsd:string"/>
</message>
<message name="SayHelloResponse">
<part name="greeting" type="xsd:string"/>
</message>
<portType name="Hello_PortType">
<operation name="sayHello">
<input message="tns:SayHelloRequest"/>
<output message="tns:SayHelloResponse"/>
</operation>
</portType>
<binding name="Hello_Binding" type="tns:Hello_PortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="sayHello">
<soap:operation soapAction="sayHello"/>
<input>
<soap:body
encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples:helloservice"
use="encoded"/>
</input>
<output>
<soap:body
encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples:helloservice"
use="encoded"/>
</output>
</operation>
</binding>
<service name="Hello_Service">
<documentation>WSDL File for HelloService</documentation>
<port binding="tns:Hello_Binding" name="Hello_Port">
<soap:address
location="http://localhost:8080/soap/servlet/
rpcrouter"/>
</port>
Macro Engine comes with Professional, Architect, and Enterprise Editions starting from MagicDraw
version 16.6 and later.
MagicDraw 18.1 Macro Engine supports two types of Javascript: (i) Javascript Nashorn and (ii) Javascript
Rhino. This support is intended to prevent some incompatibility issues in the language syntax with
macros that were created using Java 7 or earlier (Javascript Rhino), because Oracle changed the built-in
Javascript engine from Javascript Rhino to Javascript Nashorn since Java 8 was released.
If you are using MagicDraw 18.1 or later with Java 8 and created a macro with the new language
syntax in Nashorn, and then downgraded your Java to Java 7, this will cause an execution
problem for your macro.
4. Select Jython, BeanShell, Groovy, JRuby, or JavaScript.
4. Click to test and make sure that the source code works properly.
5. Click . The Macro Information dialog will open. Follow the steps described in Adding
a Macro and Its Information (see page 2588).
6. After clicking OK in the Macro Information dialog, the new macro will be saved in the location
you have specified in the File text box.
Use the or button in the Organize Macros dialog to add or edit a macro and its
information in the Macro Information dialog. You can also press the mnemonic keys to add or edit a
macro, see Macro Information Dialog Mnemonic Keys.
The , , , and buttons in the Organize
Macros dialog will be disabled if there is no macro in the macro table or if you do not
select any macro from the table.
• If you select the check box, the full pathname will not be
saved.
• If you select the check box, your source code will be imported
from the file to the model. The location to keep the model is Data::MacroEngine.
• You can open the Macro Information by using Ctrl+Alt+m as a shortcut key.
10. The function of the check box is to allow you to run the default
values automatically. If you select the check box, the system will not open a dialog to prompt you
to input the value.
If you select the check box, you need to enter the valid
default value of each parameter.
11. Click Add to specify the arguments of the macro. The arguments specified in
the Arguments table will be the global variables of a specific macro.
• Name column contains the name of a parameter
• Type column contains the type of a parameter
• Array check box is to identify if an array is the parameter
• Null check box is to identify if null is the parameter value
• Default Value column contains an initial value to run the macro
12. Type a keyboard shortcut that will be used to run the macro in the
1. Click Tools > Macros > Organize Macros. The Organize Macros dialog will open, see figure
below.
2. Select a macro from the table and either click Edit or press Alt + E. The Macro
Information dialog will open.
4. Click OK to save it. You will see the altered information in the Organize Macros dialog.
box.
box.
box.
box.
area.
box.
button.
button.
button.
box.
button.
button.
button.
On this page
2. Select a macro from the table and click . After the macro has been executed, a
message will open: The macro <macro name> has been executed.
3. If you have the parameters in the Macro Information dialog, you need to specify the value in
the Macro Arguments dialog, see figure below, before running the macro.
• You can also execute a macro from the main browser in MagicDraw by pressing the
shortcut keys that you have defined in the Organize Macros dialog.
• You can only run macro one at a time.
• If there is an error while running a macro, for example, syntax error, the following
message will open: MagicDraw cannot execute the <macro language> macro, please
make sure that <path, filename, extension> is correct. <error description>.
• If MagicDraw cannot find a macro file in the location that you have specified in
the Open dialog, the following message will open: MagicDraw cannot find the macro:
<path, filename, extension>.
• You can click the button in the Organize Macros dialog, see figure above,
to edit and save source code in the Macro Editor dialog, see figure below.
• You can click to save the source code or click to run the macro in
the Macro Editor dialog, see figure below.
Related pages
• The button in the Macro Information or Environment Options dialog
will be disabled until you type a keyboard shortcut in the
box.
box.
Field Function
• The , , and buttons in the Macro
Information or Environment Options dialog will be disabled if there is no keyboard
• The button will be enabled if the new keyboard shortcut entered has not
been assigned to any other macro. You can assign more than one keyboard shortcut to a
macro.
AutomatonMacroAPI.getOpaqueObjectByPath ("PackageA::Element2");
You can also use two other methods to get an opaque object as follows:
(iii) AutomatonMacroAPI.getModelData()
(iv) AutomatonMacroAPI.getSelectedElementFromContainmentTree()
(iii) getModelData()
This method will obtain an opaque object of the model Data in the Containment tree.
(i) <variableName>.get<PropertyName>()
(ii) <variableName>.<PropertyName>
(iii) <variableName>._automatonGetValue(String realPropertyName,
String stereotypePath)
The <variableName> is the name of a macro variable that stores the opaque object. The
<PropertyName> is the name of the property that appears in the Specification dialog.
The <variableName> is the name of a macro variable that stores the opaque object. The
<PropertyName> is the name of the property that appears in the Specification dialog.
You need to capitalize the first letter of <PropertyName> and replace the whitespace with an
underscore. If a duplicate property name occurs, you can refer to the right property name by using the
following additional information: <SterotypeName>_<PropertyName><RunningNumber>.
If there are two stereotypes applied to the same element, see above figure, you can differentiate one
from the other, for example, by specifying <PropertyName> as StereotypeA_PropertyA1 and
StereotypeA_PropertyA2 in the macro.
You can also use the method _automatonGetValue to get a property value. If you want to get the value
of a PropertyA from SterotypeA in PackageA., for example, you can use
_automatonGetValue(“PropertyA”, “PackageA::StereotypeA”).
A realPropertyName is the real property name that is used in MagicDraw openAPI. A stereotypePath is
the path of a stereotype that contains the property. This property will not be needed if it is in the
Element itself.
If you refer to a property that does not exist, Macro Engine may or may not throw an error, depending
on which language library you use. For example, if you use Javascript to call the property that does not
exist, Macro Engine will not throw an error. But if you use JRuby, it will throw an exception to report the
error condition: org.jruby.exceptions.RaiseException.
If a property has more than one value, Macro Engine will convert the values to a list of opaque objects.
If you need to get a value from the list, you can call the method of the class java.util.List, for example, by
typing:
(i) classA.appliedStereotype.get(<index>).Name
or
(ii) classA.appliedStereotype.add(anotherOpaque)
If a property is read-only, an exception will be thrown.
If you use <variableName>.<PropertyName> = value to set the value, you must call persist() to persist
the change to the MagicDraw element. You need to first set the data, call persist(), and finally call a
getter method in order to set the data and retrieve them. This process will force an opaque object to
retrieve the current value from a MagicDraw model and overwrite the value that you have just specified
in the opaque object.
The table below lists the supported element properties in Macro Engine.
Element ID N/A -
Image N/A -
Representation N/A -
To Do String Read/Write
• <variableName>._getChild(String childElementName)
If the above method cannot find the childElementName, it will throw an error.
To get the child of an element named ClassB from ClassA, for example, type:
• <variableName>._getOwner()
If the above method cannot find the owner, for example Model Data, it will throw an error.
To get the owner of an element named ClassA, for example, type:
• AutomatonMacroAPI.createElement(String metaClassName)
This method will return an opaque object of the created element. If the method cannot find the Meta-
class, it will throw an exception.
To create a new Class & Requirement element (Javascript), for example, type:
AutomatonMacroAPI.createElement("Class");
AutomatonMacroAPI.createElement("Requirement");
• AutomatonMacroAPI.createRelationship(AutomatonOpaqueObject opque1,
AutomatonOpaqueObject opque2, String relationName)
To create a Copy & Abstraction relationship between Element1 and Element2 (Javascript), for example,
type:
var a = AutomatonMacroAPI.getOpaqueObjectByPath("Element1");
var b = AutomatonMacroAPI.getOpaqueObjectByPath("Element2");
AutomatonMacroAPI.createRelationship(a, b, "Copy");
AutomatonMacroAPI.createRelationship(a, b, "Abstraction");
• AutomatonMacroAPI.removeElement(AutomatonOpaqueObject opaqueObj)
To remove an Element1 (Javascript), for example, type:
var a = AutomatonMacroAPI.getOpaqueObjectByPath("Element1");
AutomatonMacroAPI.removeElement(a);
You cannot move the element defined as a record scope during recording.
To record a macro
3. Select the check box and click the Model Scope button to locate a scope in
the Containment tree. The generated macros will later record the change in the element by using
a relative path that refers to the defined scope.
6. Click to stop recording. The Record Macro dialog will close and the Create
Macro dialog will open, see figure below, showing the recorded macros.
1281 http://docs.nomagic.com/display/MacroEngineUserGuide/
Working+with+Macro+Engine#WorkingwithMacroEngine-selecting-a-default-macro-language
• If you click the button, the recording will pause and the button will be
changed to .
out of the
box.
BeanShell
BeanShell is a lightweight scripting language for Java. The shipped version is 2.1.7. The advantage of
using BeanShell is that its syntax is compatible with Java; therefore, you can use the code assistant
feature in most Java IDE. The BeanShell syntax documentation is available at http://www.beanshell.org/
docs.html.
JavaScript
JavaScript is a scripting language based on Java syntax. The documentation is available at:
http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/index.html and https://
developer.mozilla.org/en/Rhino_documentation.
JRuby
JRuby is a 100% pure-Java implementation of the Ruby programming language. Macro Engine uses
JRuby 1.7.11 The documentation is available at http://jruby.org/documentation.
Jython
Jython, a successor of JPython, is a Python programming language implemented in Java. The
documentation is available at http://wiki.python.org/jython. Besides automating MagicDraw by using
Jython scripting, the plugin development in the Jython programming language is also supported in
MagicDraw. For more information on Jython, see JPython Scripting in MagicDraw OpenAPI User Guide.
Groovy
Groovy is an agile and dynamic language for the Java Virtual Machine. Macro Engine uses Groovy 2.0.1.
The advantage of using Groovy is that its Java-like syntax seamlessly integrates with the existing Java
source code and libraries. It supports many IDEs that provide code completion and debugging.
BeanShell scripts can be easily moved to Groovy, with some modifications. For more information on
Groovy, go to http://groovy-lang.org/.
var a;
It is difficult to determine what type of "a" later in the source code. With BeanShell, you can use a
variable without declaring it, for example:
a = new File("file.txt");
Java IDE does not officially support code completion for scripting languages. However, there is a
workaround if you use BeanShell. First you need a Java IDE. If you do not have one, you can select
NetBeans because it has the smallest file size. You can download the latest version of NetBeans
at http://www.netbeans.org/downloads/index.html. The NetBeans Java SE package is enough. Second
you need to set up a MagicDraw classpath.
1. Click File > New Project on the main menu to create a Java application project. The New
Project dialog will open.
2. Select Java in the Categories box and Java Application in the Projects box, and then follow the
instructions.
3. Expand your project node in the Project window. The Libraries node will appear.
4. Right-click the Libraries node and select Add Library from the shortcut menu.
5. Select the MagicDraw library that you have previously created (see "To set up a classpath point in
the MagicDraw library in NetBeans:") and click Add Library.
You need to create a public static method in a Java file, for example, main() method, to follow the
standard Java programming language. At the end of the file, insert a statement to call the static method.
See the example in create_project_elements.bsh in the <MagicDraw>/samples/product features/
macros directory.
The official filename extension for BeanShell is .bsh. However, you can add a .java file to
the BeanShell scripting language.
Use the following three simple steps to develop and run a Groovy script in NetBeans:
1. Set up a classpath.
2. Develop a Groovy script.
To set up a classpath
1. Click File > New Project on the main menu to create a Java application project. The New
Project dialog will open.
2. Select Java in the Categories box and Java Application in the Projects box, and then click Next.
3. Choose a project location. Be sure that you do not select Create Main Class.
4. Click Finish.
5. Expand your project node in the Project window. The Libraries node will appear.
6. Right-click the Libraries node and select Add Library from the shortcut menu.
7. Click File > New File on the main menu to add a new Groovy file.
8. Select Groovy in the Categories box and Groovy Script in the File Types box.
9. Follow the instructions until finish.
1. Go to https://github.com/groovy/groovy-eclipse.
2. Follow the instructions for installing Groovy-Eclipse Plugin.
To develop a Groovy Script
Once the gem has been installed, you can use it in MagicDraw Macro Engine, for example
require 'java'
require 'rubygems'
require 'uuid'
Application = com.nomagic.magicdraw.core.Application
uuid = UUID.new Application.getInstance().getGUILog().log(uuid.generate);
To install a gem for the existing Ruby environment on your machine and use it in Macro Engine
1. Add the following properties to specify the home and library of JRuby in <MagicDraw>/bin/
mduml.properties under JAVA_ARGS section (assuming you have JRuby installed in C:/jruby-1.5.3 on
your machine).
-Djruby.home\="C:/jruby-1.5.3" -Djruby.lib\="C:/jruby-1.5.3/lib"
For example:
2. Change the JRuby library path to navigate to your jruby.jar in <MDdir>/plugins/
com.nomagic.magicdraw.automaton/plugin.xml.
A slash (/) is used as a directory separator for all platforms, including Windows. The new language will
be displayed in most of the Macro Engine dialogs, for example, in the Macros section in
the Environment Options dialog, the Create Macro dialog, and in the Macro Information dialog. The
language name is automatically configured from the information inside the jar file. This version of
Macro Engine does not allow you to modify the language name.
You can remove a scripting language from Macro Engine by removing the associated library tag
in the plugin.xml file. Once the tag has been removed, the language will be removed from all of
the dialogs in Macro Engine. However, the script configured to be used with the language will
not be removed from MagicDraw. The language of the script will be reset to the default
language, which has been previously configured in the MagicDraw Environment
Options dialog.
1282
1282 https://docs.nomagic.com/display/MP/UML+Meta+Model
• Vertexes are redefinable in State Machines. A vertex is either a State, or Pseudo State, or
Connection Point Reference. In earlier standard versions, only the State was redefinable.
• The semantic of Context and Constrained Element properties of the Constraint are clarified in the
standard specification.
• The Behavior of an Opaque Expression is now allowed to have input parameters.
The latter two items do not affect the modeling tool functionality.
We've put all our best efforts into implementing the UML 1.4 model migration to version UML 2.
However, the new standard is not backward compatible. Situations may occur where the migration
facilities may not import 100% of the model and data loss may occur.
Related pages
Projects based on UML 1.4 must converted to UML 2 to work with MagicDraw. The project load
mechanism in MagicDraw will automatically detect UML 1.4 projects andconvert it to UML 2.
As of version 18.1, a module is referred as a used project. The keywords "used project" and
"project usage" replace the keyword "module" everywhere in MagicDraw UI.
Related pages
To make the conversion process easier, you can use a free standalone MagicDraw Project Converter.
This converter is specifically designed to convert MagicDraw 9.x or earlier version projects to
MagicDraw 17.0 projects.
To convert a project
1283 http://www.magicdraw.com/download_no_cost_plugins#free
Related pages
9.3.1 Content
s
On this page
A project based on UML 1.4 cannot be loaded into MagicDraw if it uses UML 1.4 used projects. You
must convert all used projects to UML 2 before converting your main project to UML 2.
It is not possible to load a converted used project with previous MagicDraw versions or to use
them in projects based on UML 1.4.
After all used projects are converted into UML 2, you will be able to load projects that are using them.
Converting Stereotypes/Profiles
Stereotypes in a UML 2 metamodel must be contained by a Profile model element, and all tags must
be defined as properties of a stereotype. By contrast, in the UML 1.4 metamodel you could store
stereotypes and tags anywhere in the model with no restrictions.
To fix this problem during the migration process, MagicDraw creates a Profile
named “Profile_for_<project_name>” and moves all stereotypes from various packages into it.
For tags not owned by a stereotype, a new owning stereotypes is created. It will have the same name as
the tag.
Example
If you had a tag definition called “duration”, after project conversion to UML 2 you will have a
stereotype «duration», which will have a tag definition “duration”. The stereotype will be placed
in a Profile called “Profile_for_<project_name>”. All elements that had this tag in UML 1.4 will
also have the stereotype assigned in UML 2.
The UML Standard Profile was redesigned as well. Base classes for some stereotypes have been
changed; some stereotypes were removed. Stereotypes with modified base classes will still be assigned
to elements, even if the elements cannot have this stereotype assigned. These elements will be marked
as problematic.
Related pages
Related pages
We recommend that you convert all teamwork used projects before converting projects. All standard
profiles, bundled with MagicDraw installations, will be automatically updated on the first Teamwork
Server launch.
Only the latest project version will be converted into UML 2. All old versions (history) will remain
based on UML 1.4. Any old versions can be opened only in read-only mode.
When you load a project that uses a fixed version of a teamwork project, you will be warned
that MagicDraw will automatically switch to the latest version of a teamwork used project. If it is very
important to use a particular version of a teamwork used project, you should not commit the loaded
project to the teamwork server.
Follow these steps to preserve usage of a particular version of a teamwork used project:
1. Login into Teamwork Server with MagicDraw. From the Teamwork menu, choose Projects.
2. Select your project, expand the used projects tree and check which version the teamwork project
uses.
3. Find the used project in the list of projects (select the Show Used Projects check box). Click
the Versions button to open the Versions dialog box.
4. Select the version used by your project and set it as the latest one (click Set As Latest).
5. Click the Open button to open this version. During this step you will convert the latest version of
the teamwork used project to UML 2.
6. Commit the converted used project into the Teamwork Server and close it.
7. Open a project that uses a fixed version of this used project. The last used project version will be
loaded.
8. Commit the converted project into the Teamwork Server and close it.
9. From the Teamwork menu, choose Projects again.
10. Select your project in the list of projects and expand the tree of used projects. Change the used
project version from Latest to a latest version number.
11. Find the used project in the projects list (select the Show Used Projects check box). Click the
Versions button to open the Versions dialog box.
12. Select the latest version existing before these actions. Set this version as the latest one (click
Set As Latest).
13. Open the used project and commit it to the Teamwork Server. During this step you will convert
the latest version of the teamwork used project to UML 2.
After these steps, your project will use a fixed version of a teamwork used project that is converted to
UML 2, but other projects will be able to use the latest version of this used project.
If multiple projects use various versions of the same used project, repeat these steps for each project.
After a Teamwork project is converted to UML 2, it will not be possible to commit local versions
based on UML 1.4.
For more details, see Converting Teamwork Projects (see page 2629).
4. Save the integration project locally by overriding the old project file.
Issue Solution
Depende Dependency can be connected only between Try to avoid dependencies between
ncies NamedElements in UML 2. generalizations, merge, import and other
relationships that are not NamedElements in
Dependencies between other elements will be UML 2. If a dependency contains important
deleted after load. information, try to connect it to another
semantically close element supported in UML 2.
Issue Solution
Concurr Concurrent lifelines and message branching are UML 2 provides new notation for concurrency
ent no longer supported in a sequence diagram. and branching using combined fragments. We
lifelines They will be loaded into MagicDraw, but the recommend redrawing sequence diagrams
and user will not be allowed to draw these before or after migration.
messag elements.
e
branchi
ng
State Diagram
Issue Solution
StubSta StubState and SynchState elements are no Please try to remove StubStates and
te and longer supported in UML 2. SynchStates from state diagrams before
SynchSt migration. We suggest redesigning your model in
ate StubStates and SynchStates will be removed alternative ways, trying to connect important
together with connected transitions. transitions to other states.
Parame Event can't have parameters in UML 2. All Use the parameters of Operation when using
ters of parameters will be lost during the migration. CallOperationEvent.
event
Add additional parameters to an operation if you
are using more CallOperationEvent parameters
than the Operation has.
The same rules should be applied to the parameters of the SendSignalEvent and the attributes of the
Signal.
Issue Solution
States UML 2 Activity diagram is no longer based on Redraw your activity diagrams without using
StateMachine, so State model elements ConcurrentStates, move internal elements from
(SimpleState, CompositeState, and ConcurrentState to the diagram and show
ConcurrentState) can no longer be used in the concurrent flows by using synchronization bars
activity diagram. or other notation. CompositeState in activity
diagrams should be modified in a similar
manner by moving internal elements into the
diagram. SimpleState will be mapped to
ObjectNode with this state assigned to the
InState property.
Implementation Diagram
Issue Solution
Deploym Components cannot be deployed in Nodes in During migration, MagicDraw will automatically
ent UML 2. Artifacts related to these create artifacts (named as components)
components should be deployed instead. deployed in Nodes and will manifest
Components (Manifestation relationship
between artifacts and components will be
created).
On this page
All recognized data mapping or other migration problems will be marked by adding a ToDo tagged
value with the problem description into the problematic element.
If data loss cannot be avoided, all problems, conflicts, and data loss occurrences are registered to the
model element's ToDo tags on project load:
Use the Find ToDo feature to search for elements containing ToDo information. From the Tools
main menu, choose Find ToDo.
Related pages
We do not recommend using autoupdate, as you may need a previous MagicDraw version installation
for migrating your projects to UML 2.
MagicDraw is able to convert UML 1.4 to UML 2, but some mapping problems may appear.
Previous MagicDraw version should be used for solving these problems before conversion. For more
details about mapping solutions, see Problems and solutions of data mapping (see page 2631).
We recommend downloading the MagicDraw installation manually and installing it into a new location
(not the location suggested by default).
Related pages
Change-type 1046
2 Change-types 1247
2-way-merge 1045 Changing-states 823
Class 289
3
Classifier-behavior 629
3-way-merge 1045
Client 2188
A Client-point 2188
Abstract-matrix-cell 2237 Close-session 2137
Abstract-panel-container 2278 Code-engineering-manager 2261, 2309
Abstract-pattern 2278 Collaborate-menu 25
Abstract-pattern-properties 2278 Column-header-cell-renderer 2237
Accepting-changes 1067 Command 2110
Actions-configurator-manager 2232 Compare-concepts 1246
Active-validation 1261 Compare-specification-panel 1254
Active-validation-suite 2238 Compared 1246
Actors 847 Comparison-result 1250, 1251, 1251, 1258
Addition-change 1046, 1247 Comparison-result-navigation 1256
Advanced-numbering 742 Comparison-summary 1251
Aggregation 621 Compatibility-range 106
All-mode 887 Composite-state 819
All-property-display-mode 887 Concepts 1044
Alternative-condition 861 Configure-dependency-handlers 2233
Alternative-flow 853 Conflicting-changes 1046, 1066
Alternative-flow-step 861 Connection-point-reference 824
Amconfigurator 2232, 2233 Container 2139
Analyze-menu 25 Create-add-actions 2233
Analyzing-changes 1068, 1258 Create-button 2111
Analyzing-comparison-results 1250 Create-command 2111
Analyzing-merge-results 1055 Create-edit-actions 2233
Annotation 2238 Create-operation 726
Annotation-manager 2238 Create-path 526
Application 2123 Create-region 822
Association-class 619 Create-relation-map 337
Association-end-type 621 Create-relationship 526
Association-navigability 621 Create-session 2137
Asynchcall 723 Createmessage 723
Asynchsignal 723 Creating-dependency-matrix-type 1970
Attribute 2006 Creating-diagram-type 1963
Auto-number 2252 Custom-button 2111
Automatic-synchronization 1395 Custom-command 2111
Customize-diagram-wizard 1962
B Customizing-dependency-matrix 1970
Base 1246 Customizing-diagram 1962
Base-element 2136 Customizing-diagrams 1963
Basic-flow 853 Customiztion-attribute 2006
Behavior-type 629
Bezier 528 D
Brand 2076 Decision 667
Break-point 2188 Define-rules 2321
Browser 2216 Delete-path 528
Browser-tree 2216 Delete-relationship 528
Button 2110 Deletemessage 723
Deletion-change 1046, 1247
C Dependency-editor 2233
Can-create 2233 Dependency-entry 2233
Can-edit 2233 Dependency-extractor 2233, 2237
Cell-renderer 2237 Dependency-matrix-action-registry 2233
Change-activator 745 Dependency-matrix-configurator 2232, 2233, 2237
Change-concept 1046, 1247 Dependency-matrix-customization 1970
Change-details 1063, 1256 Dependency-matrix-diagram-descriptor 2232
Change-states 1046, 1057 Dependent-changes 1046, 1247