+ All Categories
Home > Documents > MagicDraw UserManual

MagicDraw UserManual

Date post: 02-Jan-2016
Category:
Upload: rojer-kar
View: 81 times
Download: 0 times
Share this document with a friend
Popular Tags:
462
USERS MANUAL version 9.5 No Magic, Inc. April, 2005
Transcript
Page 1: MagicDraw UserManual

USER’S MANUAL

version 9.5

No Magic, Inc.

April, 2005

Page 2: MagicDraw UserManual

CONTENTS 0CONTENTS 2

1 INTRODUCING MAGICDRAW 1-12MagicDraw Editions and Features 1-13

MagicDraw Personal edition 1-13MagicDraw Standard edition 1-13MagicDraw Professional editions 1-13MagicDraw Enterprise edition 1-14MagicDraw Reader Edition 1-14MagicDraw Community Edition 1-14

MagicDraw Documentation and Support 1-14Help 1-15User’s Guides 1-15

Other Documentation 1-16Support 1-17

FAQ 1-17Newsgroups 1-17E-mail 1-17Bug Reports 1-17

2 GETTING STARTED 2-20Installing and Running 2-20

System requirements 2-20Java Virtual Machine (JVM) 2-20

Operating system - dependent issues 2-21Installation procedure 2-21

Windows 2000/9x/NT/XP 2-21Unix 2-22MAC OS X 2-22All other platforms instructions (no install version) 2-22

Updating 2-22Auto-Check for Updates dialog box 2-23

structure of menus and toolbars 2-23Setting Personal Preferences 2-24

Environment Options 2-24General pane 2-25Diagram pane 2-28Browser pane 2-29

Page 3: MagicDraw UserManual

M a g i c D r a w U s e r ’ s M a n u a lC o n t e n t s

Teamwork pane 2-31Floating pane 2-32CVS pane 2-33Update pane 2-34HTTP Proxy pane 2-35Keyboard pane 2-36Plugins pane 2-37Resources pane 2-38Path Variables Pane 2-39Launcher Pane 2-40

Look and Feel: Controlling Interface 2-40JIDE and Multiple Windows interface styles 2-42

3 WORKING WITH PROJECTS 3-44Creating New Project 3-44

Creating new project from already created template 3-45Importing project 3-46

Saving and Exporting 3-46Exporting project as template 3-47Saving diagram as image 3-48Autosave 3-50

Loading 3-50Project Options. Style Engine 3-51

Project Options 3-51Symbols Properties Styles Tree 3-54

Working with Properties Styles 3-58Properties extension by diagram 3-58Properties Inheritance 3-59General Style Properties 3-60Shapes, Paths and Diagrams Properties 3-60Stereotypes properties 3-61

Modules Functionality. Reusing project part - Partitioning 3-63Working with modules 3-63

Exporting Project Module 3-63Using Project Module 3-65Importing Project Module 3-65Sharing packages 3-65Opening Module As a Project 3-67Reloading Module 3-67

Dependencies between elements 3-68Packages dependencies by relationships 3-68Dependencies by reference 3-71Diagrams dependencies 3-71

Package Dependencies dialog box 3-72

3 © 2004 No Magic, Inc.

Page 4: MagicDraw UserManual

M a g i c D r a w U s e r ’ s M a n u a IC o n t e n t s

Profiles 3-74Creating profiles 3-74Using and importing profiles 3-75Exporting profiles 3-76

Model Differencing 3-76Models comparison 3-77

Understanding model differences 3-78Diagrams Comparison 3-81

Working with multiple projects 3-83Using Browser 3-84

The Browser window parts 3-85Containment tree 3-87

Data branch 3-89Code engineering sets 3-89

Diagrams tree 3-91Inheritance tree 3-92Model Extensions Tree 3-93Search Results Tree 3-94Working with model elements in the Browser tree 3-95Multiple selection 3-96Documentation/Zoom Control/Properties 3-96

Documentation tab 3-96Zoom Control tab 3-97Properties tab 3-98

Searching 3-99Java Regular Expressions 3-101

Metacharacters 3-101Character Sets 3-102Grouping 3-102Quantifiers 3-102Boundary Matchers 3-103Embedded Flag Expressions 3-103

MagicDraw and Rational Rose® 3-104Rational Rose 3-104MagicDraw 3-106Metamodel and XMI incompatibilities 3-107

Other noticed incompatibilities 3-109MagicDraw and Together ControlCenter 3-109

Together ControlCenter 3-110MagicDraw 3-111Metamodel and Unisys XMI incompatibilities 3-112

Other noticed incompatibilities 3-114Resources Manager 3-114

© 2004 No Magic, Inc. 4

Page 5: MagicDraw UserManual

M a g i c D r a w U s e r ’ s M a n u a lC o n t e n t s

4 DIAGRAMS BASICS 4-120Working with Diagrams 4-120

Diagrams dialog box 4-122Diagram Properties 4-124

Table with diagram information 4-125Drawing Shapes 4-126Drawing Relationship paths 4-129Smart Manipulation 4-130Selection. Multiple Selection 4-131Dragging, Copying, Cutting, and Pasting 4-132Specifying Model Elements 4-133

Specification dialog boxes 4-133Relations tab 4-134Stereotypes tab 4-135Tagged Values tab 4-136Constraints tab 4-138General tab 4-139Attributes tab 4-141Operations tab 4-142Hyperlinks tab 4-143Buttons available in the Specification dialog boxes 4-144

Formating Symbols 4-144Owner of the model element 4-145

Model Traceability 4-146Usages functionality 4-146Dependent Elements functionality 4-146

Find Usages / Dependent Elements Options dialog box 4-147Elements Using \ Dependencies windows 4-148

Defining Hyperlinks 4-150Insert Hyperlink dialog box 4-151

Laying out 4-153Orthogonal Layouter 4-154Hierarchic Layouter 4-154Tree Layouter 4-156Organic Layouter 4-158Circular Layouter 4-159Orthogonal Path Router 4-160Organic Path Router 4-160Class Diagram Layouter 4-161Quick Diagram Layout feature 4-162

Zooming 4-162Using Grid 4-163Assigning Shortcut Keys 4-164Printing 4-165

Print Range tab 4-165

5 © 2004 No Magic, Inc.

Page 6: MagicDraw UserManual

M a g i c D r a w U s e r ’ s M a n u a IC o n t e n t s

Print Options Tab 4-167Print Header/Footer Tab 4-168

Model Elements Common in all Diagrams 4-169Note Anchor 4-169Constraint path 4-170Separator 4-170Documentation 4-170

5 UML DIAGRAMS 5-174System Views 5-175

Use Case View 5-175Logical View 5-175Process view 5-176Component view 5-176Deployment view 5-176

Class Diagram 5-176Class diagram elements 5-178Classes 5-183

Working with classes 5-183Interface 5-186Attribute 5-188Operation 5-193

Template / Parameterized class 5-199Port 5-200Data types 5-201

Enumeration 5-203Primitive 5-205Programming Language Data Type 5-205

Design Patterns 5-205Class presentation options 5-206Packages 5-208

Working with packages 5-208Subsystem 5-210Model 5-213Collaboration 5-214Generalization 5-216

Generalizable elements 5-218Association 5-218

Association End 5-220Realization 5-225Dependency 5-226

Abstraction 5-227Binding dependency 5-227Permission 5-228

© 2004 No Magic, Inc. 6

Page 7: MagicDraw UserManual

M a g i c D r a w U s e r ’ s M a n u a lC o n t e n t s

Usage 5-229Merge 5-229Import 5-229

Containment 5-230Use Case Diagram 5-230

Use Case diagram elements 5-231Actors 5-233

Working with actors 5-233Use Cases 5-235Use Case Extensions 5-237Relationships in Use Case diagram 5-238

Association 5-238Extend 5-238Include 5-240Generalization 5-241Dependency 5-241Realization 5-241Containment 5-241

Collaboration Diagram 5-242Instance level 5-242Specification level 5-242Collaboration Diagram elements 5-244Instance 5-245

Instances Specification dialog boxes 5-245Link 5-248Classifier role 5-251Association role 5-252Stimulus / Message 5-254

Predecessors and activators 5-259Actions 5-260

Action types 5-263Active objects 5-264

Sequence Diagram 5-265Sequence diagram elements 5-266Interaction Use 5-268Combined Fragment 5-269Lifelines 5-271Messages in sequence diagram 5-272

State Diagram 5-274State Diagram elements 5-275State 5-278Concurrent state 5-282Submachine 5-282Synch state 5-285PseudoStates 5-286

7 © 2004 No Magic, Inc.

Page 8: MagicDraw UserManual

M a g i c D r a w U s e r ’ s M a n u a IC o n t e n t s

Initial state 5-286Final state 5-286History state 5-286Junction and dynamic choice points 5-287

Actions in State and Activity diagrams 5-287Action labels 5-288

Events 5-288Event types 5-290

Internal transitions 5-290Transition 5-291

Guard Specification dialog box 5-293Activity Diagram 5-294

Activity Diagram elements 5-296Action state 5-299Call State 5-302Subactivity state 5-302Flow Final 5-304Decision Point 5-305Object flow state 5-305Signal sending / receipt shapes 5-308

Signal sending 5-308Signal receipt 5-309

Swimlanes 5-309Implementation Diagrams 5-312

Component diagram overview 5-312Deployment diagram overview 5-312Implementation Diagram elements 5-314Components 5-318Nodes 5-321

UML Extension Mechanisms 5-323Stereotype 5-323

Stereotype Specification dialog box 5-324Profiles dialog box, Stereotypes tab 5-326UML Web Extension stereotypes 5-327

Tag definitions 5-334Tag Definition Specification dialog box 5-335Tagged Value Specification dialog box 5-336Profiles dialog box, Tag Definitions tab 5-337TODO item 5-339Groups 5-339

Constraints 5-339Constraint Specification dialog box 5-341Profiles dialog box, constraints tab 5-342

© 2004 No Magic, Inc. 8

Page 9: MagicDraw UserManual

M a g i c D r a w U s e r ’ s M a n u a lC o n t e n t s

6 EXTENSION DIAGRAMS 6-358Content Diagram 6-359

Content Diagram Elements 6-360Robustness Diagram 6-363

Robstness Diagram Elements 6-364Web Diagram 6-365

Web Diagram Elements 6-367CORBA IDL Diagram 6-371

CORBA IDL Diagram Elements 6-372DDL Diagram 6-374

DDL Diagram Elements 6-375WSDL Diagram 6-376

WSDL Diagram Elements 6-377XML Schema Diagram 6-379

XML Schema Diagram Elements 6-380Time Diagram 6-382

Time Diagram Elements 6-383

7 TOOLS 7-386Reports 7-386

Template Management tab 7-387Document Options 7-391Model Report 7-392Use Case Report 7-394Software design Description 7-395Model Extension Report 7-397

Select Packages tab 7-398Select Diagrams tab 7-399Output Options tab 7-400Report Customization 7-401

New report style creation example 7-402Fonts in PDF and PS reports 7-404

Report Generator Tool 7-404Starting report generator 7-404Generating Configuration file 7-404

Class Diagram Wizard 7-405Package Dependency Wizard 7-410Package Overview Diagram Wizard 7-412Tools for Analysis 7-417

Hierarchy Diagram Wizard 7-418Realization Diagram Wizard 7-421

Content Diagram Wizard 7-426Sequence Diagram from Java Source Wizard 7-428Pattern Wizard 7-432Creating Setters / Getters 7-438

9 © 2004 No Magic, Inc.

Page 10: MagicDraw UserManual

M a g i c D r a w U s e r ’ s M a n u a IC o n t e n t s

Implementing or Overriding Operations 7-439Model Transformation Wizard 7-440

Types of the transformations 7-440Model Transformation Wizard 7-441Model Transformation Mapping 7-444Transformation Mapping Possibilities 7-445Model Transformation Update 7-448

Metrics 7-449Metrics suites 7-449Displaying metrics 7-450Invoking Metrics 7-451

Metrics window 7-452Exporting metrics 7-454Comparing metrics 7-455Metrics Options 7-455Metrics properties 7-458

INDEX 464

© 2004 No Magic, Inc. 10

Page 11: MagicDraw UserManual

©

I N T R O D U C I N G M A G I C D R A W 1

Today’s graphical software can be extremely complex in its structure and architecture, but that does not mean it must be difficult to use. We have learned much from the hardware industry, where everything you see is scattered pieces. This approach also works well in the software world – objects at a higher abstraction level are treated like “software pieces.” To simplify the process further, we may use pictures instead of textual descriptions to show the relationships between objects in a complex system. Though pictures work better than textual descriptions alone, experience has proven that communicating complex ideas effectively requires more than simple flowcharts. Early methodologies, such as Booch notation, OMT, and others, served the same purpose: to graphically express the software’s architecture information. However, these methodologies accomplished this in slightly different ways and with different levels of thoroughness. In 1994, Grady Booch, Jim Raumbaugh, and Ivar Jacobson came together to unify their varied methods and experience. The UML (Unified Modeling Language) was the fruit of their joint effort. UML was crafted with two objectives: To reflect the best practices of the industry, and to demystify the process of software system modeling.

In short, UML provides standardized pictures of your software applications and allows your development team to quickly grasp the functionality contained within the application. UML is a language and a process with neutral notation, which means that you may use it to design your entire OO system in any programming language and any software development process.

The development of a model for an industrial-strength software system, prior to its construction or renovation, is as essential as having a blueprint for a large building. Good models are vital for effective communication among project teams.

In the early 1990s, the tools for OO software modeling emerged, followed by the development of the visual modeling approach. Visual modeling means that you first design your system by drawing diagrams (blueprints) and then employ tools to convert those diagrams into code. The value of such an approach is that the often tedious framework coding is done automatically, freeing the programmer to focus on design issues, plus, the transition from the design to the implementation phase is smoother more and straightforward. Moreover, using the features of reverse engineering and code generation, the developer may move back and forth between the code and the design that is expressed in the diagrams.

Today, visual modeling tools provide many features that replace some of the more tedious tasks for the designer, programmer, and documentation writer. Some of the leading tools provide so-called code round-trip engineering capabilities – the structure of reverse engineered code is changed in the modeling tool and is generated back without the implementation of specific information (e.g. method bodies, comments) loss.

2005 No Magic, Inc. 1-12

Page 12: MagicDraw UserManual

I N T R O D U C I N G M A G I C D R A WMagicDraw Edi t ions and Features

1

MagicDraw is a visual UML modeling and CASE tool with teamwork support. Designed for Business Analysts, Software Analysts, Programmers, QA Engineers, and Documentation Writers, this dynamic and versatile development tool facilitates analysis and design of Object Oriented (OO) systems and databases. It provides the industry's best code engineering mechanism (with full round-trip support for Java, C#, C++, WSDL, XML Schema, and CORBA IDL programming languages), as well as database schema modeling, DDL generation and reverse engineering facilities.

MAGICDRAW EDITIONS AND FEATURESThe detailed list of MagicDraw features find at:http://www.magicdraw.com/files/brochures/a4/MagicDrawDataSheet.pdf

M A G I C D R A W P E R S O N A L E D I T I O N

The MagicDraw Personal Edition contains all of MagicDraw's powerful UML diagramming capabilities, including full UML 1.4 support and extensibility features, basic reporting functionality and image export. Files are stored in XMI format.

All model elements can be accessed via MagicDraw's Open API.

In this edition, you will find everything you need to draw, edit and publish your UML models.

MagicDraw Personal Edition is available only in a standalone version and is not designed for use with the MagicDraw Teamwork Server.

M A G I C D R A W S T A N D A R D E D I T I O N

The Standard Edition takes all of the Personal Edition's features and adds to them a WAE, content, and Robustness diagrams, model analysis and facilitation features, customizable and extendable patterns, integrations with most popular IDEs and a set of predefined model templates and UML profiles.

The Standard Edition also supports UNISYS XMI diagramming extensions for interchanging the MagicDraw models you create with other UML modeling tools as well as the latest Model Driven Architecture (MDA) tool offerings.

The Standard Edition is available in standalone, floating and mobile license versions and is fully compatible with the MagicDraw Teamwork Server.

The Standard Edition is ideally suited for all analysts and architects who need various model extensions and modeling facilitations.

M A G I C D R A W P R O F E S S I O N A L E D I T I O N S The Professional Edition is built on the Standard Edition's capabilities and is available in one of three programming language specific versions-Java, C++ and C#. In addition to the Standard Edition's features, the Professional Edition adds code generation and reverse engineering functionality. Depending on the language version selected, the user will receive:

• Java version - Code engineering for Java, Java bytecode. Integration with Java IDEs.

1-13 © 2005 No Magic, Inc.

Page 13: MagicDraw UserManual

I N T R O D U C I N G M A G I C D R A WMagicDraw Documentat ion and Support

1

• C++ version - Code engineering for C++.

• C# version - Code engineering for C#, CIL (MSIL).

The Professional Edition is ideal for anyone who wants to generate code out of an existing model or create a UML model from an existing project.

M A G I C D R A W E N T E R P R I S E E D I T I O N

The MagicDraw Enterprise Edition represents the top of the line of the MagicDraw family of products and represents the ultimate solution for all your modeling needs. The Enterprise Edition combines all of the functionality of the Personal and Standard Editions, and all three versions of the Professional Edition, into a comprehensive state-of-the-art UML programming solution. But the Enterprise Edition does not stop there and adds code engineering and diagramming functionality in CORBA IDL, EJB, WSDL and XML schema. For working with DB structure, the Enterprise Edition not only provides code engineering and diagramming but also provides structure retrieval via JDBC.

The MagicDraw Enterprise Edition is a must when working with multiple development technologies and databases.

The MagicDraw family of award-winning products represents the most powerful and best value in the UML modeling industry today.

M A G I C D R A W R E A D E R E D I T I O N

MagicDraw Reader edition is made for reading and previewing UML models created with MagicDraw and is free of charge. It is extremely useful when you want to share your ideas expressed in UML with partners, colleagues, or clients, who do not have their copy of MagicDraw. This edition is also equipped with printing and image export capabilities.

M A G I C D R A W C O M M U N I T Y E D I T I O N

MagicDraw Community edition is a free edition for developers working on non-commercial projects. It has a minimal functionality set and only class diagram has no limitations. Other diagrams allows saving a project with 25 use cases, 25 states, 25 classifier roles, 25 action states, 25 instances, 25 nodes, and 25 components.

MagicDraw Community edition is designed for creating static structure models, when XMI output is needed and is ideally suited for Open Source projects.

This edition is also equipped with printing and image export capabilities.

MAGICDRAW DOCUMENTATION AND SUPPORTMagicDraw provides several kinds of documentation. Choose the way you want to know how to use MagicDraw.

The main information about MagicDraw, you may find at www.magicdraw.com.

© 2005 No Magic, Inc 1-14

Page 14: MagicDraw UserManual

1-

I N T R O D U C I N G M A G I C D R A WMagicDraw Documentat ion and Support

1

Help

Integrated in the MagicDraw help is based on JavaHelp. MagicDraw help provides detailed description of all MagicDraw dialog boxes, commands, shortcut menus, also you will find their a How to.. list, main descriptions and examples of all UML model elements.

User ’s Guides

Name Description Location

MagicDraw UserManual.pdf

Includes detailed explanations and instructions of installing and working with MagicDraw.

• <MagicDraw installation directory>/manual

• Start/Programs/MagicDrawUML/MagicDraw User Manual.pdf

• www.magicdraw.com -> Download->Download Manual

15 © 2005 No Magic, Inc.

Page 15: MagicDraw UserManual

I N T R O D U C I N G M A G I C D R A WMagicDraw Documentat ion and Support

1

O T H E R D O C U M E N T A T I O N

• Readme files. In the main MagicDraw installation directory, the main readme.html file is located. Also readme documents are available for MagicDraw integrations.

MagicDraw CodeEngineering UserGuide.pdf

In this user guide you will find not only basic information about reverse and generation in MagicDraw but also detailed descriptions about DDL, CORBA IDL, EJB 2.0, and XML Schema usage in MagicDraw.

• <MagicDraw installation directory>/manual

• www.magicdraw.com -> Download->Download Manual

MagicDraw Tutorials UserGuide.pdf

Step by step instructions presenting the basics of using MagicDraw diagramming, creation of sequence diagram, integration with CVS and Eclipse.

MagicDraw Integrations UserGuide.pdf

You will find here the full description of how to integrate MagicDraw with Eclipse, Borland JBuilder, Sun One Studio (before called Forte) including Netbeans, and CVS.

MagicDraw FloatingLicense UserGuide.pdf

Here you will find how setup and how to use MagicDraw Floating License server.

MagicDraw Teamwork UserGuide.pdf

In this document, you will find information how to install, set up, and use Teamwork Server and Teamwork Server Administrator. Also included detailed descriptions of how to work with the teamwork projects.

MagicDraw OpenAPI UserGuide.pdf

This document describes MagicDraw Open Java API and provides instructions how to write your own plug-ins, create actions in the menus and toolbars, change UML foundation elements, and create new patterns.

• <MagicDraw installation directory>/openapi/docs

Name Description Location

© 2005 No Magic, Inc 1-16

Page 16: MagicDraw UserManual

I N T R O D U C I N G M A G I C D R A WMagicDraw Documentat ion and Support

1

• Notes. In the notes.html file you will find the main information about MagicDraw features.

Support

F A QBefore you call or write an email, look into our FAQ (Frequently Asked Questions) list. It is constantly updated and perhaps it contains an answer to your question.

N E W S G R O U P S

Discuss and get answers about MagicDraw in newsgroups.

E - M A I L

We provide a professional e-mail support for registered MagicDraw users.

[email protected] - private questions about product installation, and more.

[email protected] - questions regarding academic and site discounts, quotes.

[email protected] - e-mail for other contacts.

Get an answer in 24 hours!

B U G R E P O R T S

Submit notifications of software errors by submitting a bug directly from MagicDraw application (Help menu->Submit a Bug) or by sending an email to [email protected].

These reports help us address defects in a more timely manner, as well as speed up the release of maintenance releases free of known defects.

When sending your report by email, please include (if applicable):

• MagicDraw UML version number and name of the edition (Reader, Community, Personal, Standard, Enterprise, Professional Java, Professional C++, Professional C#, Demo, or Academic).

• Source where you got the version from (demo CD, our homepage download).

• Version distribution (Standard/Professional, Windows/Java bytecode).

• Your OS name and version.

• JDK version, JVM vendor.

• CLASSPATH settings.

If you don't have this information, you can find it by opening the About dialog from MagicDraw Help menu. If MagicDraw is unable to load your file, and the file is non-confidential, please attach it to your submission.

This will assist us in our analysis of your problem.

1-17 © 2005 No Magic, Inc.

Page 17: MagicDraw UserManual

G E T T I N G S T A R T E D 2

INSTALLING AND RUNNING

System requirements

To run MagicDraw UML, your system must meet the following requirements:

Java Vi r tual Machine (JVM)

You may have the JVM installed on your computer or install JVM together with MagicDraw specifically for MagicDraw application. JVM is an application that provides the interpretation of the bytecode Java class files. Different operating systems may have different JVM implementations, thus some bugs may be specific to the operating system or JVM.

MagicDraw is a stable environment, if it is configured properly and if the stable JVM is used. USE RECOMMENDED JVM TO AVOID A LOT OF PROBLEMS. All recommendations are written below. As MagicDraw is a Java application, most of the stability and performance depends on the JVM implementation. Refer to the JVM specification and problems' description, if you have problems on the specific OS.

Resource type Minimum Recommended

CPU Pentium III 500 Pentium 4 1600

Memory 256 MB 512MB; 1GB is recommended for larger projects

Disk space 200 MB 200 MB or more

Video mode 800*600 @ 64k Colors 1280*1024 @ 64k Colors

Operation system All that have Java compatible JVM 1.4:Windows 95/98/NT/2000/XP, Linux, Mac OS X (most testing procedures and debugging were performed on those platforms)

HTML browser Any Netscape Navigator or IE

Java Virtual Machine (JVM)

JDK 1.4 Sun’s JDK 1.4.2_03

© 2005 No Magic, Inc. 2-20

Page 18: MagicDraw UserManual

G E T T I N G S T A R T E DInstal l ing and Running

2

JDK 1.1.x, 1.2.x, and 1.3.x is not supported.

You can review your system and JVM information in the About dialog box, Info tab (from the Help menu, choose About). JDK version also can be encountered from command line by writing:

java -version

To change Java version

Change line in file mduml.properties (this file is in bin folder):

JAVA_HOME = <path to new JDK>

O P E R A T I N G S Y S T E M - D E P E N D E N T I S S U E S

Because MagicDraw is 100% Pure Java, it is platform independent and runs on a variety of operating systems. However, for Java applications to interact properly with the operating system, Java Virtual Machine (JVM) software is required. JVM software varies depending on the operating system, and MagicDraw may perform inadequately with the wrong one.

The performance of Java applications depends on the performance of the Java Virtual Machine. A badly designed Machine may degrade the performance of MagicDraw. It could even cause MagicDraw to fail or crash. To avoid these problems, we recommend that you use the following Virtual Machines:

• Sun (JDK standard) for Solaris and Linux. JDK 1.4.2_03 is recommended, JDK 1.5 is supported.

• Sun (JDK standard) for Windows (2000, NT, 95/98). JDK 1.4.2_03 is recommended, JDK 1.5 is supported.

• MagicDraw runs only on Mac OS X operating system. We recommend to use JDK 1.4.x. MagicDraw has some problems on default Mac OS X JDK (JDK1.3).

Ins ta l la t ion procedure

First, obtain the MagicDraw installation files. You may download the latest version from the MagicDraw homepage (http://www.magicdraw.com/.) Because MagicDraw is a Java application, you will need more than the installation files to run the tool successfully. You may also install JVM together with MagicDraw or you may have it already installed. Information about the latest Java ports is available at http://www.magicdraw.com/jvm_list.htm.

NOTE If an installation is for Windows, and has a JVM you don't need anything else.

W I N D O W S 2 0 0 0 / 9 X / N T / X PAfter downloading, double-click MD_UML_95_win.exe (for the Personal Edition MD_UML_95_PE_win.exe).

The Setup Wizard automatically adds MagicDraw UML shortcuts to the start menu and the desktop. You may also execute the shortcuts from the installation directory.

2-21 © 2005 No Magic, Inc.

Page 19: MagicDraw UserManual

G E T T I N G S T A R T E DUpdat ing

2

U N I X

After downloading, open a shell and go to the directory where you downloaded the installer.At the prompt type: sh ./MD_UML_95_unix.sh (for the Personal Edition MD_UML_95_PE_unix.sh).

M A C O S X

After downloading, double-click MD_UML_95_mac.dmg (for the Personal Edition MD_UML_95_PE_mac.dmg) and install application by dropping launcher to the Applications folder (or somewhere else).

Requires Mac OS X 10.3 (Panther) and Java 1.4.2.

A L L O T H E R P L A T F O R M S I N S T R U C T I O N S ( N O I N S T A L L V E R S I O N )Download MD_UML_95_no_install.zip (for the Personal Edition MD_UML_95_PE_no_install.zip).

After downloading, extract the contents of the zip. These files require some modifications prior to launching them.

On Windows platform:

• Launch mduml.exe in bin directory to start MagicDraw.

On Unix or Mac OS X platform:

• Launch ./mduml in bin directory to start MagicDraw.

Be sure you have JVM installed.

UPDATINGAutomatic updates feature is implemented in MagicDraw. Notification and update of all the patches can be done automatically.

To enable an automatic checking for MagicDraw updates

1 Open the Environment Options dialog box, Update pane. For a detailed description of this dialog box, see Section “Setting Personal Preferences” on page 2-24.

2 Choose a period when MagicDraw checks for updates from the Check for Updates drop-down list box: Manually, On startup, Once a day, Once a week, Once a month. It is recommended to check for updates once a month.

NOTE You may also manually check for updates: go to the Help menu and choose the Check for Updates command.

© 2005 No Magic, Inc 2-22

Page 20: MagicDraw UserManual

2-

G E T T I N G S T A R T E Dstructure of menus and toolbars

2

A U T O - C H E C K F O R U P D A T E S D I A L O G B O X

The dialog box is opened, when automatic checking for MagicDraw UML updates is enabled on the Update pane in the Environment Options dialog box and the Show Auto-Checking Confirmation Dialog Box check box is selected.

STRUCTURE OF MENUS AND TOOLBARSBefore starting working with MagicDraw, keep in mind how MagicDraw is organized. Not all information will be described, as nearly all commands are accessible in various ways, that are listed in the table below.

NOTES Symbol shortcut menu is also accessible from Edit menu, Symbol.

The toolbar of the particular diagram presents the paths and shapes available for the corresponding diagram. If an arrow is placed on the diagram toolbar button, select a button representing the corresponding model element by right-clicking the button.

Element Name Function

Show this tip next time

If selected, the dialog box is opened each time, when the MagicDraw should be updated according to the schedule selected on the Update pane in the Environment Options dialog box.

Check Starts checking for MagicDraw UML updates in the http://www.magicdraw.com page.

Cancel Closes the dialog box without saving changes.

Help Displays MagicDraw Help.

Function Accessibility

Main operations of editing (copy, cut, paste, delete)

• Edit menu.• Main toolbar buttons.• Shortcut keys.• Shortcut menu commands from Browser.

Opening of Specification dialog boxes

• By double-clicking the model element.• Specification command from the element shortcut menu on the

diagram or Browser.• When adding one model element to another model element

from the Specification dialog box or Browser.

Defining symbols properties (font, color, etc.)

• Symbol shortcut menu -> Symbol(s) Properties.• Options menu -> Project.• Main toolbar buttons

23 © 2005 No Magic, Inc.

Page 21: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

©

2

SETTING PERSONAL PREFERENCES

Envi ronment Opt ions

You may customize MagicDraw according to your preferences: Change the application settings of your project in the Environment Options dialog box.

To open the Environment Options dialog box

Choose Environment from the Options menu.

Buttons available in the Environment Options dialog box

Reset to Defaults Resets all properties to the default ones.

OK Saves changes and exits the dialog box.

Cancel Exits the dialog box without saving changes.

Help Displays MagicDraw Help.

2005 No Magic, Inc 2-24

Page 22: MagicDraw UserManual

2-

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

G E N E R A L P A N E

Figure 1 -- Environment options dialog box. General pane

Change the appropriate fields according to your preferences. If the check box is selected, the description False changes into True.

Property name Function

Create backup file Back up files of your projects will be created. Backups are saved with name pattern old_name.xml.bak or old_name.xml.zip.bak.

Diagrams load mode Choose how to load diagrams after opening MagicDraw project. • Load all Diagrams – opens all diagrams that are created in the

project. • Load Only Opened Diagrams – opens only diagrams that were

not closed in earlier usages of the project. • Do not Load Diagrams – all diagrams are closed after opening

a project.

25 © 2005 No Magic, Inc.

Page 23: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

EMF character set Choose the encoding standard for the characters that will be copied to EMF.

Help font Choose the font that will be used in Help window.

Help server port The default Help server port is 1111. Change it, if some other server is started on this port.

Icon size Select the size of the icons on the toolbar. The possible choices of icon sizes are 32 and 24.

Idle time to activate recovery save

Enter the system idle time (in minutes) when to activate file recovery save.

Language Choose the language you wish the MagicDraw GUI to be displayed:• Default – according to your application. It is set by default. • English• French• German• Italian• Japanese• Korean• Portuguese Brazil• Spanish• ThaiNOTE Restart MagicDraw to apply the changed

language.

Mark elements with active hyperlink

Shows active hyperlink arrow on element symbol.

Open last project on startup

The project you have finished the last session will be opened next time you start MagicDraw UML.

Recent files list size Type the number of the projects to appear on the File menu. Click the file name to open it. The maximum files list size is 10. The file name list shows files that were used in MagicDraw UML.

Recent windows list size Type the number of recently used windows that are listed in the Window menu. Click the window name to make it active. The maximum windows list size is 10.

Save diagram background in image

Saves the diagram background in the image together with the saved as image diagram. By default the diagram background, after saving as image, is white.

Save project recovery data on idle

Saves AutoRecovery file of the opened project(s) when a system is not in use.

Save rich XMI Saves maximum additional information to xmi file, which is not required on Magic Draw load but may be needful using other tools.

Save settings on exit The changed settings within current MagicDraw session will be restored in the later sessions.

Show font face in font list Font names that are listed in the Font drop-down list box on the main toolbar will be displayed in the original font.

Property name Function

© 2005 No Magic, Inc 2-26

Page 24: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

Show hyperlinks in specification dialog

Shows the Hyperlinks tab in the element Specification dialog box.

Show memory monitor Shows the project memory usage line in the bottom of the Magic Draw window.

Show model enrichment suggestion dialog

Opens the Model Enrichment dialog box in report generation.

Show status bar Shows status bar line in the bottom of the Magic Draw window.

Show tip of the day Shows the Tips of the Day dialog box every time you start the tool.

Undo list size Type the number of actions that will be available for undo/redo operations. They will be listed in undo/redo drop down lists on the main toolbar. The maximum undo/redo list size is 500.

Use icons in dialogs Icons on the button of dialog boxes are shown.

Use list for type select If selected, displays the list of available classifiers, if not selected, the hierarchy of all model elements is displayed in a drop-down list for selecting a type.

Use model enrichment wizard

Opens the Software Design Model Wizard or Use Case Model Wizard in report generation.

Property name Function

2-27 © 2005 No Magic, Inc.

Page 25: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

©

2

D I A G R A M P A N E

Figure 2 -- Environment Options dialog box. Diagram pane

Property name Function

Allow class members selection

Operations and attributes can be selected and dragged & dropped to the other class.

Apply stereotype style for all symbols

Applies created stereotype style to symbol when adding stereotype to element.

Apply stereotype style for symbols in unlocked diagrams

Applies stereotype style in teamwork for unlocked diagrams.

Center on the mouse location when zooming

Centers zooming according to mouse arrow.

Display paths on element drop

When dragging and dropping an element from the Browser or executing a Create Symbol action, path to existing symbols are created.

Edit name with stereotypes

Allows to manage stereotypes by editing stereotype name directly on the Diagram pane

Graphics antialiasing Smooths the jagged edges of graphics.

Grid style Select one of the following style of the grid: Dense and Sparse.

2005 No Magic, Inc 2-28

Page 26: MagicDraw UserManual

2-

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

B R O W S E R P A N E

Figure 3 -- Environment Options dialog box. Browser pane

Mark selected labels Mark paths labels after selecting a path.

Optimize paths When a path is drawn in various directions, this selected option removes loops from the path.

Show manipulation highlighting

Enable error highlighting of the modeling process. This helps you to see the errors in the model at the drawing time. The valid and invalid actions will be highlighted in different colors (defaults are red for invalid actions, blue for valid actions).

Text antialiasing Smooths the jagged edges of text.

Use smart manipulation Easy you work of working with symbols.For the detailed description about smart manipulation feature, see Section “Smart Manipulation” on page 4-130.

Zoom step size Type in the step value of zooming your diagram views. Step value should be in range from 0.1 to 1.0.

Property name Function

Property name Function

29 © 2005 No Magic, Inc.

Page 27: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

Browser position In the drop-down list, select the Left if you wish the browser to appear in the left side of the workspace. Select the Right if you wish the browser to appear on the right side of the workspace.

Group by base class Groups stereotypes, tagged values and constraints by base class in the in the Model Extensions Tree.

Group by diagram type

Groups diagrams according to diagram type in the Diagrams tree.

Group by profiles Groups stereotypes, tagged values and constraints by profiles in the in the Model Extensions Tree.

Show changes in browser

Highlight edited or added model elements and diagrams in the Browser.

Show code engineering sets

Shows code engineering sets items in the browser.

Show diagram zoom slider

Shows zoom slider in the Zoom Control tab.

Show full types in browser

Shows the full attributes, operations, and relationships data.

Show hyperlinks in browser

Shows hyperlinks that are assigned to the model elements.

Show stereotypes in browser

Shows stereotypes that are assigned to the model elements.

Sort always Always alphabetically sort browser items.

Property name Function

© 2005 No Magic, Inc 2-30

Page 28: MagicDraw UserManual

2-

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

T E A M W O R K P A N E

Figure 4 -- Environment Options dialog box. Teamwork pane

Property name Function

Auto login to server

The user automatically logs on to the Teamwork Server after starting MagicDraw.

Teamwork server name

Shows the name of your teamwork server.

Show commit warning

The warning appears while committing project to the Teamwork Server.

Show modules versions conflict warning

The warning appears when two modules (or module and a project) use the same submodules.

31 © 2005 No Magic, Inc.

Page 29: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

©

2

F L O A T I N G P A N E

This pane is available only if you use MagicDraw Floating License.

Figure 5 -- Environment Options dialog box. Floating pane

Property name Function

Floating license server name

Specify the name of the Floating License Server.

Floating license server port

Enter the port number of the Floating License Server. The server may be started on many different ports.

Auto login to floating license server

If selected, automatically logs in to the Floating License Server when starting MagicDraw.

2005 No Magic, Inc 2-32

Page 30: MagicDraw UserManual

2-

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

C V S P A N E

Figure 6 -- Environment Options dialog box. CVS pane

Property name Function

Add project to CVS after saving

Every time adds a newly created project in the checked out directory to CVS. The Add Project to CVS dialog box appears.

Commit project to CVS after saving

Updates the project that is added to CVS while loading. The Update CVS Project dialog box appears.

Update project from CVS before loading

Commits project to CVS after saving it. The Commit Project to CVS dialog box appears.

Location of .cvspass

The path where the .cvspass is located. You may type it or choose the path from the Open dialog box.

Local folder The path where the module will be saved on checkout action. You may type it or choose the path from the Open dialog box.

33 © 2005 No Magic, Inc.

Page 31: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

©

2

U P D A T E P A N E

Figure 7 -- Environment Options dialog box. Update pane

Property name Function

Check for Updates Choose the period for checking MagicDraw updates.• Manually• On startup• Once a day• Once a week• Once a month (recommended)

Show auto-checking confirmation dialog box

If selected, shows the confirmation dialog each time before auto-checking.

2005 No Magic, Inc 2-34

Page 32: MagicDraw UserManual

2-

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

H T T P P R O X Y P A N E

Figure 8 -- Environment Options dialog box. HTTP Proxy pane

Property name Function

Use HTTP proxy server

If selected, uses the Http Proxy Server when MagicDraw is checking for updates.

HTTP proxy server address

Type the Http Proxy Server name or IP address.

HTTP proxy server port

Type the port of the HTTP Proxy Server. The default number is 8080.

HTTP proxy server user

Type the name of the Http Proxy Server user.

Authenticate HTTP proxy server

Authenticates Http Proxy Server.

35 © 2005 No Magic, Inc.

Page 33: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

©

2

K E Y B O A R D P A N E

Figure 9 -- Environment Options dialog box. Keyboard pane

Property name Function

Category The list of all available categories of the keys (File, Edit, Tools, etc.). The default item in this choice is always All Categories. Selecting the category opens its context in the Commands list.

Commands The list of commands from the selected category. If All Categories is selected in the Categories list, all commands of an application are shown in this list. Commands are alphabetically sorted. The selecting of the command shows already assigned shortcut keys in the Current keys list.

Current keys The list of keys assigned to the selected command.

Press new shortcut key

The field for entering the new key. Puts a human representation of any key pressed in the field. If the pressed key is already assigned to other command, the Currently Assigned To label with this command name appears.

Currently assigned to

Shows the name of the command of the entered new key if this key is already assigned to some command. By default is hidden. This label is visible just if entered key is already assigned to some command.

Assign Assigns the entered key to the selected command. The entered key is added to the Current Keys list.

2005 No Magic, Inc 2-36

Page 34: MagicDraw UserManual

2

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

P L U G I N S P A N E

Figure 10 -- Environment Options dialog box. Plugins pane

Remove Removes the selected keys from the selected command.

Remove All Removes all keys from the selected command.

Property name Function

Name The name of the plugin.

Provider The name of the company which provides a plugin.

Version Version number of the selected plugin.

Loaded Indicates if the plugin is correctly loaded.

Enabled Shows the status of the plugin. If True, the selected plugin is activated in MagicDraw.

Disable/Enable Disables or enables the selected plugin.

Property name Function

-37 © 2005 No Magic, Inc.

Page 35: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

©

2

R E S O U R C E S P A N E

Displays the external resources such as dtd, xsd, etc. that are used in MagicDraw.

Figure 11 -- Environment Options dialog box. Resources pane

Property name Function

Configure External Resources.Define external resources that will be used in XML parsing.

Location The location of the external resource.

URI The URI of the external resource.

Edit Edit the location and the URI of the resource in the External Resource dialog box.

Add Add a new external resource

Remove Remove the selected resource form the list.

Configure Ignored Resources

URI The URI of the external resource that will not ignored in MagicDraw.

Edit Edit the URI of the ignored external resource in the External Resource dialog box.

2005 No Magic, Inc 2-38

Page 36: MagicDraw UserManual

2-

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

P A T H V A R I A B L E S P A N E

Add Add a new external resource that will be ignored.

Remove Remove the selected ignored resource from the list.

Property name Function

39 © 2005 No Magic, Inc.

Page 37: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

L A U N C H E R P A N E

Figure 12 -- Environment Options dialog box. Launcher pane

Look and Feel : Control l ing In ter face

The appearance of MagicDraw UML windows, dialog boxes, menus, and everything inside them can be changed.

Property name Function

Default Launcher The Launcher Properties dialog box appears.

Default Browser The Launcher Properties dialog box appears.

Defined Launchers

Edit Opens the Launcher Properties dialog box for editing launcher information.

Add Adds launcher in the Launcher Properties dialog box.

Remove Removes launcher from the list.

Reset to Defaults Resets all properties to the default ones.

OK Saves changes and exits the dialog box.

Cancel Exits the dialog box without saving changes.

Help Displays MagicDraw Help.

© 2005 No Magic, Inc 2-40

Page 38: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

To make changes to the interface:

From the Options menu, choose Look and Feel and then choose the style you wish.

Figure 13 -- Look and Feel Themes submenu

The chosen style will not look exactly like the applications in those operating systems because every style of graphical interface is implemented within a Swing library, but it will look quite similar. Depending on which operating system you use, some choices might be unavailable to you. For example, Windows9x/NT users may not switch to the Mac interface style.

Look and Feel Themes – themes listed in Look and Feel Themes subcommands are valid only for the metal style. Choose from any of the following themes:

• Aqua

• Contrast

• Big Contrast

• Green

• MagicDraw

• Big MagicDraw

Theme Description

Metal Standard Java Swing library (default)

CDE/Motif Similar to GUI that is used on UNIX operating systems

Windows Microsoft Windows 95, Windows NT 4.0, Windows 2000 interface

Kunststoff Is an extension of the Java Metal Look and Feel. MagicDraw will have a more modern and smoother look.

2-41 © 2005 No Magic, Inc.

Page 39: MagicDraw UserManual

G E T T I N G S T A R T E DSet t ing Personal Preferences

2

• Khaki

• Kunststoff Theme

• Custom – set your own options in the Properties dialog box.

J I D E A N D M U L T I P L E W I N D O W S I N T E R F A C E S T Y L E S

Since MagicDraw version 7.5, modern JIDE library is implemented. Using the JIDE interface style, it is possible to work with Browser window in more flexible way, use documentation, zoom, and message windows as dockable and place above the main window. Now you may arrange the Browser window in your desired combination, hide the desired Browser windows

Also you may use Multiple Windows style. It allows you to manage all windows independently, as if they belong to different applications. For instance, you may overlap the tool’s windows across each other, resize them independently and so on. There is no main window where all other windows are placed.

To set interface style

From the Options menu, choose Interface Style, and then choose one of the desired interface styles: Multiple Windows, or JIDE.

2-42 © 2005 No Magic, Inc.

Page 40: MagicDraw UserManual

W O R K I N G W I T H P R O J E C T S 3

The term “project” is used to describe the problem that must be solved, including all the possible solutions for how the problem can be resolved and finally developed. All works in MagicDrawTM UML are organized into projects. Project is a top one entity where all model-related data (the set of diagrams) is held. Project data is organized by object orientation, which makes its management intuitive and in accordance with the problem that is being solved.

In this Section, you will find the following chapters:

1 "Creating New Project ", on page 44

2 "Saving and Exporting", on page 463 "Loading", on page 504 "Project Options. Style Engine", on page 515 "Modules Functionality. Reusing project part - Partitioning", on page 636 "Profiles", on page 747 "Model Differencing", on page 768 "Working with multiple projects", on page 839 "Using Browser", on page 8410"Searching", on page 9911"MagicDraw and Rational Rose®", on page 10412"MagicDraw and Together ControlCenter", on page 10913"Resources Manager", on page 114

CREATING NEW PROJECT All project information is stored in a single file. A project name matches the file name where the project is saved.

The newly created project consists of the following packages:

• Data package is empty and holds all model elements.

• Component View package contains components that are created during the code engineering and represent source files. Adding a resident element to a particular component causes that element to be generated within the source file.

• MagicDraw Profile contains tagged values and stereotypes that are necessary for working with various parts of MagicDraw.

• UML Standard Profile contains primitive data types, constraints, tagged values, and stereotypes, which are UML standard and can be used in various cases. The

© 2005 No Magic, Inc. 3-44

Page 41: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SCreat ing New Project

3

following data types are specified in Magic Draw: boolean, byte, char, double, float, int, integer, long, short, and void.

You may also create your own packages for holding the model elements, but, by default, packages may not be deleted or renamed in a project (except for the Component View package).

To start a new project, you must create a new workspace for it.

To create a new workspace for a project

• From the File menu, choose New Project.

• On the main toolbar, click the New Project button.

• Press shortcut key CTRL+N.

In all cases, you receive a new project named UntitledN, and it is selected as an active project.

Creat ing new project f rom al ready created template

C++, CIL, Java, C#, DDL, EJB, WSDL, XML Schema, MOF, RUP extensions, CORBA IDL, and UMLWebExtension templates are available in the New From Template dialog box.

The New From Template command is used for creating a new project from the selected template file.

3-45 © 2005 No Magic, Inc.

Page 42: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SSaving and Expor t ing

3

To open the New From Template dialog box

From the File menu, choose New From Template.

Figure 14 -- New From Template dialog box

The newly created project from template will contain specific model elements and stereotypes.

TIP! All MagicDraw templates are located in the <MagicDraw installation directory>/templates folder so you may import the desired template in your already created project using Import command from the File menu.

Impor t ing project

To import an already created project to an opened project

1 From the File menu, choose Import.2 The Import dialog box appears. Choose the project you want to import and

click OK. The diagrams of the imported project are placed in the opened one.

SAVING AND EXPORTINGIMPORTANT!Beginning with MagicDraw version 3.6, the native MagicDraw format is .xml.

Saving in .mdf format is not allowed.

© 2005 No Magic, Inc 3-46

Page 43: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SSaving and Expor t ing

3

To save changes for the later sessions, revised projects must be saved. While saving, you may edit the changeable name of the project and the file format.

To save the project

1 From the File menu, choose the Save Project or Save Project As command, or click the Save button on the main toolbar, or press shortcut keys CTRL+S. The Save dialog box appears.

2 Select the destination directory (where you wish to save the project) and type the file name for it.

3 Choose the format for saving a project: Packed XML (*xml.zip) (default) or Extensible Markup Language (*.xml)

4 Choose the version of XMI - 1.0, 1.1, or 1.2. Also if you want to save maximum additional information to xmi file, which is not required on Magic Draw load but may be useful using other tools, select Rich XMI button.

Figure 15 -- Save dialog box

NOTE If the Create Backup File check box is selected in the Environment Options dialog box, MagicDraw always creates a backup file that has the previously saved project. The backup is held in a file with a name identical to that of the project. For a detailed description of the Environment Options dialog box, see Section “Setting Personal Preferences” on page 2-24.

Expor t ing project as template

You may save (export) the created project as a template and use the same project for creating other new projects.

3-47 © 2005 No Magic, Inc.

Page 44: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SSaving and Expor t ing

3

To export project as template

1 Open a project you want to export as a template. From the File menu, choose Export, and then Template.

2 The Export Template dialog box appears.3 Type the name and a description of a template.4 Click OK.

Figure 16 -- Export Template dialog box

Sav ing diagram as image

Diagrams that were created in the model can be saved as image in the following formats:

• Enhanced Metafile Format (*.emf) - supports language specific symbols.

• Encapsulated PostScript (*.eps)

• Joint Photographic Experts Group (*.jpg, *.jpeg)

• Portable Network Graphics (*.png)

• Scalable Vector Graphics (*.svg)

Box Function

Template Name Type a template name.

Description Type information about the template.

OK Exports the template and the description to the Templates folder.

Cancel Closes the dialog box without exporting the template.

Help Displays MagicDraw Help

© 2005 No Magic, Inc 3-48

Page 45: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SSaving and Expor t ing

3

• Windows Metafile Format (*.wmf)

To save the current diagram, or the selected element, within the diagram as an image

1 From the File menu, choose Save As Image. The Save As Image dialog box appears.

2 Select the Active Diagram or the Selected Symbols option button.3 Select the file format (*.svg, *.eps, *.dxf, *.wmf, *.png, *.jpg, *.emf), file name,

and the location directory.

To save the selected diagrams of your project as images

1 Choose the Save Selected Diagrams As Images command from the File menu. The Save As Image dialog box appears.

2 Choose diagrams you want to save as image from the Not Empty Diagrams list.3 In the Working Directory field, type in the name of the destination directory, or

click the ‘...’ button to, browse the directory list.4 Select the graphical file format in the File Format drop down list (JPG, PNG,

WMF, EPS, EMF, or SVG) and click Save.

Figure 17 -- Save As Image dialog box

The filename of the saved diagram will be the same as the name of that diagram.

3-49 © 2005 No Magic, Inc.

Page 46: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SLoading

3

The Not Empty Diagrams list contains all exportable diagrams that contain UML elements. Empty diagrams are not displayed, select the diagrams you wish to export:

To make multiple selections

Press the CTRL key and click the diagrams you wish to export.

To select or unselect all diagrams

Click the Select All button (press CTRL+A keys) or Unselect All button.

To display in the list all diagrams that are available in the project

Click the Load All Diagrams button in the Save As Image dialog box.

Autosave

After you stop working with MD, an idle time passes and the current project is saved to a special file - AutoRecovery file.

If application is terminated normally, AutoRecovery file is removed. If application crashes, AutoRecovery file is left. On startup, MagicDraw checks for AutoRecovery file, if it exists, suggests to load a project from this file.

To save AutoRecovery file of the opened project(s) when a system is not in use.

1 Open the Environment Options dialog box.2 In the General pane, select the Save Project Recovery Data on Idle check box.

Also enter the system idle time (in minutes) when to activate file recovery save in the Idle Time to Activate Recovery Save text box.

LOADINGIMPORTANT! Beginning with MagicDraw Version 3.6, the native MagicDraw format is .xml.

Saved projects can be loaded back to MagicDraw.

To edit or review already created projects

1 From the File menu, choose Open Project, or click the Open Project button on the main toolbar.

2 In the Open dialog box, choose the project you wish to open and click Open.TIP: Drag and drop the project you wish to open directly from the open window to the

MagicDraw. The project is started at once.

NOTES:

© 2005 No Magic, Inc 3-50

Page 47: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

If the Open Last Project on Startup check box in the Environment Options dialog box is selected, the last project you worked with will be opened right after MagicDraw starts.

XMI v1.0, v 1.1 and v1.2 are native MagicDraw file formats for model storage. But these formats do not specify how to store diagrams. So if you use MagicDraw to open the XMI file, exported with another tool, only the model will be loaded (diagrams, views not). MagicDraw can not "import" such XMI, it can only open it.For model interchange you should use the Unisys XMI 1.0. If your tool does not support Unisys XMI 1.0, you will not be able fully (with diagrams) exchange the model. More about interchange with Rational Rose ant Together ControlCenter, see in Section “MagicDraw and Rational Rose®” on page 3-104 and Section “MagicDraw and Together ControlCenter” on page 3-109.

You may load more than one project within the same MagicDraw session. Separate workspace will be created for each project that is opened.

PROJECT OPTIONS. STYLE ENGINEStyle engine is a part of the MagicDraw UML system that defines diagrams, shapes, paths, and stereotypes properties. There may be few properties styles defined but all symbols are created according to the style that is selected as default. There is possibility to apply different presentation styles for diagram/shape/path/stereotype depending on diagram type.

Pro ject Opt ions

The Project Options dialog box is used for defining properties for model elements (shapes and paths) and diagrams, for creating your own project style, importing or exporting the created project style, and defining code engineering options.

3-51 © 2005 No Magic, Inc.

Page 48: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

To change the default project options and Code Engineering tasks

From the Options main menu, choose Project. The Project Options dialog box appears.

Figure 18 -- Project Options dialog box

The Project Options dialog box has several collections of customizable options:

To find elements to change, browse the options tree in the Project Options dialog box. The items in this hierarchy are either:

• Compressed - a plus sign next to an icon indicates that the icon is compressed, and contains other model elements. This is the default setting when you start

General Project Options

Define the default packages where the extension elements will be stored. Also if desired you may choose the package every time when creating a new extension element, the dialog box asking about the storage place will appear. In the Modules Path text box, enter the path where by default modules will be stored.

Diagram Info Customize what and how information will be displayed in the Diagram Info table.

Symbols Properties Styles

Expands tree hierarchy of all the styles defined within the project. You may create as many of these styles as you like.NOTE To apply the changed project option to the

opened project, click the Apply button.

Code Engineering Define general code engineering options as well as options specific to languages. The description about this part, see Code Engineering user’s guide.

© 2005 No Magic, Inc 3-52

Page 49: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

your application. Click the plus sign to expand the icon and view its subordinate items.

• Expanded - a minus sign next to an icon indicates that the icon is fully expanded. Click the minus sign to collapse the item.

If there is no sign next to an icon, it does not contain other model elements.

The following buttons are available in the Project Options dialog box:

To create a new style by cloning the existing one

1 Select the default style in the Styles list box and click the Clone button. 2 Type the name for the new style in the Enter Style Name dialog box.3 Change options of the new style.

To change the name of the selected style

1 Select a style you want to rename and click the Rename button. 2 Type a new name for the style in the Enter Style Name dialog box.

To remove the selected style

Click the Delete button in the Project Options dialog box.

To make a selected style your default style for newly created projects

Click the Make Default button in the Project Options dialog box.

To apply the selected style or changed option to a current project

• Click the Apply button in the Project Options dialog box, Styles pane.

NOTE: You may also apply the desired options to the selected diagrams model elements. Click the Apply button in the specific elements pane.

Button name Function

Clone Clone (duplicate) the selected style.

Rename Change the name of all existing style. Type a new name for a style in the Enter Style Name dialog box.

Delete Remove the selected style.

Make Default Make the selected style as your default style for the newly created projects.

Apply Apply the selected style to the opened project.

Import The Open dialog box appears. Select the style you wish to import (*.stl).

Export The Save dialog box appears. Select the directory where you wish to export a style.

Reset to Defaults Changes all settings to the default configuration.

3-53 © 2005 No Magic, Inc.

Page 50: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

To import an already created (and exported) project style

Click the Import button. The Open dialog box appears. Select the style you wish to import (*.stl).

To save the created style (export) for a later usage or for other users

Click the Export button. The Save dialog box appears. Select the directory where you wish to export a style.

S Y M B O L S P R O P E R T I E S S T Y L E S T R E E

Expands the tree hierarchy of all the styles defined within the project. You may use as many of these styles as you wish.

Shape and Paths trees have the inner structure to help you find the model element, the representation of which must be changed. The right side of the dialog box contains possible choices and instruments to manage them.

© 2005 No Magic, Inc 3-54

Page 51: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

Figure 19 -- Project Options dialog box. Styles

In the following table you may find all possible options that can be set for the symbols:

Property Function (when selected)

Fill Color The fill color of the symbol. The Color dialog box appears.

Use Fill Color Uses the fill color and symbols are colored on the diagram.

Pen Color The pen color that is used to draw elements. The Color dialog box appears.

Text Color The color that is used for text coloring. The Color dialog box appears.

Font Font that is used for a name and other displayed properties of the model element. The Font dialog box appears.

Autosize Adjusts the size of a symbol to the contained information. Element borders are changed so that it uses minimum space.

Use Fixed Connection Points The end of the path is connected to the fixed point of the shape.

Path Style The drawing style of a path.Possible choices: Rectilinear, Oblique, or Bezier.

Attribute Color The color of the attribute name. The Color dialog box appears.

Attribute Font Font that is used for a name of the attribute. The Font dialog box appears.

Attributes Sort Mode The mode for sorting attributes. Possible choices: No Sorting, By Name, By Stereotype, or By Visibility.

Constraint Text Mode Displays constraint’s name or expression on a symbol.

Direction The direction of a signal.Possible choices: Right or Left.

Header Position The package name position on the symbol.Possible choices: Top or In Tab.

Header in Bold Shows the name of the symbol as bolded.

HTML Text Activates HTML editor for the text of a note and a text box.

Line Style A line style for a horizontal separator.Possible choices: Dashed or Solid.

Operation Color The color of the operation name. The Color dialog box appears.

Operation Font Font that is used for a name of the operation. The Font dialog box appears.

Operations Sort Mode The mode for sorting operations. Possible choices: No Sorting, By Name, By Stereotype, or By Visibility.

Orientation Primarily the sychronization bar diagram button is set to vertical or horizontal position.

Show Attributes Constraints Shows constraints of attributes.

Show Attributes Properties Shows tagged values of an attribute.

Show Attributes Stereotypes Shows stereotypes of attributes.

3-55 © 2005 No Magic, Inc.

Page 52: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

Show Attributes Visibility Shows attribute visibility signs (+, -, #,~).

Show Base Classes Shows a base class on stereotype symbol.

Show Classifier Shows a classifier name near a model element name.

Show Direction Arrow Shows the direction arrow on the association. The association must be set as Navigable.

Show Elements List Shows model elements that are assigned to a model, package or subsystem as a list.

Show Entire Activation Shows entire activation bar on active classifier role in sequence diagram.

Show Full Classifier Type Shows all attributes that are defined within a class or assigned classifier.

Show Initial Attribute Value Shows initial attribute value on a class or artifact.

Show Message Numbers Shows the messages numbers on a diagram.

Show More Sign for Attributes Shows additional information sign “…” in the class, artifact attributes list, when omissions are made by editing class compartment.

Show More Sign for Operations

Shows additional information sign “…” in the class, artifact or numeration operations list, when omissions are made by editing class, artifact or enumeration compartment.

Show Multiplicity Shows multiplicity value.

Show Name Shows the name of a relationship, role and message/stimulus

Show Operations Constraints Shows constraints of operations.

Show Operations Signature Shows all of the operation arguments and the return type.

Show Operations Stereotypes Shows stereotypes of operations.

Show Operation Parameters Direction Kind

Show Operations Properties

Show Operations Visibility

Shows the direction kind for operations parameters

Shows tagged values and concurrency of an operation.

Shows operation visibility signs (+, -, ~ #).

Show Owner Shows the name of the owner model element (in parenthesis beneath the corresponding model element name.)

Show Predecessors Shows predecessors on message.

Show Visibility Shows role visibility signs (+, -, #).

Property Function (when selected)

© 2005 No Magic, Inc 3-56

Page 53: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

Stereotype Color

Stereotype Font

Show Stereotypes

Show ConstraintsShow Tagged Values

The color that will be used to draw stereotypes. The Color dialog box appears.

The font that will be used to draw stereotypes. The Font dialog box appears.

Shows stereotype labels on symbols.

Shows constraints on symbols.Shows tagged values on symbols.

Suppress Actions Hides actions associated with the state.

Suppress Attributes Hides attributes list.

Suppress Content Displays only an icon of an assigned element or stereotype.NOTE Only when a model element contains an icon or a stereotype with an icon, the Suppress Content command is activated on the element shortcut menu.

Suppress Extension Points Hides use-case extensions on a use case.

Extension Point Color The color of the extension point name. The Color dialog box appears.

Extension Point Font Font that is used for a name of the extension point. The Font dialog box appears.

Suppress Enumeration Literals Hides enumeration literals on a enumeration.

Enumeration Literal Color The color of the enumeration literal name. The Color dialog box appears.

Enumeration Literal Font Font that is used for a name of the enumeration literal. The Font dialog box appears.

Suppress Operations Hides operations compartment section.

Suppress Realization Elements Hides realization elements of a subsystem.

Suppress Specification Elements

Hides specification elements of a subsystem.

Text Position Changes the text position of a separator.Possible choices: Center, Left, or Right.

Wrap Words Wraps printed text at the edge of text container.

Background Color The color of the diagram background. Click the ‘...’ button to open the Color dialog box, select the background color.

Snap Paths to Grid Snaps paths to grid.

Snap Shapes to Grid Snaps shapes to grid.

Grid Size Grid size settings from 2 to 30.

Show Grid Shows a grid on the diagrams.

Show Diagram Info Shows diagram information table on diagram pane.

Property Function (when selected)

3-57 © 2005 No Magic, Inc.

Page 54: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

Working wi th Proper t ies S ty le s

All symbols in MagicDraw UML are created according to active properties style. There may be more than one properties style in the same project, and the whole style may be applied for the project.

Every style has its own presentation of Diagram, Shape, Path, and Stereotype that you may modify using the Project Options dialog box in the Symbols Properties Styles branch. You may set your own options for every model element to the current style.

Paths, Shapes, and Stereotypes 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 box contains possible choices and instruments to manage them.

The following properties are defined for the formatting symbols:

• Shapes. Set general options for the shapes in the right pane of the Project Options dialog box. You may set such 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 box. You may 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 box. You may set options for all stereotypes that may be applied to elements on the Diagram pane.

P R O P E R T I E S E X T E N S I O N B Y D I A G R A M

Diagrams, shapes, paths, and stereotypes properties may be extended by particular diagram type. It means that presentation style options will be applied only for the specified element symbol in the specific diagram.

To extend element properties by diagram

1 In the Project Options dialog box, the Symbols Properties Styles tree, expand a branch, select the specific element (shape, path, diagram, or stereotype) and right click the mouse button. The list of diagrams in which element symbol may be created, appears.

Figure 20 -- Element extension by diagram

© 2005 No Magic, Inc 3-58

Page 55: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

2 Select the diagram type. Diagram is added as additional branch to the section.

Figure 21 -- Extended diagram addition

3 Set the style properties for the element in the right pane of the Project Options dialog box. Properties will be applied only in the specified type of diagram.

• Element may be extended by diagram in the Project Options dialog box, specific elements pane, clicking the Extend by Diagram button. The Extend by Diagram dialog box appears. Click the Add Diagram button and select a diagram from the list.

Figure 22 -- Extend by Diagram dialog box

To remove extended diagram from the tree

• Select extended diagram and on the right click mouse button, choose Remove.

Figure 23 -- Remove extended diagram

• In the Project Options dialog box, extended diagram style properties pane, click the Remove button.

P R O P E R T I E S I N H E R I T A N C E

All element properties have “inherited” check box. This check box indicates if property is derived from the base element properties, or is it specific.

3-59 © 2005 No Magic, Inc.

Page 56: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

The Inherited column check box value in the elements properties pane specifies if current property is synchronized with its parent property. When the Inherited value is “true”, elements property is changed after changing the parent property.

If property has no correspondent property in upper (parent) level, the Inherited column check box is cleared and disabled.

If property is modified for the specific element and value differs from the upper level current property value, the Inherited column check box is cleared automatically.

G E N E R A L S T Y L E P R O P E R T I E S

You may define the common properties for the whole style. The style properties are displayed when properties style is selected in the Project Options dialog box styles tree.

S H A P E S , P A T H S A N D D I A G R A M S P R O P E R T I E S

All shapes, paths and diagrams that may be created in the project, are listed in the Project Options dialog box. If the Shapes, Paths or Diagrams branches are selected in the tree, the general properties may be set in the right pane of this dialog box.

When expanding any of these branches, the style for concrete element (diagram) may be created.

To apply a new style for the already created element symbol

1 In the Project Options dialog box, change element style properties and click the Apply button. The Select Diagrams dialog box appears. The list of diagrams, which were created in the project, is displayed.

Figure 24 -- Select Diagrams dialog box

© 2005 No Magic, Inc 3-60

Page 57: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

2 Select diagrams in which element properties will be applied and click OK. The Select Properties to Apply dialog box appears.

Figure 25 -- Select Properties to Apply dialog box

3 Choose which properties will be applied to element symbol from the All to Selected list. Click OK.

NOTE! If a new style was set, it will be applied for all newly created elements after drawing them on diagram pane. You may always set the default symbols style to element by clicking the Apply Default Symbol Style button in the main toolbar.

S T E R E O T Y P E S P R O P E R T I E S

Stereotypes properties may be applied only if stereotype properties style is created in the Project Options dialog box.

Stereotype properties are derived from their base class. Stereotype base class is defined in the label of the right pane of the Project Options dialog box.

The same element may have several stereotypes assigned. In this case, style of the first stereotype will be applied to the element symbol. If 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.

Stereotypes may be extended by diagram.

All stereotypes that have defined symbol properties are included into the Stereotypes branch. By default only boundary, control, and entity stereotypes are added to the tree when expanding the Stereotypes branch and default style is created for these stereotypes.

3-61 © 2005 No Magic, Inc.

Page 58: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProject Opt ions. S ty le Engine

3

To add stereotype to the branch

1 In the Project Options dialog box, the Symbols Properties Styles tree right-click the Stereotypes branch. The list of stereotypes appears.

Figure 26 -- List of stereotypes

2 Select the check box near the stereotype and click the Apply button. Stereotype will be included into the Stereotypes branch. Set the stereotype style properties in the right pane of the Project Options dialog box.

To remove stereotype from the branch

1 In the Project Options dialog box, the Symbols Properties Styles tree select the Stereotypes branch. The list of stereotypes appears.

2 Clear the check box near the stereotype and click Apply. Stereotype is removed from the branch.

To change stereotype properties

1 Expand the Stereotypes branch and select a stereotype. 2 Set properties in the right pane of the Project Options dialog box.

To apply stereotype properties for already created symbol with assigned stereotype

1 When stereotype style properties in the right pane of the Project Options dialog box are changed, click the Apply button. The Select Diagrams dialog box appears.

2 Select diagrams in which stereotype properties will be applied and click OK.3 In the Select Properties to Apply dialog box, choose which properties will be

applied to stereotype. Click OK.NOTE! You may apply stereotype properties to symbol after changing style properties and

in the Project Options dialog box clicking OK. Style will be applied when selecting symbol on the diagram pane and from the main toolbar clicking the Apply Default Symbol Style button.

© 2005 No Magic, Inc 3-62

Page 59: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModules Funct ional i t y. Reus ing project par t - Par t i t ioning

3

To apply stereotype properties when assigning stereotype to element

NOTE! In the Environment Options dialog box, Diagrams tab, the Apply Stereotype Style for All Symbols check box should be selected and in the Project Options dialog box, the style properties should be changed for stereotype.

1 In the created diagram, draw an element.2 From the element shortcut menu, choose Stereotype. The list of available

stereotypes appears.3 Select the check box near the stereotype you want to assign to element. Click

Apply. Stereotype properties are applied automatically when assigning stereotype to element.

MODULES FUNCTIONALITY. REUSING PROJECT PART - PARTIT IONING

Partitioning functionality – it is the segmentation of the MagicDraw project into multiple independent parts, called modules. This functionality is based on referencing. These modules are saved using the same file format, as do regular MagicDraw projects, so the modules can be opened and edited in any MagicDraw client application. This approach allows easy reuse of the same basic model libraries in multiple projects.

Work ing wi th modules

E X P O R T I N G P R O J E C T M O D U L E

The export module action saves the content of the selected package into a separate file. Exporting module is the only way to create a module. The package and all the containing elements after exporting have a “read–only” status. The module name is displayed in the brackets near the package name in the Browser tree.

3-63 © 2005 No Magic, Inc.

Page 60: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModules Funct ional i t y. Reus ing project par t - Par t i t ioning

3

To export any module using the File menu

1 From the File main menu, choose Export, and then choose Profile/Module. The Export Profile/Module dialog box appears.

Figure 27 -- The Select Package dialog box for module exportation

2 In the All Data list, select the package, which you want to be saved as a separate module. Click the Add button. The package will be placed to the Selected Objects list.

3 If desired, type the description of the module, which will be displayed in as the documentation of the package.

4 Click OK. The Save dialog box appears.5 Select the destination directory, where you wish to save the project module, type

the file name, choose the format for saving and click OK.

To export the selected module using the package shortcut menu

1 In the Browser tree, select a package, which you want to be saved as a separate module (multiple packages selection is possible).

2 From the package shortcut menu, choose Modules, and then choose Export Module. The Export Profile/Module dialog box appears.

3 In the All Data list, select the package, which you want to be saved as a separate module. Click the Add button. The package will be placed to the Selected Objects list.

© 2005 No Magic, Inc 3-64

Page 61: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModules Funct ional i t y. Reus ing project par t - Par t i t ioning

3

4 If desired, type the description of the module, which will be displayed in as the documentation of the package.

5 Click OK. The Save dialog box appears.6 Select the destination directory, where you wish to save the project module, type

the file name, choose the format for saving and click OK.NOTE: Only packages can be exported as modules. In order to export the created

diagram, you have to move it to the package, which contains elements to export.

U S I N G P R O J E C T M O D U L E

The use module action opens the module for using it in the project. Module will be loaded in a “read-only” status. You may use this module in your project, although for editing you have to import this module or open it as a separate project.

To use module in the project

1 From the File main menu, choose Use Profiles/Modules.2 In the Use Profile/Module dialog box, select the module you wish to use in your

project and click OK.

I M P O R T I N G P R O J E C T M O D U L E

After the module is opened for use or when exported, it is in the read-only status. The import module action makes a package and entire inner elements editable. Module model after importing is merged with the project model.

To make module editable

In the Browser tree, from the module shortcut menu, choose Modules and then choose Import.

NOTE: There is another way to change modules’ content and make inner elements editable – use the Open Module As Project command. A module will be opened as a separate project.

S H A R I N G P A C K A G E S

Since MagicDraw version 8.0, a new concept of ”shared packages” is presented. Module editing limitations now are removed and if module is opened as a project, it is treated as regular MagicDraw project only includes shared packages.

Packages can be shared only if they are not dependent on other model (the same principle as now in "export module"). If project has shared packages, dependencies should be checked on every saving.

Every project that has "shared packages" can be used in other projects as a module. When opening it as a module, only shared packages will be loaded from this project file and used "read only", other packages and all project related information remains not loaded. If there are no shared packages, this project can't be used as a module.

3-65 © 2005 No Magic, Inc.

Page 62: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModules Funct ional i t y. Reus ing project par t - Par t i t ioning

3

To share a package

1 Create package. Select it in the Browser. Invoke model element shortcut menu, select the Modules command and then the Shared Packages command. The Shared Packages dialog box appears.

2 In the Shared Packages dialog box, the Selected Objects tree, package you want to share is selected. Click OK. If package doesn't have dependencies with not shared packages, it is shared.

After package is shared, in the Browser, next to the shared package name appears word [shared].

To share few packages at the same time

1 Select few packages in the Browser and then invoke the Shared Packages dialog box. In the Shared Packages dialog box, the Selected Objects tree, packages you want to share are selected.

2 In the Shared Packages dialog box, you may add packages you want to share. To do this, in the All Data tree, select packages you want share and click the Add button. Click Ok button.

TIP Not only package can be shared, but model and subsystem too.

© 2005 No Magic, Inc 3-66

Page 63: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModules Funct ional i t y. Reus ing project par t - Par t i t ioning

3

To unshare shared package

1 Select shared package in the Browser. Invoke shared package shortcut menu, choose the Modules command and then the Shared Packages command. The Shared Packages dialog box appears.

2 In the Shared Packages dialog box, the Selected Objects tree are listed shared packages. So, in the Selected Objects tree, select the package or packages you want to unshare, and click Remove. If you want to unshare all shared packages, click on the Remove All button.

Restrictions of shared packages usage

Actions which are not allowed with shared packages:

• Shared package can not include module. This is so, because shared package is module itself.For example, draw parent package p1 and package inside it p2. Invoke the Shared Packages dialog box. To the Selected Objects list add the p1 package. In the All Data tree, select the p2 package. Message appears: p2 parent package p1 is already selected. If you will move shared package p1 to other shared package p2, [shared] words removes from p2 package, because parent package is shared. Move p2 package from p1 package, next to the package name [shared] is written again.

• Cannot export package with inner shared package.

O P E N I N G M O D U L E A S A P R O J E C T

Since MagicDraw version 8.0, after opening module as a separate project, all available packages, are enabled for editing, with the corresponding module package marked as shared.

When loading module as a project, it is allowed to separate existing module into sub-modules, make changes to the containing elements, and add the new ones.

To open module as a project

In the Browser tree, from the exported module shortcut menu, choose Modules, and then choose Open Module As Project.

R E L O A D I N G M O D U L E

The reload module action is useful to get the newest changes of the module. All modifications, which were made in the other project for this module and then module exported with the same name, will be reloaded in the current project.

To reload the module

In the Browser tree, from the exported module shortcut menu, choose Modules, and then choose Reload Module.

NOTE: If the module is opened as a project, use the Save command to save the changes, made in this module. All modifications of the module will appear after

3-67 © 2005 No Magic, Inc.

Page 64: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModules Funct ional i t y. Reus ing project par t - Par t i t ioning

3

reloading it in the other opened project, where this module is used as a part of the project model.

Dependencies between e lements

Package can be exported into an independent module only if it does not depend on external elements (except other modules). Cyclic dependencies between several modules are not allowed.

There are three types of dependencies:

• Dependencies by relationships

• Dependencies by reference

• Diagrams dependencies

P A C K A G E S D E P E N D E N C I E S B Y R E L A T I O N S H I P S

Module depends on external elements

If module element has a relationship with an external element and this relationship is contained in some of module package, the error message occurs when exporting the module.

Figure 28 -- Example of module dependency on external element

Such dependency on external elements is displayed in the Browser tree:

Figure 29 -- Package has dependency on external element

© 2005 No Magic, Inc 3-68

Page 65: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModules Funct ional i t y. Reus ing project par t - Par t i t ioning

3

In this situation, MagicDraw can suggest moving relationship into the parent package of this external element, e.g. in this example package1 is a parent of class B, so the relationship can be moved from module into package1:

Figure 30 -- Resolved package dependency on external element

This movement can be done in the Package Dependencies dialog box, by clicking the Solve button. For a detailed description of this dialog box, see Section “Package Dependencies dialog box” on page 3-72.

Figure 31 -- Error in the Package Dependencies dialog box

Also you may drag–and–drop the relationship from one package to another manually in the Browser tree.

Module depends on external element, but can be exported (with warning)

Module’s element has relationship with external element but this relationship is contained in some external package:

Figure 32 -- Example of “legal” module dependency on external element

3-69 © 2005 No Magic, Inc.

Page 66: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModules Funct ional i t y. Reus ing project par t - Par t i t ioning

3

In this case, dependency on external elements is displayed in the Browser tree:

Figure 33 -- “Legal” module dependency on external element in data model browser

Package can be exported as module, because relationship is contained in external package. You will be warned about such dependencies, because they have some logical meaning:

Figure 34 -- Warning in the Package Dependencies dialog box

If you want to skip this dependency, click the Export button. After opening the module as a separate project, this relationship will be absent.

Module does not depend on external element

If module element has a relationship with external element but this relationship is meaningless in UML context (it means external model uses module, but not otherwise) and

© 2005 No Magic, Inc 3-70

Page 67: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModules Funct ional i t y. Reus ing project par t - Par t i t ioning

3

contained in an external model, such package can be exported into independent module without warnings:

Figure 35 -- Example of relationship when module does not depend on external element

D E P E N D E N C I E S B Y R E F E R E N C E

Module depends on external elements, when model elements from module’s packages have references to external elements.

Figure 36 -- Example of dependency by reference

In this case, the module package cannot be exported into independent module.

D I A G R A M S D E P E N D E N C I E S

Diagram depends on all model elements displayed in this diagram.

If diagram is contained in some module package and depends on external elements, this package cannot be exported into module.

Figure 37 -- Example of the relationship when diagram depends on external element

About the package dependency on external elements, see Section “Module depends on external elements” on page 3-68.

3-71 © 2005 No Magic, Inc.

Page 68: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModules Funct ional i t y. Reus ing project par t - Par t i t ioning

3

In this case, if diagram is not important for the module, it can be moved from the module package into any external package manually by dragging and dropping in the Browser tree:

Figure 38 -- Diagram is moved from the module package to the package1 package.

Now the module package can be exported into independent module.

Package Dependencies d ia log box

The Package Dependencies dialog box appears when the package cannot be exported to the project module, because dependencies with external model elements are found (see more detailed information about the types of package dependencies in the Section “Packages dependencies by relationships” on page 3-68.

To open the Package Dependencies dialog box

In the Browser tree, from the package, which contains dependency with external model element, shortcut menu, choose Modules, and then choose Export Module.

Figure 39 -- The Package Dependencies dialog box

© 2005 No Magic, Inc 3-72

Page 69: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModules Funct ional i t y. Reus ing project par t - Par t i t ioning

3

Every MagicDraw UML project module (package or diagram) or group of them can be saved into separate xml file: from the File menu, choose Export, and then choose Profile/Module command.

You can save reusable model part as module xml file. Module file is a simple MagicDraw project file and can be opened as separate project.

Module xml file later can be imported into other MagicDraw project: choose the Import command from the File menu. All elements from module xml file are copied into the target project. There is no linkage between these two projects (files) after import; both these files can be used separately.

NOTE: We do not suggest using modules for splitting project into parts and developing these parts simultaneously. After splitting, you will need to merge all project parts into one project. Only model elements are merged on import. If you have the same diagram exported into separate files, it will be duplicated after importing it back. We use simple rule for model elements merging - two model elements are equal if names are equal. If the same model element was exported into two files and name of it was changed in one file, you will have two model elements after merging these two parts.

Primary purpose of Save Project Module functionality was to allow the user to export some project part into separate file and import later it into another project. This is not the same as splitting project into parts and connecting these parts into one project later.

Box name Function

Status Status of the problem. It can be Error or Warning.

Module Element The name of the model element.

Element Type The type of the element.

Dependency Type The type of dependency.

Depends On Model element, on which the package element is dependent.

Solve Solves the Error dependencies. Enabled, when error status dependency is selected in the table and when solution of the problem can be found. The message about how dependency can be solved is displayed. Dependency status in the dependencies table is changed from Error to Warning.

Select in Containment Tree Selects the element in the Browser, which is already selected in the dependent elements table.

Refresh Performs module dependency checking and refreshes module dependencies table.

Export Exports package as a separate module.Enabled, when all module dependencies have Warning status or no problematic dependencies exist.

Cancel Exits the dialog box without saving changes.

Help Displays MagicDraw Help.

3-73 © 2005 No Magic, Inc.

Page 70: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProf i les

3

The best solution for group work on the same project is MagicDraw Teamwork Server. For more information about the Teamwork Server, see the MagicDraw Teamwork System User’s Guide.

PROFILESThe profile is defined using the extensibility mechanisms of UML, which allow modelers to customize UML for specific domains, such as software development processes. In MagicDraw, profiles mechanism is similar to modules functionality although the profile is a package with stereotype <<profile>> and its content is visible in Profiles dialog box, and UML extensions tabs of Specification dialog boxes.

There are several ways of how you may work with profiles. You may:

1 Create your own profile.

2 Use already created profile.3 Import already created profile4 You may export your created profile.

More about all these functions in the following sections.

Creat ing prof i les

Usually the profile contains specific stereotypes, constraints, tagged values that you may use according your needs. Sometimes profiles also contain other specific model elements and MagicDraw allows to include them into profile. You can use your created profile in other projects parts or other projects. Also other users also may reuse it as a module.

To create your own profile

1 Create a package with the stereotype <<profile>>.2 Add your desired stereotypes, constraints, tag definitions, and/or other model

elements you need for extending UML. How to add stereotypes, tagged values, or constraints to the profile (package), see Section “UML Extension Mechanisms” on page 5-323.

The created profile will appear in the Profiles dialog box and in the Tagged Values and Stereotypes tabs of Specification dialog boxes. More about working with UML extensions, see Section “UML Extension Mechanisms” on page 5-323.

© 2005 No Magic, Inc 3-74

Page 71: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SProf i les

3

Using and import ing prof i les

In your project, you may use other profiles or import them. MagicDraw offers several profiles, which you may find in the <MagicDraw installation directory>/profiles folder.

To use already created profile in your project

1 From the File menu, choose Use Profile/Module.2 The Use Profile/Module dialog box appears. If needed select the directory

where the desired profile is located, then choose the desired profile, and click OK.

The chosen profile will appear in the Browser tree in a read-only status. You may use it in your project. Also you may import it and edit, if needed.

To import already created profile in your project

• From the profile, that you have chosen to use, shortcut menu in the Browser, choose Modules and then Import Module.

• From the File menu, choose Import. The Import dialog box appears. Choose the profile you want to import and click Open.

The imported profile will appear as a editable package in the Browser. You will be able not only to use the contents of package and also to edit it.

3-75 © 2005 No Magic, Inc.

Page 72: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModel Di f ferencing

3

Profiles dialog box

Figure 40 -- Profiles dialog box

Expor t ing prof i les

If you want to use the created profile in the other project or provide the ability for other users to use your profile, you may save the created profile in the selected directory. Exporting profiles is similar to exporting modules functionality.

1 From the File menu, choose Export, and then choose Profile/Module.2 The Export Profile/Module dialog box appears. Choose the <<profile>>

package you want to export and add to the Selected. Write the description of the profile, click OK and save it to the desired directory.

MODEL DIFFERENCINGSince MagicDraw version 9.0, model differencing functionality is presented. Now you are able to compare two MagicDraw UML local projects or teamwork project versions, as well as diagrams. Model elements are compared by elements ID.

© 2005 No Magic, Inc 3-76

Page 73: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModel Di f ferencing

3

You may compare:

• current project with locally saved project

• current project with opened project

• two teamwork project versions

• current project with teamwork project version.

• local project and teamwork project version.

• diagrams

Models compar ison

First of all you have to choose projects you want to compare. Model comparison will be displayed as two model trees. Differences between model versions are marked using colors and highlighting.

When comparing two models such data changes will be reflected:

• New model elements.

• Deleted model elements.

• Model elements with modified data.

• Model elements that changed location.

• Inner elements changes.

To choose projects you want to compare

1 Open a project you want to compare and from the Tools menu, choose Compare Projects.

2 The Compare Projects dialog box appears.

Figure 41 -- Select Projects to Compare dialog box

3 From the Active Project combo box, choose a project you want to compare with another project. The list contains names of all opened projects in MagicDraw.

4 From the Compare With combo box, choose a project with which you want to compare the first project. The following options are available:

3-77 © 2005 No Magic, Inc.

Page 74: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModel Di f ferencing

3

• opened project names are listed, except the project, which is selected in the Active Project combo box.

• Local Project. Click the "…" button and choose a project version you want to compare the current project with.

• Teamwork Project. Click the “...” button and from the Open Teamwork Project dialog box, select a project ant its version you want to compare with.

• <current project>Disk version. By selecting this option you will be able to compare currently changed project version with the project version on the disc without current changes.

By default the first opened project should be selected. If there are no more projects opened, value Local Project is selected.

U N D E R S T A N D I N G M O D E L D I F F E R E N C E S

All model version differences are displayed in the Difference Viewer dialog box.

© 2005 No Magic, Inc 3-78

Page 75: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModel Di f ferencing

3

Figure 42 -- Difference Viewer dialog box

In the Difference Viewer dialog box two compared projects are displayed. At the bottom of the dialog box number of differences is displayed. Differences number includes inserted, deleted, and modified elements. Number does not include elements that inner elements are changes. Differences number is displayed in following order:

For marking model element changes several colors are used:

• Elements that do not exist in the other model (inserted elements). Element is displayed only in the right-hand tree. New element is highlighted in light green color.

• Elements that exist in other model, but do not exist in current model (deleted elements). Elements always are displayed in the left-hand tree. Deleted element is highlighted in grey color.

3-79 © 2005 No Magic, Inc.

Page 76: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModel Di f ferencing

3

• Elements with modified element data (modified elements). Modified element is highlighted as changed in both trees. Modified element is highlighted in light blue color.

• Elements that changed location (parent has changed). Element is marked as modified element. Empty nodes are displayed in opposite tree where element does not exist. On moved element and on its former position button is displayed. Pressing button on former position selects place where element is moved. Pressing button on moved elements position selects former element place. Also you may perform these operations using shortcut menu commands Go to former position or Go to moved element.

• Elements that inner elements are changed. Element is marked in both trees. Such element is highlighted in light grey color dashes. Element with modified element data and changed inner elements is marked as modified and as element with changed inner elements. Element is marked as modified when:

• Element specification properties have changed. Element specification properties include all properties, which are not displayed in Browser as separate elements. Model element specification properties are treated as changed only if element property may be changed from element specification. If element specification has changed because of changes made to other elements, the element should be not treated as changed. Example: typed values in tagged values specification, attribute links in object and instance specification, etc.

• Element parent has changed.

• Path is drawn from/to element.

Buttons available in the Difference Viewer dialog box:

Button Function

Expand All

Both trees are expanded.

Collapse All

Both trees are collapsed.

Go to Previous Difference

Select the difference, which is previous to the selected one.

Go to Next Difference

Select the difference, which is next to the selected one.

Filter

The Filter dialog box appears. Show/hide the elements you want to analyze.

© 2005 No Magic, Inc 3-80

Page 77: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModel Di f ferencing

3

The first column of the Property window contains the same properties as the Quick Properties tab in the Browser. The second column title is left-hand project name (with path) for local projects, and teamwork project name and version number for teamwork projects. The third column title is right-hand project name (with path) for local projects, and teamwork project name and version number for teamwork projects. Modified properties are marked with the same color as in model element tree.

Diagrams Compar ison

To compare diagrams

1 In the Difference Viewer dialog box, select the diagram you want to compare and click the Compare Diagrams button.

Include Relation Ends

Relations are displayed in elements specification. Relation added to element means that element is marked as modified.

Display: All - Shows all elements of the projects.

All Differences - Shows only differences made between he projects.

Deleted Elements - Shows only elements that were deleted from the projects.

Inserted Elements - Shows only elements that were inserted in the projects.

Modified Elements - Shows only elements that were modified.

Find Next Element

The Find dialog box appears. Search for elements within the corresponding project.

More>><<Less

More/Less button shows/hides element properties table. By default properties table is hidden.

Export Differences

Creates .html or .txt differences report. In the appeared Save Difference Report As dialog box, choose the directory where you want to save this report. NOTE: *.html format is suitable for viewing difference

report. If you want to copy this report to other program, please use *.txt format.

Button Function

3-81 © 2005 No Magic, Inc.

Page 78: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SModel Di f ferencing

3

2 The Diagrams Difference Viewer dialog box appears, which displays both diagrams with changes made in them.

Figure 43 -- Diagram Difference Viewer dialog box

Diagrams Difference Viewer displays two diagrams:

• Current (or first opened) project diagram is displayed at the right-hand side.

• Diagram that is compared with is displayed at the left-hand side.

Symbols changes that are reflected in the diagram:

• Modified symbol properties

• New symbol creation

• Symbol deletion

• Symbol bound changes (resize, bound changes because of element properties changes)

All changes are highlighted in light blue color dashes.

© 2005 No Magic, Inc 3-82

Page 79: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SWorking wi th mul t ip le projects

3

Buttons available in the Diagrams Difference Viewer dialog box:

WORKING WITH MULTIPLE PROJECTSBecause you may have to manage several projects at the same time, MagicDraw allows you to work with several projects simultaneously.

All opened projects are held in separate workspaces. Different activated projects may exchange data. Entities from the one project can be copied or moved to another.

To switch between loaded projects

• In the Projects drop-down combo box, click the additional project you wish to open.

Button Function

Synchronize Zooming

If pressed, zooming affects both diagrams: zooming one diagram invokes zooming of another diagram.

Synchronize Scrolling

If pressed, scrolling one diagram invokes scrolling of another diagram.

Mark Changes

If pressed, places where diagram has changed are marked on both diagrams.

Print Diagram

Prints the corresponding diagram together with marked changes.

Zoom 1:1

Zooms the corresponding diagram(s) to the original size.

Fit in Window

Zooms the corresponding diagram(s) to the size that fits in window.

Zoom In

Zooms the corresponding diagram(s) in.

Zoom Out

Zooms the corresponding diagram(s) out.

Choose the percentage for zooming the corresponding diagram(s).

3-83 © 2005 No Magic, Inc.

Page 80: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

• Choose Projects from the File menu and click the name of the project you wish to open.

To close all opened projects

Choose Close All Projects from the File menu. The Question message box appears.

Figure 44 -- Question message box

Choose the way your projects will be closed:

To exchange model entities between opened projects

• Use the Cut, Copy, and Paste commands in the Edit menu, or appropriate shortcut keys: Ctrl+X, Ctrl+C, Ctrl+V or the toolbar buttons.

• Drag-and-drop the created model element from the Browser tree to the Diagram pane.

NOTE Data may only be exchanged between projects that are currently opened within MagicDraw. You may not copy/paste elements between instances of different tools that are currently running or to other applications.

USING BROWSERThe Browser provides a visual representation of the hierarchy for your model elements. The items in this hierarchy are either:

• Compressed - a plus sign next to an icon indicates that the icon is compressed, that is, it contains other model elements. This is the default setting when you start

Yes The project you are currently closing will be saved (its name appears in the question). Dialog box is displayed again when the next project closes.

Yes To All Save all projects without prompting. The Save dialog box appears for each opened project.

No Project you are currently closing will not be saved. The dialog box is displayed again when the next project closes.

No To All All the projects will be closed without saving and prompting.

Cancel Cancels saving projects.

© 2005 No Magic, Inc 3-84

Page 81: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

your application. Click the plus sign to expand the icon and view its subordinate items.

• Expanded - a minus sign next to an icon indicates that the icon is fully expanded. Click the minus sign to collapse the item.

If there is no sign next to an icon, means that it does not contain other model elements.

The Browser is a hierarchical navigational tool that allows you to manage your model data, including packages, components, classes, all UML diagrams, extension mechanisms, and other data. You may use the Browser as an alternative tool to the menus and toolbars that are in MagicDraw. It is easier to work with projects diagrams and data elements using the Browser. The Browser performs the following operations:

• Creation and specification of model elements without viewing them.

• Copying, cutting, and pasting of model elements.

• Opening and deletion of model elements.

• Dragging and dropping of model elements to the Diagram pane and inside the Browser.

• Dragging and dropping of data in the Code engineering sets (you may create data in the Data branch, drag it to the Code Engineering sets, and the round trip object is created automatically).

• Hierarchical viewing of all model elements.

• Trace viewing for the selected model element.

• Symbol creation for the selected model element in the current diagram.

• Managing diagrams.

• Managing extension mechanisms such as constraints, stereotypes, and tagged values.

• Java reversing a class directly from classpath.

• Adjusting the code engineering sets.

• Code generation for the particular sets.

• Filtering of the visible items (by any model type, e.g. class, package, operation, component, state and others - both for views and dates), when the Filter from the Browser shortcut menu is selected.

• Sorting of the visible items for the selected model element.

• Sorting of all model elements.

• Displaying search results.

T H E B R O W S E R W I N D O W P A R T S

The Browser window is divided into two parts:

• Containment tree/Diagrams tree/Inheritance tree/Model Extensions tree/Search Results part.

3-85 © 2005 No Magic, Inc.

Page 82: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

The Containment tree tab groups data in the logical sets.The Diagrams tab groups diagrams that are represented on the diagram pane according to the diagrams types or shows them as a list. The Inherence tree tab represents class hierarchy of the project.The Model Extensions tree tab represents all predefined and created constraints, stereotypes, and tagged values.The Search results tab displays search results.

• Documentation/Zoom Control part. The Documentation tab shows documentation associated with selected item. The Zoom Control tab is responsible for zooming current diagram.

Figure 45 -- Browser

When at least one Project is open, the Browser is placed to the left side of the main window. Since MagicDraw version 7.5 it is possible to place Browser in any plane of the MagicDraw

© 2005 No Magic, Inc 3-86

Page 83: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

application, also all tabs can be viewed separately, you may set up Browser according your need by hiding the desired tabs.

To change the size of either part of the Browser

Drag the bar that separates the two parts.

To change the Browser position from the Options menu

1 Choose Environment from the Options menu. The Environment Options dialog box appears.

2 In the Browser tab, change the Browser Position property to Right or Left.

To close or reopen the desired tab of the Browser

From the Window menu, choose the tab you want to close/open.

To reset all Browser tabs to it default position

From the Window menu, choose Reset Windows Configuration command.

To sort alphabetically items in browser

1 Choose Environment command from the Options menu. The Environment Options dialog box appears.

2 In the Browser tab, set the Sort Always check box to “true” (default “true”). The same option is available from the Browser shortcut menu.

Containment t ree

The Containment tree displays model data, grouping it in logical sets.

To open the Containment tree

• Click the Containment Tree tab in the upper side of the Browser.

3-87 © 2005 No Magic, Inc.

Page 84: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

• If the Containment tree is hidden, from the Window menu, choose Containment Tree.

Figure 46 -- Containment tree

To show the full information of operations, attributes, and relationships in the Containment Tree

• In the Containment Tree tab, click the Show Full Types in Browser button .

1 Choose Environment command from the Options menu. The Environment Options dialog box appears.

2 In the Browser tab, set the Show Full Types in Browser check box to “true” (default “false”).

To show stereotypes in Containment tree

• In the Containment Tree tab, click the Show Stereotypes in Browser button .

1 Choose Environment command from the Options menu. The Environment Options dialog box appears.

2 In the Browser tab, set the Show Stereotypes in Browser check box to “true” (default “false”).

To show/hide Code Engineering sets branch

• In the Containment Tree tab, click the Show Code Engineering Sets button .

1 Choose Environment command from the Options menu. The Environment Options dialog box appears.

© 2005 No Magic, Inc 3-88

Page 85: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

2 In the Browser tab, set the Show Code Engineering Sets check box to “true” (default “true”).

D A T A B R A N C H

The Data branch represents a project’s model and structure. All model elements are stored in packages. This helps you distribute data into logical groups. By default, all new model elements data (inner structure) are stored in the Data package. You may create your own packages for storing your model elements data.

The Data branch also contains the Component View, Data Types, and Relations (appears only when at least one path is drawn on the diagram pane) branches.

Component View is already created package where the components during code engineering are placed.

Data Types contains the list of primitive data types: Boolean, byte, char, double, float, int, long, short, and void. You may create your own data types.

To create a new data type

1 Choose New Element from the package in the Browser shortcut menu and then choose Data Type.

2 Type the name of the data type directly in the Browser tree.For more information about managing model elements from the Browser, see Section “Working with model elements in the Browser tree” on page 3-95.

C O D E E N G I N E E R I N G S E T S

The Code engineering sets branch is a gateway between your source code and model data. Using sets, you may perform Java, C++, IDL, DDL, EJB, CIL, and C# code round-trip engineering (code generation + reverse engineering).

To create a new Code engineering set

1 Right-click the Code Engineering Sets item and choose New from the item shortcut menu or open the Code Engineering Sets dialog box and click the New button. The New Set dialog box appears.

2 Type the set name and select programming language from the drop-down list (by default - Java).

3 Click OK to finish set creation.

To edit the selected set

Choose Edit from the set shortcut menu. The Round Trip Set dialog box appears. You may add/remove files or classes from the Code engineering set.

To rename the selected set

Choose Rename from the set shortcut menu and type the set name.

3-89 © 2005 No Magic, Inc.

Page 86: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

To change code generation properties

Choose Properties from the set shortcut menu. The CG Properties Editor dialog box appears.

The detailed description about the CG Properties Editor dialog boxes, see MagicDraw Help.

To delete the selected set

Choose Delete from the set shortcut menu.

To restore the deleted set

From the Edit menu, choose Undo or press shortcut keys CTRL+Z.

To generate code from the selected set

1 Choose Generate from the set shortcut menu. The Code Generation Options dialog box appears.

2 Adjust your own code generation options. 3 Click OK. The Messages Window dialog box appears. You may see information

about generated files.

To check syntax

Choose Check Syntax from the set shortcut menu. If no errors are found, the There are no syntax errors in the model message box appears.

To reverse the selected set

1 Choose Reverse from the set shortcut menu. 2 The Reverse Options dialog box appears. Define options and click OK.

For the detailed descriptions about the reverse, see Section Reverse in the Code Engineering User’s Guide.

To reverse files that have been changed

1 Choose Refresh from the set shortcut menu.2 The Reverse Options dialog box appears. Define options and click OK.

For the detailed descriptions about the reverse, see Section “Reverse” in the Code Engineering User’s Guide.

TIP! All above listed functions can be performed in the Code Engineering Sets dialog box.

To choose a text editor for source code

1 Choose Editor Properties from the set shortcut menu. The Editor Properties dialog box appears.

© 2005 No Magic, Inc 3-90

Page 87: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

2 Select the directory where the text editor is located and Arguments.3 Click OK.

To reverse a class from a classpath (Java)

Choose Reverse from Classpath command from the selected class (Data package) shortcut menu.

NOTE The classpath is defined in the Project Options dialog box, Java Language Options pane.

Diagrams t ree

The Diagrams tree in the Browser represents a diagram’s external structure.

Figure 47 -- Diagrams tree

In the Diagrams tree, with the selected diagrams, you may perform the operations listed below.

To group diagrams according their diagrams types

• Click the Group by Diagram Type button in the Diagrams tree.

• From the shortcut menu, select the Group by Diagram Type check box.

To open the selected diagram from the Browser

Choose Open from the item shortcut menu or double-click the item of the diagram.

3-91 © 2005 No Magic, Inc.

Page 88: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

To delete the selected diagram

Choose Delete from the selected diagram shortcut menu.

To rename the selected diagram

Choose Specification from the diagram shortcut menu. The corresponding Diagram Specification dialog box appears. Type the diagram name and click OK.

TIP! Also in the Diagram Specification dialog box you may add documentation of the diagram, define steretypes, contraints and tagged values, view ther relationships in which the diagram participates, and difine hyperliks.

To print the selected diagram

• Choose Print from the diagram item shortcut menu. If the diagram is empty, it will not be printed.

Also there are other ways for printing diagram. For more details about printing, see Section “Printing” on page 4-165.

Inher i tance t ree

The Inheritance tree represents classes, packages, interfaces, primitive data types hierarchy of your project. The inheritance according UML Specification is shown using generalization relationship.

Figure 48 -- Inheritance tree

© 2005 No Magic, Inc 3-92

Page 89: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

For more information about managing model elements from the Browser, see Section “Working with model elements in the Browser tree” on page 3-95.

To show stereotypes in Inheritance tree

• In the Inheritance Tree tab, click the Show Stereotypes in Browser button .

1 Choose Environment command from the Options menu. The Environment Options dialog box appears.

2 In the Browser tab, set the Show Stereotypes in Browser check box to “true” (default “false”).

Model Ex tens ions Tree

The Model Extensions Tree contains all Stereotypes, Tag Definitions, and Constraints that are predefined and created manually in the project.

In this tree you may create, review, copy/paste, and delete extensions mechanisms.

It can be mainly used for the work of the team using the Teamwork server for locking for edit/unlocking extension mechanisms.

Figure 49 -- Model Extensions Tree

To group extensions by profiles

• In the Model Extensions Tree, click the Group by Profiles button .

• From the Model Extensions Tree shortcut menu, select the Group by Profiles check box.

3-93 © 2005 No Magic, Inc.

Page 90: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

To group extensions by their base classes

• In the Model Extensions Tree, click the Group by Base Class button .

• From the Model Extensions Tree shortcut menu, select the Group by Profiles check box.

Search Resul ts Tree

The Search Results tree shows results of the search, which may be performed through the Find dialog box.

Figure 50 -- Search Results tab

The results in the tab are dispalyed in two packages:

• From Diagrams - shown are those elements that are displayed on the diagram(s).

• From Model - shown are those elements that are created in the model data.

How to perform search, see Section “Searching” on page 3-99.

To open the Find dialog box, from the Search Results Tree

Click the Find button , or press CTRL+F keys.

To clear the results of the previous search

Click the lear Clear Results button or select the Clear Results button from the Search Results tab.

© 2005 No Magic, Inc 3-94

Page 91: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

Working wi th model e lements in the Browser t ree

To create a model element or a diagram in the Browser

1 Right-click the package in the Browser.2 From the New command, select the model element or a diagram you wish to

create.

To copy/cut and paste the selected model element in the Browser tree

1 Choose Copy or Cut from the item shortcut menu.2 Select an item where you wish to put the copy of the model element.3 Choose Paste from the item shortcut menu.

To copy/cut and paste the selected model element among different projects

1 Choose Copy or Cut from the item shortcut menu.2 Change the project name in the Projects list on main window toolbar.3 Select where you wish to put the copy of the element.4 Choose Paste from the item shortcut menu.

To delete a model element from the Browser tree

Choose Delete from the item shortcut menu.

To drag-and-drop the selected item in the Browser tree

1 Make sure that the place you wish to drag the item is visible.2 Drag the selected item to the destination and drop it.

To draw a symbol on the diagram

Choose Create Symbol from the items in the Browser shortcut menu.

NOTE You may draw a symbol by dragging and dropping an item to the Diagram pane

To show/hide model elemens in the Browser tree

1 Right-click in the Browser.2 From the shortcut menu, choose Filter.3 The Items Filter dialog box appears. Clear the check boxes of those model

elements that you would not like to appear in the Browser tree

3-95 © 2005 No Magic, Inc.

Page 92: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

Mult ip le se lect ion

A group of model elements can be selected within the Browser tree, and you may edit all the selected model elements at the same time.

To make multiple selections

• Hold down the SHIFT key and click the last element you wish to include in to multiple selection.

• For more precise selection, hold down the CTRL key and click (while holding the key down) with the mouse on the elements you wish to select.

To select all model elements or all browser tree items

Click the mouse pointer in the area you want to select all elements and press shortcut keys CTRL+A.

NOTE All selected model elements can be moved or deleted as a single selected element. While moving the set MultipleDrag, a border appears denoting the area you have selected. Be careful when deleting multiple elements because no confirmation dialog box will appear.

Documentat ion/Zoom Control /Proper t ies

D O C U M E N T A T I O N T A B

The Documentation tab shows information associated with the selected model element in the Browser tree or diagram.

© 2005 No Magic, Inc 3-96

Page 93: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

To open the Documentation tab

Click the Documentation tab in the lower side of the Browser window or from the Window menu, choose Documentation. If there is no documentation for the selected element, No documentation message is displayed in the section.

To write documentation for the selected model element

1 Click the Documentation tab.2 Type information.

Z O O M C O N T R O L T A B

In this tab, you may preview the desired diagram simply by selecting it in the Browser on on the Content diagram. Also you use this tab for zooming the diagram.

To zoom in for a close-up view of your diagram, or to zoom out and see more of the diagram at a reduced size

1 Click the Zoom Control tab in the Browser window.2 Drag the rectangle or drag the slider.

NOTE: By default the zoom slider is not visible. To display the zoom slider in the Zoom Control tab, in the Environment Options dialog box, Browser tab, select the Show Diagram Zoom Slider check box.

Quickly access any part of the diagram using the Zoom Control tab

Drag the blue square to the desired part of the diagrm. The desired diagram part will be displayed on the diagram window.

To fit diagram in window, through the Zoom Control tab

Click the Fit in Window button on the square in the Zoom Control tab.

3-97 © 2005 No Magic, Inc.

Page 94: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SUsing Browser

3

P R O P E R T I E S T A B

Since MagicDraw version 8.0, you may edit model elements and diargram properties such as data, sybol properties, language properties directly from in the Browser, Properties tab.

Properties tab has two modes - Standard ant Expert. Depending on your needs you may choose one of them.

Figure 51 -- Customize Properties dialog box

© 2005 No Magic, Inc 3-98

Page 95: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SSearching

3

SEARCHINGMagicDraw search mechnism enables the serch within model elements data, symbols, and extensions.

You may also search for usages and dependant elements of the selected elements. This functionality is described in Section “Usages functionality” on page 4-146 and in Section “Dependent Elements functionality” on page 4-146.

To find quickly the needed classifier or diagram

From the Edit menu, choose Quick Find. In the appeared screen, type the name of the classifier or diagram (also you may choose it from the drop-down list), and choose one of the needed option buttons.

Figure 52 -- Quick Find screen

Find all elements of some type

1 From the Edit menu, choose Find, or press corresponding shortcut key Ctrl+F, or click the Find button on the main toolbar. The Find dialog box appears.

2 Type the "*" symbol in the Name text box. 3 Click the "..." button near the Type text box to open the Select Model Elements

Types drop-down combo box. Select types of elements and click OK. Model elements in this box are listed according metamodel.

4 Click the Find button to start search. The search results appear in the Search Tree in the Browser.

TIP! To generalize the beginning or ending of the name, add the "?" symbol in the front or in the end of the string.

Find model elements and symbols in your project

1 Choose Find from Edit menu or press corresponding shortcut key Ctrl+F or click the Search tab in the Browser.

2 In the Name text box, type the name of the element. If you want to find all elements of the selected type, enter the "*" symbol in the Name text box.

3 Click the "..." button near the Type text box to open the Select Model Element/Symbol Types drop-down combo box. Select types of elements and click OK. Model elements in this box are listed according metamodel.

4 To start search, click the Find button. The search results appear in the Search Results tree in the Browser.

TIP! To generalize the beginning or ending of the name, add the "?" symbol in the front or in the end of the string.

3-99 © 2005 No Magic, Inc.

Page 96: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SSearching

3

NOTE If the Clear Previous Results check box is cleared, new results are appended to previous search results in the tree.

TIP! Select Search Data Unused in Diagrams check box to find only elements lacking shapes.

Find dialog box

Figure 53 -- Find dialog box

The Find dialog box contains five tabs:

• Search Element by Name tab

• Search Element by Stereotype tab

• Search Element by Tagged Value tab

• Search Element by Constraint Value tab

• Search Element by Documentation tab

Element Function

© 2005 No Magic, Inc 3-100

Page 97: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SSearching

3

Java Regular Express ions

M E T A C H A R A C T E R S

There are supported several character, which are used to form search pattern ([{\^$|)?*+.

Name Type the name of the item you wish to find.NOTE: You may define wildcards <*> and <?> for the

search. For example, if you define the following input string <a*b>, the system looks for items with <a> at the beginning and <b> at the end of the string. If you define such string as <?agicDraw>, all strings containing <agicDraw> will be found.

Type Select a type of elements from the proposed items, or leave this field empty.

ValueOnly available for Search Element by Tagged Value and Constraint Value tab.

Select or type a value of Tagged Value or Constaint.

Case Sensitive Searches for the groups of items that have the names and capitalization exactly as defined in the string entered in the Item to Find box. When unselected, MagicDraw UML does not distinguish between uppercase and lowercase characters of the item name entered in the Name box while searching for the item.

Match Whole Words Only

Searches for the groups of items with names that exactly match the string entered in the Item to Find box. When unselected, the MagicDraw searches for the groups of items with the names matching the first parts of the string entered in the Name field.

Search Data Unused in Diagrams

Searches only elements that do not contain symbols in any diagram.

Java Regular Expression

In the Section “Java Regular Expressions” on page 3-101, you may find several expressions that will help you to make a search in MagicDraw.

Clear Previous Results

Removes from the Browser tree all previously found items.

Find Searches for items and displays the results of the search in the found items list field. If MagicDraw does not find any item, the message is displayed.

Close Exits the dialog box.

Help Displays MagicDraw Help.

3-101 © 2005 No Magic, Inc.

Page 98: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SSearching

3

There are two ways to force a metacharacter to be treated as an ordinary character:

• + Precede the metacharacter with a backslash

• + Enclose it within \Q (starts the quote) and \E (ends it).

C H A R A C T E R S E T S

Predefined character sets:

Example:

Regular expression: [ABC][^\s]\d

Matched text: any sequence starting with a "A", "B" or "C" symbol, followed with any non white space character and any digit.

G R O U P I N G

Capturing groups helps to treat multiple characters as single unit.

Example:

Regular Expression: ABC|(\dABC)

Matched text: any text containing ABC symbols set or ABC symbol set beginning with any digit symbol

Q U A N T I F I E R S

Quantifiers allow specify a number of character X appearance.

[abc] Any character of a, b or c

[^abc] ) Any character except a, b or c (negation

[a-z] All character from a to z (range)

[a-z[A-Z]] All characters from a to z and A to Z (union)

[a-z&&[r-z]] Character from r to z (intersection)

[a-z&&[^r-z]] Characters from a to q (subtraction)

. Any character

\d Any digit character

\D Any non digit character

\s White space character (\t\n\x0B\f\r)

\S Any non white character

\w Word character (a-z, A-Z,_,0-9)

\W Any non word character

X? Match X zero or one time

X* Match X zero or many time

X+ Match X one or many time

X{n} Match X exactly n times

© 2005 No Magic, Inc 3-102

Page 99: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SSearching

3

Example:

Regular expression: Cla(s{2})

Matched text:any sequence starting with "Cla" symbols, followed with "s" symbol two times. It shall match any text containing string "Class"

B O U N D A R Y M A T C H E R S

Boundary matchers help to match strings more precisely. Helps to match particular word, matches at the beginning of the input or line.

Example:

Regular expression: \bCla(s{2})\b

Matched text:any sequence starting with "Cla" symbols, followed with "s" symbol two times. It shall match any text containing string "Class" as whole word ("Classs" won't be matched)

E M B E D D E D F L A G E X P R E S S I O N S

Allows to set properties for regular expression matcher.

Example

Regular expression: (?m)^\bCla(s{2})\b

Matched text: any sequence from new line, starting with "Cla" symbols, followed with "s" symbol two times.

References

X{n,} Match X at least n times

X{n,m} Match X exactly n, but not more than m times

^ Beginning of the line

$ The end of the line

\b A word boundary

\B A non word boundary

\A Beginning of the input

\z End of the input

(?i) Case insensitive matching

(?x) Ignores white spaces in regular expression

(?m) Enabled multi line option. If not specifies boundary matches ^ and $ matches beginning of the input and end respectively.

(?s) Enables expression "." to match any character including line terminators. If not specified, dot in expression doesn't match line terminators.

(?u) Enable Unicode-aware case folding. When this flag is specified, case insensitive is done regarding to Unicode standard.

(?d) Enable Unix lines mode. Only terminator '\n' is recognized in behaviour of ".","^","$"

3-103 © 2005 No Magic, Inc.

Page 100: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SMagicDraw and Rat ional Rose®

3

http://java.sun.com/docs/books/tutorial/extra/regex/index.html

MAGICDRAW AND RATIONAL ROSE®

MagicDraw supports Rose XMI model exchange model.

Rat ional Rose

To prepare Rational Rose for XMI exchange

1 Download Rose 2001a/2002 XMI support add-in at ftp://www6.software.ibm.com/software/developer/library/rational/2834/Rose/RoseXMLTools1.3.6.01.zip

2 After you have installed XMI support for Rational Rose, two new menu items Export Model to UML and Import UML Model appears under Tools menu. These items are for XMI exchange.

Figure 54 -- Unisys Rose XMI export/import menu items

To export the opened Rational Rose project to XML file.

1 From the Tools menu, choose the Export Model to UML command. The Unisys Rose UML Export Options dialog box appears.

2 From the XMI Format group box, select the XMI 1.0 option button (only XMI 1.0 format is supported by MagicDraw.)

© 2005 No Magic, Inc 3-104

Page 101: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SMagicDraw and Rat ional Rose®

3

3 From the Output File Basis group box, select the Model option button.4 Click OK.

Figure 55 -- Unisys Rose UML 1.3.4 Export Options dialog box

5 The Save XML File dialog appears. 6 Type the name of the XML file and choose the directory where to save the file.

NOTES: Before exporting Rational Rose project, it must be saved as MDL file. While exporting: XMI 1.0 and Model option buttons should be selected.

To import a model from XMI format

1 From the Tools menu, choose the Import UML Model command. 2 The Import XML File dialog appears, choose the desired XML file and click

Open. 3 The Rose UML Import Options dialog appears, click OK.

Figure 56 -- Rose UML Import Options

4 Creates a new project and imports model from XML file.

3-105 © 2005 No Magic, Inc.

Page 102: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SMagicDraw and Rat ional Rose®

3

MagicDraw

To export MagicDraw project to Rose supported XMI format

1 Open the project file you want to export to XMI format.2 From the File menu, choose the Export As Unisys XMI.3 The Save dialog box appears. Type the name of the project and choose the

directory where to save the file.

To open the XML file exported by Rational Rose

1 From the File menu, choose the Open Project command.2 The Open dialog box appears. Choose the desired project file and click the

Open button.

© 2005 No Magic, Inc 3-106

Page 103: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SMagicDraw and Rat ional Rose®

3

Metamodel and XMI incompat ib i l i t ies

Field Rational Rose does not support MagicDraw does not support

Common • Constraints and Constraint link• Tag Definitions• Multiple stereotypes for model

elements• Names of the model elements

must be unique because data is collected according to name.

Names of the model elements can be not unique because data is collected according to ID.

Class diagram • Data Type• Primitive• Programming Language Data

Type• Enumeration• Collaboration• Object and Link• Dependency between Package

and Class• Subsystem and Model (are

imported as Packages with appropriate stereotypes)

• Containment• Generalization stereotype and

documentation are not exported

MagicDraw does not have Association Class element (Link Attribute + Class).

Use Case diagram

• Include relationship• Extend relationship• Dependency between Use Cases,

between Actor and Use Case• Extension Point• Collaboration

Collaboration diagram

• Instance• Object• Subsystem Instance• Use Case Instance• Link• Stimulus• Nested message numbering• Classifier Role (is imported as

Object)• Association Role (is imported as

Link)• Does not read Association Role

name.

3-107 © 2005 No Magic, Inc.

Page 104: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SMagicDraw and Rat ional Rose®

3

Sequence diagram

• Diagonal message• Concurrent Lifeline• Recursive Message

State diagram (Statechart diagram in Rose)

• Action State (is imported as Activity)

• Concurrent State (is imported as State)

• Synch State (is imported as State)• Junction Point (is imported as

Decision)• Stub State (is imported as State)• Submachine State (is imported as

State)• Call State is (imported as Activity)

Activity diagram • Action State (is imported as Activity)

• Concurrent State (is imported as State)

• Call State (is imported as Activity)• Submachine State (is imported as

State)• Subactivity State (is imported as

Activity)• Signal Receipt• Signal Sending• Object Flow state• Swimlanes are not displayed in

diagram.

Field Rational Rose does not support MagicDraw does not support

© 2005 No Magic, Inc 3-108

Page 105: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SMagicDraw and Together ControlCenter

3

O T H E R N O T I C E D I N C O M P A T I B I L I T I E S

• Unisys XMI format does not support rectilinear property and breakpoints for relationships in the diagrams.

• Rational Rose exports Class Instance elements as Object elements.

• Rational Rose does not export symbol style for Package, Message, Component, Transition, Synchronization and Swimlane.

• Rational Rose does not export Stereotype display option.

• Rational Rose does not export Show Class option for Object element in Collaboration diagram.

• Rational Rose does not export Show Actions and Show Nested Elements options for State/Activity element in Statechart/Activity diagram.

• If Note element is empty Rational Rose exports additional empty Note element.

• Rational Rose does not export anchor between Note and Link, Note and Message, Note and Connection.

• After importing Rational Rose, doesn't display inner state as inner. Although it is inner in model data.

MAGICDRAW AND TOGETHER CONTROLCENTERMagicDrawTM supports Unisys XMI Extensions model exchange model.

Implementation diagram (deployment and component diagrams in Rose)

• Nodes are imported as Processors in Deployment View

• Associations between Nodes are imported as Connections (Connection name is not imported/exported)

• Dependency between Node elements

• Artifact• Package• Instance• Node Instance• Component Instance• Interface• Class (also corresponding

relationships are not supported)• Link• Association between Component

elements• Abstraction between Component

elements (is exported as Dependency)

Connection (element not defined by UML 1.4)

Field Rational Rose does not support MagicDraw does not support

3-109 © 2005 No Magic, Inc.

Page 106: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SMagicDraw and Together ControlCenter

3

Together Contro lCenter

To export the Together ControlCenter project to Unisys XMI Extensions file.

1 From the File -> Export menu, choose the Model to XMI File… command.2 The Export to XMI dialog box appears. Select the XMI 1.0 for UML 1.3 (Unisys

Extension) option button from the Select XMI Type group box.

Figure 57 -- Export to XMI dialog box

3 Choose where to save the file and click OK.NOTES: While exporting: XMI 1.0 for UML 1.3 (Unisys Extension) check box should be

selected.

To import a model from XMI format

1 From the File -> Import menu, choose the Model from XMI File… command.

© 2005 No Magic, Inc 3-110

Page 107: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SMagicDraw and Together ControlCenter

3

2 The Select XML Document dialog appears, choose the desired XML file and click the OK button.

Figure 58 -- Select XML Document dialog box

3 Model from XML file is imported into project.

MagicDraw

To export MagicDrawTM UML project to Unisys XMI format

1 Open the project file you want to export to XMI format.2 From the File menu, choose the Export as Unisys XMI.3 The Save dialog box appears. Type the name of the project and choose the

directory where to save the file.

To open the XML file exported by Together ControlCenter

1 From the File menu, choose the Open Project command.

3-111 © 2005 No Magic, Inc.

Page 108: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SMagicDraw and Together ControlCenter

3

2 The Open dialog box appears. Choose the desired project file and click the Open button.

Metamodel and Unisys XMI incompat ib i l i t ies

Field Together ControlCenter does not support

MagicDrawTM does not support

Common • Constraints and Constraint link• Tag Definitions• Multiple stereotypes for model

elements• Names of the model elements

must be unique because data is collected according to name.

Class diagram • Data Type• Primitive• Programming Language Data

Type• Enumeration• Collaboration• Object and Link• Subsystem and Model (are

imported as Packages with appropriate stereotypes)

• Containment link• Does not export Generalization

link view• Implementation link is exported

as generalization• Does not import Abstraction

Use Case diagram • Include relationship is exported as Generalization with <<include>> stereotype

• Extend relationship is exported as Generalization with <<extend>> stereotype.

• Does not export System Boundary.

• Extension Point• Collaboration• Dependency between Use

Cases, between Actor and Use Case

© 2005 No Magic, Inc 3-112

Page 109: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SMagicDraw and Together ControlCenter

3

Collaboration diagram • Does not export messages• Instance• Object• Subsystem Instance• Use Case Instance• Link• Stimulus• Nested message numbering• Classifier Role (is imported as

Object)• Association Role (is imported as

Link)• Does not read Association Role

name.

Association

Sequence diagram • Does not export messages• Diagonal message• Concurrent Lifeline• Recursive Message

State diagram (Statechart diagram)

• Dynamic Choice• Action State (is imported as

Activity in <default> diagram)• Concurrent State (is imported as

State)• Synch State (is imported as State)• Junction Point (is imported as

Decision)• Stub State (is imported as State)• Submachine State (is imported

as State)• Call State is (imported as State)

Does not import State diagram

Activity diagram • Action State (is imported as Activity in <default> diagram)

• Concurrent State (is imported as State)

• Call State (is imported as State)• Submachine State (is imported

as State)• Subactivity State (is imported as

Activity)• Signal Receipt (is imported as

State)• Signal Sending (is imported as

State)• Object Flow state (is imported as

State)• Swimlanes are not displayed in

diagram.

Does not import Activity diagram

3-113 © 2005 No Magic, Inc.

Page 110: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SResources Manager

3

O T H E R N O T I C E D I N C O M P A T I B I L I T I E S

• Together ControlCenter does not export stereotypes.

• Together ControlCenter does not export note link.

RESOURCES MANAGER

MagicDraw Resource Manager functionality allows you to manage local (installed with MagicDraw, downloaded) resources and resources available on web. With RM (Resource Manager) you may manage different types of resources (Profiles, Plugins, Templates, Language resources, Case studies/examples, Custom diagrams, and others). RM lets:

• Review

• Remove (delete)

• Import, download

• Update resources.

There are the following benefits of the Resource Manager functionality:

Benefits:

• Easier to find needed resource and download it.

• More informative resources description.

• Possibility to create your own resources and share them.

• Possibility to check resource dependency in required table

Resource Manager functionality is included in all MagicDraw editions, except, Reader.

Implementation diagram (deployment and component diagrams)

• Nodes are imported as Processors in Deployment View

• Association name is not imported

• Dependency name is not imported

• Artifact• Instance• Node Instance• Component Instance• Link• Abstraction• Does not export Component,

Interface, Object, Association, Dependency from Deployment diagram

Does not import Supports link (element not defined by UML 1.4)

© 2005 No Magic, Inc 3-114

Page 111: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SResources Manager

3

To invoke the Resource Manager:

From the Options main menu, choose the Resources command. The Resource Manager window appears.

In the table bellow is listed items of the Resource Manager window.

Element Name Function

Name Different types of resources are listed in separate nodes. There are the following resources types: examples, templates, languages, profiles.In the front of each resource are check box. Select this check box, for managing this resource. If resource is unavailable it is impossible to select check box in front of it (checkbox is grey). Required table rows contains information why it is not available.

ID Resource ID.

Category Resource type.

State There are possible the following states of resources:• Not installed (downloaded), • Will be installed after restart, • Installed, • Will be removed after restart, • Not downloaded, • removed (if resource not exists on web).

Ver Obtained The Version Obtained column indicates version for resources with state: installed, not installed, and removed.

Ver Available Column Version Available indicates newest resource version on web.• Not exist on web. If resource not exist on web.• Check for updates. If resource list has not been downloaded

from web.

3-115 © 2005 No Magic, Inc.

Page 112: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SResources Manager

3

NOTE If resource requires fee-paying, in the Resource Manager window, the Price column price of the particular resource is displayed.

Date Resource creation date.

Size Size of the particular resource.

Meaning of text colors

In one row are listed text color meanings:• Green - installed resources are marked green.• Blue- Not downloaded resources are marked blue and if already

installed or downloaded resource newer version is available is marked blue.

• Black - changes will be fully applied after restarting MagicDraw.

More>>/<<Less Expands / Collapse main Resource Manager window with additional fields.In the following fields are listed all data of the selected in the list resource:• Name, Resource home page, Provider, Description• Required table (with Name, Required, Status columns). If

resource is installed but newer version is available on web, required table shows newest version requirements.

Check for Updates The Check for Updates button is inactive if resource list is already successfully downloaded.

Download/Install Downloads selected resources and installs. The Download/Install button is inactive if no resources are selected.

Remove Button is active if at least one resource is selected with states ñ ìnot installedî or ìinstalledî. Resources of other states may not be removed from RM list. Remove functionality is not available for necessary resources.

Import The Open dialog is invoked. Import the resource you need.

© 2005 No Magic, Inc 3-116

Page 113: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SResources Manager

3

3-117 © 2005 No Magic, Inc.

Page 114: MagicDraw UserManual

WO R K I N G WI T H PR O J E C T SResources Manager

3

© 2005 No Magic, Inc 3-118

Page 115: MagicDraw UserManual

D I A G R A M S B A S I C S 4

This chapter offers an overview of working with diagrams. In general, the topics discussed apply to all the supported diagram types.

Concepts that can be useful:

• A shape refers to a notation of a model element such as a package, class, state, use case, object, and others.

• A path refers to the notation for the various kinds of relationships such as associations, aggregations, dependency, message, and links.

• Both paths and shapes are defined as symbols.

In this Section, you will find the following chapters:

1 "Working with Diagrams", on page 120

2 "Drawing Shapes", on page 1263 "Drawing Relationship paths", on page 1294 "Smart Manipulation", on page 1305 "Selection. Multiple Selection", on page 1316 "Dragging, Copying, Cutting, and Pasting", on page 1327 "Specifying Model Elements", on page 1338 "Model Traceability", on page 1469 "Laying out", on page 15310"Zooming", on page 16211"Using Grid", on page 16312"Assigning Shortcut Keys", on page 16413"Printing", on page 16514"Model Elements Common in all Diagrams", on page 169

WORKING WITH DIAGRAMSTIP! The MagicDraw Enterprise edition contains a Content Diagram, which is used for

managing all project diagrams as well as works as table of contents. More information about Content Diagram, find in the Section “Content Diagram” on page 6-359.

To create a new diagram

• Using toolbar buttons:Click the desired diagram button on the toolbar. The Create Diagram dialog box

© 2005 No Magic, Inc. 4-120

Page 116: MagicDraw UserManual

D I A G R A M S B A S I C SWorking wi th Diagrams

4

appears. Enter the name of the diagram and select or create a package where you wish to create your diagram.

• Through the Diagrams menu:From the Diagrams menu, choose the desired diagram. The corresponding Diagrams dialog box appears. Click the Add button. The Create Diagram dialog box appears. Enter the name of the diagram and select or create a package where you wish to create your diagram.

• From the Browser:Right-click the desired model element in which you would like to create a diagram and, from the shortcut menu, choose New Diagram or New. The the Diagram Specification dialog box appears. In this dialog box you may define diagram name, enter documentation, define stereotypes, tagged values, and/or constraints.

• From the model element Specification dialog box:Open the Package, Subsystem, or Model Specification Inner Elements tab or Use Case Specification dialog box, Diagrams tab. Click the Add button. The corresponding Diagram Specification dialog box appears. In this dialog box, you may define diagram name, enter documentation, define stereotypes, tagged values, and/or constraints.

NOTES You may create a diagram in the selected package, model, or subsystem.

Use case, collaboration, sequence, state, and activity diagrams can also be created in use cases.

State and activity diagrams can be created from the Assign State/Activity Diagram dialog box by clicking the New button.

To open diagram

• From the Browser:Choose Open from the diagram item shortcut menu or double-click the diagram item.

• Through the Diagrams menu:From the Diagrams menu, choose the desired diagram. The corresponding Diagrams dialog box appears. Click the Open button.

• From the content diagram (available only in the Enterprise edition).

• If the diagram is assigned to some model element, by double clicking this model element.

TIP 1! To open all diagrams, that are created in the project, from the Diagrams menu, choose Load All Diagrams.

TIP 2! To open the list of diagrams that were lastly closed, from the View menu, choose Recently Closed Diagrams and double-click the diagram you want to open. Also F12 activates this command.

TIP 3! In the Environment Options dialog box, General pane, you may choose a way for loading diagrams while opening a project. Three options are available:

4-121 © 2005 No Magic, Inc.

Page 117: MagicDraw UserManual

D I A G R A M S B A S I C SWorking wi th Diagrams

4

• Load all Diagrams – opens all diagrams that are created in the project.

• Load Only Opened Diagrams – opens only diagrams that were not closed in earlier usages of the project.

• Do not Load Diagrams – all diagrams are closed after opening a project.

To close diagram

Click the Close Diagram button on the diagram pane or choose Close Diagram from the diagram shortcut menu.

Define a diagram in the corresponding Diagram Specification dialog box.

Diagram Specification dialog box

Figure 59 -- Diagram Specification dialog box

Refer to the Section “Specification dialog boxes” on page 4-133 for the information of this specification elements.

To rename a diagram

In the corresponding Diagram Specification dialog box, enter a new diagram name.

Diagrams dia log box

The Diagrams dialog box is used for the following purposes:

• For viewing the owner of the diagram

© 2005 No Magic, Inc 4-122

Page 118: MagicDraw UserManual

D I A G R A M S B A S I C SWorking wi th Diagrams

4

• For creating a new corresponding type of diagram.

• For editing the name and other characteristics of the diagram.

• For removing a diagram from the project.

• For opening a diagram.

To open the corresponding Diagrams dialog box

From the Diagrams menu, choose one of the diagrams. Depending on the type of the diagram, the opened dialog box has a corresponding title.

Figure 60 -- Diagrams dialog box

The Diagrams dialog box contains the following elements.

Element name Function

Name The names of all created corresponding diagrams in the opened project.

Owner The name of the package that owns the diagram.

Edit The Diagram Specification dialog box appears. Type the diagram name, select a package, and click OK.

Add Creates a new diagram. The Create Diagram dialog box appears. Type the diagram name, select a package, and click OK.

Remove Deletes the selected diagram.

Open Opens the selected diagram.

OK Saves all actions performed during the session and exits the dialog box.

Cancel Cancels all actions performed during the session and exits the dialog box.

Help Displays the MagicDraw Help.

4-123 © 2005 No Magic, Inc.

Page 119: MagicDraw UserManual

D I A G R A M S B A S I C SWorking wi th Diagrams

4

Diagram Proper t ies

Customize the diagram style (color, grid) in the Diagram Properties dialog box.

To open the Diagram Properties dialog box

• Choose Diagram Properties from the diagram shortcut menu. The Properties dialog box appears.

• From the Edit menu, choose Symbol, and then choose Diagram Properties.

• Press SHIFT+ENTER.

Figure 61 -- Diagram Properties dialog box

The Diagram Properties dialog box contains the following elements.

Element name Function

Background Color Set diagram’s background color. Click the ’...’ button. The Color dialog box appears. Set color in the three different ways: using Swatches, HSB, or RGB tabs.

Show Grid Shows grid on the Diagram pane.

Snap Paths to Grid Uses grid on diagram for drawing paths.

Snap Shapes to Grid Uses grid on diagram for drawing shapes.

Grid Size Set grid size from 2 to 30.

© 2005 No Magic, Inc 4-124

Page 120: MagicDraw UserManual

D I A G R A M S B A S I C SWorking wi th Diagrams

4

T A B L E W I T H D I A G R A M I N F O R M A T I O N

On the diagram, you may display a table with the information about when the diagram was created and modified, its name, author, status, and any other desired information. By default the table is placed in the upper left corner, although you may drag and drop this table whenever you want on the diagram.

By default the table includes the following fields:

• Diagram name

• Author

• Creation date

• Modification date

• other available tag definitions

To show the table with information about the diagram

1 From the diagram shortcut menu, choose Show Diagram Info.2 The table with the predefined information will be displayed on the diagram.

To define the information that will be included in the table

1 From the diagram info table shortcut menu, choose Customize or from the Options menu, choose Project. The Project Options dialog box appears.

2 Open the Diagram Info pane. 3 In the Source pane, choose the type of information you want to include in the

table: Standard Mode or Custom Mode.

Show Message Numbers(Available only for Collaboration and Sequence diagrams)

Displays message numbers on the diagram.

Show Activations(Available only for Sequence diagrams)

Displays activation bars on the diagram.

Show Diagram Info Displays the table on the diagram with the information about the diagram (Diagram name, Author, Creation date, Modification date, etc.) What information will be included in the diagram you may set in the Project Options dialog box (Options menu->Project).

Apply Style Select the predefined style.

Make Default Make the specified style as default.

OK Saves changes and exits the dialog box.

Cancel Exits the dialog box without saving changes.

Help Displays MagicDraw Help.

Element name Function

4-125 © 2005 No Magic, Inc.

Page 121: MagicDraw UserManual

D I A G R A M S B A S I C SDrawing Shapes

4

4 Standard Mode contains the following fields that will be shown in the table: Author, Creation date, and Modification date and all other tag definitions that can be assigned to the diagram. In the field Custom Mode, you may create your own table or any other object in HTML.

5 Preview the selected table or other created object in the Preview pane.

DRAWING SHAPES

To draw a shape on the Diagram pane

1 Click the shape button on the diagram toolbar, or press the appropriate shortcut keys for the shape you wish to draw (the button remains pressed). For a detailed description of diagram toolbars, see Section “Toolbars” on page 9-447.

2 Click the desired location on the diagram pane. The new shape is placed on the diagram pane at the point you click.

• Create the desired model element in the Browser tree. From the created item shortcut menu, choose Create Symbol or drag and drop the selected model element to the diagram pane.

To draw a number of shapes on the diagram pane

1 Click the shape button on the diagram toolbar, or press the appropriate shortcut keys for the shape you wish to draw (the button remains pressed.)

2 Click the Sticky button on the diagram toolbar (shortcut keys Z or CTRL+SHIFT+Z.)

3 Click the desired location on the diagram pane. The new shape is placed on the diagram at the point you click (the button remains pressed.)

4 Click the next location on the diagram pane. The next shape is placed on the diagram pane. Repeat this until you draw a desired number of shapes.

5 To undo, click the Sticky button on the diagram toolbar (shortcut keys Z or CTRL+SHIFT+Z.)

To draw a shape for the selected item in the Browser tree

1 Activate a diagram on which you wish to draw a shape.2 From the Browser tree, select an item you wish to draw. 3 From the item shortcut menu, choose the Create Symbol command or drag and

drop the selected model element onto the diagram pane.

To specify the name of the shape (if it is allowed)

1 Double-click the shape or choose Specification from the shape shortcut menu. The corresponding Specification dialog box appears.

2 Type the shape name in the Name text box and click OK.

© 2005 No Magic, Inc 4-126

Page 122: MagicDraw UserManual

4-

D I A G R A M S B A S I C SDrawing Shapes

4

• Type the shape name directly on the selected shape on the Diagram pane.

• Type the shape name after slow double-clicking the shape in the Browser tree.

To create several shapes with the same data

• From the shortcut menu of the desired item in the Browser tree, choose the Create Symbol command. Or, drag and drop the selected model element onto the diagram pane.

• Type the same name for multiple shapes directly on the shape after the text cursor appears in that area.

1 Specify a shape name.2 Draw another shape for the same kind on the Diagram pane.3 Click the shape in the name area. The list of existing shape names

appears.4 Choose a name of the shape from the list.

NOTES: • These shapes will contain equivalent data.

• Auto completion for entering names is available only for classes, actors, packages, and subsystems.

IMPORTANT If you attempt to enter an existing name in the corresponding Specification dialog box, you will receive an error message notifying you of the existence of the current name of the shape. You may not specify a name for a new shape if another shape of the same name and kind is already present in the package.

To display elements that are related to the selected one by relationships

1 From the shape shortcut menu or from the Edit menu -> Symbol, choose Display Related Elements.

127 © 2005 No Magic, Inc.

Page 123: MagicDraw UserManual

D I A G R A M S B A S I C SDrawing Shapes

4

2 The Display Related Elements dialog box appears.

Figure 62 -- Display Related Elements dialog box

3 Choose the desired options for displaying the related elements:

Option name Function

Expand Relations Choose what kind of elements should be displayed on the diagram:• Clients• Suppliers• Both

Scope Choose where the elements related to the selected model element:• Whole Project• Package

Depth Describes how far by selected relationships search must be performed:• Indefinite. All possible related relationships are

involved.• Definite. Specify the level of hierarchy of the

involved relationships.

Relations Select the relationships you want to be displayed on the diagram.

© 2005 No Magic, Inc 4-128

Page 124: MagicDraw UserManual

D I A G R A M S B A S I C SDrawing Relat ionship paths

4

To display paths among shapes that already are created in the model data

• From the shape shortcut menu, choose Display Paths.

• Select a symbol and from the Edit menu, choose Symbol and then choose Display Paths.

To delete the selected model element or only symbol

• From the Edit menu, choose Delete (data together with symbol is deleted.)

• On the main toolbar, click Delete (data together with symbol is deleted.)

• Press CTRL+D keys (data together with symbol is deleted.)

• Press Delete key (only symbol without data is deleted.)

DRAWING RELATIONSHIP PATHS

To create a path between shapes

1 Click the appropriate path button on the diagram toolbar for the relationship you wish to draw. For a detailed description of diagram toolbars, see Section “Toolbars” on page 9-447.

2 Click the first (source) shape of a path.3 Drag the path to the second (target) shape of a path and drop it there.

To create a number of paths

1 Click the appropriate path button on the diagram toolbar.2 Click the Sticky button on the Diagram toolbar (shortcut key Z.)3 Click the first (source) shape of a path.4 Drag the path to the second (target) shape of a path and drop it there.5 Click the first (source) shape of a path of the next path.6 Drag the path to the target shape and drop it there. The new path is created

between two shapes. Repeat this until you create a desired number of paths of that type.

7 Click the Sticky button on the Diagram toolbar (shortcut key Z.)

To change the appearance style of the paths

1 Select the path.

NOTE When deleting paths by pressing DELETE key, the Delete Data? message appears. To delete the relationship’s data from the model click Yes.

When you use other methods to delete relationships, relationship data is automatically deleted.

4-129 © 2005 No Magic, Inc.

Page 125: MagicDraw UserManual

D I A G R A M S B A S I C SSmart Manipulat ion

4

2 Right-click the path or choose Path from the Edit menu, and choose the commands you need:

• To set the path as rectilinear, oblique, or bezier, choose Path Style.

• To choose in turn one of the path styles, choose Change Path Style (shortcut keys CTRL+L.)

• To reset path labels to the default position, choose Reset Labels Positions.

• To remove all angles of the path, choose Remove Break Points.

NOTES: • Every diagram has the Manipulation Highlighting feature. When you try to draw a path between two model elements, you will see that those shapes are bordered with the red or blue rectangle. The red color means that the path may not be drawn between these shapes.

• Remove the manipulation highlighting in the Environment Options dialog box. For more information, see Section “Environment Options” on page 2-24.

SMART MANIPULATIONTo make the work with MagicDraw easier, smart manipulation (smart control) function is presented. Using it, you may easily suppress attributes and operations, draw some kinds of relationships, set an autosize option, and reset labels position.

Suppressed attributes and operations:

© 2005 No Magic, Inc 4-130

Page 126: MagicDraw UserManual

D I A G R A M S B A S I C SSelect ion. Mul t ip le Select ion

4

Autosize option is added for all shapes. For various shapes different smart mechanisms are presented:

To hide smart manipulation

1 From the Options menu, choose Environment. The Environment Options dialog box appears.

2 In the Diagram pane, set the Use Smart Manipulation check box to False and click OK.

SELECTION. MULTIPLE SELECTION

Two ways to select a shape

• Click the desired shape on the Diagram pane.

• Click a shape item in the Containment or Inheritance branch of the Browser tree, and choose Tracing from the item shortcut menu. Then select a diagram and click Open.

To deselect the selected shape

Click outside the shape on the Diagram pane.

To make a multiple selection

1 Click the shape on the Diagram pane.2 Hold down SHIFT key and click another shape. Repeat until you select a desired

number of shapes.

Class, actor Suppress attributes, suppress operations, draw generalization, draw aggregation.

Use case Draw include, extend, and association.

Package, Subsystem, Model

Draw dependency

All kinds of instances Draw link

All kinds of states Draw transition

Component Draw association

Note Anchor to note

Paths Reset labels position

4-131 © 2005 No Magic, Inc.

Page 127: MagicDraw UserManual

D I A G R A M S B A S I C SDragging, Copying, Cut t ing, and Pas t ing

4

• Drag the cursor diagonally across the area you wish to select. All shapes in the selected area will be selected.

To select all shapes of the same type

Press ALT and click the shape. All shapes of the same type are selected.

To select all shapes on the diagram

From the Edit menu, choose Select All (shortcut keys CTRL+A.)

DRAGGING, COPYING, CUTTING, AND PASTINGMove a shape to another place on the diagram pane by dragging-and-dropping.

To drag a number of selected symbols

Select symbols and drag them to the desired area on the Diagram pane.

To copy a shape using dragging-and-dropping

Hold down CTRL key when you drag the selected shape to the area where you wish to make a copy.

Drag and drop items from browser to diagram pane

1 In the Browser tree, select the created model element you wish to draw.2 Drag it to the desired location on the Diagram pane and drop it there.

NOTES: • The element will be drawn with its existing relationship.

• You may select several model elements and draw them on the diagram pane.

• If the selected model elements are not compatible with the opened diagram, you will not be allowed to draw those model elements.

To copy/cut and paste the selected shape on the diagram

1 From the Edit menu, choose Copy/Cut (shortcut keys CTRL+C/CTRL+X.)2 From the Edit menu, choose Paste (shortcut keys CTRL+V.)

NOTE: You may copy/paste many (but not all) model elements among various diagrams.

To paste one or more copied model element by creating new data and symbols

From the Edit menu, choose the Paste With New Data command (shortcut keys CTRL+E.)

© 2005 No Magic, Inc 4-132

Page 128: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

To copy the whole diagram and paste it to MS Office or other application

1 Select or deselect all model elements on the diagram.2 From the Edit menu, choose the Copy as EMF or Copy as JPG command

(shortcut keys CTRL+SHIFT+E or CTRL+SHIFT+J.)3 Open the desired application and paste the copied diagram.

To copy the selected model elements and paste to MS Office or other application

1 Select the desired model elements on the diagram pane.2 From the Edit menu, choose the Copy as EMF or Copy as JPG (shortcut keys

CTRL+SHIFT+E or CTRL+SHIFT+J.)3 Open the desired application and paste the copied model elements.

TIP!: You are allowed to drag and drop source code files from the native file manager to a MagicDraw Code Engineering Set.

NOTE: You may copy or cut and paste the text only when using the shortcut keys CTRL+C or CTRL+X and CTRL+V. When you use the buttons or commands, the whole element is copied/cut and pasted.

SPECIFYING MODEL ELEMENTSYou may define all model elements in the corresponding Specification dialog boxes.

Using shortcut menus, toolbars, and the Browser makes editing of model elements easier.

IMPORTANT Since version 8.0, MagicDraw enables to edit model element and symbol properties directly from the Browser, Quick Properties tab. More about this functionality, read in Section “Properties tab” on page 3-98.

Speci f icat ion dia log boxes

To open the corresponding Specification dialog box

• Choose Specification from the selected symbol shortcut menu.

• Double-click a symbol on the Diagram pane or Browser.

• Select a symbol on the Diagram pane and press ENTER key.

• The element Specification dialog box appears, when adding one model element to another model element from the Specification dialog box or Browser.

The Specification dialog boxes are used to define UML model elements such as class, package, activity, and others. Every Specification dialog box has a different structure based on the element characteristics.

4-133 © 2005 No Magic, Inc.

Page 129: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

Model elements that may participate in the relationships, have the Relations tab. All model elements specification dialog boxes have the Stereotypes, Tagged Values, Constraints, and, if desired, Hyperlinks tabs. The descriptions of these tabs see in the following sections.

R E L A T I O N S T A B

The Relations tab contains the list of relationships in which the appropriate model element participates.

Figure 63 -- Relations tab

Element name Function

Name Name of the relationship (optional).

Type Relationship type. Click the Edit button, or double-click the relationship type, to open the element Specification dialog box.

Begins Relationship source. The name of the shape from which the path begins.

Ends Relationship destination. The name of the shape where the path ends.

Edit The element Specification dialog box appears.

Remove Removes the selected relationship from the list.

Filter Choose the relationships you want to be displayed on the diagrams in the Relation Types dialog box.

© 2005 No Magic, Inc 4-134

Page 130: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

S T E R E O T Y P E S T A B

Figure 64 -- Stereotypes tab

Element name

Function

Profile The list of profiles that are available for the project.

All The list of all stereotypes that are predefined to the selected model element.

Selected The list of stereotypes that are shown on the selected model element shape.

> Adds the selected stereotype from the All to the Selected list. This stereotype becomes visible on the symbol.

< Removes the selected stereotype from the Selected list. This stereotype becomes invisible.

>> Adds all stereotypes from the All list to the Selected list.

<< Removes all stereotypes from the Selected list back to the All list.

Edit Stereotypes

The Profiles dialog box appears. Edit, add, or remove stereotypes for the selected model element.

4-135 © 2005 No Magic, Inc.

Page 131: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

T A G G E D V A L U E S T A B

Figure 65 -- Tagged Values tab

Element name Function

Profile The list of profiles that are available for the current project.

Expand All Tree Branches

If tag definitions are grouped and those groups are collapsed, expands those groups.

Collapse All Tree Branches

If tag definitions are grouped and those groups are expanded, collapses those groups.

Show Tag Definitions with Values

Displays in the list only those tag definitions that have values.

Show Tag Definitions Groups

If tag definition are grouped into specific “packages”, shows those “packages” on the list by grouping tag definitions.

Group By Stereotype

Sorts tag definitions by the assigned stereotypes.

Show Tag Definitions Types

Displays that types of tag definitions in the list.

© 2005 No Magic, Inc 4-136

Page 132: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

The list of tag definitions with values that are selected for the current model element.

Create Value Create a value for the selected tag definition. The right pane of the dialog box is activated. Choose or enter the value. All data types and types of metamodel can be the types of values.

Remove Value (available only when the tag definition has value)

Removes the value(s) from the selected tag definition.

Edit Value The Tagged Value Specification dialog box appears where you may edit or extend the selected tagged value.

Edit Tag Definitions The Profiles dialog box appears. Edit, add, or remove tag definitions for the current model element.

Right pane of the dialog box

Tag Definition “...” Click the “...” button and edit the selected tag definition in the Tag Definition Specification dialog box.

HTML Set tagged value text as HTML.

Value (if the value is added)

Type or choose the value.

Edit Edit the selected value.

Add Add the new value.

Remove Removes the selected value.

Element name Function

4-137 © 2005 No Magic, Inc.

Page 133: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

C O N S T R A I N T S T A B

Figure 66 -- Constraints tab

Element name Function

The list of constraints assigned to the current model element.

Add Creates a constraint. Use the Name and Expression boxes to change the constraint’s parameters.

Remove Removes the selected constraint from the list.

... To edit common model constraints or add common constraint to a particular element list of constraints, click the ‘…’ button. The Profile dialog box appears where you may manage constraints ant other extensions.

Name Enter the name of the constraint.

Base Classes Shows the type of the base classes.

Expression Enter an expression of the constraint.

Check OCL Syntax If selected, the expression is checked according Object Constraint Language (OCL)

Documentation A comment associated with the selected constraint.To edit the comment, click the button, the Comment Specification dialog box appears. Edit the name, add stereotypes, tagged values, and/or constraints to the comment.

© 2005 No Magic, Inc 4-138

Page 134: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

G E N E R A L T A B

Name text box

Type or view the model element name. If you enter the name of the already existing model element, an error message box appears.

For some model elements (for example attribute, operation, etc.), the default name Untitled 1 is set. You may change this name to your own name.

Documentation field

Documentation is a comment associated with the selected constraint. To edit the comment, click the button, the Comment Specification dialog box appears. Edit the name, add stereotypes, tagged values, and/or constraints to the comment.

Also you may write documentation in HTML format. Just select the HTML check box and menu with available text formatting buttons appears.

Button Function

Text Color Choose font color of the text.

Font Name Choose font style of the text.

Font Size Choose font size of the text.

Bold Set text as bold.

Italic Set text as italic.

Underline Set text as underlined.

Align left Align text to left side border.

Center Layout the selected text to the center.

4-139 © 2005 No Magic, Inc.

Page 135: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

For more information about documentation, see Section “Documentation” on page 4-170.

Abstract, leaf, or root check boxes

When selected one of the check boxes, the model element is correspondingly set as generalizable model element - abstract, leaf, or root.

A generalizable element is a model element that may participate in a generalization relationship.

Align Right Align the selected text to right side border.

Insert Hyperlink

Add a hyperlink to the desired file, model element, or web page for the selected text. The Insert Hyperlink dialog box appears.

Unordered list

Change text style to bullet list.

Ordered list Change text style to numbered list.

Decrease Indent

Decrease indent by moving text closer to the left border.

Increase Indent

Increase indent by moving text closer to the right border.

HTML Source

Show text with HTML source characters.

Name Function

Abstract Specifies whether the generalizable element may or may not have a direct instance. True indicates that an instance of the generalizable element must be an instance of a child of the generalizable element. False indicates that there may an instance of the generalizable element that is not an instance of a child. An abstract generalizable element is not instantiable since it does not contain all necessary information.

Leaf Specifies whether the generalizable element is without descendents. True indicates that it may not have descendents False indicates that it may have descendents (whether or not it actually has any descendents at the moment.)

Root Specifies whether the generalizable element is a root generalizable element with no ancestors. True indicates that it may not have ancestors, false indicates that it may have ancestors (whether or not it actually has any ancestors at the moment.)

Button Function

© 2005 No Magic, Inc 4-140

Page 136: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

A T T R I B U T E S T A B

Figure 67 -- Attributes tab

Attributes tab contains the model element attributes list and buttons for editing attributes list.

Name Attribute’s name.

Classifier Class name that contains the current attribute.

Type Attribute’s type. It can be a primitive type or another class.

Initial Value Attribute’s initial value.

Edit The Attribute Specification dialog box appears. Specify attribute, change name, define the name of a class, etc.

Add Add a new attribute to the class. The Attribute Specification dialog box appears.

Remove Remove the selected attribute from the class.

Filter Filters attributes in the list. The list of filter options appears: • Show all base class attributes – attributes list shows current and all

base class’s attributes. • Show public base class attributes – attributes list shows current

and the public base class’s attributes. • Show public and protected base class attributes – attributes list

shows current, public and protected base class’s attributes. • Do not show base class attributes – attributes list shows only

current class’s attributes.

4-141 © 2005 No Magic, Inc.

Page 137: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

O P E R A T I O N S T A B

Figure 68 -- Operations tab

Operation tab Contains model element operations list and buttons for managing this list.

Name Operation’s name.

Classifier Classifiers name that contains current operation.

Return type Operation’s return type.

Edit The Operation Specification dialog box appears. Specify operation, change name, define class’s name, etc.

Add Add a new operation to the model element. The Operation Specification dialog box appears.

Remove Remove the selected operation from the model element.

Filter Filters attributes in the list. The list of filter options appears:• Show all base class operation – operations list shows current and

all base class’s operations. • Show public base class operations – operations list shows current

and the public base class’s operations. • Show public and protected base class operations – operations list

shows current, public and protected base class’s operations. • Do not show base class operations – operations list shows only

current class’s operations.

© 2005 No Magic, Inc 4-142

Page 138: MagicDraw UserManual

4-

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

H Y P E R L I N K S T A B

In the Hyperlinks tab, manage the hyperlinks you want to add to the model element.

Figure 69 -- Specification dialog box. Hyperlinks tab

Active If selected, the hyperlink is activated and will work when double-clicking the model element.

Hyperlink The information about hyperlink - diagram or element name, file path, or url name.

Edit The Insert Hyperlink dialog box appears. Edit the selected hyperlink.

Add The Insert Hyperlink dialog box appears. Select the hyperlink you want to add to the model element.

Remove Remove the selected hyperlink from the model element.

143 © 2005 No Magic, Inc.

Page 139: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

B U T T O N S A V A I L A B L E I N T H E S P E C I F I C A T I O N D I A L O G B O X E S

Format ing Symbols

In MagicDraw, every symbol may have it’s own style: color, font, size, etc. There are several ways to define symbol properties:

• In the symbol properties dialog box: from the selected symbol shortcut menu or from the Edit menu, Symbols command, choose Symbol(s) Properties.

• In the Project Options dialog box. This dialog box enables you to change all available symbols properties, create your own style for the project, apply different symbol properties for different diagrams, define stereotypes properties, that may be bound to the symbol, and many more.

• Using MagicDraw main toolbar. Using MagicDraw toolbar, you may change symbols color, font, and paths style.

To set a symbol’s properties (fill color, text color, etc.)

• From the symbol shortcut menu, choose Symbol(s) Properties.

• From the Options menu, choose Project. The Project Options dialog box appears. Choose the desired options for the selected model elements.

• Select a symbol and from the Edit menu, choose Symbol, and then choose Symbol(s) Properties.

To show/hide model element constraints, stereotype and/or tagged values on the diagram pane

• Select/clear the Show Constraints, Show Stereotype, and/or Show Tagged Values check boxes from the symbol shortcut menu.

Button Function

OK Saves changes and exits the dialog box.

Cancel Exits the dialog box without saving changes.

Help Displays MagicDraw Help.

Owner Displays the Specification dialog box of the model element that owns the current element.

NOTE To apply changes made in the Project Options dialog box, click Apply.

© 2005 No Magic, Inc 4-144

Page 140: MagicDraw UserManual

D I A G R A M S B A S I C SSpeci fy ing Model E lements

4

1 From the Options menu, choose Project.2 The Project Options dialog box appears. Select the Show Constraints, Show

Stereotype, and/or Show Tagged Values check box for the selected model elements.

Owner of the model e lement

Model element and diagram belongs to a package, model (system boundary), subsystem or other appropriated model element, which is called owner.

The name of the owner is shown in the model element name compartment in parentheses.

To add a model element to a package, model (system boundary) or subsystem

• Drag a model element to the desired package on the Diagram pane or in the Browser tree.

• Open the Package, Model, or Subsystem Specification dialog box, Inner Elements tab. Click the Add button and choose a model element or diagram you want to add to a package. Define a model element or diagram in the opened Specification dialog box and click OK.

• From the selected owner shortcut menu in the Browser tree, choose New Element. From the list, choose the desired model element ant type its name on the Browser.

To display/hide the package/system boundary/subsystem name (the owner of an actor) on a model element

• From the symbol shortcut menu, choose Symbol(s) Properties. The Properties dialog box appears. Select/clear the Show Owner check box.

• From the Options menu, choose Project. The Project Options dialog box appears. Select the desired model element and select/clear the Show Owner check box. Click Apply, if you want to apply changes for already created model elements.

TIP! For a class, actor, and interface you may display/hide the name of the owner from the symbol shortcut menu: choose Presentation Options, and then select/clear the Show Owner check box.

NOTE To apply changes made in the Project Options dialog box, click the Apply button in the Styles tab.

4-145 © 2005 No Magic, Inc.

Page 141: MagicDraw UserManual

D I A G R A M S B A S I C SModel Traceabi l i t y

4

MODEL TRACEABIL ITYUsages / Dependencies functionality allows to track/view element dependencies in the UML model.

Usages and Dependent Elements functionality will help you to find information how model elements are used by another elements, what are relations between used and dependent elements. Usages and Dependent Elements functionality is very useful for analyzing associations between elements or searching for diagrams where these elements are represented.

The Usages / Dependent Elements results window is not synchronized with model. So, if there were made some actions with model elements, the Refresh button must be pressed in order to synchronize it.

To search for usages / dependent elements:

1 Select model element in the Browser or on the diagram pane.2 From the shortcut menu, choose the Related Elements command and then Find

Usages or Find Dependent Elements command. The Find Usages / Dependent Elements Options dialog box appears.

3 Specify options and click OK. The Elements Using or Dependencies window is opened.

Usages funct ional i t y

In the Elements Using window are listed elements, which uses the current element.

For example: If element1 has reference to element2. This means that element1 uses element2. So, element2 is used be elemen1. In the Attribute Specification dialog box, Type combo box, add class2. This means that class2 is used by attribute.

Containing other elements is not usage. For example, when package has inner element class, this doesn’t mean, that package uses class. Class is only container of package.

Dependent E lements funct ional i t y

Dependency is converse to Elements Using window results. In the Dependencies window are listed elements, which are depend on current element.

For example: If element1 has reference to element2. This means that element1 depends on element2.

© 2005 No Magic, Inc 4-146

Page 142: MagicDraw UserManual

D I A G R A M S B A S I C SModel Traceabi l i t y

4

F I N D U S A G E S / D E P E N D E N T E L E M E N T S O P T I O N S D I A L O G B O X In the Find Usages / Dependent Elements Options dialog box, you may specify options of usages/dependencies functionality. You may specify search options and visualization options.

The Find Usages / Dependent Elements Options dialog box is and for Usages and for Dependent Element functionality. It means if you would search for usages and clear/select one of the check boxes in the Find Usages / Dependent Elements Options dialog box, next time then you will search for dependencies, value of this check box will be the same.

To open the Find Usages / Dependent Elements Options dialog box:

1 Select a model element in the Browser tree or on the diagram pane. 2 Choose the Related Elements command from the shortcut menu and then Find

Usages or Find Dependent Elements command. 3 The Find Usages/Dependent Elements Options dialog box appears.

Figure 70 -- Find Usages/Dependent Elements Options

Element Name Function

Treat relationships as search result

Search results provide the complete list of used or dependent relationships together with other results.

Treat model elements at the end of relationships as search results

Relationships are skipped and displays only usages/dependent elements between model elements that are connected with these relationships.

4-147 © 2005 No Magic, Inc.

Page 143: MagicDraw UserManual

D I A G R A M S B A S I C SModel Traceabi l i t y

4

E L E M E N T S U S I N G \ D E P E N D E N C I E S W I N D O W S In the Elements Using / Dependencies windows are listed results of the usages / dependencies. In the Elements Using / Dependencies windows you may analyze results, search for elements place (in diagram, in browser), filter results.

To open the Elements Using / Dependencies off windows:

1 Select a model element in the Browser tree or on the diagram pane. 2 Choose the Related Elements command from the shortcut menu and then Find

Usages or Find Dependent Elements command. 3 The Find Usages/Dependent Elements dialog box appears. Click OK.

List usages/dependent elements of every child element

Usages/dependencies of inner elements (beneath the level of current element) are listed in the search results list. When the List usages/dependent elements of every child element check box is cleared (default value), in the usages/dependencies tables, are listed those elements that are using the current element. For example: element1, contains element2. Search not recursively. Elements, which use element1 are listed. Search recursively. Elements, which use element1 are listed, and in other branch, are listed elements, which uses element2.

Ignore inner relations Only usages/dependencies outside the current element (above the level of current element and in the same level) are listed.You may use this option when exporting package as modules. You may analyze dependencies of package inner element to the outer elements (you may not export package, if it has inner elements with dependencies to outer elements according to this package).For example: Create package p1 and package p2. Connect these packages with dependency relationship. In the Browser, drag and drop dependency to the p1. In the Find Usages / Dependent Elements Options dialog box, select the Ignore inner relations check box. Search for the p1 dependency. Dependency to the dependency relationship is not found, because this element is child of p1.

Show results in the new tab

If you want to see new Elements Using / Dependencies windows for every new search, select the Show results in the new tab check box.

Show this dialog before searching

If the Show this dialog before searching check box is selected, every time you will search for usages/dependencies the Find Usages / Dependent Elements Options dialog box will appear. If the Show this dialog before searching check box is cleared, you may invoke the Find Usages / Dependent Elements Options dialog box, from the Elements Using/Dependencies windows, by pressing the Show Usages / Dependent Elements Options button.

Element Name Function

© 2005 No Magic, Inc 4-148

Page 144: MagicDraw UserManual

D I A G R A M S B A S I C SModel Traceabi l i t y

4

4 The Elements Using / Dependencies window is opened.

Figure 71 -- Elements using/ Dependences off window

More information about the Elements Using /Dependencies window, is written in the table bellow.

Item Name Function

Expand Expand records listed in groups. Adequate action is next to the group name to click on the cross.

Collapse Collapse records listed in groups.

Select in Containment Tree

In the usages / dependencies table, select the record. Click on the Select in Containment Tree button. Element is select in the Browser, Containment tree and symbol on this element is selected on the diagram pane.Press the Select in Containment Tree button, closed and not loaded diagrams are opened.Element is selected in the Containment Tree after double click too.NOTE Select in Containment Tree button is not available for multiple elements selections.

Move to Search Results In the usages / dependencies table, select the record. Click on the Move to Search Results button. In the usages/dependencies tables listed results, are moved to the Browser, Search Results tree. In the Search Results tree, you may see all results in one list, grouped in two groups: From diagram and From model.

Open all diagrams that contain current Usages/Dependencies

Diagrams which are mentioned in the usages / dependencies tables are opened. In opened diagrams view is centered on used/dependent elements.NOTE The Open all diagrams that contain current Usages/Dependencies button is inactive if there are no elements that are used in diagrams.

Show/hide the Full Path Names

Next to the element name, full path is displayed. NOTE For symbol this button is not valid.

4-149 © 2005 No Magic, Inc.

Page 145: MagicDraw UserManual

D I A G R A M S B A S I C SModel Traceabi l i t y

4

Def in ing Hyper l inks

You may set text for notes, text boxes, or separators as HTML text. Also you may hyperlinks to any model element.

To add a hyperlink for the model element

1 Open the model element Specification dialog box and select the Hyperlinks tab.2 Define the hyperlink to any model element, file, or web page in the Insert

Hyperlink dialog box. If you want this hyperlink to be active, click the Active Hyperlink check box.

3 Click OK.NOTE The hyperlink is added as a tag definition.

To set the note/text box/separator text as HTML

• From the note/text box shortcut menu, choose HTML Text.

• Draw note or text box, using the Note (HTML text) or Text Box (HTML text) toolbar buttons.

When selecting the text, the HTML editor toolbar appears.

To add a hyperlink to a note, text box, or separator text

Refresh The usages/dependencies tables should be refreshed after: • •elements or symbols are deleted, • •new dependencies/usages are created for the particular model

element.

Show Usages/Dependent Elements Options

The Find Usages / Dependent Elements Options dialog box is opened.

Filter In the Elements Using and Dependencies windows, Filter combo boxes are placed above the column which will be filtered.In the Elements Using window, filtering according to element type and usage type are available. In the Dependencies window, filtering according to element type and dependency type are available.Expand the Filter combo box, you will see items, listed in the appropriate usages / dependencies columns. NOTE In the Elements Using window, Element Type Filter combo box, additional Show All but Symbols filtering options is added.

© 2005 No Magic, Inc 4-150

Page 146: MagicDraw UserManual

D I A G R A M S B A S I C SModel Traceabi l i t y

4

1 Select the text where you want to add a hyperlink and click the Insert Hyperlink .

2 The Insert Hyperlink dialog box appears. Select the hyperlink you want to insert: to a web page, another model element, or a file:

• To link to an existing model element, click the Element/Symbol tab, then click the Select Element/Symbol “…” button and select the model element or symbol you want to link to in the Select Model Element dialog box.

• To link to an existing Web page, click the Web Page tab, and in the Type the Web page name text box, type the URL of a Web page you want to link to. You may click the “…” button and browse the Web for the desired Web page.

• To link to an existing file, click the File tab, enter the path to the file you want to link to. Or, click the Type the file name “…” button and, in the Open dialog box, select the file you want to link to.

Using the HTML editor toolbar, you may change the font, color, size, and the alignment of the selected text.

I N S E R T H Y P E R L I N K D I A L O G B O X

To open the Insert Hyperlink dialog box

1 Create a text box or a note on a diagram pane. Type the text you need. Set the note/text box text as HTML: choose HTML Text from the note/text box shortcut menu.-or-Create a text box or note by clicking the Text Box (HTML Text) or Note (HTML Text) buttons.

2 Select the text. The HTML editor toolbar appears.

NOTE Set the path of the HTML viewer in the Environment Options dialog box (for a description, see Section “Setting Personal Preferences” on page 2-24.)

NOTES: •The selected file will be opened in the HTML browser.

•Set the path of the HTML viewer in the Environment Options dialog box.

•You may link only to an existing file. New files will not be created for you.

4-151 © 2005 No Magic, Inc.

Page 147: MagicDraw UserManual

D I A G R A M S B A S I C SModel Traceabi l i t y

4

3 Select the text where you want to add hyperlink and click the Insert Hyperlink button.

Figure 72 -- Insert Hyperlink dialog box

Tab name Box Function

Element/ SymbolCreates a hyperlink that goes to the selected model element.

Text to display A text that will be displayed as a hyperlink.

Select Element / Symbol “…”

The Select Model Element dialog box appears. Select the model element you want to link to.

Select from list A list of items that have ever been selected as a link.

Clear Removes all items from the Select from list list.

Active If selected, activates the hyperlink on the diagram.

Web PageCreates a hyperlink that goes to the specified Web page.

Text to display A text that will be displayed as a hyperlink.

Type the Web Page name “…”

Type the web page url. Click the “…” button. The Web browser window appears. Browse the web and find the web page you want to link to.NOTE Make sure that the path of a

HTML viewer is set in the Environment Options dialog box.

© 2005 No Magic, Inc 4-152

Page 148: MagicDraw UserManual

D I A G R A M S B A S I C SLaying out

4

Buttons available in the Insert Hyperlink dialog box:

• OK. Saves changes and exits the dialog box.

• Cancel. Exits the dialog box without saving changes.

• Help. Displays MagicDraw Help

LAYING OUTWith MagicDraw, it is easy to manage simple or complex diagrams using automated layout features that optimize diagram layout for viewing.

Lay out your symbols on the Diagram pane using the Layout menu, or you can use the symbol shortcut menu when two or more symbols are selected. Since MagicDraw version 8.0 new layout component is applied with much more possibilities for laying out your models.

To resize the selected shape

Drag the corner of the shape to the desired size.

To resize automatically the selected shape to preferred size

From the shape shortcut menu, choose Autosize.

To alter the routing of the path line

Drag any point of the selected path in any direction.

Magic Draw layouting mechanism is built on various layouters. All Layouters could be separated into 2 different groups: general layouters and specific diagram layouters. MagicDraw has only one specific diagram layouter - Class Diagram Layouter.

General layouters are:

• Orthogonal Layouter

Select from list A list of items that have ever been selected as a link.

Clear Removes all items from the Select from list list.

File Creates a hyperlink that goes to the specified file.

Text to display A text that will be displayed as a hyperlink.

Type the file name “…”

Type the path to the file you want to be opened or click the “...” button.The Open dialog box appears. Select the file you want to link to.

Select from list A list of items that have ever been selected as a link.

Clear Removes all items from the Select from list list.

Tab name Box Function

4-153 © 2005 No Magic, Inc.

Page 149: MagicDraw UserManual

D I A G R A M S B A S I C SLaying out

4

• Hierarchic Layouter

• Tree Layouter

• Organic Layouter

• Circular Layouter

• Path Router

These layouters are provided by yFiles layouting component. Component webstart demo version could be found at http://www.yworks.com/products/yed/demo/yed.jnlp.

User can layout each diagram (except Sequence and Time Diagram) by using 6 general layouters. Class diagram also could be layouted using Class Diagram Layouter.

Orthogonal Layouter

The Orthogonal Layouter is well suited for medium sized sparse diagrams. It produces compact drawings with no shape overlaps, few crossings and few bends. All edges will be routed in an orthogonal style, i.e. only rectilinear style paths will be used.

Orthogonal layout options

Hierarchic Layouter

Use Hierarchic layout style to highlight the main direction or flow within a diagram. Cyclic dependencies of shapes will be automatically detected and resolved. Shapes will be placed

Option Values Default Value Description

Use Existing Drawing as Sketch

boolean false The layouter tries to "orthogonalize" the given sketch by interpreting it and without making too many modifications in respect to the original drawing.

Layout Only Top Level Symbols

Boolean False Keeps the relative position of symbols inside packages and performs the top level layout.

Group Layout Quality

0-1 1 Set the desired layout quality. Higher values result in less connection crossings and smaller layout area, but also increased computation time.

Orthogonal Grid

Integer 50 Defines the virtual grid spacing used by the layouter. Each shape center point lies on a grid point.

© 2005 No Magic, Inc 4-154

Page 150: MagicDraw UserManual

D I A G R A M S B A S I C SLaying out

4

in hierarchically arranged layers. Additionally, the ordering of nodes within each layer is chosen in such a way, that the number of paths crossings is small.

Orthogonal layout options

Option Values Default Value Description

Reverse Orientation in Activity Diagram

Boolean True If True, orientation is reversed in activity diagram.

Minimal Layer Distance

Integer 40 Determines the minimal distance between shapes that reside in adjacent layers.

Minimal Shape Distance

Integer 30 Determines the minimal distance between adjacent shapes that reside in the same layer.

Minimal Path Distance

Integer 30 Determines the distance between adjacent pairs of horizontal path segments and between horizontal path segments and shapes.

Minimal First Segment Length

Integer 10 Determines the minimal length of the first and last segments for orthogonal path routings, i.e. the length from the intersection points to the first or last bend point respectively.

Orientation Top to Bottom, Bottom to Top, Left to Right, Right to Left

Top to Bottom

Determines main layout orientation.

Shape Placement

Linear Segments, Polyline, Simplex, Pendulum, Median Simplex, Tree

Simplex Linear Segments. Aligns shapes in such a way that path segments tend to have very few bends. It is a very good choice in combination with Path Routing set to Orthogonal. However this greatly increases layout width. • Polyline. Aligns shapes by slightly

reducing the width without shape overlaps. Although paths will have lots of bends.

• Pendulum. A sound combination of Linear Segments and Polyline.

• Simplex. Produces high quality drawings. Similar to Linear Segments, aligns shapes in such a way that path segments tend to have very few bends. Additionally, the resulting layout will be more balanced and more compact.

• Median Simplex. It tends to produce more locally symmetric layouts for the sake of a few more bends.

• Tree. Produces very nice layouts, when the graph is a tree. If the graph is not a tree, the placement policy Linear Segments will be used.

4-155 © 2005 No Magic, Inc.

Page 151: MagicDraw UserManual

D I A G R A M S B A S I C SLaying out

4

Tree Layouter

Tree layouter organizes diagram shapes into a tree structure. Tree layouter might be applied on shapes that have no undirected cyclic paths between them.

Table 3, Visible Tree layout options

Path Routing Oblique, Orthogonal

Orthogonal • Oblique. Paths are routed to oblique style with a certain number of bends.

• Orthogonal. Paths are routed to orthogonal style. Orthogonal path routing increases the height of the layout.

Randomization Rounds

Integer 40 Determines the number of rounds that are initialized using different randomized starting positions. Greater values can lead to fewer crossings and longer running times. Huge diagrams with lots of inherent crossings should be processed using smaller values.

Layout Only Top Level Symbols

Boolean False Keeps the relative position of symbols inside packages and performs the layout only on the top level.

Make Sub Trees Boolean True Inheritance paths are joined into inheritance arcs.

Option Values Default Value Description

Layout Style Directed, Balloon,Horizontal-Vertical

Directed • Directed. The tree is laid out hierarchically with the root shape on the top. This is a good choice for directed trees with a unique root shape and a moderate number of shapes on a single hierarchy level. This layout style uses current diagram layout as a sketch to determine the order of siblings at a common shape.

• Balloon. The tree is routed in a radial style. This is a good choice for undirected, dense, or huge trees with a high number of shapes on a single hierarchy level.

• Horizontal-Vertical. Children of a shape are either arranged on a horizontal or on a vertical line. Paths are routed orthogonally. This layout can be very compact if you choose the right alignment type for children of a node.

Option Values Default Value Description

© 2005 No Magic, Inc 4-156

Page 152: MagicDraw UserManual

D I A G R A M S B A S I C SLaying out

4

Make Sub Trees Boolean True Inheritance paths are joined into inheritance arcs.

Directed

Minimal Layer Distance

Integer 50 Determines the minimal distance between parent and child shapes.

Minimal Shape Distance

Integer 50 Determines the minimal distance between siblings of a shape.

Orientation Top to Bottom, Bottom to Top, Left to Right, Left to Right

Top to bottom

Determines the main layout orientation. The layouter tries to arrange shapes in such a way that all paths point in the main layout direction.

Port Style Border Centered, Border Distributed

Border Centered

Determines the way how paths are attached to shapes. • Border Centered. Paths are attached

to the center of the border of corresponding shapes.

• Border Distributed. Path attachment points are distributed along the border of corresponding shapes.

Orthogonal Path Routing

Boolean True If selected, all paths are routed orthogonally in a bus-like fashion. If not selected, paths are routed as straight line segments.

Balloon

Root Shape Position

Directed Root, Center Root

Center Root • Directed Root. Chooses a shape with indegree zero if present. A good choice for directed rooted trees.

• Center Root. Chooses the root shape in such a way that the depth of the resulting tree is minimized.

Preferred Child Wedge

0-360 340 Determines the angular range of the sector that will be reserved for children of a shape. The remaining angular range will be automatically used to accommodate the edge that connects to the root node.

Preferred Root Wedge

0-360 360 Determines the angular range of the sector that will be reserved around the root shape to accommodate attached subtrees.

Minimal Path Length

Integer 50 Determines the minimal length of a path.

Compactness Factor

0.1-0.9 0.5 The smaller the compactness factor, the shorter paths and more compact overall layout.

Horizontal-Vertical

Option Values Default Value Description

4-157 © 2005 No Magic, Inc.

Page 153: MagicDraw UserManual

D I A G R A M S B A S I C SLaying out

4

Organic Layouter

The layouter is well-suited for the visualization of highly connected backbone regions with attached peripheral ring or star structures. These structurally different regions of a network can be easily identified by looking at a drawing produced by this layouter.

Organic layout options

Horizontal Spacing

Integer 20 The minimal horizontal distance between adjacent shapes.

Vertical Spacing integer 20 The minimal vertical distance between adjacent shapes.

Option Values Default Value Description

Preferred Path Length

Integer 50 Specify the preferred length of all paths. The layouter tries to arrange the shapes in such a way that paths have the determined path length.

Obey Shape Size

Boolean True If True, the distance between two shapes is calculated with respect to shapes' size.

Gravity Factor -0.2-2 2 Regulates the tendency of the shapes to be placed near the center of the diagram. The greater factor is, the closer shapes are placed to the center of diagram. Negative values lead to huge layouts.

Path Attraction 0-2 2 Higher values makes Layouter obey the given preferred path length.

Shape Repulsion 0-2 0 Higher values result in greater shape distances.

Activate Tree Beautifier

Boolean True If True, optimizes tree-like substructures of the diagram. Optimization process might ignore some layout options.

Layout Only Top Level Symbols

Boolean False If True, the algorithm keeps the relative position of symbols inside of packages and performs the layout only on the top level.

Package Shape Compactness

0-1 0.2 Control the compactness of package shape. Larger values lead to more compact package shapes but paths between packages may be longer and shapes inside packages tend to get clutched together at the center of the package.

Option Values Default Value Description

© 2005 No Magic, Inc 4-158

Page 154: MagicDraw UserManual

D I A G R A M S B A S I C SLaying out

4

Circular Layouter

Circular Layouter produces layouts that emphasize group and tree structures within a network. It partitions shapes into groups by analyzing the connectivity structure of the network. The detected groups are laid out on separate circles. The circles themselves are arranged in a radial tree layout fashion.

Circular Layouter options

Option Values Default Value

Description

Layout Style Compact, Isolated, Single Cycle

Compact • Compact. Each group will consist of shapes that are reachable by two link disjoint paths. Shapes that belong to more than one group will be assigned exclusively to one group.

• Isolated. Each group will consist of shapes that are reachable by two path disjoint paths. All shapes belonging to more than one group will be assigned to an isolated group.

• Single Cycle. All shapes will be arranged on a single circle.

Minimal Shape Distance

Integer 100 Determines the minimal distance between borders of two adjacent shapes on a common circle. The smaller the distance, the more compact resulting layout.

Auto Circle Radius

Boolean True If True, determines the radius of each circle in the layout automatically. An automatically chosen radius is usually the smallest possible radius that obeys Minimal Node Distance.

Fixed Circle Radius

Integer 200 If Auto Circle Radius is not set, this option determines the fixed radius for all circles in the resulting layout. Minimal Node Distance will be ignored in this case.

Preferred Child Wedge

0-360 340 Determines the angular range of the sector that will be reserved for children of a shape. The remaining angular range will be automatically used to accommodate the paths that connect to the root node.

4-159 © 2005 No Magic, Inc.

Page 155: MagicDraw UserManual

D I A G R A M S B A S I C SLaying out

4

Orthogonal Path Router

This layouter routes paths using only vertical and horizontal line segments, while keeping the positions of shapes in the diagram fixed. The routed paths usually will not cross any shapes and not overlap any other paths.

Orthogonal Path layout options

Organic Path Router

This layouter routes paths using oblique paths style, while keeping fixed positions of shapes on a diagram. The routed paths usually will not cross any shapes and not overlap any other paths.

Minimal Path Length

Integer 50 Determines the minimal length of a path that connects two shapes that lie on separate circles. The smaller the chosen value, the more compact the resulting layout.

Maximal Deviation Angle

10-360 100 The bigger the chosen value, the more compact the resulting layout. If a value smaller than 90 degrees, the tree-edges might cross through the circularly arranged groups of shapes.

Compactness Factor

0.1-0.9 0.5 The smaller the compactness factor, the shorter paths and the more compact the overall layout.

Option Values Default Value

Description

Minimal Distance

Integer 20 Specifies the minimal allowed distance between shapes and paths.

Use Existing Bends

Boolean False Specifies whether existing bends should be used as an initial solution for the new routing.

Route Only Necessary

Boolean False If True, only paths that violate the minimal distance criterion will be rerouted.

Option Values Default Value

Description

© 2005 No Magic, Inc 4-160

Page 156: MagicDraw UserManual

D I A G R A M S B A S I C SLaying out

4

Organic Path layout options

Class Diagram Layouter

Class diagram layouter uses different layout algorithms to improve class diagram readability.

Class Diagram layout options

Option Values Default Value Description

Minimum Path Distance

Integer 1 Determines the minimum distance between any two path segments.

Custom Minimum Distance to Nodes

Integer 10 Determines the distance between any path segment and any shape side. The path router strictly adheres to the set value. Router doesn't use this value by default due to increased calculation times.

Route on Grid Boolean True If True, all paths are routed on grid lines from the predefined grid.

Space Driven Vs. Center Driven Search

0-1 1 Determines the ratio between two complementary weighting strategies when looking for a path, namely "center driven" and "space driven" weighting. Values closer to 0 lead to paths that are more distributed over the available space. Values closer to 1 give more emphasis to paths closer to a path's center.

Local Crossing Minimization

Boolean True If False, the number of crossings seen at a shape side can increase a lot. Since this option has a positive effect on a diagram "readability," it is enabled by default.

Option Values Default Value Description

Minimal Layer Distance

Integer 50 Determines the minimal distance between parent and child shapes.

Minimal Shape Distance

Integer 50 Determines the minimal distance between the siblings of a shape.

Orientation Top to Bottom, Bottom to Top, Left to Right, Left to Right

Top to bottom Determines the main layout orientation. The layouter tries to arrange shapes in such a way that all paths point in the main layout direction.

4-161 © 2005 No Magic, Inc.

Page 157: MagicDraw UserManual

D I A G R A M S B A S I C SZooming

4

Quick Diagram Layout feature

You may use Quick Layout feature when editing diagrams other that class or sequence. This feature applies recommended layouter with default options on active diagram.

ZOOMINGZooming allows you to select a small part of a diagram, zoom into it, and make changes to the enlarged portion working with a finer level of detail, or gain an overview of a diagram by zooming it out.

To fit the current diagram in the window

• From the View menu or from the diagram shortcut menu, choose Fit in Window (shortcut keys CTRL+W.)

• Click the Fit in Window button in the Browser, Zoom tab.

Compactness Factor

0-1 1 Adjusting this value can lead to a variety of differing layouts. For small values, the resulting layout will use much space and shapes tend to be far away from each other. Values around 0.5 lead to evenly distributed shapes, whereas values near 1.0 produce highly compact layouts

Space Driven Vs. Center Driven Search

0-1 1 Determines the ratio between two complementary weighting strategies when looking for a path, namely "center driven" and "space driven" weighting. Values closer to 0 lead to paths that are more distributed over the available space. Values closes to 1 give more emphasis to path paths closer to a path's center.

Build Generalization Hierarchies

Boolean True Classes connected by generalization paths are organized into hierarchies

Build Realization Hierarchies

Boolean False Classes connected by realization paths are organized into hierarchies

Build Containment Hierarchies

Boolean False Classes connected by containment paths are organized into hierarchies

Make Sub Trees Boolean True If enabled, inheritance paths will be joined into inheritance arcs.

Option Values Default Value Description

© 2005 No Magic, Inc 4-162

Page 158: MagicDraw UserManual

D I A G R A M S B A S I C SUsing Grid

4

To zoom the current diagram in

• From the View menu or from the diagram shortcut menu, choose Zoom In (shortcut keys CTRL+NumPad PLUS SIGN (+) or scroll.)

• Click the Zoom In toolbar button .

To zoom the current diagram out

• From the View menu or from the diagram shortcut menu, choose Zoom Out (shortcut keys CTRL+NumPad MINUS SIGN (-) or scroll.)

• Click the Zoom Out toolbar button .

TIP! You may zoom in or zoom out using the CTRL+wheel keys.

To restore the diagram’s original size

• From the View menu or from the diagram shortcut menu, choose Zoom 1:1 (shortcut keys CTRL+NumPad SLASH MARK (/).)

• Click the Zoom 1:1 toolbar button .

To view selected shapes at maximum size

Select shapes and then, from either the View menu or the diagram shortcut menu, choose Zoom to Selection (shortcut keys CTRL+NumPad ASTERICS MARK (*).)

To determine the size of a zoom step, which will be used in zoom operations

1 From the Options menu, choose Environment. The Environment Options dialog box appears.

2 Open the Diagram pane and change the Zoom Step Size property. The maximum number is 1.0 (you may zoom a diagram twice.)

USING GRIDThe grid helps you lay out the diagram symbols on the Diagram pane. By default the grid is in the visible state.

NOTE You may also zoom in or out of the diagram using the zoom panel in the Browser window. For the detailed description, see Section “Documentation/Zoom Control/Properties” on page 3-96.

4-163 © 2005 No Magic, Inc.

Page 159: MagicDraw UserManual

D I A G R A M S B A S I C SAss igning Shor tcut Keys

4

To change the grid state (visible, not visible)

From either the View menu or from the diagram shortcut menu, choose Grid and then select/clear the Show Grid check box.

To pull a path with the intersection of gridlines

From either the View menu or from the diagram shortcut menu, choose Grid and then select/clear the Snap Paths to Grid check box.

To pull a shape with the intersection of gridlines

From either the View menu or from the diagram shortcut menu, choose Grid and then select/clear the Snap Shapes to Grid check box.

To change the grid size

1 From either the View menu or from the diagram shortcut menu, choose Grid and then choose Grid Size .

2 The Grid Size dialog box appears. 3 Enter a grid size between 2 and 30 (default is 10).4 Click OK.

To change the grid style

1 From the Options menu, choose Environment. The Environment Options dialog box appears.

2 From the Grid Style drop-down list box, select one of the following style of the grid:

• Dense

• Sparse (default)

ASSIGNING SHORTCUT KEYS

To assign or change the shortcut key of the command

1 From the Options menu, choose Environment.2 The Environment Options dialog box appears.3 Choose the Keyboard pane and assign the desired shortcut keys in the right

pane of the dialog box. For more information about Keyboard pane Section “Keyboard pane” on page 2-36.

© 2005 No Magic, Inc 4-164

Page 160: MagicDraw UserManual

D I A G R A M S B A S I C SPr in t ing

4

PRINTINGIn MagicDraw, you may print an active diagram, the selected model elements, or several diagrams. All menu commands for printing you may find in the File menu, use the toolbar buttons, or the shortcut keys.

Before printing, we suggest to define options of printing in the Print dialog box.

NOTE If the size of the text is too small, it may be not visible on the printed page.

To open the Print dialog box

• Choose the Print command from the File menu.

• In the Print Preview screen, click the button.

The Print dialog box contains the Print Range tab, Print Options tab and the Print Header/Footer tab. See the description in the following sections.

P R I N T R A N G E T A B

In the Print Range tab, select what you want to print.

4-165 © 2005 No Magic, Inc.

Page 161: MagicDraw UserManual

D I A G R A M S B A S I C SPr in t ing

4

Figure 73 -- Print dialog box. Print Range tab

Element name Function

Active Diagram Prints currently opened diagram.

Selected Symbols Prints symbols you select on the diagram. The desired symbols should be selected to activate this option button.

Selected Diagrams From the Not Empty Diagrams list, select diagrams you want to print.

Name Shows available diagrams in the project. To select the diagram for printing, click the name of the diagram in the list. The selected diagrams are highlighted. Press CTRL or SHIFT to select more than one diagram.

Owner The name of the model element that owns the particular diagram.

Select All Selects all the diagrams in the list for printing.

Unselect All Removes the selection.

Load All Diagrams Loads all diagrams of the project. By default only opened diagrams are shown in the Print dialog box.

Print Prints the selected diagram(s).

Close Closes the dialog box.

Help Displays MagicDraw UML Help.

© 2005 No Magic, Inc 4-166

Page 162: MagicDraw UserManual

D I A G R A M S B A S I C SPr in t ing

4

P R I N T O P T I O N S T A B

Click the Print Options tab to customize the printing jobs.

Figure 74 -- Print dialog box. Print Options tab

Element name Function

Print Background Prints the background color of your diagrams.

Show Pages on Diagram

Shows the page boundary on the diagram pane. NOTE You will not see any boundary if the Fit in Page

check box is selected.

Fit in Page The printed diagram fits in one page. If the Fit in Page check box is cleared, and the Show Pages in Diagram check box is selected, the gridlines of pages are shown on the diagram pane.

Zoom Zoom the selected diagram to the size you want to print it. NOTE You are not allowed to zoom a diagram if the Fit in

Page check box is selected.

Pages Set the number of pages you want to printed a diagram on.• Vertical. The number of vertical pages the diagram will be

displayed on.• Horizontal. The number of horizontal pages the diagram will be

displayed on.

Page Settings The standard, according to your application, the Page Setup dialog box appears.

4-167 © 2005 No Magic, Inc.

Page 163: MagicDraw UserManual

D I A G R A M S B A S I C SPr in t ing

4

P R I N T H E A D E R / F O O T E R T A B

Click the Print Header/Footer tab to customize header and footer of the printed pages.

Figure 75 -- Print dialog box. Print Header/Footer tab

• Use any text and combine it with these variables box - indication how to insert some fields in the header/footer.

• Customize header group box - prints header. Select the Print Header check box and type the text you wish to be printed, also choose the desired font.

• Customize footer group box - prints footer. Select the Print Footer check box and type or change the text you wish to be printed also choose the desired font. By default <$PageNumber$> <$FileName$> <$DiagramName$> <$Date$> <$Time$> is printed.

Print Test Page Print the test page. Set print options in the Print Options dialog box.

Preview Preview your diagram’s appearance before printing.

< Preview the previous page.

> Preview the next page.

Element name Function

© 2005 No Magic, Inc 4-168

Page 164: MagicDraw UserManual

D I A G R A M S B A S I C SModel E lements Common in a l l Diagrams

4

MODEL ELEMENTS COMMON IN ALL DIAGRAMSThe following symbols are only graphical symbols and do not possess data.

Note Anchor

Use a note anchor to relate any symbol to a note. You may change the style of a note anchor to rectilinear, oblique, or bezier.

For a detailed description on editing the appearance of paths, see Section “Drawing Relationship paths” on page 4-129.

Model elements Button Function Notation

Text Box

Text Box (HTML text)

(X)

(SHIFT+X)

Type text directly on the diagram.

Note

Note (HTML text)

(N)

(SHIFT+N)

A graphical symbol containing textual information. Use a note to add any needed information to your diagram. Usually a note is connected with another symbol, using a note anchor line.

Note Anchor

(H)

Relates symbols and notes. Use a note anchor to relate any symbol to a note. You may change the style of a note anchor to rectilinear, oblique, or bezier.For a detailed description on editing the appearance of paths, see Section “Drawing Relationship paths” on page 4-129.

ConstraintNOTE

To select a constraint, right-click the Note Anchor button.

(SHIFT+H)

The presentation of a constraint between two graphical symbols.

Separator

(W)

Separates different parts of a diagram with a horizontal line.

4-169 © 2005 No Magic, Inc.

Page 165: MagicDraw UserManual

D I A G R A M S B A S I C SModel E lements Common in al l Diagrams

4

Const ra in t path

For two graphical symbols (such as two classes or two associations), the constraint is shown as a dashed arrow from one element to the other element. The constraint is labeled by the constraint string (in braces {}). The direction of the arrow is relevant information within the constraint. The client (tail of the arrow) is mapped to the first position and the supplier (head of the arrow) is mapped to the second position in the constraint.

To add a constraint expression to the constraint path

From the constraint path shortcut menu, choose Select Constraint and select one of the following:

• Choose <new>. The Constraint Specification dialog box appears. Fill in the dialog box.

• Choose an already created constraint from the list.

• Choose <none>.

Separator

You may use a horizontal separator to rule off different parts of a diagram. Specification of UML 1.4 does not provide rules for using a separator in diagrams.

To set the text position of the name of a separator

• From the separator shortcut menu, choose Text Position, and then choose the text position you need: Left (default), Center, or Right.

• Set a text position in the Project Options dialog box.

To set a separator line style (dashed or solid)

• From the separator shortcut menu, choose Line Style, and then choose the style you need: Dashed (default) or Solid.

Documentat ion

Define the documentation for various documents in the Comment Specification dialog box. Also for a comment you may define stereotypes, tagged values and constraints.

© 2005 No Magic, Inc 4-170

Page 166: MagicDraw UserManual

D I A G R A M S B A S I C SModel E lements Common in a l l Diagrams

4

To open the Comment Specification dialog box

In the elements Specification dialog box, click the Documentation button.

To display the documentation on the Diagram pane

1 Draw a note on the Diagram pane.2 Using a note anchor, connect a note with the model element which contains the

documentation you want to be displayed.3 From the note shortcut menu, choose Retrieve Documentation.

TIP! If a comment contains stereotypes, tagged values, and/or constraints, you may choose to display them in the note’s content.

4-171 © 2005 No Magic, Inc.

Page 167: MagicDraw UserManual

D I A G R A M S B A S I C SModel E lements Common in al l Diagrams

4

© 2005 No Magic, Inc 4-172

Page 168: MagicDraw UserManual

U M L D I A G R A M S 5

In software development, the diagram is the equivalent of a blueprint. To meet the various needs of many parties, we often need several different “blueprints” of the same system. Furthermore, ever system is described by many different aspects. For example:

• Functional (static structure and dynamic interactions)

• Nonfunctional (timing requirements, reliability, and deployment)

• Organizational (work organization and mapping to code modules)

MagicDraw supports all diagrams defined in UML 1.4:

• Class diagram

• Object diagram

• Use case diagram

• Statechart diagram

• Activity diagram

• Collaboration diagram

• Sequence diagram

• Component diagram

• Deployment diagram

However, MagicDraw has only 7 diagram buttons in the application. This is done to simplify the user interface and allow for more flexibility.

Object and collaboration diagrams are supported by MagicDraw collaboration diagram. However it is possible to draw objects in the class diagram, node and component instances in the implementation diagram.

Component and deployment diagrams are supported by MagicDraw implementation diagram which allows you to draw both kinds of diagrams (or mix of them) on the same canvas.

It possible to distinguish model management diagrams that are supported by MagicDraw class diagram.

© 2005 No Magic, Inc. 5-174

Page 169: MagicDraw UserManual

U M L D I A G R A M SSys tem Views

5

SYSTEM VIEWSMost UML literature (“Instant UML”, “UML Toolkit”, “The Unified Modeling Language Reference Manual”) define more or less similar classification for the system views:

Figure 76 -- System Views

Several kinds of diagrams provide a visual notation for the concepts in each view.

Use Case View

The use case view represents the functionality and behavior of a system, subsystem or a class as it is perceived by external users. This view is targeted mainly to customers, designers, developers, and testers.

The use case view usually is presented as a number of use cases and actors in Use Case diagrams. Occasionally it is used in Activity and Sequence diagrams.

The use case view is central because its contents drive the development of the other views. It is also used for the project planning. Every single use case unit is deemed as the manageable unit during a project’s execution.

Logical V iew

The logical view represents both the static and dynamic aspects of a system in terms of class and objects. In contrast to the use case view, the logical view looks inside the system.

Static structure is displayed on Class and Package diagrams, and the main goal of these diagrams is to represent a system’s class structure: The development of the static structure relies on abstraction, encapsulation, and uniformity. The class diagram finally results in the code structure.

The dynamic behavior of the system is displayed on Interaction (sequence and collaboration), Statechart, and Activity diagrams. It focuses mainly on the interactions that occur between objects inside a system, activities and work performed by the various parts of a system, and state changes within a particular object or collaboration. Rather than defining the participants of the system, it defines how particular use cases are executed, which provides value for the external user. The dynamic view is concerned about what is happening inside the system and how those actions impact other participants.

5-175 © 2005 No Magic, Inc.

Page 170: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Process v iew

The process view represents the division of the system into processes and processors. This view allows efficient resource usage, parallel execution, and the handling of asynchronous events from the environment.

The process view is displayed on Component, Deployment and Interaction diagrams.

The process view also is called the concurrency view. The term “concurrency view”, however, carries with it a slightly different connotation/ implication. The synchronization of the thread, object initialization, and other actions are displayed on the same diagrams as dynamic model elements (sequence, collaboration, state, and activity).

Component v iew

The component view represents the implementation modules and their dependencies. This view mainly deals with the development time software structure – source code files, libraries, linking time components, and finally executable components. In fact, the component view describes the software as it appears in the computer disc, such as files and directories.

The component view is displayed on component diagrams.

Deployment v iew

The deployment 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) within the system.

The deployment view is displayed on component and deployment diagrams. The mix of component and deployment diagrams is called the implementation diagram in MagicDrawTM UML.

CLASS DIAGRAMA class diagram is a graphic representation of the static structural model. It shows classes and interfaces, along with their internal structure and relationships. 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

© 2005 No Magic, Inc 5-176

Page 171: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

instantiated only on the runtime and are represented by an object and interaction diagrams.

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 to other objects.

A system typically has a number of class diagrams – not all classes are inserted into a single class diagram. A class may have multiple levels of meaning and participate in several class diagrams.

A class diagram is the logical map of your existing or future source code.

Classes can be grouped into packages. 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).

5-177 © 2005 No Magic, Inc.

Page 172: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Class d iagram elements

Model element Button (hot key)

Notation

ClassA descriptor for a set of objects with similar structures, behaviors, and relationships.

(C)

EnumerationA user-defined data type whose instances are a set of user-specified named enumeration literals. The literals have a relative order but no algebra is defined on them.

(K)

InterfaceThe description of a visible behavior of a class, a component or a package. Interface with the suppressed attributes and operations.

(I)

PortPorts represent interaction points between a classifier and its environment. A port has the ability to specify that any requests arriving at this port are handled.

(Shift_F11)

PackageA group of classes and other model elements.

(P)

© 2005 No Magic, Inc 5-178

Page 173: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Subsystem A subsystem is treated as an abstract single unit and groups model elements by representing the behavioral unit in a physical system.

(Y)

ModelA model is an abstraction of a physical system from a particular point of view. A model contains a hierarchy of packages/subsystems and other model elements that describe the system.

(M)

N-ary associationAn association among two or more classes (a single class may appear more than once).

(O)

Model element Button (hot key)

Notation

5-179 © 2005 No Magic, Inc.

Page 174: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

CollaborationA collaboration describes how an operation or a classifier, like a use case, is realized by a set of classifiers and associations used in a specific way. The collaboration defines a set of roles to be played by instances and links, as well as a set of interactions that define the communication between the instances when they play the roles.Collaboration may have internal structure specified relying on roles and connectors.

(Q)

ObjectAn instance of a class.

(SHIFT+O)

AssociationA connection among classes, which means that there is also a connection among objects of those classes.

(S)

Aggregation An aggregation is an association that represents a whole-part relationship.

(A)

CompositionA composition is a form of aggregation with stronger ownership and coincident lifetime of part with the whole.

(F)

Model element Button (hot key)

Notation

© 2005 No Magic, Inc 5-180

Page 175: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

ContainmentShows a class, package or other model element declared within another model element. Such a declared class is not a structural part of the enclosing class but merely has scope within the namespace of the enclosing class, which acts like a package toward the inner class.

(SHIFT+C)

GeneralizationA relationship between a more general and a more specific element. (G)

Realization (realize)A relationship usually used between an interface and implementation class.

(R)

RealizationRelationship between class and interface.

(E)

Model element Button (hot key)

Notation

5-181 © 2005 No Magic, Inc.

Page 176: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

DependencyIndicates a semantic relationship between two or more model elements. It relates model elements themselves and does not require a set of instances for its meaning.

NOTE Select by right-clicking the kind of relationship: dependency, abstraction, usage, binding dependency, permission, merge, or import.

(D)

(T)

(U)

(B)

(J)

Link AttributeVisual tie between parts of association class – association part and class part.

(L)

LinkA connection between two or more objects.

(SHIFT+L)

Stereotype

(SHIFT+S)

Model element Button (hot key)

Notation

© 2005 No Magic, Inc 5-182

Page 177: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Classes

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); the middle list compartment holds a list of attributes; the bottom list compartment holds a list of operations. The attribute and operation compartments are optional and you may suppress them.

A class is the descriptor for a set of objects with similar structure, behavior, and relationships. The model is concerned with describing the intention of the class, that is, the rules that define it. The run-time execution provides its extension, that is, its instances.

Classes are declared in class diagrams and used in most other diagrams. UML provides a graphical notation for declaring and using classes, as well as a textual notation for referencing classes within the descriptions of other model elements.

A class represents a concept within the system being modeled. Classes have data structure, behavior, and relationships to other elements. The name of a class has scope within the package in which it is declared and the name must be unique (among class names) within its package.

W O R K I N G W I T H C L A S S E S

General information about working with shapes is offered in Chapter 4, "Diagrams Basics."

All options associated with a class can be set in the Class Specification dialog box.

Class Specification dialog box

Figure 77 -- Class Specification dialog box

5-183 © 2005 No Magic, Inc.

Page 178: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Refer to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box Function

General Set general information about the class

Visibility Set class visibility, which defines class access level.• Public. The class can be accessed by any

outside object.• Package. Any classifier declared in the same

package (or a nested subpackage, to any level) can use this class.

• Private. The class can be accessed only from inside the current class.

• Protected. The class can be accessed from inside the current class and classes derived from that class.

Active Defines a class as active.

Template Parameters A template is the descriptor for a class with one or more unbound formal parameters.

Name The name of the template parameter.

Type Type of the template parameter: other classifier or data type.

Default Value Set your own value or select a model element in the Select Model Element dialog box.

Edit The Template Parameter Specification dialog box appears. Edit the parameter.

Add The Template Parameter Specification dialog box appears. Define the parameter.

Remove Remove the selected template parameter from the class.

Inner ElementsAdd another class, use case, interface, or/and collaboration to a class

Name Model element type and name.

Edit The corresponding (class, use case, data type, interface, collaboration) specification dialog box appears. Edit the selected model element in the dialog box.

Add The corresponding (class, use case, interface, collaboration) specification dialog box appears. Define the selected model element in the dialog box.

Remove Remove the selected model element from the class.

Ports Default Name Name of the port.

Type Class, assigned to port as a type.

Edit The Port Specification dialog box appears. Define the port options in the dialog box.

Remove Port is removed from class.

© 2005 No Magic, Inc 5-184

Page 179: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

To insert an inner element in the selected class

1 Double-click the selected class or choose Specification from the class shortcut menu. The Class Specification dialog box appears.

2 Click the Inner Elements tab and then click the Add button. Choose the element (class, use case or interface) you wish to add from the list.

3 Click the selected element. 4 The Class Specification / Use Case Specification / Enumeration Specification /

Interface Specification / Data Type Specification / Primitive Specification / Programming Language Data Type Specification / Collaboration Specification dialog box appears. Define the class, use case or interface and click OK.

To show an inner element on the diagram

1 Select a created inner element in the Browser. 2 From the element shortcut menu, choose Create Symbol.

To analyze a class

From the class shortcut menu, choose Tools, and then Analyze. For a detailed description, see Section “Creating Setters / Getters” on page 7-438.

To generate operations for setting or getting private data to the selected class

From the class shortcut menu, choose Tools and then Create Setters/Getters. For a detailed description, see Section “Creating Setters / Getters” on page 7-438.

To control a list of operations and attributes that are visible on a diagram

Choose Edit Compartment from class shortcut menu. The Compartment Edit dialog box appears. For a detailed descriptions, see Section “Submit a Bug dialog box” on page 9-470.

A class can be defined as active (a border to the class shape is added). An active class specifies whether an object of the class maintains its own thread of control.

A class is a generalizable element and can be defined as Abstract, Leaf, or Root.

To define class as abstract, leaf, root and/or active

1 Double-click the selected class or choose Specification from the class shortcut menu. The Class Specification dialog box appears.

2 Select the Abstract, Leaf, Root, and/or Active check box in the General tab.

5-185 © 2005 No Magic, Inc.

Page 180: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

In ter face

An interface is a specifier for the externally-visible operations of a class, component, or other classifier (including subsystems) without specification of 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 are 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.

To display provided interface, from class to interface draw realize relationship (attributes and operations of the interface should be suppressed).

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.

To display required interface, from class to interface draw usage relationship (attributes and operations of the interface should be suppressed)

Working with interface is similar to working with classes. For more information, see Section “Working with classes” on page 5-183.

General information about working with shapes is offered in Chapter 4, "Diagrams Basics."

All options associated with a interface can be set in the Interface Specification dialog box.

© 2005 No Magic, Inc 5-186

Page 181: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Interface Specification dialog box

Figure 78 -- Interface Specification dialog box

Refer to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

General Set general information about the interface

Visibility • Public. The interface can be accessed by any outside model element.

• Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use that interface.

• Private. Only the interface itself, or elements nested within that interface can see it.

• Protected. Classifiers derived from that interface may see it.

Template Parameters A template is the descriptor for an interface with one or more unbound formal parameters.

Name The name of the template parameter.

Type Type of the template parameter: other interface or data type.

Default Value Set your own value or select a model element in the Select Model Element dialog box.

Edit The Template Parameter Specification dialog box appears. Edit the parameter.

Add The Template Parameter Specification dialog box appears. Define the parameter.

Remove Remove the selected template parameter from the interface.

5-187 © 2005 No Magic, Inc.

Page 182: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

At t r ibute

An attribute is a named property of a class that describes a range of values that can be held by instances of that class.

To create a new attribute

• Double-click the selected class or choose Specification from the class shortcut menu. The Class Specification dialog box appears. Click the Attributes tab and then click the Add button. The Attribute Specification dialog box appears. Define a new attribute and click OK.

• Choose the Insert New Attribute from the class shortcut menu. Type attribute name directly on the class shape.

• In the Browser tree, choose already created class. From the class item shortcut menu, choose New and then choose Attribute.

Define an attribute in the Attribute Specification dialog box.

To open the Attribute Specification dialog

1 Open the Class Specification, Actor Specification, or Interface Specification dialog box.

2 In the Attributes tab, double-click the desired attribute in the list, or click the Edit or Add button.

• In the Association End Role Specification, and Association End Role Specification dialog boxes, Details tab, Qualifiers group box, click the Add or Edit button.

• Double-click the desired attribute directly on the diagram.

Inner ElementsAdd class, use case, interface, enumeration, data type, programming language data type or/and collaboration to an interface

Name Model element type and name.

Edit The corresponding (class, use case, interface, enumeration, data type, programming language data type, or collaboration) specification dialog box appears. Edit the selected model element in the dialog box.

Add The corresponding (class, use case, interface, enumeration, data type, programming language data type, or collaboration) specification dialog box appears. Define the selected model element in the dialog box.

Remove Remove the selected model element from an interface.

Tab name Box name Function

© 2005 No Magic, Inc 5-188

Page 183: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Attribute Specification dialog box

Figure 79 -- Attribute Specification dialog box

Refer to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Options Function

General Set general information for the attribute

Class Shows a class that contains the current attribute. You may not change the value of the Class box. It is automatically defined when you create an attribute.

Type Shows attribute’s type. It can be another project class or primitive type such as int or double or other. Choose the type from the list or add new one by clicking the New button.

Type Modifier Additional information about the type. • & - one class has a reference to other model element. • * - one class has a pointer to other model element. • [] - one class has an array of other model elements.

Changeability Attributes changeability:• Changeable No restrictions on modification. • Frozen The value may not be altered after the object is

instantiated and its values initialized. No additional values can be added to a set. @ sign is added.

• AddOnly Meaningful only if the multiplicity is not fixed to a single value. Additional values can be added to the set of values, but once created, a value may not be removed or altered.

5-189 © 2005 No Magic, Inc.

Page 184: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

To create a link attribute

1 Draw an association between two classes (for example A and B).2 On the Diagram pane, place the third class (C).3 Click the Link Attribute button and draw a dashed line from C to an association

Initial value Type the initial value for the current attribute.

Multiplicity The possible number of data values for the attribute that can be held by an instance. The cardinality of the set of values is an implicit part of the attribute. In the common case in which the multiplicity is • 1..1, then the attribute is a scalar (i.e., it holds exactly one

value). • 0 – zero and only zero. • 1 – one and only one. • 0..1 – zero or one. • 0..* - from zero to any positive integer. • 1..* - from one to any positive integer. • * - any positive integer.

Visibility Set attribute’s visibility, which defines attribute’s access level.• Public. The attribute can be accessed by any outside

object.• Package. Any classifier declared in the same package (or a

nested subpackage, to any level) can use this attribute.• Private. The attribute can be accessed only from inside the

current class.• Protected. The attribute can be accessed from inside the

current class and classes derived from that class.

Scope Specifies whether the targets are ordinary Instances or are Classifiers • Instance. Each value contains a reference to an Instance of

the target Classifier. This is the setting for a normal Attribute.

• Classifier. Each value contains a reference to the target Classifier itself. This represents a way to store meta-information.

Tab name Options Function

© 2005 No Magic, Inc 5-190

Page 185: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

If an attribute’s type is another model class, this attribute can be represented as an association with a role (attribute name) between owner class and class of attribute type

Choose Create Roles from the class shortcut menu. A list of available attributes appears. Choose one and an association relationship with a role is created.

NOTE This command is visible only if one or more attribute types are other model classes.

To change an attribute name

Attribute name must be unique in the class scope.

1 Click the attribute in the selected class on the diagram pane or in the Browser tree.

2 Type a new name.• Change an attribute name in the Attribute Specification dialog box.

To define the type of an attribute

Attribute type can be other class, interface, or a primitive class, such as int or double.

• Choose the type of an attribute from the Type drop-down list box in the Attribute Specification dialog box.

• Type a colon “:” and the name of the type of an attribute just after the attribute name on the diagram pane. If you specify a nonexistent type of an attribute, a new class is created.

TIP: There are available two kinds of lists for selecting a type for an attribute. If in the Environment Options dialog box, General pane you will select the Use List for Type Select check box, all available classifiers will be displayed in the list, if you unselect this check box, the hierarchy of available classifiers will be displayed in the list.

To add additional information about the type of an attribute

1 Open the Attribute Specification dialog box. 2 Choose a sign in the Type Modifier drop-down list box:

• & - one class has a reference to other model element.

• * - one class has a pointer to other model element.

• [] - one class has an array of other model elements.

5-191 © 2005 No Magic, Inc.

Page 186: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

To set an attribute visibility

• Type ‘+’, ‘~’, ‘-‘, or ‘#’ visibility marks just before an attribute name directly on a diagram.

1 Open the Attribute Specification dialog box.2 From the Visibility drop-down list box, choose the desired item (public, package,

protected, and private.)NOTE Attribute visibility is shown at the attribute signature.

To set an attribute scope

1 Open the Attribute Specification dialog box.2 From the Scope drop-down list box, choose the desired item (Instance or

Classifier.)

To set an attribute multiplicity

1 Open the Attribute Specification dialog box (see above).2 Choose or set a multiplicity value in the Multiplicity drop-down box.

To set attribute changeability

The attribute changeability controls the access by operations on the class on the opposite end.

• Choose changeable, frozen, or addOnly from the drop-down list box in the Attribute Specification dialog box.

Visibility Name Function

Public ‘+’ an attribute can be accessed by any other element.

Package ’~’ an attribute can be accessed by element 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.

Name Function

changeable No restrictions on modification.

frozen The value may not be altered after the object is instantiated and its values initialized. No additional values can be added to a set. @ sign is added.

addOnly Meaningful only if the multiplicity is not fixed to a single value. Additional values can be added to the set of values, but once created a value may not be removed or altered.

© 2005 No Magic, Inc 5-192

Page 187: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Operat ion

Entries in the operation compartment are strings that show operations defined on classes, as well as operations supplied by classes. An operation is a service that an instance of the class can be requested to perform. It has a name and a list of arguments.

Usually class attributes are accessed through operations. 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.

To create a new operation

• Double-click the selected class or choose Specification from the class shortcut menu. The Class Specification dialog box appears. Click the Operations tab and then click the Add button. The Operation Specification dialog box appears. Define a new operation and click OK.

• Choose the Insert New Operation from the class shortcut menu. Type operation name directly on the class shape.

• In the Browser tree, choose already created class. From the class item shortcut menu, choose New and then choose Operation.

Define an operation in the Operation Specification dialog box.

To open the Operation Specification dialog box

1 Double-click the class /actor/subsystem or choose Specification from the class’s/actor’s shortcut menu. The Class Specification / Actor Specification / Subsystem Specification dialog box appears.

2 Click the Operations tab. 3 Click the Add or Edit button. The Operation Specification dialog box appears.• Double-click an operation.

5-193 © 2005 No Magic, Inc.

Page 188: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Operation Specification dialog box

Figure 80 -- Operation Specification dialog box

Refer to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box Function

General Set general information for the operation

Class Shows a class, which contains the current operation. You may not change the value of the Class box. It is automatically defined when you create an operation.

Return Type Shows operation’s type. It can be another project class or primitive type such as int or double. Choose the type from the list or add a new one by clicking the New button.

Return Type Modifier

Additional information about the return type. • & - one class has a reference to other model

element. • * - one class has a pointer to other model element. • [] - one class has an array of other model elements.

Concurrency Set operation’s concurrency: sequential, guarded, concurrent.

Query If selected, the operation is set as query. An operation that returns a value but does not alter the state of the system; an operation without side effects.

© 2005 No Magic, Inc 5-194

Page 189: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

To change an operation name

1 Click the operation in the selected class on the diagram pane or in the Browser tree.

2 Type a new name.• Change an operation name in the Operation Specification dialog box.

To define the return type of an operation

• In the Attribute Specification dialog box, the Return Type drop-down list box, choose the return type of an operation .

Visibility Set operation’s visibility, which defines operation’s access level.• Public. The operation can be accessed by any

outside object.• Package. Any classifier declared in the same

package (or a nested subpackage, to any level) can use that operation.

• Private. The operation can be accessed only from inside the current class.

• Protected. The operation can be accessed from inside the current class and classes derived from that class.

Scope Specifies whether the operation is an instance or a classifier. • Instance. An instance value is part of each link. This

is the default. • Classifier. A classifier itself is part of each link.

Normally this would be fixed at modeling time and need not be stored separately at run time.

Parameters A parameter is an unbound variable that can be changed, passed, or returned.

Name Shows the parameter’s name.

Type Shows the parameter’s type. It can be a classifier or a data type.

Default value An expression whose evaluation yields a value to be used when no argument (operation) is supplied for the parameter.

Direction kind Specifies what kind of a parameter is required: • in - an input parameter (may not be modified). • out - an output parameter (can be modified to

communicate information to the caller). • inOut - an input parameter that can be modified.

Up Move up the list

Down Move down the list.

Edit The Parameter Specification dialog box appears.

Add The Parameter Specification dialog box appears.

Remove Removes the parameter.

Tab name Box Function

5-195 © 2005 No Magic, Inc.

Page 190: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

• Type a colon “:” and the name of the type of an operation just after the operation name on the diagram pane. If you specify a nonexistent type of an operation, a new class is created.

To edit / add operation parameter

1 Open the Operation Specification dialog box.2 Click the Parameters tab.3 Double-click the desired parameter in the list of operation parameters or select

a parameter and click the Edit or Add button. The Parameter Specification dialog box appears.

• Type a parameter text (in parenthesis) directly on a diagram.

• Select an operation in the Browser tree, choose New from its shortcut menu and choose Parameter. The Parameter Specification dialog box appears.

Parameter Specification dialog box

The Parameter Specification dialog box defines operation’s argument.

To open the Parameter Specification dialog box

1 Open the Operation Specification dialog box.2 Click the Parameters tab, and then double-click the desired parameter. Or click

the Add /Edit button.

Figure 81 -- Parameter Specification dialog box

© 2005 No Magic, Inc 5-196

Page 191: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Refer to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

To add additional information about the return type of an operation

1 Open the Operation Specification dialog box. 2 Choose a sign from the Return Type Modifier drop-down list box:

• & - one class has a reference to other model element.

• * - one class has a pointer to other model element.

• [] - one class has an array of other model elements.

Operation can be defined as:

To define an operation as abstract, leaf, or root

1 Open the Operation Specification dialog box.2 Select the Abstract, Leaf, and/or Root check box(es) in the General tab.

Tab name Box Function

General Set general information about the parameter

Operation The name of the operation, which contains the parameter.

Type Shows the parameter’s type. It can be a classifier or a data type. Choose a type from the list or create a new one by clicking the New button.

Type Modifier Additional information about the type. • & - a parameter is a reference to other model

element. • * - a parameter is a pointer to other model element. • [] - a parameter is a an array of other model

elements.

Default Value An expression whose evaluation yields a value to be used when no argument (operation) is supplied for the parameter.

Direction kind Select the direction kind: • in - an input parameter (may not be modified).• out - an output parameter (can be modified to

communicate information to the caller). • InOut - an input parameter that can be modified.

Name Function

Abstract The operation does not have an implementation, and one must be supplied by a descendant.

Leaf The implementation of the operation may not be overridden by a descendant class.

Root The class must not inherit a declaration of the same operation.

5-197 © 2005 No Magic, Inc.

Page 192: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

To set an operation visibility

1 Open the Operation Specification dialog box.2 From the Visibility drop-down list box, choose Public, Package, Private, or

Protected.NOTE Operation visibility is shown in the operation signature.

To set an operation scope

1 Open the Operation Specification dialog box.2 From the Scope drop-down list box, choose Instance or Classifier.

To set an operation as query

Select the Query check box in the Operation Specification dialog box.

To set an operation’s Concurrency: sequential, guarded or concurrent

• Choose the concurrency type in the Concurrency drop-down list box in the Operation Specification dialog box.

Visibility name Function

Public ‘+’ Operation can be accessed by any other object from outside.

Package ’~’ Operation can be accessed by element from the same package.

Private ‘-‘ Operation can be accessed only from that class.

Protected ‘#’ Operation can be accessed from inside that class and the classes derived from that class.

Name Function

Sequential Callers must coordinate so that only one call to an Instance (on any sequential Operation) can be outstanding at once. If simultaneous calls occur, then the semantics and integrity of the system may not be guaranteed.

Guarded Multiple calls from concurrent threads may occur simultaneously to one Instance (on any guarded Operation), but only one is allowed to commence. The others are blocked until the performance of the first Operation is complete. It is the responsibility of the system designer to ensure that deadlocks do not occur due to simultaneous blocks. Guarded Operations must perform correctly (or block themselves) in the case of a simultaneous sequential Operation or guarded semantics may not be claimed.

Concurrent Multiple calls from concurrent threads may occur simultaneously to one Instance (on any concurrent Operation). All of them may proceed concurrently with correct semantics. Concurrent Operations must perform correctly in the case of a simultaneous sequential or guarded Operation or concurrent semantics may not be claimed.

© 2005 No Magic, Inc 5-198

Page 193: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

T E M P L A T E / P A R A M E T E R I Z E D C L A S S

A template is the descriptor for a class with one or more unbound formal parameters. It defines a family of classes, each class specified by binding the parameters to actual values. Typically, the parameters represent attribute types; however, they may also represent integers, other types, or even operations. Attributes and operations within the template are defined in terms of the formal parameters, so they too become bound when the template itself is bound to actual values.

To define a parameterized class

1 Double-click the class shape or choose Specification from the class shape shortcut menu. The Class Specification dialog box appears. Click the Template Parameters tab.

2 To add or edit a parameterized class, click the Add button. The Template Parameter Specification dialog box appears. Type the name of the parameter, choose the type from the Type drop-down list box and set the default value by selecting a model element in the Select Model Element dialog box.

3 To remove the selected parameterized class, click the Remove button.

To open the Template Parameter Specification dialog box

In the Class Specification or Interface Specification dialog box, click the Template Parameters tab and then click the Add or Edit button.

Template Parameter Specification dialog box

Figure 82 -- Template Parameter Specification dialog box

Tab name Box name Function

GeneralSet general information about the template parameter

Type Specify the template parameter’s type. It can be a class or a primitive type. Choose the type fro the list or add a new one by clicking the New button.

Default Value Type the default value for the template parameter.

‘…’ The Select Model Element dialog box appears. Select a classifier you wish to assign as a default value to the template parameter.

5-199 © 2005 No Magic, Inc.

Page 194: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Por t

Ports represent interaction points between a classifier and its environment.

The interfaces associated with a port specify the nature of the interactions that may occur over a port. The required interfaces of a port characterize the requests which may be made from the classifier to its environment through this port. The provided interfaces of a port characterize requests to the classifier that its environment may make through this port.

A port has the ability to specify that any requests arriving at this port are handled.

Class model element and Component model elements may have any number of Ports.

When port is created, new class for port definition is created in the same package as source class. Port class name by default is Port_<incremental number>.

Define a port in the Port Specification dialog box.

Port Specification dialog box

Figure 83 -- Port Specification dialog box

© 2005 No Magic, Inc 5-200

Page 195: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Data types

A data type is a type whose values have no identity; that is, they are pure values.

Data type is a classifier and inherits the general features of the classifier: visibility, generalizable element properties, and operations.

MagicDraw provides the following predefined data types: byte, int, boolean, char, float, double, short, void, long.

Tab name Box Function

General Set general information for the port

Type Shows port’s type. It can be another project class or interface. Choose the type from the list or add a new one by clicking the New button.

Multiplicity The possible number of data values for the port that can be held by an instance. The cardinality of the set of values is an implicit part of the port. In the common case in which the multiplicity is • 1..1, then the port is a scalar (i.e., it holds exactly

one value). • 0 – zero and only zero. • 1 – one and only one. • 0..1 – zero or one. • 0..* - from zero to any positive integer. • 1..* - from one to any positive integer. • * - any positive integer.

Is Behavior Specifies whether requests arriving at this port are sent to the classifier behavior of this classifier. Such ports are referred to as behavior port. Any invocation of a behavioral feature targeted at a behavior port will be handled by the instance of the owning classifier itself, rather than by any instances that this classifier may contain.

Is Service If Is Service check box is true, it indicates that this port is used to provide the published functionality of a classifier. If Is Service check box is false, this port is used to implement the classifier but is not part of the essential externally.

Provided Interfaces

Required Interfaces

Name Shows the name of required interface.

Edit Opens the Interface Specification dialog box.

Name Shows the name of provided interface.

Edit Opens the Interface Specification dialog box.

5-201 © 2005 No Magic, Inc.

Page 196: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

You may also create Enumeration, Primitive, and Programming Language data types.

To create a new data type, including Enumeration, Primitive, and Programming Language Data Type

• From the Browser: Choose New from the class or New Element from the package, subsystem, or model shortcut menu, and then choose Data Type, Enumeration, Primitive, or Programming Language Data Type.

• In the Class, Package, Subsystem, and Model Specification dialog boxes, Inner Elements tab, click Add and select a data type you want to create.

NOTE: You may create an enumeration by clicking the Enumeration button from the class diagram toolbar:

To create symbol of the created data type

From the created data type shortcut menu in the Browser, choose Create Symbol command.

© 2005 No Magic, Inc 5-202

Page 197: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Data Type, Primitive, or Programming Language Data Type Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

E N U M E R A T I O N

Enumeration defines a kind of data type whose range is a list of predefined values, called enumeration literals. An Enumeration may have operations, but they must be pure functions (this is the rule for all data type elements).

Define an enumerations in the Enumeration Specification dialog box.

Tab name Box Function

General Set general information about the data type

Visibility • Public. The data type may be accessed by any outside model element.

• Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use that data type.

• Private. Only the data type itself, or elements nested within that data type can see it.

• Protected. Classifiers derived from that data type may see it.

ExpressionNOTE: Expression is available only for Programming Language Data Type.

Expression is expressed in data type’s particular programming language.

5-203 © 2005 No Magic, Inc.

Page 198: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Enumeration Specification dialog box

Figure 84 -- Enumeration Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

To add an enumeration literal

An enumeration literal defines an element of the run-time extension of an Enumeration data type. It has no relevant substructure, that is, it is atomic.

1 Open the Enumeration Specification dialog box.

Tab name Box Function

General Set general information about the enumeration

Visibility • Public. The enumeration may be accessed by any outside model element.

• Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use that enumeration.

• Private. Only the enumeration itself, or elements nested within that enumeration can see it.

• Protected. Classifiers derived from that enumeration may see it.

Enumeration Literals An enumeration literal defines an element of the run-time extension of an enumeration data type.

Name The name of the enumeration literal.

Edit The Enumeration Literal Specification dialog box appears. Edit the enumeration literal.

Add The Enumeration Literal Specification dialog box appears. Define the enumeration literal.

Remove Remove the selected enumeration literal from the enumeration.

© 2005 No Magic, Inc 5-204

Page 199: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

2 In the Enumeration Literals tab, click Add button.3 The Enumeration Literal Specification dialog box appears. Define an

enumeration literal.• Choose Insert New Enumeration Literal command from the Enumeration

shortcut menu.

To suppress enumeration literals

1 From the enumeration shortcut menu, choose Presentation Options.2 Select the Suppress Enumeration Literals check box.

To open the Enumeration Literal Specification dialog box

1 Open the Enumeration Specification dialog box.2 In the Enumeration Literals tab, double-click the desired literal in the list, or click

the Edit or Add button.

P R I M I T I V E

A primitive defines a predefined data type without possessing any relevant UML substructure; that is, it has no UML parts. A primitive data type may have an algebra as well as operations defined outside of UML (for example, mathematically). Primitive data types used in UML include Integer, Unlimited Integer, and String.

P R O G R A M M I N G L A N G U A G E D A T A T Y P E

A data type is a type whose values have no identity (i.e., they are pure values). A programming language data type is a data type specified according to the semantics of a particular programming language, using constructs available in that language. There are a wide variety of programming languages and many of them include type constructs not included as UML classifiers. In some cases, it is important to represent those constructs so that their exact form in the programming language is available.

Because they are dependent on particular languages, they are not portable among languages (except by agreement among the languages) and they do not map into other UML classifiers. Many or most programming language types can be directly represented using other UML classifiers, and such representation makes available deeper semantic analysis.

A programming language data type may omit its name. Two programming language data type elements without names are not considered equivalent.

Des ign Pat terns

In MagicDraw, you may create and edit design patterns for the selected class. The detailed description of templates is in the Design Patterns of Reusable Object-Oriented Software.

5-205 © 2005 No Magic, Inc.

Page 200: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

To create the design pattern for the selected class

1 From the class shortcut menu, choose Tools, and then choose Apply Pattern. The Pattern Wizard dialog box appears.

2 Select the design pattern you want to apply and choose the desired options. Click OK.

• Select class and choose Apply Pattern from the Tools menu.

For a detailed description of this dialog box, see Section “Pattern Wizard” on page 7-432.

Class presentat ion opt ions

To organize class data on the class shape

• Choose Presentation Options from the class shortcut menu. The following choices are available in the Presentation Options submenu.

• Class presentation options you may also define in the Project Options dialog box. For a detailed description of this dialog box, see Section “Project Options ” on page 3-51.

© 2005 No Magic, Inc 5-206

Page 201: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Figure 85 -- Presentation Options submenu

Command Function (when selected)

Show Operations Signature Shows operation signature (arguments, return value and etc).

Show Full Classifier Type Shows the full track of the type of an attribute from the root package.

Show Initial Attribute Value Shows Initial attribute value.

Show Attributes Visibility Shows attribute visibility (public, package, private, or protected).

Show Operations Visibility Shows operation visibility (public, package, private, or protected).

Suppress Attributes Attributes compartment is suppressed.

Suppress Operations Operations compartment is suppressed.

Show Only Public Members Shows only public attributes and operations.

Show all Members The default settings are restored and shows all attributes and operations.

5-207 © 2005 No Magic, Inc.

Page 202: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Packages

A package groups together classes and other model elements. All types of UML model elements can be organized into packages. Each diagram must be owned by one package and packages themselves can be nested within other packages. Special kinds of packages are subsystems and models.

Packages may have dependency, generalization, realize, containment, and association relationships. All relationships are usually derived from the relationships between the classes that are placed inside those packages.

W O R K I N G W I T H P A C K A G E S

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Define the selected package in the Package Specification dialog box.

Attributes Sort Mode• By Name• By Stereotype• By Visibility• No Sorting

Choose the sorting parameter:• Sort attributes by name.• Sort attributes by stereotype• Sort attributes by visibility (public, package, private, or

protected)• No sorting is executed.

Operations Sort Mode• By Name• By Stereotypes• By Visibility• No Sorting

Choose the sorting parameter:• Sort operations by name.• Sort operations by stereotype.• Sort operations by visibility (public, package, private,

or protected)• No sorting is executed.

Show More Sign For Attributes

Additional information sign '…' in the class attributes list, when a portion of attributes are omitted by editing a class compartment.

Show More Sign For Operations

Additional information sign '…' in the class operations list, when a portion of operations are omitted by editing a class compartment.

Show Stereotypes Shows stereotypes on a class.

Show Constraints Shows constraints on a class.

Show Tagged Values Shows tagged values on a class.

Show Owner Shows the owner (package, subsystem, or model) name on a class.

Command Function (when selected)

© 2005 No Magic, Inc 5-208

Page 203: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Package Specification dialog box

Figure 86 -- Package Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

To add inner elements to the selected package

1 Open the Package Specification dialog box.2 Click the Inner Elements tab.3 Click the Add button, and then click the element you wish to add.4 If you select a class, use case, actor, interface, component, node, collaboration,

subsystem, model, or package the corresponding Specification dialog box appears. If you select a diagram the Diagram Specification dialog box appears.

Tab name Box name Function

Inner ElementsAdd another model element or a diagram to a package

Name The type and the name of the model element or diagram, assigned to a package.

Edit The corresponding (class, use case, actor, interface, component, node, data type, collaboration, subsystem, model, package) specification dialog box appears. Edit the selected model element in the dialog box. Or the corresponding diagram Specification dialog box appears. Edit the name of the selected diagram.

Add The corresponding specification dialog box appears. Specify the selected model element in the dialog box. Or the corresponding diagram Specification dialog box appears. A new diagram is created.

Remove Remove the selected model element or diagram from the package.

5-209 © 2005 No Magic, Inc.

Page 204: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

5 The inner elements data for the selected package is created.

To change package header (name, stereotypes, tagged values, and constraints) position

• From the package shortcut menu, choose Header Position and then choose Top or In Tab.

• Choose Symbol(s) Properties from the package shortcut menu, and choose Header Position Top or In Tab in the Properties dialog box.

To show the list of elements assigned to a package on the package shape

Choose Show Elements List from the package shortcut menu.

Subsys tem

A subsystem is treated as an abstract single unit. It groups model elements by representing the behavioral unit in a physical system. A subsystem is defined as a package, and it includes operations, specification elements, and realization elements. Specification elements define unit behavior and interaction with other subsystems. Specification elements include interfaces, use cases, constraints, relationships between use cases, etc. Realization elements realize subsystem behavior. Realization elements include various kinds of classifiers and their relationships.

A subsystem is presented as a package with a fork symbol placed in the upper right corner of the small rectangle. The large rectangle has three compartments. One is for operations, one for specification elements, and one for realization elements.

A subsystem is defined as a package – it has package properties – in the Subsystem Specification dialog box. For a detailed description of packages, see Section “Packages” on page 5-208.

© 2005 No Magic, Inc 5-210

Page 205: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Subsystem Specification dialog box

Figure 87 -- Subsystem Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

GeneralSet general information about the subsystem

Instantiable Sets a subsystem as instantiable. It means that there may be several system parts with the same definition otherwise a subsystem represents a unique part of the physical system. The string <<instantiable>> is added above subsystem name.

Inner ElementsAdd another model element or a diagram to a subsystem

Name The type and the name of the model element or diagram, assigned to a subsystem.

Edit The corresponding (class, use case, actor, interface, component, node, data type, collaboration, subsystem, model) specification dialog box appears. Edit the selected model element in the dialog box. Or the Diagram Specification of the corresponding diagram (class diagram, use case diagram, collaboration diagram, sequence diagram, sate diagram, activity diagram, and/or implementation diagram) dialog box appears. Define the selected diagram.

Add The corresponding (class, use case, actor, interface, component, node, data type, collaboration, subsystem, model, subsystem) specification dialog box appears. Specify the selected model element in the dialog box. Or the Diagram Specification of the corresponding diagram (class diagram, use case diagram, collaboration diagram, sequence diagram, state diagram, sate diagram, activity diagram, and/or implementation diagram) dialog box appears. A new diagram is created.

5-211 © 2005 No Magic, Inc.

Page 206: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Additional operations can be added to a subsystem. For more information about how to define operations, see Section “Operation” on page 5-193.

To add an operation to a subsystem

• Choose Insert New Operation from the subsystem shortcut menu.

• Open the Subsystem Specification dialog box. Click the Operations tab. Click the Add button. The Operation Specification dialog box appears.

• Select a subsystem and press shortcut keys CTRL+ALT+O.

• From subsystem shortcut menu in the Browser, choose New Element and then choose Operation.

To show/hide operations on a subsystem

Clear/select Suppress Operations check box from the subsystem shortcut menu or in the subsystem Properties dialog box.

To show/hide operations visibility on a subsystem

Select/clear Show Operations Visibility check box from the subsystem shortcut menu or in the subsystem’s Properties dialog box.

To show/hide a subsystem’s owner (package of which owns the subsystem)

Select/clear Show Owner check box from the subsystem’s shortcut menu or in the subsystem’s Properties dialog box.

To show/hide realization/specification elements

Clear/select Suppress Realization/Specification Elements check box from the subsystem’s shortcut menu or in the subsystem’s Properties dialog box.

If a subsystem is set as instantiable, there may be several system parts with the same definition, if not, the subsystem represents a unique part of the physical system.

To set a subsystem as instantiable elements

Select the Instantiable check box in the Subsystem Specification dialog box, General tab.

Remove Remove the selected model element or diagram from the model.

Tab name Box name Function

© 2005 No Magic, Inc 5-212

Page 207: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Model

A model is an abstraction of a physical system from a particular point of view. A model contains a hierarchy of packages/subsystems and other model elements that describe the system.

A model is presented as a package with a small triangle in the upper right corner of the large rectangle. The triangle can be shown in the tab.

A model is defined as a package – it has package properties - in the Model Specification dialog box. For a detailed description of packages, see Section “Packages” on page 5-208.

Model Specification dialog box

Figure 88 -- Model Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section..

Tab name Box Function

Inner Elements Add other model elements and diagrams to a model

Name A name of an inner model element that is added to a model.

Type The type of the inner element.

Edit The corresponding (class, use case, actor, interface, component, node, data type, collaboration, subsystem, model, package) specification dialog box appears. Edit the selected model element in the dialog box. Or the Type Name of the corresponding diagram (class diagram, use case diagram, collaboration diagram, sequence diagram, state diagram, activity diagram, and/or implementation diagram) dialog box appears. Edit the name of the selected diagram.

5-213 © 2005 No Magic, Inc.

Page 208: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Col laborat ion

A collaboration describes how an operation or a classifier (like a use case) is realized by a set of classifiers and associations used in a specific way. The collaboration defines a set of roles to be played by instances and links, as well as a set of interactions that define the communication between the instances when they play those roles.

Define a collaboration in the Collaboration Specification dialog box.

Collaboration Specification dialog box

Figure 89 -- Collaboration Specification dialog box

Add The corresponding (class, use case, actor, interface, component, node, data type, collaboration, subsystem, model, package) specification dialog box appears. Edit the selected model element in the dialog box. Or the Edit Name of the corresponding diagram (class diagram, use case diagram, collaboration diagram, sequence diagram, state diagram, sate diagram, activity diagram, and/or implementation diagram) dialog box appears. A new diagram is created.

Remove Remove the selected model element or diagram from the model.

Tab name Box Function

© 2005 No Magic, Inc 5-214

Page 209: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

To assign a new classifier role to the collaboration

• In the Collaboration Specification dialog box, Classifier Roles tab, click the Add button. Define a classifier role in the Classifier Role Specification dialog box.

• From the collaboration shortcut menu in the Browser, choose New, and then choose Classifier Role. Type a name of the classifier role and modify it in the Classifier Role Specification dialog box.

NOTE You may edit the assigned classifier role in the Collaboration Specification dialog box, Cllassifier Roles tab.

To assign a new instance to the collaboration

• In the Collaboration Specification dialog box, Instances tab, click the Add button. Define an instance in the Instance Specification dialog box.

• From the collaboration shortcut menu in the Browser, choose the New, and then choose Instance. Type a name of the instance and modify it in the Instance Specification dialog box.

NOTE

Tab name Box Function

General Set general information about the collaboration

Represented The name of the model element that will represent a collaboration. Click the ‘...’ button, to open the Select Model Element dialog box. Select a model element that will represent a collaboration.

Classifier Roles Contains the list of collaborations classifier roles and buttons for editing this list.

Name The name of the classifier, which is assigned to the collaboration.

Classifier Name The name of the classifier, to which classifier role is assigned.

Edit The Classifier Role Specification dialog box appears. Modify the classifier role.

Add The Classifier Role Specification dialog box appears. Define a new classifier role that will be added.

Remove Remove the selected classifier role from the collaboration.

Instances Contains the list of collaboration instances and buttons for managing this list.

Name The name of the instance, which is assigned to the collaboration.

Assigned Classifiers

The name of the classifier, to which the instance is assigned.

Edit The Instance Specification dialog box appears. Modify the instance.

Add The Instance Specification dialog box appears. Define a new instance that will be added.

Remove Remove the selected instance from the collaboration.

5-215 © 2005 No Magic, Inc.

Page 210: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

You may edit the assigned instance in the Collaboration Specification dialog box, Instances tab.

To select a classifier or operation that a collaboration represents

1 Open the Collaboration Specification dialog box. 2 Click the ‘…’ button in the Represented field.3 Select the model element in the Select Model Element dialog box.

General i zat ion

Generalization is the relationship from the child element (the more specific element, such as a subclass) to the parent (the more general element, such as a superclass) that is fully consistent with the first element and that provides additional information. Generalization is used between elements of the same kind, such as classes, packages, use cases, but never for instances, such as an object. MagicDraw is not yet adapted to draw generalization between associations.

A generalization is shown as a solid-line path from the child element (the more specific element, such as a subclass) to the parent element (the more general element, such as a superclass), with a large hollow triangle at the end of the path where it meets the more general element. Generalization lines can be combined into trees.

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Define the generalization in the Generalization Specification dialog box.

© 2005 No Magic, Inc 5-216

Page 211: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Generalization Specification dialog box

Figure 90 -- Generalization Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

To group generalization paths into a tree

1 Draw a generalization path between the child element and the parent element.2 Click the generalization path button on the diagram toolbar.3 Click the other child shape.4 Drag the path to the other generalization path and drop it there.• Choose Make Sub Tree from the parent class shortcut menu.

• Choose Make Sub Tree from the parent package shortcut menu.

To ungroup a generalization tree

1 Click the generalization tree’s hollow triangle pointing to a parent element.2 From the tree shortcut menu, choose Ungroup Tree.

Tab name Box Function

GeneralSet general information about the generalization relationship

Parent Element The name of the parent element. To edit this element, click the “...” button. The appropriated Specification dialog box appears.

Child Element The name of the child element. To edit this element, click the “...” button. The appropriated Specification dialog box appears.

5-217 © 2005 No Magic, Inc.

Page 212: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

To separate the generalization path from the generalization tree

• From the generalization path shortcut menu, choose Remove From Tree.

• Drag one generalization path to another class.

NOTE This command is available if the same tree contains the selected generalization path.

G E N E R A L I Z A B L E E L E M E N T S

A generalizable element is a model element that may participate in a generalization relationship.

To define a generalizable model element (class, package, use case, etc.) as abstract, leaf, or root

1 Open the corresponding Specification dialog box.2 Select the Abstract, Leaf, and/or Root check box(es) in the General tab.

Associat ion

An association in class diagrams 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.

An association in use case diagrams represents the participation of an actor in a use case, i.e., when instances of the actor and instances of the use case communicate with each other. This is the only relationship between actors and use cases. Sometimes an association relationship is called communication association.

An association is drawn as a solid path connecting two classifier symbols.

Name Function

Abstract Specifies whether the generalizable element may or may not have a direct instance. True indicates that an instance of the generalizable element must be an instance of a child of the generalizable element. False indicates that there may an instance of the generalizable element that is not an instance of a child. An abstract generalizable element is not instantiable since it does not contain all necessary information.

Leaf Specifies whether the generalizable element is without descendents. True indicates that it may not have descendents False indicates that it may have descendents (whether or not it actually has any descendents at the moment.)

Root Specifies whether the generalizable element is a root generalizable element with no ancestors. True indicates that it may not have ancestors, false indicates that it may have ancestors (whether or not it actually has any ancestors at the moment.)

© 2005 No Magic, Inc 5-218

Page 213: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

For general information about working with symbols, see Chapter 4, "Diagrams Basics."

Specify an association in the Association Specification dialog box.

Association Specification dialog box

Figure 91 -- Association Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box Function

General Set general information about the association

Association End A

Name The name of the class A. Click the ‘…’ button, to open the Association End Specification dialog box.

Multiplicity The multiplicity value of an association end A.

Element A The name of the class A. Click the ‘…’ button, to open the Class Specification dialog box.

Association End B

Name The name of the association end B. Click the ‘…’ button, to open the Association End Specification dialog box.

5-219 © 2005 No Magic, Inc.

Page 214: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

To show the direction arrow near the association name

From the association shortcut menu, select the Show Direction Arrow check box.

To draw an association class

In the class diagram, you may add attributes to an association using an association class. The association class is a simple class that has a dashed line connection to the association.

1 Draw two classes and the association path between them. 2 Draw the third class.3 Click the Link Attribute button on the diagram toolbar.4 Click the third class shape (path source).5 Drag the path to the association path (path destination) and drop it there.6 If you need to model a relationship among a number of classes, N-ary

association is used.

To draw N-ary association class

N-ary association is drawn as a big diamond with all the associations attached to its points. Every involved class may have role name and multiplicity.

1 Draw three classes on the Diagram pane.2 Draw N-ary association connector icon.3 Connect all classes and N-ary association connector icon using association

path.

A S S O C I A T I O N E N D

An association end is simply an end of an association where it connects to a classifier. It is part of the association, not part of the classifier. Each association has two or more ends. An association end is not a separable element it is just a mechanical part of an association.

To open the Association End Specification dialog box

1 Double-click the association path. The Association Specification dialog box appears.

2 Click the Name “…” button in the Association End A or B group box. A or B depends on which classifier playing role you wish to define (class A - association path target, class B – source).

• From the association end shortcut menu, choose Specification.

Multiplicity The multiplicity value of an association end B.

Element B The name of the classifier role B. Click the ‘…’ button, to open the Class Specification dialog box.

Tab name Box Function

© 2005 No Magic, Inc 5-220

Page 215: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Association End Specification dialog box

Figure 92 -- Association End Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box Function

General Set general information about the association end

Element The name of the class, to which the association end is related.

Initial Value Type the initial value for an association end.

Multiplicity The association end multiplicity describes how many entities are participating at the each association end: • 0 – zero and only zero. • 1 – one and only one. • 0..1 – zero or one. • 0..* - from zero to any positive integer. • 1..* - from one to any positive integer. • * - any positive integer.

5-221 © 2005 No Magic, Inc.

Page 216: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Ordering If the multiplicity is greater than one, then the set of related elements can be ordered or unordered. • unordered - the elements form an unordered set.

This is the default and need not be shown explicitly. • ordered - the elements of the set have an ordering,

but duplicates are still prohibited. This generic specification includes all kinds of ordering. This may be specified by the keyword syntax “{ordered}.”

Type Modifier Additional information about the type. • & - one class has a reference to other model

element. • * - one class has a pointer to other model element. • [] – one class has an array of other model elements.

Scope Specify whether the target value is an instance or a classifier.• Instance. An instance value is part of each link. This

is the default.• Classifier. A classifier itself is part of each link.

Normally this would be fixed at modeling time and need not be stored separately at run time.

Visibility Set association end’s visibility, which defines association end’s access level• Public. The association end can be accessed by any

outside object.• Package. Classifiers in the same package (or a

nested subpackage, to any level) as the association declaration may navigate the association and use the role name in expressions.

• Private. The association end can be accessed only from inside the current class.

• Protected. The association end can be accessed from inside the current class and classes derived from that class.

Aggregation Kind

When placed on a target end, specifies whether the target end is an aggregation with respect to the source end. Only one end can be an aggregation. • None. The end is not an aggregate.• Aggregate. The end is an aggregate; therefore, the

other end is a part and must have the aggregation value of none. The part can be contained in other aggregates.

• Composite. The end is a composite; therefore, the other end is a part and must have the aggregation value of none. The part is strongly owned by the composite and may not be part of any other composite.

Tab name Box Function

© 2005 No Magic, Inc 5-222

Page 217: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

To define the association end name

1 Open the Association End Specification dialog box.2 Type association end name in the Name box.• Choose Role A of <class name> or Role B of <class name> from the

association shortcut menu, and then choose the Edit Name subcommand, then type or edit name directly on the Diagram pane.

To make a special case of an association path (aggregation/composition)

1 Open the Association End Specification dialog box.2 Click the desired option button for an aggregation kind (None, Aggregate or

Composite).• From the association shortcut menu, choose Role A of (class name) or Role B of

(class name), and from an Aggregation Kind drop-down list box, choose none, aggregate, or composite.

• Click the Composition or Aggregation buttons and draw appropriated path on a diagram.

• Right click an association path end and choose Aggregate or Composite command from the shortcut menu.

Changeability Association end’s changeability:• Changeable. No restrictions on modification.• Frozen. The value may not be altered after the object

is instantiated and its values initialized. No additional values can be added to a set. @ sign is added.

• AddOnly. Meaningful only if the multiplicity is not fixed to a single value. Additional values can be added to the set of values, but once created a value may not be removed or altered.

Navigable Make an association end navigable. By default both association end are set as navigable.

Qualifiers Define qualifiers of the association end. A qualifier is an attribute of an association end.

Name The name of the assigned attribute of association end.

Type The type of the assigned attribute of association end. It can be a class of primitive data type.

Initial value Initial value of an attribute of an association end.

Edit The Attribute Specification dialog box appears. Edit the selected qualifier.

Add The Attribute Specification dialog box appears. Specify the qualifier.

Remove Remove the qualifier from the list.

Tab name Box Function

5-223 © 2005 No Magic, Inc.

Page 218: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

To change an association’s navigability

An association’s navigability indicates whether it is possible to traverse an association within expression of a classifier to obtain the object or set of objects associated with the instances. Navigability is shown as an arrow that can be attached to the end of the path to indicate that navigation is supported toward the classifier attached to the arrow.

1 Open the Association End Specification dialog box.2 Select/clear the Navigable check box. • Choose Role A of (class name) or Role B of (class name) from the association

shortcut menu, and then select/clear the Navigable check box.

NOTE By default, an association is navigable in both sides and its navigability is not visible.

To define the association end’s visibility

A role indicates a 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 into the reference name to the opposite class. Roles may have visibility (public, protected, and private).

1 Open the Association End Specification dialog box.2 From the Visibility drop-down list box, choose public, package, protected, or

private.

To place multiplicity values in the association path ends

The association end multiplicity describes how many entities are participating at the each association end:

0 – zero and only zero.

1 – one and only one.

0..1 – zero or one.

0..* – from zero to any positive integer.

1..* – from one to any positive integer.

* – any positive integer.

1 Open the Association End Specification dialog box.2 Type or choose from the list multiplicity value (1, *, 0..*, etc.) in the Multiplicity

box.• Open the Association Specification dialog box and from the Multiplicity drop-

down list box, choose or type the multiplicity value for the desired association end.

• From the association shortcut menu, choose Role A of (class name) or Role B of (class name), and from the Multiplicity drop-down list box, choose the multiplicity value (1, *, 0..*, etc.)

© 2005 No Magic, Inc 5-224

Page 219: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

To define association end’s changeability

Association end changeability:

1 Open the Association End Specification dialog box.2 Choose changeable, frozen or addOnly from the Changeability drop-down list

box.

To add, edit, or remove a qualifier to/from an association end

A qualifier is an attribute or list of attributes whose values serve to partition the set of instances associated with an instance across an association. The qualifiers are attributes of the association. A qualifier is shown 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.

1 Open the Association End Specification dialog box, the Qualifiers tab.2 Click the Add or Edit button. The Attribute Specification dialog box appears.

Define a qualifier. 3 To remove a qualifier, click the Remove button.

In the Association End Specification dialog box, you may also define association end scope, type modifier, or set association end as ordered.

Real i zat ion

A realization relationship is a relationship between two descriptions of the same thing – between specification and its implementation − but at different levels of abstraction. A realization is used to show an interface implementation. The realization means that the client element must support all the behavior of the supplier element but need not match its structure or implementation.

Realization relationships are 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 without the necessity of supporting the data structure of the supplier (attributes and associations).

Changeability name Function

Changeable No restrictions on modification.

Frozen The value may not be altered after the object is instantiated and its values initialized. No additional values can be added to a set. @ sign is added.

AddOnly Meaningful only if the multiplicity is not fixed to a single value. Additional values can be added to the set of values, but once created a value may not be removed or altered.

5-225 © 2005 No Magic, Inc.

Page 220: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Realization paths can be grouped in the tree. This feature makes a diagram appear both more structural and understandable.

NOTE In MagicDraw, you will find two kinds of a realization relationship:

• Realize. A dashed line with a solid triangular arrowhead.

• Realization. A relationship that is placed between a classifier and an interface that is shown as a solid line.

To create a realization tree if a class or an interface already has a number of realization paths attached to it

Choose the Make Sub Tree command from the class or the interface shortcut menu.

To remove a realization from the tree or to ungroup a tree

• Select the realization and choose the Remove From Tree command from the path shortcut menu.

• Select tree head and choose the Ungroup Tree command from the tree shortcut menu.

To specify the selected realization path in the Abstraction Specification dialog box

• Double-click the path.

• Choose Specification from the path shortcut menu.

• Select the path and press ENTER.

Dependency

A dependency indicates a semantic relationship between two model elements (or two sets of model elements). It relates the model elements themselves and does not require a set of instances for its meaning. It indicates a situation in which a change to the supplier (target) element may require a change to the client (source) element in the dependency.

A dependency is shown as a dashed arrow between classes or packages. The model element at the tail of the arrow (the client element) depends on the model element at the arrowhead (the supplier element). The arrow can be labeled with an optional stereotype and an optional individual name.

NOTE You may also draw a dependency between a class and other class elements, such as attributes and operations.

Since version 6.0 you may draw a dependency between paths.

© 2005 No Magic, Inc 5-226

Page 221: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

For more general information about working with the symbols, see Chapter 4, "Diagrams Basics."

A B S T R A C T I O N

An abstraction is a Dependency relationship that relates two elements or sets of elements that represent the same concept at different levels of abstraction or from different viewpoints.

Define an abstraction in the Abstraction Specification dialog box.

Dependency and its kinds Specification dialog boxes

Abstraction, usage, dependency, and permission relationships are defined in the same dialog box. Differs from one another only corresponding name and different predefined stereotypes.

Figure 93 -- Dependency kinds specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

B I N D I N G D E P E N D E N C Y

A binding is a relationship between a template and a model element generated from the template. It includes a list of arguments matching the template parameters. The template is a form that is cloned and modified by substitution to yield an implicit model fragment that behaves as if it were a direct part of the model. A Binding must have one supplier and one client; unlike a general Dependency, the supplier and client may not be sets.

Tab name Box name Function

General Supplier Element Shows the name of the dependency’s supplier element. Click the ‘…’ button. The corresponding element Specification dialog box appears.

Client Element Shows the name of the dependency’s client element. Click the ‘…’ button, the corresponding element Specification dialog box appears.

5-227 © 2005 No Magic, Inc.

Page 222: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Define a binding dependency in the Binding Specification dialog box.

Binding Specification dialog box

Figure 94 -- Binding Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

P E R M I S S I O N

Permission is a kind of dependency. It grants a model element permission to access elements in another namespace.

Tab name Box name Function

General Supplier Element Shows the name of the dependency’s supplier element. Click the ‘…’ button, the corresponding element’s specification dialog box appears.

Client Element Shows the name of the dependency’s client element. Click the ‘…’ button, the corresponding element’s Specification dialog box appears.

Initialized Arguments The list of the template parameters attached to the class.

Name The name of the template parameter.

Type The type of the template parameter. It can be a classifier or a primitive data type.

Default value The default value of the template parameter.

Instantiated The default value of the initialized argument that can be changed. By default, it is the value of the template parameter.

Edit Edit the default value of the initialized arguments in the Type Init Value dialog box.

© 2005 No Magic, Inc 5-228

Page 223: MagicDraw UserManual

U M L D I A G R A M SClass Diagram

5

Define a permission relationship in the Permission Specification dialog box. For a detailed description of this dialog box, see Section “Dependency and its kinds Specification dialog boxes” on page 5-227.

U S A G E

A usage is a relationship in which one element requires another element (or set of elements) for its full implementation or operation. The relationship is not a mere historical artifact, but an ongoing need; therefore, two elements related by usage must be in the same model.

Define a usage relationship in the Usage Specification dialog box. For a detailed description of this dialog box, see Section “Dependency and its kinds Specification dialog boxes” on page 5-227.

M E R G E

A package merge is a directed relationship between two packages, that indicates that the contents of the two packages are to be combined. It is dependency relation with applied stereotype <<merge>>.

Define a merge relationship in the Dependency Specification dialog box. For a detailed description of this dialog box, see Section “Dependency and its kinds Specification dialog boxes” on page 5-227.

I M P O R T

A package import is a relationship between an importing namespace and a package, indicating that the importing namespace adds the names of the members of the package to its own namespace. It is dependency relation with applied stereotype <<import>>.

Define an import relationship in the Dependency Specification dialog box. For a detailed description of this dialog box, see Section “Dependency and its kinds Specification dialog boxes” on page 5-227

5-229 © 2005 No Magic, Inc.

Page 224: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

Containment

A containment shows a class, package or other model element declared within another model element. Such a declared class is not a structural part of the enclosing class but merely has scope within the namespace of the enclosing class, which acts like a package toward the inner class.

USE CASE DIAGRAMA use case is a description of the functionality (a specific usage of a system) that a system provides. The use case descriptions may exist in textual form (simple table), where the use case diagram provides additional information about the relationship between use cases and external users. The diagram also allows definition of the system’s boundary.

Use cases are described only as 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. Use cases are not object oriented, but they are included in the UML to simplify the approach of the project’s lifecycle -- from specification to implementation.

Figure 95 -- Schematic view of the use cases in the system.

© 2005 No Magic, Inc 5-230

Page 225: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

Use Case diagram elements

Element Button (hot key)

Notation

ActorAn actor represents a role played by an external person, process or a thing interacting with a system. One physical object may play several roles.

(A)

Use caseA use case is a classifier representing a coherent unit of functionality provided by a system, a subsystem, or a class as manifested by sequences of messages exchanged among the system and one or more outside interactors (called actors) together with actions performed by the system.

(U)

PackageA group of classes and other model elements. A package may contain other packages. (P)

SubsystemA subsystem is treated as an abstract single unit and groups model elements by representing the behavioral unit in a physical system.

(Y)

System BoundaryAnother representation of a package. A system boundary element consists of use cases related by exclude or include (uses) relationships.

(B)

5-231 © 2005 No Magic, Inc.

Page 226: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

CollaborationA collaboration describes how an operation or a classifier, like a use case, is realized by a set of classifiers and associations used in a specific way. The collaboration defines a set of roles to be played by instances and links, as well as a set of interactions that define the communication between the instances when they play the roles.

(Q)

AssociationThe participation of an actor in a use case, i.e. instances of the actor and instances of the use case communicate with each other. This is the only relationship between actors and use cases.

(S)

Extend An extend relationship from use case A to use case B indicates that an instance of use case B can be augmented (subject to specific conditions specified in the extension) by the behavior specified by A. The behavior is inserted at the location defined by the extension point in B which is referenced by the extend relationship.

(E)

IncludeAn include (uses) relationship from use case A to use case B indicates that an instance of the use case A will also contain the behavior as specified by B. The behavior is included at the location which defined in A.

(C)

DependencyIndicates a semantic relationship among two or more model elements. (D)

Element Button (hot key)

Notation

© 2005 No Magic, Inc 5-232

Page 227: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

Actors

An actor represents any external user working with a system. An actor can be a human, another system or some executable process. An actor requires some task solutions from a system. This task is represented as a use case.

An actor is shown as a “stick man” figure with the name below the figure. If attributes and operations are unsuppressed, an actor is shown as a class with a “stick man” figure in the upper right corner.

W O R K I N G W I T H A C T O R S

General information about working with shapes is offered in Chapter 4, "Diagrams Basics."

Define an actor in the Actor Specification dialog box.

GeneralizationA relationship between a more general and a more specific element. (G)

RealizationA realization relationship between a specification element and its implementation. (R)

ContainmentShows a class, package or other model element declared within another model element. Such a declared class is not a structural part of the enclosing class but merely has scope within the namespace of the enclosing class, which acts like a package toward the inner class.

SHIFT+C

Element Button (hot key)

Notation

5-233 © 2005 No Magic, Inc.

Page 228: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

Actor Specification dialog box

Figure 96 -- Actor Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements.

To display an actor as a class shape or as a stick man figure

• From the actor shortcut menu, choose Presentation Options, and then select/clear the Suppress Attributes and Suppress Operation check boxes.

• From the actor shortcut menu, choose Symbol(s) Properties. The Properties dialog box appears. Select/clear the Suppress Attributes and Suppress Operation check boxes.

• From the Options menu, choose Project. The Project Options dialog box appears. Select an actor and select/clear the Suppress Attributes and Suppress Operation check boxes. Click Apply, if you want to apply changes for other already created actors.

To analyze an actor

From the actor shortcut menu, choose Tools, and then Analyze. For a detailed description, see Section “Tools for Analysis” on page 7-417.

To generate operations for setting or getting private data to the selected class

From the actor shortcut menu, choose Tools and then Create Setters/Getters. For a detailed description, see Section “Creating Setters / Getters” on page 7-438.

© 2005 No Magic, Inc 5-234

Page 229: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

To control a list of operations and attributes that are visible on a diagram

Choose Edit Compartment from the actor shortcut menu. The Compartment Edit dialog box appears. For a detailed descriptions, see Section “Submit a Bug dialog box” on page 9-470.

An actor is a generalizable element and can be defined as Abstract, Leaf, or Root.

To define an actor as abstract, leaf, and/or root

1 Double-click the selected actor or choose Specification from the actor shortcut menu. The Actor Specification dialog box appears.

2 Select the Abstract, Leaf, and/or Root check box in the General tab.

Use Cases

A use case represents a typical interaction between a user and a system. It captures some of the functionality and data that the user works with. A use case is a classifier representing a coherent unit of functionality provided by a system, a subsystem, or a class. This unit of functionality is manifested by sequences of messages exchanged among the system and one or more outside interactors (called actors) together with actions performed by the system.

An extension point is a reference to one location within a use case where action sequences from other use cases can be inserted. Each extension point has a unique name within a use case and a description of the location within the behavior of the use case.

A use case is shown as an ellipse containing the name inside. Extension points are listed in a compartment of the use case with the heading extension points.

Define the selected use case in the Use Case Specification dialog box.

5-235 © 2005 No Magic, Inc.

Page 230: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

Use Case Specification dialog box

Figure 97 -- Use Case specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Tab name Box Function

General Load Profile Loads the Use Case description profile that contains specific extensions.

DiagramsThe list of the diagrams in which the use case participates. Create or assign a diagram within a use case.

Type The type of the assigned diagram.

Name The name of the assigned diagram.

Edit Edit the name of the diagram in the Diagram Specification dialog box.

Add The list of diagrams appears. Choose a diagram you want to assign and define a diagram in the Diagram Specification dialog box.

Remove Remove the selected diagram from the use case.

Extension Points Name The name of an extension point.

Edit The Extension Point Specification dialog box of the selected extension point appears.

Add Define a new extension point. The Extension Point Specification dialog box appears.

Remove Removes the selected extension point from the use case.

© 2005 No Magic, Inc 5-236

Page 231: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

To add an extension point for the use case

1 Open the Use Case Specification dialog box.2 Click the Extension Points tab. 3 Click the Add button. The Extension Point Specification dialog box appears.4 Specify the extension point and click OK.• Press CTRL+ALT+E.

• From the use case shortcut menu, choose Insert New Extension Point.

• From the use case shortcut menu in the Browser, choose New Element, and then choose Extension Point. Type the name of the extension point.

TIPS: You may create an extension point directly on a diagram: Draw an extension path between two use cases, and then in the message window click YES. The extension point is being created. Specify the name of an extension point.

You may define a use case as abstract, leaf, or root (for the detailed description, see Section “Generalizable elements” on page 5-218.)

Use Case Ex tens ions

MagicDraw presents UseCase description extensions. Now you may define pre-conditions and post-conditions for the use cases and other extensions, which are implemented as tag definitions.

MagicDraw contains UseCase Description profile, which may be loaded from Use Case Specification dialog box. Tag defitions available in UseCase Description profile:

IMPORTANT

Group Tag Defitions

Conditions PostConditionPreCondition

Description GoalImplementation IssuesNon Functional RequirementsNotes

Flow of Events Alternative Flow of EventsAlternative Flow of Events DiagramsBasic Flow of EventsBasic Flow of Events DiagramsExceptional Flow of EventsExceptional Flow of Events Diagrams

Identity AuthorDatePriority

Other AssumptionOut-standing Issue

5-237 © 2005 No Magic, Inc.

Page 232: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

Tag definitions from UseCase Description profile are not visible on diagrams, only in generated reports. The detailed description about reports, see in Section “Reports” on page 7-386. For the detailed description of working with tag definitions, see in Section “Tag definitions” on page 5-334.

To display tag definitions from the UC Description profile on the diagram

1 Open the UseCase Description profile UseCase_Profile.xml as a project (this profile is located in the <MagicDraw installation directory>/profiles folder).

2 In the Browser tree select the desired tag definition and open its Specification dialog box.

3 Select the Show In Diagrams check box.4 Save the project.5 Reload the profile in the project you are working: from the UseCase Description

Profile shortcut menu in the Browser tree, choose Modules, and then choose Reload Module.

Re lat ionships in Use Case diagram

There are several standard relationships among use cases or between actors and use cases.

A S S O C I A T I O N

For more on defining associations, see Section “Association” on page 5-218.

The participation of an actor in a use case, i.e. instances of an actor and 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.

E X T E N D

An extend relationship from use case A to use case B indicates that an instance of use case B can be augmented (subject to specific conditions specified in the extension) by the behavior specified by use case A. The behavior is inserted at the location defined by the extension point in B which is referenced by the extend relationship.

Define extend relationship in the Extend Specification dialog box.

© 2005 No Magic, Inc 5-238

Page 233: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

Extend Specification dialog box

Figure 98 -- Extend Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

To open the Extension Point Specification dialog box

1 Choose Specification from the use case shortcut menu, or double-click the use case shape. The Use Case Specification dialog box appears.

2 Open the Extension Points tab and the Edit or Add buttons.

Tab name Box Function

GeneralSet general information about the extend relationship

Base The base Use Case Specification dialog box appears.

Extension The extension Use Case Specification dialog box appears.

Condition An expression specifying the condition, which must be fulfilled if the extension is to take place.

Extension PointsSelect the extension points to be assigned on the extend relationship

Assign Select already predefined extension points you wish to assign to the extend relationship in the Extension Points dialog box.

Unassign Remove already created extension point from the use case.

5-239 © 2005 No Magic, Inc.

Page 234: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

Extension Point Specification dialog box

Figure 99 -- Extension Point Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

I N C L U D E

An include relationship from use case A to use case B indicates that an instance of the use case A will also contain the behavior as specified by B. The behavior is included at the location defined in use case A.

Define extend relationship in Include Specification dialog box.

Tab name Box name Function

General Set general information about the extension point

Use case The name of the use case, which owns the extension point.

BehavioralRepresents a linkage of an extension point to other model element or diagram.

Link to The name of the model element you want to connect an extension point.

Type The type of the linked model element.

Owner The name of the owner of the linked model element.

Add The Select Model Element dialog box appears. Select a model element or diagram.

Remove Remove the selected model element or diagram from the extension point list.

© 2005 No Magic, Inc 5-240

Page 235: MagicDraw UserManual

U M L D I A G R A M SUse Case Diagram

5

Include Specification dialog box

Figure 100 -- Include Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

G E N E R A L I Z A T I O N

For more on defining generalizations, see Section “Generalization” on page 5-216.

A generalization from use case A to use case B indicates that A is a specialization of B.

D E P E N D E N C Y

For more on defining dependencies see Section “Dependency” on page 5-226.

A dependency indicates a semantic relationship between two model elements (or two sets of model elements). It relates the model elements themselves and does not require a set of instances for its meaning. It indicates a situation in which a change to the target element may require a change to the source element in the dependency.

R E A L I Z A T I O N

For more on defining realizations see Section “Dependency” on page 5-226

C O N T A I N M E N T

For more on defining containment see Section “Dependency” on page 5-226

Tab name Box Function

General Set general information about the include relationship

Base The base Use Case Specification dialog box appears.

Addition The addition Use Case Specification dialog box appears.

5-241 © 2005 No Magic, Inc.

Page 236: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

COLLABORATION DIAGRAMCollaboration diagram shows an interaction organized around roles. A collaboration diagram presents a collaboration that contains a set of instances, as well as their required relationships given in a particular context. The diagram also presents an interaction that defines a set of messages specifying the interaction between the classifier roles within a collaboration to achieve the desired result.

A collaboration diagram is given in two different forms: at the instance level or at the specification level; it shows either Instances, Links, and Stimulus, or ClassifierRoles, AssociationRoles, and Messages.

Ins tance level

The instance level (or context) is defined in terms of a static structure of instances and the relationships between them. Instances have to be assigned to a classifier: either to a class (object), a use case (use case instance), or an actor (actor instance). The structural part (more precisely the representation of it) is sometimes called object diagram.

Speci f icat ion level

At the specification level, the diagram shows behavioral elements - ClassifierRoles, AssociationRoles - and Messages among them. Behavioral elements are dynamic interactions that show sequence of messages exchanged by objects over time.

A collaboration diagram shows objects interactions organized around the objects and their relationships to each other. The 3D interaction model shows that the collaboration diagram is the model projection to the bottom.

© 2005 No Magic, Inc 5-242

Page 237: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

Figure 101 -- Interaction representation in 3-Dimensional view

5-243 © 2005 No Magic, Inc.

Page 238: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

Col laborat ion Diagram elements

Element Button (hot key)

Notation

InstanceA particular instance of a classifier. It has a unique name, state, and classifier as the type of identifier.Object, Use Case Instance, and Subsystem Instance can be created in collaboration diagram.

(I)

(O)

(U)

(B)

LinkAn instance of an association between classifiers. Every link among instances of particular classifiers should have corresponding association between corresponding classifiers.

(L)

Link to SelfAn instance of association. Self link for self-calls. It begins and ends on the same instance.

(S)

Classifier RoleA classifier role is a specific role played by a participant in a collaboration. It specifies a restricted view of a classifier, defined by what is required in the collaboration.

(C)

Association RoleAssociation roles describe the required links between the instances, i.e. a subset of the existing links. (A)

© 2005 No Magic, Inc 5-244

Page 239: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

Ins tance

An instance is an individual unit with its own identity and value. Each instance has a descriptor, model element. MagicDraw allows you to create instances of classifiers – class, interface, use case, actor, and subsystem - in a collaboration diagram.

Instances are shown using a rectangle by underlining the name string of an instance element. Instance of an actor is shown as an actor stick man figure with an actor’s name string below the symbol.

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Define the selected instance in the Instance Specification dialog box, Object (an instance of a class) in the Object Specification dialog box, Use Case Instance in the Use Case Instance Specification dialog box, Subsystem Instance in the Subsystem Instance Specification dialog box.

I N S T A N C E S S P E C I F I C A T I O N D I A L O G B O X E S

An instance is an individual unit with its own identity and value. Each instance has a descriptor – model element. MagicDraw allows you to create instances of classifiers – class, interface, use case, subsystem, and actor - in the collaboration and implementation diagram.

NOTE: In this section the Specification dialog box of Object, Instance, Use Case Instance, and Subsystem Instance will be described.

Message / StimulusA stimulus is a communication between two instances that conveys information with the expectation that action will ensue. A stimulus will cause an operation to be invoked, raise a signal, or an instance to be created or destroyed. A message is a specification of stimulus, i.e. it specifies the roles that the sender and the receiver objects should conform to, as well as the Action which will, when executed, dispatch a stimulus that conforms to the message.

(R)

(E)

see Examples above

Element Button (hot key)

Notation

5-245 © 2005 No Magic, Inc.

Page 240: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

To open the Instance, Object, Use Case Instance, or Subsystem Specification dialog box

Choose Specification from the appropriated instance shortcut menu or double-click the instance shape.

Figure 102 -- Instance Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

Assigned Classifiers A template is the descriptor for a instance with one or more unbound formal parameters.

Name The name of the assigned classifier.

Type The type of the assigned classifier.

Owner The name of the owner of the assigned classifier.

Edit Edit the assigned classifier in the Specification dialog box appears.

Assign The Select Model Element dialog box appears. Select classifiers you wish to assign.

Unassign Unassign the selected classifier from the instance.

Attribute Links A named slot in an instance, which holds the value (the instance that is the value of the AttributeLink) of an attribute (the attribute from which the AttributeLink originates)

Type The name, which is the owner of the attribute.

Attribute The name of the attribute.

Instance The name of an instance, to which the current instance is set as a default value.

© 2005 No Magic, Inc 5-246

Page 241: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

To assign an already existing classifier to an instance

1 Draw an instance on the diagram pane.2 Right-click the instance shape and choose Classifier from the instance shortcut

menu. 3 Choose the classifier you wish to assign to an instance.

To assign/change/ unassign a previously existing classifier to/for an instance in the Instance Specification dialog box

1 Draw an instance on the diagram pane.2 Double-click an instance shape or choose Specification from the shape shortcut

menu. 3 The Instance Specification dialog box appears. Click the Assigned Classifiers

tab.• To assign a new classifier, click the Assign button. The Select Model

Element dialog box appears. Select a classifier you wish to assign to an instance.

• To edit a previously created classifier, click the Edit button. The corresponding Specification dialog box appears.

• To unassign the assigned classifier, click the Unassign button.

To hide/show an assigned classifier

From the instance shortcut menu, select/clear the Show Classifier check box.

To create a multiobject

1 Create a classifier role and set a multiplicity with an unbounded upper limit “*”.2 Assign that classifier role to an instance.

To set initial value to an attribute of the assigned classifier

1 Draw an instance on the diagram pane. Double-click an instance’s shape or choose Specification from the shape shortcut menu.

2 The Instance Specification dialog box appears. Click the Slots tab.3 Click the Edit button. The Initial Value dialog box appears.4 Type the name of the initial value.

To show/hide attributes of the assigned classifier

Clear/select Suppress Attributes check box in the instance shortcut menu.

NOTE By default attributes of the classifier are suppressed.

5-247 © 2005 No Magic, Inc.

Page 242: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

To select attributes to be shown on the instance

1 Choose Edit Compartment from the instance shortcut menu. The Compartment Edit dialog box appears. Select attributes to be visible on the instance shape.

NOTE The Suppress Attributes and Edit Compartment commands are available only when the assigned classifier contains at least one attribute.

To reduce a diagram’s complexity, instances of class (objects) that are made of sub-objects can be represented as a composite object.

Figure 103 -- Composite object

To create a composite object

1 Click the Object button on the diagram toolbar or press key O (the button remains pressed).

2 Click the Sticky button on the diagram toolbar or press shortcut keys: Z, SHIFT+CTRL+Z.

3 Click on the desired place in the Diagram pane. The new object is placed on the diagram.

4 Click on the created object on the Diagram pane. The new object is placed on the composite object.

5 Repeat this until you draw the desired number of objects.6 Click the Sticky button on the diagram toolbar or press shortcut keys Z,

SHIFT+CTRL+Z.• Drag already created objects to your target object.

L ink

A link represents a connection between two or more instances of class, interface, actor, and use case. A link is an instance of an association. Through this connection, instances send and receive messages and data.

A link end is an instance of association end.

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Define the selected link in the Link Specification dialog box.

© 2005 No Magic, Inc 5-248

Page 243: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

Link Specification dialog box

Figure 104 -- Link Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

General Set general information about the link relationship

Link End A

Name The name of the link end A. Click the ‘…’ button to open the Link End Specification dialog box.

Element A The name of the model element

Link End B

Name The name of the link end B. Click the ‘…’ button to open the Link End Specification dialog box.

Element B The name of the model element

Stimulus Contains the list of stimulus which the current link participates.

Name The name of the stimulus.

Action Type The type of stimulus action is displayed.

Begins The name of the source link. The name of the shape from which the path begins.

Ends Stimulus destination. The name of the shape where the path ends.

5-249 © 2005 No Magic, Inc.

Page 244: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

To open the Link End Specification dialog box

1 Choose Specification from the link shortcut menu, or double-click the link. The Link Specification dialog box appears.

2 Click the ‘…’ button in the Link End A or Link End B group boxes.

Link End Specification dialog box

Figure 105 -- Link End Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Edit The Stimulus Specification dialog box appears. Edit the stimulus.

Remove Removes the selected stimulus.

Tab name Box name Function

General Set general information about the link end

Name Type the link end name. NOTE The name of the link end is not

visible on the diagram.

Instance The name of an instance at the link end.

Tab name Box name Function

© 2005 No Magic, Inc 5-250

Page 245: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

Class i f ier ro le

A classifier role is a specific role played by a participant in a collaboration. It specifies a restricted view of a classifier, defined by what is required in the collaboration. The role describes the type of Object that may play the role, such as required Operations and Attributes, and describes its relationships to other roles. The relationships to other roles are defined by Association Roles.

A Classifier Role is shown using a rectangle symbol.

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Define the selected classifier role in the Classifier Role Specification dialog box.

Classifier Role Specification dialog box

Figure 106 -- Classifier Role Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box Function

General Set general information about the classifier role

Base Classifier Shows the base classifier of the classifier role. You may click an arrow button and choose a classifier role.

Multiplicity Choose or set your own multiplicity value.

5-251 © 2005 No Magic, Inc.

Page 246: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

To assign a base classifier to a classifier role

1 Right-click the classifier role shape and choose Classifier from the classifier role’s shortcut menu.

2 Choose the classifier you wish to assign to a classifier role.

To assign/change base classifier of a classifier role

1 Double-click a classifier role shape or choose Specification from the shape shortcut menu.

2 The Classifier Role Specification dialog box appears. • To assign a new base classifier, click the Base Classifier drop-down

button. The list with classifiers appears. Select a classifier you wish to assign to a classifier role.

• To edit already created classifier, click the Edit Base button. The corresponding to a classifier Specification dialog box appears.

To hide/show a base classifier

Choose Show Classifier from the classifier role shortcut menu.

To set multiplicity indicator for a classifier role

1 Double-click a classifier role’s shape or choose Specification from the shape shortcut menu.

2 The Classifier Role Specification dialog box appears. 3 Select the multiplicity indicator from the Multiplicity drop-down list box or type

your own indicator.NOTE If you create a classifier role and set a multiplicity with an unbounded limit “*” the

classifier role is drawn as a multiple object.

Associat ion role

Relationships between classifier roles are defined by association roles. An association role is shown with the usual association line. The name string of the association role follows the same syntax as for the classifier role. If the name is omitted, a line connected to classifier role symbols denotes an association role.

For more general information about working with symbols see, Chapter 4, "Diagrams Basics."

Define the selected association role in the Association Role Specification dialog box.

© 2005 No Magic, Inc 5-252

Page 247: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

To open the Association End Role Specification dilaog box

You may define association end role’s name, initial value, multiplicity, type modifier, visibility, changeability, ordering, scope, aggregation king, and navigability.

1 Double-click the association role or choose Specification from the association role shortcut menu. The Association Role Specification dialog box appears.

2 In the Association End Role A or Association End Role B group box, click the Name “...” button. The Association End Role Specification dialog box appears. Specify the association end role and click OK.

• Right-click the association end role name. Specify some options in the shortsut menu, or choose the Specification command to open the Association End Role Specification dialog box.

Association Role Specification dialog box

Figure 107 -- Association Role Specification dialog box

5-253 © 2005 No Magic, Inc.

Page 248: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

S t imulus / Message

In a collaboration diagram, a Stimulus is a communication between two Instances that conveys information with the expectation that action will ensue. A Stimulus will cause an Operation to be invoked, raise a Signal, or cause an Instance to be created or destroyed.

A Message is a specification of a Stimulus, i.e. it specifies the roles to which the sender and the receiver Instances should conform, as well as the Action which will, when executed, dispatch a Stimulus that conforms to the Message.

Tab name Box Function

General Set general information about the association role

Association End Role A

Name The name of the association end role A. Click the ‘…’ button, to open the Association End Role Specification dialog box.

Multiplicity The multiplicity value of an association end role A.

Element A The name of the classifier role A.

Association End Role B

Name The name of the association end role B. Click the ‘…’ button to open the Association End Role Specification dialog box.

Multiplicity The multiplicity value of an association end role B.

Element B The name of the classifier role B.

Documentation A comment associated with the current association role. To edit the comment, click the button, the Comment Specification dialog box appears. Edit the name, add stereotypes, tagged values, and/or constraints to the comment.

Messages Contains the list of messages of the current association role. NOTE In the Message tab, you are not allowed to add messages. Add messages directly in the diagram.

Name The name of the message.

Type The message type: message.

Begins The name of the source of the association role. The name of the shape from which the path begins.

Ends Message destination. The name of the shape where the path ends.

Edit The Message Specification dialog box appears. Edit the message.

Remove Removes the selected message.

© 2005 No Magic, Inc 5-254

Page 249: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

There are several different action types of Messages and Stimulus. Messages and Stimulus are shown as labeled arrows placed near an Association Role or a Link, respectively. They are shown this way to suggest that the Link is used for transportation of the Stimulus to the target Instance. The arrow points along the line in the direction of the receiving Instance.

To open the Message Specification dialog box

• Choose Specification from the message shortcut menu or double-click the message.

• Open the Association Role Specification dialog box. Open the Messages tab and click the Edit button.

Name Function Notation

Asynchronous message / stimulus

The sender is not waiting for acceptance from the recipient.

Synchronous message / stimulus

The operation that is called should be completed before the caller resumes execution.

Balking message / stimulus

NOTE: Set this type of message / stimulus in the Message / Stimulus Specification dialog box, Stereotypes tab.

The sender abandons the message if the receiver is not ready.

Time-out message / stimulus

NOTE: Set this type of message / stimulus in the Message / Stimulus Specification dialog box, Stereotypes tab.

The sender waits for acknowledgment from the recipient for a given period of time. The sender is freed up if the acknowledgment does not occur within the duration specified in the description.

5-255 © 2005 No Magic, Inc.

Page 250: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

Message Specification dialog box

Figure 108 -- Message Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

General Set general information about the message

Action Type The type of the action: uninterpreted, call, send, create, return, destroy, or terminate. Click the ‘…’ button to open the Action Specification dialog box.

Sender The name of the sender classifier role. Click the ‘…’ button to open the Classifier Role Specification dialog box.

Receiver The name of the receiver classifier role. Click the ‘…’ button to open the Classifier Role Specification dialog box.

Return Value The arguments of the action are shown. To edit the return value, click the “...” button. The Action Specification dialog box appears.

Predecessors The set of Messages whose completion enables the execution of the current Message. All of them must be completed before execution begins.

Number The number of the predecessor message

Action An action that performs that message.

Edit The Message Specification dialog box appears.

© 2005 No Magic, Inc 5-256

Page 251: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

To open the Stimulus Specification dialog box

• Choose Specification from the stimulus shortcut menu or double-click the stimulus.

• Open the Link Specification dialog box. Open the Stimulus tab and click the Edit button.

Stimulus Specification dialog box

Figure 109 -- Stimulus Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

General tab Set general information about the stimulus

Action Type The type of the action: uninterpreted, call, send, create, destroy. Click the ‘…’ button, to open the Action Specification dialog box.

Sender The name of the sender instance. Click the ‘…’ button, to open the Instance Specification dialog box.

Receiver The name of the receiver instance. Click the ‘…’ button, to open the Instance Specification dialog box.

Link The name of the link relationship. Click the ‘…’ button, to open the Link Specification dialog box.

5-257 © 2005 No Magic, Inc.

Page 252: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

©

5

To draw a stimulus/message on the link/association role

1 Click the Message/Stimulus to Right or Left button on the diagram toolbar or press shortcut keys R or E (the button remains pressed.)

2 Click the desired link/association on the Diagram pane. A stimulus/message arrow is placed to the link/association role you click on the diagram.

NOTE A message flow has two directions: right and left. Choose one of them by clicking an associated button on the diagram toolbar.

To set an action for a message/stimulus

1 Open the Message Specification or Stimulus Specification dialog box.2 Click the Action Type “...” button. The Action Specification dialog box

appears.3 Choose the action type from the Type drop-down box. See Section “Actions”

on page 5-260.

To show/hide the numbers of the messages/stimulus

From the collaboration diagram shortcut menu, choose Numbering and then select/clear the Show Meesage Numbers check box.

To remove advanced automatic numbering of messages

From the collaboration diagram shortcut menu, choose Numbering and then clear the Advaced Message Numbering check box and you will be able to number messages according your needs.

To change the numbering of the messages/stimulus

1 From the collaboration diagram shortcut menu, choose the Change Numbering command.

2005 No Magic, Inc 5-258

Page 253: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

2 Increase, decrease, and/or change the level of numbering in the Change Collaboration Numbering dialog box:

Figure 110 -- Change Collaboration Numbering dialog box

P R E D E C E S S O R S A N D A C T I V A T O R S

Predecessor is the set of messages/stimulus whose completion enables the execution of the current message.

The predecessor is a comma-separated list of sequence numbers followed by a slash

(‘/’): sequence-number ‘,’ . . . ‘/’

The meaning is that the message is not enabled until all of the communications whose sequence numbers appear in the list have occurred. Therefore, the list of predecessors represents a synchronization of threads. The message corresponding to the numerically preceding sequence number is an implicit predecessor and need not be explicitly listed.

Box name Function

Number The number of the stimulus/message.

Type Displays the type – stimulus or message – for which the numbering is being edited.

Name The type, name of the action of the corresponding stimulus/message.

Edit The Type Number dialog box appears. Type the number of the stimulus/message.

Increase Increases the selected number in one point.

Decrease Decreases the selected number in one point.

OK Saves changes and exits the dialog box.

Cancel Exits the dialog box without saving changes.

Help Displays the MagicDraw Help.

5-259 © 2005 No Magic, Inc.

Page 254: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

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 3.1.4.5 is the predecessor of 3.1.4.6, where the number “3” is an activator.

To show predecessors on the message

• Choose Show Predecessors from the current message shortcut menu.

• Choose Symbol(s) Properties command from the message shortcut menu and select the Show Predecessors check box.

To change the activator number of the messages

1 Choose Activator command from the current message shortcut menu.2 Choose the number of activator that you want to assign for the current message

and predecessors.NOTE: If you change the activator number to one of the predecessor message, this

number also changes for other predecessors.

Define the selected stimulus in the Stimulus Specification dialog box. For a detailed description of this dialog box, see Section “Stimulus Specification dialog box” on page 5-257.

Define the selected message in the Message Specification dialog box. For a detailed description of this dialog box, see Section “Message Specification dialog box” on page 5-256.

Act ions

An action is a specification of an executable statement that forms an abstraction of a computational procedure, resulting in a change in the state of the model. It can be realized by sending a message to an object, or by modifying a link or a value of an attribute.

Specify assigned actions in the Action Specification dialog box.

To open the Action Specification dialog box

• In the Composite State Specification, Action State Specification, Submachine State Specification, Object Flow State, or Subactivity State Specification dialog boxes, Detail tab click the Edit button in the Actions group box.

• In the Message Specification and Stimulus Specification dialog boxes, click the Action Type “…” button.

• In the Transition Specification dialog box, click the Edit button in Effect group box.

© 2005 No Magic, Inc 5-260

Page 255: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

Action Specification dialog box

Figure 111 -- Action Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

NOTE: The name of the dialog box changes according action type.

Tab name Box Function

General Set general information about the action

Script Type an action expression that describes the effects of the action.

Target

Type an ObjectSetExpression, which a target of an action and resolves into zero or more instances when the action is executed.

Type Choose the type of an action: call, send, create, return, destroy, terminate, uninterpreted, or sequence.NOTE: If action type is sequence, you may

specify a sequence of various kinds of actions. More information see in Section “Actions” on page 5-260.

5-261 © 2005 No Magic, Inc.

Page 256: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

Operation (only for call action)

Choose operations if a state diagram is assigned to a class, which contains operations. NOTE The parameters of an operation are

automatically added to the Arguments list.

Instantiation(Only for create action)

Shows the classifier of which an instance will be created of when the create action is performed.

Recurrence / Condition

Type an expression that states how many times the action should be performed.

Iteration An iteration represents a sequence of Messages at the given nesting depth. As UML does not prescribe its format MagicDraw uses a * sign to represent an iteration. An example would be: *[i := 1..n].

Asynchronous Defines an action as asynchronous.

Arguments An argument is an expression describing how to determine the actual values passed in a dispatched request.

Expression Shows the defined argument expression.

Edit The Type Expression dialog box appears. Edit an expression and click OK.

Add The Type Expression dialog box appears. Type an expression and click OK.

Remove Removes an argument expression.

Tab name Box Function

© 2005 No Magic, Inc 5-262

Page 257: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

A C T I O N T Y P E S

Set the following features for an action in the Action Specification dialog box.

Action Type Description Characteristics Representation

Collaboration diagram

Sequence diagram

Create An action in which an instance is created based on the definitions of the specified set of classifiers.

Instantiation (classifier) - the Classifier of which an Instance will be created when the Create Action is performed.

Stimulus and message

(new)

Message is connected directly to an object (not lifeline).

Call An action in which a stimulus is created that causes an operation to be invoked on the receiver.

Operation - the operation, which will be invoked when the Action is executed.

Stimulus and message

Send An action in which a stimulus is created that causes a signal event for the receiver(s).

Stimulus and message

Destroy An action in which an instance causes another instance to cease to exist.

Stimulus and message

A large X mark is displayed on the object’s lifeline in the message’s destination.

Uninterpreted

An action that has no interpretation in UML.

Stimulus and message

Return An action that returns a value to a caller.

Message

Terminate An action in which an instance causes itself to cease to exist.

Message

Assignment An action that assigns an instance to an attribute link, or a link.

Message

5-263 © 2005 No Magic, Inc.

Page 258: MagicDraw UserManual

U M L D I A G R A M SCol laborat ion Diagram

5

Act ive objects

An active object is an object that has its own state machine and a thread of control. An active object executes concurrently with other active objects. They are used to model real-time systems. An active object is an instance of an active class that is implemented as a thread or a process.

These objects may have a synchronization mechanism to prevent them from concurrently using the same resource. The problem is solved by sending synchronous messages. Active objects communicate using synchronous messages or messages mailbox and queues. This technique allows a message to be sent and received asynchronously (a sender object does not wait for an answer from a recipient object).

An active object is shown as a rectangle with a heavy border and an underlined object name inside. Frequently, an active object is shown as a composite with embedded parts to explain its internal structure. These internal objects might be passive as well as active. You may also use a keyword {active} to indicate an active object.

To draw an active object in a collaboration or sequence diagram

1 Create an active class by selecting Active check box in the Class Specification dialog box. An active class is shown as a rectangle with heavy borders.

2 Create an instance of this class as an active object.

Attribute Description How to

Recurrence /Condition

An expression which states how many times the Action should be performed.

Type an expression in the Recurrence/Condition text box.

Script An action expression describing the effects of the action.

Type an expression in the Script text box.

Argument An argument is an expression describing how to determine the actual values passed in a dispatched request. It is aggregated within an action.

Click the Arguments tab.• To enter a new argument expression,

click the Add button. The Type Expression dialog box appears. Type an expression and click OK.

• To edit an argument expression, click the Edit button. The Type Expression dialog box appears. Edit the expression and click OK.

• To remove an argument expression, click the Remove button or press DELETE.

© 2005 No Magic, Inc 5-264

Page 259: MagicDraw UserManual

U M L D I A G R A M SSequence Diagram

5

SEQUENCE DIAGRAMA sequence diagram shows interaction information with an emphasis on the time sequence. The diagram has two dimensions: the vertical axis represents time, while the horizontal axis represents participating objects. The time axis could be an actual reference point (by placing the time moments labels as text boxes). Horizontal ordering of the objects is not significant to the operation, and you may rearrange them as necessary. The 3D-interaction model (See “Interaction representation in 3-Dimensional view” on page 243.)

5-265 © 2005 No Magic, Inc.

Page 260: MagicDraw UserManual

U M L D I A G R A M SSequence Diagram

5

Sequence diagram elements

Model elements Button (hot key)

Notation

Classifier RoleAn instance of a class. An object has identity, attribute values, a unique name, a state, and a class as the type of identifier.LifelineRepresents the existence of an object at a particular time.

Activation BarFocus of control. Shows the period during which an object is performing an action either directly or through a subordinated procedure.

(O)

Interaction UseReference to collaboration diagram, sequence diagram and time diagram can be created.

(SHIFT+T)

Combined FragmentA fragment of sequence diagram can be separated.

(F)

© 2005 No Magic, Inc 5-266

Page 261: MagicDraw UserManual

U M L D I A G R A M SSequence Diagram

5

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Message Default: synchronous uninterpretedA communication between objects that conveys information with the expectation that action will ensue. The receipt of a message is one type of event.

(M)

Message to Self

(S)

Diagonal MessageRequires some time to arrive, during which another action occurs. (D)

Concurrent LifelineA conditional branch in the message flow.

(L)

Recursive messageA connected set of messages can be enclosed and marked as iteration. (R)

Model elements Button (hot key)

Notation

5-267 © 2005 No Magic, Inc.

Page 262: MagicDraw UserManual

U M L D I A G R A M SSequence Diagram

5

Define the selected association role in the Classifier Role Specification dialog box. For a detailed description of this dialog box, see Section “Classifier Role Specification dialog box” on page 5-251.

For more information on working with classifier roles, see Section “Classifier role” on page 5-251.

In teract ion Use

Interactions are units of behavior of an enclosing Classifier. Interactions focus on the passing of information with Messages between the ConnectableElements of the Classifier.

Reference to collaboration diagram, sequence diagram and time diagram can be created.

© 2005 No Magic, Inc 5-268

Page 263: MagicDraw UserManual

U M L D I A G R A M SSequence Diagram

5

Interaction Use Specification dialog box

Figure 112 -- Interaction Use Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Combined Fragment

Tab name Box Function

Refers ToReference to specified diagram.

Combobox A list of collaboration, sequence and time diagrams, created in the project, appears. Click ‘...’ button, to edit specification of the diagram. Click the New button to create a new collaboration, sequence, or time diagram.

Attribute Text box Type value for attribute.

Return value Text box Type return value.

Arguments List A list of specified arguments appears.Click the Add button for creating new argument. Edit and remove value actions can be performed too.

5-269 © 2005 No Magic, Inc.

Page 264: MagicDraw UserManual

U M L D I A G R A M SSequence Diagram

5

Fragment is an abstract notion of the most general interaction unit. The Fragment is a piece of an interaction. Each interaction fragment is conceptually like an interaction by itself. Using Combined Fragment, a fragment of sequence diagram can be separated.

Combined Fragment Specification dialog box

Figure 113 -- Combined Fragment Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box Function

Guard Text box Guard is interatction constraint. Typed value will be displayed in angle brackets.

Operator Combobox Select the operator for fragment. Available: alt, assert, break, consider, critical, ignore, loop, neg, opt, par, seq, strict.

Operands List Separated alternative part of interaction fragment. Click the Add button for creating new value. Edit and remove value actions can be performed too.

© 2005 No Magic, Inc 5-270

Page 265: MagicDraw UserManual

U M L D I A G R A M SSequence Diagram

5

L i fe l ines

A lifeline represents the existence of the object at a particular time. It stretches from the top to the bottom of the diagram. In a sequence diagram, an object lifeline denotes an Object playing a specific role.

To destroy a sequence object - a large “X” at the end of its lifeline marks its destruction

• Choose Destroy Mark from the lifeline or classifier role shortcut menu.

• Set a message as destroyed.

When an object receives a message, an activity starts in that object. An activation (focus of control) shows the period during which an object is performing an action either directly or through a subordinate procedure. The activation bar is used to denote that activity.

To change activation bar size

1 Click the desired activation bar on the Diagram pane.2 Drag an activation bar to the desired direction.

NOTE After resizing, the lines on an activation bar are thickened and the size of an activation bar may not change automatically.

The lifeline may split into two or more concurrent lifelines to show conditionality. Each corresponds to a conditional branch in the message flow. Lifelines may merge together at some subsequent point.

To add a concurrent lifeline to a lifeline

Click the Concurrent Lifeline button on the diagram toolbar and click the lifeline on the desired place where you wish to draw a concurrent lifeline.

A branch is shown by multiple arrows leaving a single point, each labeled by a guard condition. Depending on whether the guard conditions are mutually exclusive, the construct may represent conditionality or concurrency.

To draw a branching of messages

1 Draw a message from one lifeline to another.2 Draw another message from one message to the concurrent lifeline or a lifeline.

5-271 © 2005 No Magic, Inc.

Page 266: MagicDraw UserManual

U M L D I A G R A M SSequence Diagram

5

Messages in sequence diagram

Messages are the main tool for displaying an interaction between objects, which is usually an operation call or creation and destruction event. Messages are labeled with the name (operation or signal) and their argument values.

Define the selected message in the Message Specification dialog box. For more information on working with messages, Section “Stimulus / Message” on page 5-254 and Section “Actions” on page 5-260.

Message type Function Notation

Synchronous Typically implemented as an operation call. The operation that is called should be completed before the caller resumes execution. The return can be shown as a simple message or it can be omitted.

Asynchronous Asynchronous means that the source is not waiting for the acceptance.

Balking message

NOTE: Set this type of message in the Message Specification dialog box, Stereotypes tab.

In the balking message case the sender abandons the message if the receiver is not ready.

© 2005 No Magic, Inc 5-272

Page 267: MagicDraw UserManual

U M L D I A G R A M SSequence Diagram

5

Time-out

NOTE: Set this type of message in the Message Specification dialog box, Stereotypes tab.

A time-out message the sender sends for a given period of time while waiting for acknowledgment by recipient. The sender is freed up if the acknowledgment does not occur within the duration specified in the description.

Call Call action is an action in which a stimulus is created that causes an operation to be invoked on the receiver.

Send Send action is an action in which a stimulus is created that causes a signal event for the receiver(s).

Create Create action is an action in which an instance is created based on the definitions of the specified set of classifiers.

Return Return action is an action that returns a value to a caller.

Message type Function Notation

5-273 © 2005 No Magic, Inc.

Page 268: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

STATE DIAGRAMThe behavior of objects of a class can be described in terms of states and events, using a state machine connected to the class under construction.

A state machine is a specification of the sequence of states through which an object or an interaction goes in response to events during its life, together with responsive actions. The state machine may represent the sequence of states of a particular collaboration (i.e. collection of objects) or even the whole system (which is also considered a collaboration). The abstraction of all possible states defined in a state machine is similar to the way class diagrams are abstracted: all possible object types (classes) of a particular system are described.

Objects that do not present a very pronounced reactive behavior may always be considered to stay in the same state. In such a case, their classes do not possess a state machine.

State diagrams (also called Statechart diagrams) represent the behavior of entities capable of dynamic behavior by specifying its response to the receipt of event instances. Typically, state diagrams describe the behavior of classes, but statecharts may also describe the behavior of other model entities such as use-cases, actors, subsystems, operations, or methods.

A state diagram is a graph that represents a state machine. States and various other types of vertices (pseudostates) in the state machine graph are rendered by appropriate state and pseudostate symbols, while transitions are generally rendered by directed arcs that inter-connect them. States may also contain subdiagrams by physical containment or tiling. Note that every state machine has a top state, which contains all the other elements of the entire state machine. The graphical rendering of this top state is optional.

Destroy Destroy action is an action in which an instance causes another instance to cease to exist.

Terminate Terminate action is an action in which an instance causes itself to cease to exist.

Uninterpreted A simple message shows the control flow from a sender to a receiver without presenting any details about the communication process.

Message type Function Notation

© 2005 No Magic, Inc 5-274

Page 269: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

The states are represented by state symbols, while the transitions are represented by arrows connecting the state symbols.

A state diagram concerns internal object changes (as opposed to the external object interaction in collaboration). Do not attempt to draw them for all classes in the system, because they are used only for modeling a complex behavior. A state diagram shows all the possible states that objects or collaborations may have, and what events cause the state to change. An event can be another object that sends a message to it: for example, that a specified time has elapsed or that some condition has been fulfilled. A change of a state is called a transition. A transition may also have an action connected to it that specifies what should be done in connection with the state transition.

S ta te Diagram elements

NOTE If a black arrow is placed on a button, right-click the button, to open other available buttons.

Model elements Button (hot key)

Notation

StateA condition or situation during the life of an object or an interaction during which it satisfies some condition, performs some action, or waits for some event.

(S)

Concurrent State A state containing other state vertices (states, pseudostates, etc.). It is useful when a given object contains sets of independent behaviors.

(C)

Submachine Represents the invocation of a state machine defined elsewhere. (M)

Action StateA state with an internal action and at least one outgoing transition involving the implicit event of completing the internal action (there can be several such transitions if they have guard conditions).

(A)

5-275 © 2005 No Magic, Inc.

Page 270: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

Call StateA call state is an action state that has exactly one call action as its entry action. It is useful in object flow modeling to reduce notational ambiguity over which action is taking input or providing output.

(K)

Initial StateDenotes an initial state when an object is created.

(I)

Final StateDenotes an object’s destruction or the end of collaboration. (F)

Synch StateA special state that enables synchronization of control between two concurrent regions in a state machine.

(Y)

History StateServes for internal state memorizing. A history state indicates that the enclosing composite state remembers its previously active substate after it exits.

(R)

Junction PointA junction point is used to merge and split transitions. (J)

Model elements Button (hot key)

Notation

© 2005 No Magic, Inc 5-276

Page 271: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

Dynamic Choice PointDynamic choice points are used for splitting transition paths. In the dynamic choice point, a decision on which branch to take is only made after the transition from State1 is taken and the choice point is reached.

(D)

Stub StateRepresents already created state.

(U)

Vertical Synchronization BarHelps to control parallel actions. (V)

Horizontal Synchronization BarHelps to control parallel actions. (B)

TransitionA relationship between two states indicating that an object in the first state will enter the second state and perform certain specified actions when a specified event occurs if specified conditions are satisfied.

(T)

Transition to SelfWhen an object returns to the same state after the specified event occurs. (E)

Model elements Button (hot key)

Notation

5-277 © 2005 No Magic, Inc.

Page 272: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

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. States are defined by the concepts of duration and stability. An object may not be in an unknown or undefined state. A state may have three compartments to provide more information about that state:

• The first compartment - name compartment - contains state name, for example: running, going up.

• The second compartment - activity compartment - events and actions of the state are listed.

• The third compartment - optional state variable compartment - attributes can be listed and assigned. The attributes are those of the class displayed by the state diagram.

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Define the selected state in the Composite State Specification dialog box.

Composite State Specification dialog boxT

Figure 114 -- Composite State Specification dialog box

© 2005 No Magic, Inc 5-278

Page 273: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

Detail Contains the state actions, events and buttons for editing list.

Actions group box

Entry The type of the entry action.

Edit The Action Specification dialog box appears.

Remove Remove the entry action.

Exit The type of the exit action

Edit The Action Specification dialog box appears.

Remove Remove the exit action.

Do Activity The type of the do activity action

Edit The Action Specification dialog box appears.

Remove Remove the do activity action.

Deferrable Events group box

Name The name of the event

Edit The Event Specification dialog box appears. Edit the selected event.

Add Add a new event to the state. The Event Specification dialog box appears.

Remove Remove the selected event from the state.

Internal TransitionsA set of transitions that, if triggered, occur without exiting or entering the state. This means that the entry or exit condition of the State will not be invoked.

Name The name of the internal transition.

Edit The Transition Specification dialog box appears. Edit the transition.

Add The Transition Specification dialog box appears. Define a new transition.

Remove Remove the selected transition from the state.

Attributes The list of state attributes and buttons for editing them. NOTE Only the name of the attribute can be edited.

Name The name of the attribute.

Edit Edit the name of the attribute in the Type Name screen.

Add Type the name of the new state attribute in the Type Name screen.

Remove Remove the selected attribute from the state.

Inner States The list of inner states and buttons for editing them.

Name The type and name of the assigned composite, final, concurrent, call, action, or submachine state.

Edit The corresponding (state, concurrent state, submachine state, action state, call state, or final state) specification dialog box appears. Edit the selected inner state in the dialog box.

5-279 © 2005 No Magic, Inc.

Page 274: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

To control a list of actions and attributes that are visible in a diagram for the class view

From the state shortcut menu, choose Edit Compartment. The Compartment Edit dialog box appears. In the Actions or Attributes tabs, move elements you want to hide or see on a diagram between All and Selected lists.

To suppress/unsuppress actions compartment

In the state shortcut menu, select/clear the Suppress Actions check box.

To suppress/unsuppress attributes compartment

In the state shortcut menu, select/clear the Suppress Attributes check box.

To insert a new attribute directly in the state

• Choose Insert New Attribute from the state shortcut menu.

• Open the Composite State Specification dialog box, Attributes tab and click the Add button. Specify attribute name in the Type Name dialog box.

• Select a state and press CTRL+ALT+A shortcut keys.

Any state may have its own internal states, also known as substates. Substates describe what occurs inside a particular state of an object. A composite state is either a network of disjointed substates or a set of concurrent substates.

The start and end states may also be internal states. All internal states of a composite state can be deemed as a separate state diagram.

To open the State Specification dialog box

1 Open the Composite State Specification dialog box, Inner States tab.2 Click the Add or Edit (if available) button. Select State from the appeared list.

Add Select the inner state you want add. The corresponding (state, concurrent state, submachine state, action state, call state, or final state) specification dialog box appears. Define the selected mod in the dialog box.

Remove Remove the selected inner state from the state.

Tab name Box name Function

© 2005 No Magic, Inc 5-280

Page 275: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

State Specification dialog box

The description of this dialog box is the same as Final State Specification dialog box.

Figure 115 -- State Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

Detail Contains the state actions, events and buttons for editing list.

Actions group box

Entry The type of the entry action.

Edit The Action Specification dialog box appears.

Remove Remove the entry action.

Exit The type of the exit action

Edit The Action Specification dialog box appears.

Remove Remove the exit action.

Do Activity The type of the do activity action

Edit The Action Specification dialog box appears.

Remove Remove the do activity action.

Deferrable Events group box

Name The name of the event

Edit The Event Specification dialog box appears. Edit the selected event.

Add Add a new event to the state. The Event Specification dialog box appears.

Remove Remove the selected event from the state.

5-281 © 2005 No Magic, Inc.

Page 276: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

Concurrent s ta te

A concurrent state (also known as a concurrent composite state) is divided into two or more substates (called regions). It is a state that contains other state vertices (states, pseudostates, etc.). Naturally, any substate of a concurrent state may also be a composite state of either type. Any state enclosed within a composite state is called a substate of that concurrent state.

An expansion of a state shows its internal state machine structure. A concurrent state is shown as a simple state with the regions that are separated by dashed lines. You may enclose all kinds of states in a concurrent state’s regions.

For more general information about working with symbols see Chapter 4, "Diagrams Basics."

Define the selected concurrent state in the Composite State Specification dialog box. For a detailed description of this dialog box, see Section “Composite State Specification dialog boxT” on page 5-278.

For more information on working with states, see Section “State” on page 5-278.

To add a new region to the concurrent state

Choose Add New Region from the concurrent state shortcut menu.

To remove any region from the concurrent state (at least two regions have to be left)

Choose Remove Region from the concurrent state shortcut menu and choose a region you want to remove.

Submachine

A submachine state represents the invocation of a state machine defined elsewhere.

Internal TransitionsA set of transitions that, if triggered, occur without exiting or entering the state. This means that the entry or exit condition of the State will not be invoked.

Name The name of the internal transition.

Edit The Transition Specification dialog box appears. Edit the transition.

Add The Transition Specification dialog box appears. Define a new transition.

Remove Remove the selected transition from the state.

Tab name Box name Function

© 2005 No Magic, Inc 5-282

Page 277: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

The submachine state is depicted as a normal state with the appropriate “include” declaration within its internal transitions compartment. As an option, the submachine state may contain one or more stub states, which represent already created states.

For more general information about working with symbols see, Chapter 4, "Diagrams Basics."

Define the selected submachine in the Submachine State Specification dialog box.

Submachine State Specification dialog box

Figure 116 -- Submachine State Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

General Include Select the state machine or activity diagram to include in the submachine.

DetailContains the submachine actions, events and buttons for editing list.

Actions group box

Entry The type of the entry action.

Edit The Action Specification dialog box appears.

Remove Remove the entry action.

Exit The type of the exit action

Edit The Action Specification dialog box appears.

Remove Remove the exit action.

Do Activity The type of the do activity action

Edit The Action Specification dialog box appears.

Remove Remove the do activity action.

Deferrable Events group box

Name The name of the event

5-283 © 2005 No Magic, Inc.

Page 278: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

For more information on submachine states see, Section “State” on page 5-278

Define a stub state in the Stub State Specification dialog box. .

To include a state machine or activity graph into a submachine state

1 Double-click the submachine state or choose Specification from the submachine state shortcut menu. The Submachine State Specification dialog box appears.

2 Choose a state machine or activity graph you wish to include in the submachine from the Include drop-down box.

Edit The Event Specification dialog box appears. Edit the selected event.

Add Add a new event to the object flow submachine. The Event Specification dialog box appears.

Remove Remove the selected event from the object flow submachine.

Internal TransitionsA set of transitions that, if triggered, occur without exiting or entering the submachine. This means that the entry or exit condition of the Submachine will not be invoked.

Name The name of the internal transition.

Edit The Transition Specification dialog box appears. Edit the transition.

Add The Transition Specification dialog box appears. Define a new transition.

Remove Remove the selected transition from the submachine.

Attributes The list of submachine attributes and buttons for editing them. NOTE Only the name of the attribute can be edited.

Name The name of the attribute.

Edit Edit the name of the attribute in the Type Name screen.

Add Type the name of the new submachine attribute in the Type Name screen.

Remove Remove the selected attribute from the submachine.

Inner States Only the stub state can be added to the submachine state.

Name The type and name of the assigned stub state.

Edit The Stub State Specification dialog box appears. Edit the stub state.

Add The Stub State Specification dialog box appears. Define the stub state.

Remove Remove the selected stub state from the submachine.

Tab name Box name Function

© 2005 No Magic, Inc 5-284

Page 279: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

Synch s ta te

A synch state is a special state that enables synchronization of control between two concurrent regions in a state machine.

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Define the selected synch state in the Synch State Specification dialog box.

State Vertex Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

NOTE: The name of the dialog box changes according state vertex type.

To set the bound number for the synch state

1 Double-click the synch state or choose Specification from the shape shortcut menu. The Synch State Specification dialog box appears.

2 Choose Specified from the Bound drop-down box. Type the numeric value in the text box. The number must be not less than 0 and not greater than 2147483647.

Tab name Box name Function

General Set general information about the state vertex NOTE Dynamic choice point, junction point, stub state, history state, synch state, initial state are specified in the State Vertex Specification dialog box.

Pseudo KindNOTE Available for dynamic choice point, junction point, history state, initial state.

Dynamic choice point: choice Junction point: junction History state: set history state as deep history or shallow history state. Initial state: initial.

Reference NOTE Available for stub state.

The Select Model Element dialog box appears. Select the model element you wish the stub state will represent. The name of the assigned model element appears in the text box.

Bound NOTE Available for synch state.

Unspecified: The * is shown in the synch state. Specified: Type the numeric value from 0 to 2147483647 in the text box. By default the number is 0.

5-285 © 2005 No Magic, Inc.

Page 280: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

PseudoStates

A pseudostate is an abstraction that encompasses different types of transient vertices in the state machine graph. They are typically used, to connect multiple transitions into more complex state transitions paths.

Specify pseudostates in the Pseudo State Specification dialog box.

NOTE Any transition from the pseudostate does not contain a trigger event.

I N I T I A L S T A T E

Every object is in some particular state as soon as it is created, so it is useful to explicitly show that state. A solid filled circle represents the initial state of an object. There can only be one initial state for an object. An initial state denotes the starting place for a transition, the target of which is a composite state.

F I N A L S T A T E

To represent the object’s destruction, use the final state symbol (a circle surrounding a smaller solid circle). The final state is optional in the diagram because there is a system that runs without interruption after the start of the activities. Also, there can be several final states in the same state diagram, denoting that the object’s life may finish depending to several conditions.

H I S T O R Y S T A T E

A history state serves for internal state memorizing, indicating that the enclosing composite state remembers its previously active substate after it exits.

A deep history state is used to remember a state that has been nested at some depth within a composite state.

A shallow history state is used to remember a state that is at the same nesting depth as the history state itself.

Figure 117 -- History State

History state can be a deep history state (with a letter H∗) or of shallow history state (with a letter H). By default deep history shape is drawn.

To define a history state

Select/clear the Deep History check box from the history state shortcut menu.

© 2005 No Magic, Inc 5-286

Page 281: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

J U N C T I O N A N D D Y N A M I C C H O I C E P O I N T S

Junction point is used for joining and splitting transition paths. Regardless of whether the junction point was reached from state State 0 or from state State, the outgoing paths are the same for both cases. If the state machine in this example is in state State1 and b is less than 0 when event e1 occurs, the outgoing transition will be taken only if one of the three downstream guards is true. Thus, if a is equal to 6 at that point, no transition will be triggered.

In the dynamic choice point, a decision on which branch to take is only made after the transition from State1 is taken and the choice point is reached. Note that the action associated with that incoming transition computes a new value. This new value can then be used to determine the outgoing transition to be taken.

Act ions in S tate and Act iv i t y d iagrams

The action label identifies the circumstances under which the action specified by the action expression will be invoked.

For more information on defining actions, see Section “Actions” on page 5-260. Specify actions in Action Specification dialog box.

The general format for the list of actions: action-label / action-expression.

To define an action label

1 Double-click the state, or choose Specification from the state shortcut menu. The Composite State Specification dialog box appears.

2 Click the Detail tab.3 Select an Entry, Exit or Do Activity action label in the Actions group box.

• To add or edit an action label, click the Edit button. The Action Specification box appears. Specify an action.

• To remove an action label, click the Remove button.

5-287 © 2005 No Magic, Inc.

Page 282: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

A C T I O N L A B E L S

Events

An event is a specification of a type of observable occurrence. The occurrence that generates an event instance is assumed to take place at an instant in time with no duration.

Define the selected event in the Event Specification dialog box.

To open the Event Specification dialog box

• Open the Composite State Specification, Action State Specification, Submachine State Specification, or Subactivity State Specification dialog box. In the Detail tab, click the Edit or Add button in the Deferrable Events group box.

• In the Transition Specification dialog box, click the Edit button in Trigger group box.Event Specification dialog box

Figure 118 -- Event Specification dialog box

Action name Description

Entry An action, specified by the corresponding action expression, which is performed upon entry to the state (entry action.)

Exit An action, specified by the corresponding action expression, that is performed upon exit from the state (exit action)

Do activity An ongoing activity that is performed as long as the modeled element is in the state, or until the computation specified by the action expression is completed (the latter may result in a completion event being generated).

© 2005 No Magic, Inc 5-288

Page 283: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

NOTE: The name of the dialog box changes according to event type

To define an event in the Event Specification dialog box

• In the Composite State Specification, Action State Specification, Submachine State Specification, or Subactivity State Specification dialog box, Detail tab click the Edit button in the Actions group box.

• In the Transition Specification dialog box, click the Edit button in Trigger group box.

Tab name Box Function

General Set general information about the event

Type Define the type of event: signal, call, time, or change.

Expression

NOTE The Expression text box is available for time and change events

Type an expression for an event.

Operation

NOTE The Operation text box is available for a call event.

Choose the defined operation. You may choose operation from the list when a diagram is drawn for a classifier, which contains operations.

ParametersA parameter is an unbound variable that can be changed, passed, or returned.

Name Shows the parameter’s name.

Type Shows the parameter’s type. It can be a classifier or a data type.

Default value An expression whose evaluation yields a value to be used when no argument (operation) is supplied for the parameter.

Direction kind Specifies what kind of a parameter is required: • in - an input parameter (may not be modified).• out - an output parameter (can be modified to

communicate information to the caller).• inOut - an input parameter that can be modified.

Up Move the selected item up the list

Down Move the selected item down the list.

Edit The Parameter Specification dialog box appears.

Add The Parameter Specification dialog box appears.

Remove Removes the parameter.

5-289 © 2005 No Magic, Inc.

Page 284: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

E V E N T T Y P E S

In ternal t rans i t ions

In all other cases, the action label identifies the event that triggers the corresponding action expression. These events are called internal transitions and are semantically equivalent to self transitions except that the state is not exited or re-entered. This means that the corresponding exit and entry actions are not performed.

For more information on defining transitions, see Section “Transition” on page 5-291.

Specify transition in the Transition Specification dialog box. For a detailed description of this dialog box, see Section “Transition Specification dialog box” on page 5-291.

The general format for the list item of an internal transition is:

event-name ( comma-separated-parameter-list ) [ guard-condition] / action-expression

To define an internal transition

1 Double-click the state or choose Specification from the state shortcut menu. The Composite State Specification dialog box appears.

2 Click the Internal Transitions tab.3 Click the Add or Edit button. The Transition Specification dialog box appears.

Specify an internal transition.• To remove an internal transition, click the Remove button.

Name Description

Signal A signal event represents the reception of a particular (asynchronous) signal. Signal Event is a child of Event.

Call A call event represents the reception of a request to synchronously invoke a specific operation. (Note that a call event instance is distinct from the call action that caused it.) The expected result is the execution of a sequence of actions, which characterize the operation behavior at a particular state. Operation designates the operation whose invocation raised the call event.

Time A Time Event models the expiration of a specific deadline. Note that the time of occurrence of a time event instance (i.e., the expiration of the deadline) is the same as the time of its reception. Expression specifies the corresponding time deadline: keyword after, followed by an expression.

Change A change event models an event that occurs when an explicit boolean expression becomes true as a result of a change in value of one or more attributes or associations. A change event is raised implicitly and is not the result of some explicit change event action. Expression specifies the change event: keyword when followed by an expression.

© 2005 No Magic, Inc 5-290

Page 285: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

Trans i t ion

Drawing an arrow from one state to other denotes that object’s change from one state to another when a specified event occurs (trigger event) and specified guard conditions are satisfied. A simple transition has a single source state and a single target state. A complex transition has more that one target and source states. A transition indicates the way an object in a state responds to the occurrence of an event.

The event may have parameters. These are accessible by the actions specified on the transition as well as in the corresponding exit and entry actions associated with the source and target states, respectively. Events are processed one at a time.

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Define the selected transition in the Transition Specification dialog box.

Transition Specification dialog box

The Transition Specification dialog box defines transition or trigger link..

5-291 © 2005 No Magic, Inc.

Page 286: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

Figure 119 -- Transition Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

The difference between a transition in state diagrams from a transition in activity diagrams lies in the event. A transition is often triggered by some specified event in state diagrams, but a transition in activity diagrams has no defined event. An exception is made for transitions that go from the start point to the first activity. They may have an attached event that’s defined when the first activity starts.

To edit a source/target state of the transition path

1 Double-click the transition path or choose Specification from the path’s shortcut menu. The Transition Specification dialog box appears.

2 Click the Source/Target “...” button.

Tab name Box name Function

GeneralSet general information about the transition

Target The name of the model element (state, submachine, action state, concurrent state, subactivity, other), which is the target of the transition.

‘…’ The corresponding Composite State Specification, State Specification, Submachine State, State Specification, Action State Specification, Subactivity Specification, or State Vertex Specification dialog box appears, which is the target of the transition.

Source The name of the model element (state, submachine, action state, concurrent state), which is the source of the transition.

‘…’ The corresponding Composite State Specification, State Specification, Submachine State, State Specification, Action State Specification, Subactivity Specification, or State Vertex Specification dialog box appears, which is the source of the transition.

Trigger group box

Type The type of the event

Edit The Event Specification dialog box appears.

Remove Remove the trigger event.

Effect group box

Type The type of the effect action

Edit The Action Specification dialog box appears.

Remove Remove the effect action.

Guard group box

Expression The guard expression.

Edit The Guard Specification dialog box appears.

Remove Remove the guard expression.

© 2005 No Magic, Inc 5-292

Page 287: MagicDraw UserManual

U M L D I A G R A M SState Diagram

5

3 The Composite State Specification dialog box appears in a state diagram appears or Action State Specification dialog box in an activity diagram appears.

To specify a trigger event for a transition

Trigger specifies the event that fires the transition. There can be at most one trigger per transition.

1 Double-click the transition path or choose Specification from the path’s shortcut menu. The Transition Specification dialog box appears.

2 In the Trigger group box, click the Edit button. (To remove a trigger event, click the Remove button.)

3 The Event Specification dialog box appears. See Section “Events” on page 5-288.

NOTE Trigger event box is not available when a transition source is an initial state, junction/dynamic choice point, vertical/horizontal synchronization bar, or history state.

To specify an effect action for a transition

Specifies an optional action to be performed when the transition fires.

1 Double-click the transition path or choose Specification from the path’s shortcut menu. The Transition Specification dialog box appears.

2 In the Effect group box, click the Edit button. (To remove an effect action, click the Remove button.)

3 The Action Specification dialog box appears. See Section “Actions in State and Activity diagrams” on page 5-287.

To specify a guard expression (condition) for a transition

A guard expression provides a fine-grained control over the firing of the transition. It is evaluated at the time the event is dispatched. There can be at most one guard per transition.

1 Double-click the transition path or choose Specification from the path shortcut menu. The Transition Specification dialog box appears.

2 In the Guard group box, click the Edit button. (To remove a guard expression, click the Remove button.)

3 The Guard Specification dialog box appears. 4 Type an expression in the Expression text box.

G U A R D S P E C I F I C A T I O N D I A L O G B O X

A guard is a boolean expression that is attached to a transition as a fine-grained control over its firing. The guard is evaluated when an event instance is dispatched by the state machine. If the guard is true at that time, the transition is enabled, otherwise, it is disabled.

5-293 © 2005 No Magic, Inc.

Page 288: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

To open the Guard Specification dialog box

1 Choose Specification from the transition path’s shortcut menu, or double-click the transition path. The Transition Specification dialog box appears.

2 Click the Edit button in the Guard group box.

Figure 120 -- Guard Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

ACTIVITY DIAGRAMAn activity graph is a variation of a state machine. In a state machine, the states represent the performance of actions or subactivities, while the transitions are triggered by the completion of the actions or subactivities. It represents a state machine of a procedure itself. The entire activity diagram is attached (through the model) to a class, such as a use

Tab name Box name Function

General Set general information about the guard

Name Type the guard’ name. If you enter the name of the already existing guard, an error message box appears. NOTE The name of the guard is not visible on the diagram.

Expression Type the guard expression.

Check OCL Syntax

Checks Object Constraint Language (OCL) syntax if guard is described using OCL.

© 2005 No Magic, Inc 5-294

Page 289: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

case, or to a package, or to the implementation of an operation. The purpose of this diagram is to focus on flows driven by internal processing (as opposed to external events). You should use activity diagrams in situations where all or most of the events represent the completion of internally-generated actions (that is, procedural flow of control). You should use ordinary state diagrams in situations where asynchronous events occur. An activity diagram is a variant of a state diagram. Organized according to actions, activity diagrams are mainly targeted towards the representation of the internal behavior of a method (the implementation of an operation) or a use case.

Though activity diagrams are often classified alongside interaction diagrams, they actually focus on work performed by a system instead of an object interaction. An activity diagram captures actions 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, activities, and events systematically (i.e., state changes and external events have less importance inside the method). It is therefore beneficial to have a simplified representation for directly displaying activities.

An activity diagram is a convenient way to describe complex algorithms, parallel operations, and business processes. Together with the collaboration and sequence diagrams, they are used to relate use cases.

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 distinguish states, activities, and events systematically (i.e. state changes and external events aren’t so important inside the method). It is therefore beneficial to have a simplified representation for directly displaying activities.

An activity diagram is a convenient way to describe complex algorithms, parallel operations, and business processes. They are used to relate use cases together with the collaboration and sequence diagrams.

5-295 © 2005 No Magic, Inc.

Page 290: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

Act iv i t y Diagram elements

Element Button (hot key)

Notation

Action StateA state with an internal action and at least one outgoing transition involving the implicit event of completing the internal action (there can be several such transitions if they have guard conditions).

(A)

StateA condition or situation during the life of an object or an interaction during which it satisfies some condition, performs some action, or waits for some event.

(S)

Call StateA call state is an action state that has exactly one call action as its entry action. It is useful in object flow modeling to reduce notational ambiguity over which action is taking input or providing output.

(K)

Concurrent StateA state containing other state vertices (states, pseudostates, etc.). It is useful when a given object contains sets of independent behaviors.

(C)

Submachine StateRepresents the invocation of a state machine defined elsewhere. (M)

© 2005 No Magic, Inc 5-296

Page 291: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

Subactivity State Represents an activity graph. Entering a subactivity state represents, entering the activity graph, which is “nested” in the subactivity state.

(Q)

Interaction UseReference to Collaboration, Sequence and Time diagrams can be created.

(SHIFT+T)

Initial StateDenotes an initial state when an object is created. (I)

Final StateDenotes an object’s destruction or the end of collaboration. (F)

Flow FinalFinal node that terminates a flow. Destroys all tokens that arrive at it. It has no effect on other flows in the activity.

(SHIFT+F)

TransitionA relationship between two states indicating that an object in the first state will enter the second state and perform certain specified actions when a specified event occurs, once specified conditions are satisfied.

(T)

Exception HandlerAn element that specifies a body to execute in case the specified exceptionoccurs during the execution of the protected node.

Element Button (hot key)

Notation

5-297 © 2005 No Magic, Inc.

Page 292: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

Horizontal Synchronization BarHelps to control parallel actions. (B)

Vertical Synchronization BarHelps to control parallel actions. (V)

Input PinA pin that holds input values to be consumed by an action. (SHIFT

+I)

Output PinA pin that holds output values produced by an action. (SHIFT

+O)

Decision PointIs used to model conditional branching.

(D)

Signal Receipt

(R)

Signal Sending

(G)

Element Button (hot key)

Notation

© 2005 No Magic, Inc 5-298

Page 293: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

Act ion s ta te

Action state is sometimes called an activity. An action state is a shorthand for a state with an entry action, plus at least one outgoing transition involving the implicit event of completing the entry action. There can be several such transitions if they have guard conditions.

An action state is performed to produce a result, to describe an implementation of an operation. The transition triggers as soon as all activities in the action state are performed.

An action state is shown as a shape with a straight top and bottom and with convex arcs on the two sides. The action-expression is placed in the symbol.

For more general information about working with symbols see, Chapter 4, "Diagrams Basics."

Define the selected action state in the Action State Specification dialog box.

SwimlanesSwimlanes are used to organize responsibility for actions and subactivities according to class, dividing an activity diagram.

(P)

Object Flow StateObjects that are input to or output from an action.

(O)

Central BufferIt is an object node for managing flows from multiple sources and destinations.

(SHIFT+B)

Data StoreIt is a central buffer node for non-transient information. (SHIFT

+D)

Element Button (hot key)

Notation

5-299 © 2005 No Magic, Inc.

Page 294: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

Action State Specification dialog box

Figure 121 -- Actions State Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box Function

GeneralSet general information about an action state

Multiplicity Choose or type the multiplicity value for an action state. The Multiplicity drop-down box is activated only when an action state is set as dynamic.

Arguments Type an argument expression for an action state. The Arguments box is activated only when an action state is set as dynamic.

Dynamic Select the Dynamic check box and set an action state as dynamic.

Detail Define an entry action and events.

Actions: Entry Shows the type of an entry action.

Edit The Action Specification dialog box appears. Define an action state.

Remove Remove the defined action.

Deferrable Events: Name

Shows the list of the defined events.

Edit The Event Specification dialog box appears. Edit the event.

© 2005 No Magic, Inc 5-300

Page 295: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

To define an action state as dynamic

Depending on runtime information, the Dynamic attribute of an action state determines whether multiple invocations of state might be executed concurrently.

1 Double click an action state or choose Specification from the shape shortcut menu. The Action State Specification dialog box appears.

2 Select the Dynamic check box, found on the bottom of the dialog box.

To set multiplicity for a dynamic action state

A multiplicity in an action state indicates the number of parallel executions of the actions of state. If the dynamic concurrency of an action state is not always exactly one, its multiplicity is shown in the upper left corner of the state.

1 Double-click an action state, or choose Specification from the shape shortcut menu. The Action State Specification dialog box appears.

2 Set the multiplicity value in the Multiplicity drop-down list box.NOTE Multiplicity is activated only when an action state is defined as dynamic.

To define arguments for a dynamic action state

An Argument expression determines the number of parallel executions of the actions of the state at runtime. The value must be a set of lists of objects, each list serving as arguments for one execution.

1 Double click an action state, or choose Specification from the shape shortcut menu. The Action State Specification dialog box appears.

2 Type an argument in the Arguments text box.

To define an entry action for an action state

1 Double-click an action state, or choose Specification from the shape shortcut menu. The Action State Specification dialog box appears.

2 Click the Detail tab.3 In the Actions group:

• To add or edit an action label, click the entry Edit button. The Action Specification box appears. Specify an action.

• To remove an action label, click the Remove button.

NOTE For more information defining actions, see Section “Actions” on page 5-260 and Section “Actions in State and Activity diagrams” on page 5-287.

Add The Event Specification dialog box appears. Define an event.

Remove Remove the defined event

Tab name Box Function

5-301 © 2005 No Magic, Inc.

Page 296: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

To define events for an action state

See Section “Events” on page 5-288.

Cal l S tate

A call state is an action state that has exactly one call action as its entry action. It is useful in object flow modeling to reduce notational ambiguity over which action is taking input or providing output.

To draw a call state and select an operation it invokes

1 Draw a class. 2 Add an operation to the class. 3 In the Browser, open class shortcut menu and from the State/Activity Diagram,

choose Assign. 4 In the appeared Assign State/Activity Diagram dialog box, click New and select

State Diagram or Activity.5 Type State/Activity diagram name and close all dialogs by clicking OK.6 In the created State/Activity diagram, draw a call state and open the Call State

Specification dialog box, the Detail tab. 7 Click the Edit button in the Actions group box. The Call Action Specification

dialog box appears. 8 From the Operation drop-down list box, select the desired operation. 9 Click OK in all previous dialog boxes.

Operation that a call state invokes will appear on the call state shape.

Subact iv i t y s ta te

A subactivity state is represented in the same way as an action state, with the addition of an icon in the lower right corner depicting a nested activity diagram. On the subactivity, the name of the entered activity graph is shown. A subactivity state represents an activity graph. Entering a subactivity state represents entering the activity graph, which is “nested” in the subactivity state. The subactivity state is not exited until the final state of the nested graph is reached, or when trigger events occur on transitions coming out of the subactivity state. Since states in activity graphs do not normally have trigger events, subactivity states are normally exited when their nested graph is finished. A single activity graph can be invoked by many subactivity states.

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

© 2005 No Magic, Inc 5-302

Page 297: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

Define the selected subactivity state in the Subactivity State Specification dialog box.

To open the Subactivity State Specification dialog box

Choose Specification from the subactivity state shortcut menu, or double-click the subactivity state shape.

Subactivity State Specification dialog box

Figure 122 -- Subactivity State Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

GeneralSet general information about the subactivity state

Include Select the already created state machine or activity diagram to include in the subactivity state.

5-303 © 2005 No Magic, Inc.

Page 298: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

Flow Final

It is a final node that terminates a flow. Destroys all tokens that arrive at it. It has no effect on other flows in the activity.

Multiplicity

NOTE Is available only when a subactivity state is set as dynamic.

Select the multiplicity value from the list or type it directly in the text box. A multiplicity limiting the number of parallel executions of the actions of state.

Arguments

NOTE Is available only when a subactivity state is set as dynamic.

Type an expression that determines the number of parallel executions of the submachine of the state. The value must be a set of lists of objects, each list serving as arguments for one execution.

Dynamic Specifies whether the state's submachine might be executed concurrently.

DetailContains the subactivity state actions, events and buttons for editing list.

Actions group box

Entry The type of the entry action.

Edit The Action Specification dialog box appears.

Remove Remove the entry action.

Exit The type of the exit action

Edit The Action Specification dialog box appears.

Remove Remove the exit action.

Do Activity The type of the do activity action

Edit The Action Specification dialog box appears.

Remove Remove the do activity action.

Deferrable Events group box

Name The name of the event

Edit The Event Specification dialog box appears. Edit the selected event.

Add Add a new event to the subactivity state. The Event Specification dialog box appears.

Remove Remove the selected event from the subactivity state.

Tab name Box name Function

© 2005 No Magic, Inc 5-304

Page 299: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

See example for flow final element notation in MagicDraw project.

For more information defining pseudo states, see Section “PseudoStates” on page 5-286.

Decis ion Point

Decisions are made using guard conditions. They help protect transitions that depend on a guarding condition. The symbol used for the decision is a large diamond, which may have one or more incoming transitions and two or more outgoing transitions.

A decision point in an activity diagram is used much like a dynamic choice or junction point in state diagrams. Decision points allows to separate and merge transition paths back together.

Object f low s ta te

Objects that are input to or output from an action are shown as object symbols. A dashed arrow is drawn from an action state to an output object, and a dashed arrow is drawn from an input object to an action state. The same object is the output of one action and the input of one or more subsequent actions. The control flow arrows (which are solid) must be omitted when the object flow arrows (which are dashed) supply a redundant constraint. To distinguish the various appearances of the same object, the state of the object at each point is placed in brackets and appended to the name of the object.

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Define the selected object flow state in the Object Flow State Specification dialog box.

5-305 © 2005 No Magic, Inc.

Page 300: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

Object Flow State Specification dialog box

Figure 123 -- Object Flow State Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

GeneralSet general information about the object flow state

Type The list of classifiers. Select a classifier you wish to assign to an object flow state shape. Click the ‘…’ button to open the corresponding classifier specification dialog box.

Assign StateNOTE The Assign State button is activated when the object flow state’s type is a classifier.

The Classifier in State Specification dialog box appears. Define a new classifier in state.

Synch State Makes an object flow state as a synch state.

Detail Contains the object flow state attributes list and buttons for editing attributes list.

Actions group box

Entry The type of the entry action.

Edit The Action Specification dialog box appears.

Remove Remove the entry action.

Exit The type of the exit action

© 2005 No Magic, Inc 5-306

Page 301: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

To open the Classifier in State Specification dialog box

1 Open the Object Flow State Specification dialog box.2 Set the type of the object flow state by choosing the classifier from the Type

drop-down list box. The Assign State button is activated and you may create a classifier in state.

3 Click the Assign State button.

Classifier in State Specification dialog box

Figure 124 -- Classifier in State Specification dialog box

Edit The Action Specification dialog box appears.

Remove Remove the exit action.

Do Activity The type of the do activity action

Edit The Action Specification dialog box appears.

Remove Remove the do activity action.

Deferrable Events group box

Name The name of the event

Edit The Event Specification dialog box appears. Edit the selected event.

Add Add a new event to the object flow state. The Event Specification dialog box appears.

Remove Remove the selected event from the object flow state.

Tab name Box name Function

5-307 © 2005 No Magic, Inc.

Page 302: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

To set a classifier to an object flow state

1 Double-click the object flow state or choose Specification from the shape shortcut menu. The Object Flow State Specification dialog box appears.

2 Choose a classifier you wish to assign to an object flow from the Type drop-down box.

To assign a state to an object flow state

1 Click the Assign State button in the Object Flow State Specification dialog box. The Classifier in State Specification dialog box appears.

2 Type the name of the classifier in state (optional) in the Name text box.NOTE The Assign State button is activated only when a classifier is assigned to an object

flow state.

S ignal sending / receipt shapes

S I G N A L S E N D I N G

The sending of a signal is shown as a convex pentagon that looks like a rectangle with a triangular point on one end (it can be on either end). The signature of the signal is shown inside the symbol. (In MagicDraw, a signal signature is defined through uninterpreted transition event action.) An unlabeled transition arrow is drawn from the previous action state to the pentagon and another unlabeled transition arrow is drawn from the pentagon to the next action state. As an option, a dashed arrow can be drawn from the point on the pentagon to an object symbol to show the receiver of the signal.

To set an action to a signal sending shape

1 Double-click the signal sending shape or choose Specification from the shape shortcut menu. The Transition Specification dialog box of the incoming transition path appears.

Tab name Box Function

General Set general information about the classifier in state

States

Name Shows the name of the assigned state.

Type The type of the assigned state.

Owner The name of the owner of the assigned state.

Assign The Select Model Element dialog box appears. Select a state you wish to assign.

Unassign Unassign the selected state from the list.

© 2005 No Magic, Inc 5-308

Page 303: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

NOTE Specify a signal sending shape in the incoming to the shape transition’s specification.

2 Click the Edit button in the Effect group box.3 The Action Specification dialog box appears. Define an action. More details

about defining actions see Section “Actions” on page 5-260.4 Type an action’s name directly on the signal sending shape.

S I G N A L R E C E I P T

The receipt of a signal can be shown as a concave pentagon that looks like a rectangle with a triangular notch on one end (either end). The signature of the signal is shown inside the symbol. An unlabeled transition arrow is drawn from the previous action state to the pentagon and another unlabeled transition arrow is drawn from the pentagon to the next action state. A dashed arrow can be drawn from an object symbol to the notch on the pentagon to show the sender of the signal; this is optional.

To set a trigger event to a signal receipt shape

1 Double-click the signal receipt shape or choose Specification from the shape shortcut menu. The Transition Specification dialog box of the outgoing transition path appears.

NOTE Specify a signal receipt shape in the outcoming from the shape transition’s specification.

2 Click the Edit button in the Trigger group box.3 The Event Specification dialog box appears. Define an event. More details

about defining events, see .• Type an event’s name directly on the signal receipt shape.

Swimlanes

Actions and subactivities can be organized into swimlanes in activity diagrams. Swimlanes are used to organize responsibility for actions and subactivities according to class. They often correspond to organizational units in a business model.

An activity diagram can be divided visually into “swimlanes,” each separated from neighboring swimlanes by vertical or horizontal solid lines on both sides. Each swimlane represents 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 might indicate some affinity. Each action is assigned to one swimlane. Transitions may cross lanes. There is no significance to the routing of a transition path.

5-309 © 2005 No Magic, Inc.

Page 304: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

Horizontal and vertical swimlanes are supported:

Also multidimentional swimlanes can be created (from the swimlane shortcut menu, choose the Insert Vertical Swimlane or Insert Horizontal Swimlane commands):

To open the Partition Specification dialog box

Choose Specification from the partition (swimlane) shortcut menu, or double-click the partition line.

© 2005 No Magic, Inc 5-310

Page 305: MagicDraw UserManual

U M L D I A G R A M SAct iv i ty Diagram

5

Partition Specification dialog box

Figure 125 -- Partition Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

To draw a swimlane on the diagram

Click the Swimlane button on the diagram toolbar and click the diagram.

To set a name for a swimlane

1 Double-click the swimlane line or choose Specification from the line shortcut menu.

2 The Partition Specification dialog box appears. Type a name in the Name box.• Type the name directly on the Diagram pane.

Tab name Box name Function

General Set general information about the partition

Diagram Name Shows the name of the activity diagram where the partition is placed.

Content Name The name of the element that contains the partition.

Type Element type.

Edit The selected model element Specification dialog box appears.

5-311 © 2005 No Magic, Inc.

Page 306: MagicDraw UserManual

U M L D I A G R A M SImplementat ion Diagrams

5

IMPLEMENTATION DIAGRAMSImplementation diagrams help the developer describe the logical software structure inside a computer or across a large distributed system. Implementation diagrams show aspects of physical implementation, including the structure of components and the run-time deployment system.

They come in two forms:

1 Component diagrams show the structure of components, including the classifiers that specify them and the artifacts that implement them; and

2 Deployment diagrams show the structure of the nodes on which the components are deployed.

These diagrams can also be applied in a broader way to business modeling where the components represent business procedures and artifacts, and the deployment nodes represent the organization units and resources (human and otherwise) of the business.

Component d iagram overv iew

A component diagram represents a physical structure of a code (as opposed to the class diagram, which portrays the logical structure) in terms of code components and their relationships within the implementation environment. A component can be a source code component, a binary component, or an executable component.

A component contains information about the logical class or classes that it implements, thus creating a mapping from a logical view to a component view. Dependencies between the components are shown, making it easy to analyze how a change in one component affects the others. Components may also be shown with any of the interfaces that they expose. Components, as with almost any other model element, can be grouped into packages, much like classes or use cases.

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, components are used for file-class mapping during code generation, reverse engineering, and round-trip engineering operations.

Deployment d iagram overv iew

Deployment diagrams show the physical layout of the various hardware components (nodes) 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 system topology. Inside nodes, the executable components and objects are

© 2005 No Magic, Inc 5-312

Page 307: MagicDraw UserManual

U M L D I A G R A M SImplementat ion Diagrams

5

located in a way that shows where the software units are residing and on which nodes they are executed. You may also show dependencies between the components.

5-313 © 2005 No Magic, Inc.

Page 308: MagicDraw UserManual

U M L D I A G R A M SImplementat ion Diagrams

5

Implementat ion Diagram elements

Element Button (hot key)

Notation

ComponentA collection of classes (or it might be one class.) Usually a component stands for a file.

(K)

Component Instance

(A)

Port

(SHIFT+F11)

NodeA physical object (devices.)

(O)

Node Execution EnvironmentElement is used for indicating that node is execution environment.

Node DeviceA physical computational resource with processing capability upon which artifacts may be deployed for execution.

© 2005 No Magic, Inc 5-314

Page 309: MagicDraw UserManual

U M L D I A G R A M SImplementat ion Diagrams

5

Node Instance

(T)

Node Instance Execution EnvironmentElement is used for indicating that node is execution environment.

Node Instance Device

PackageA group of classes and other model elements.

(P)

InterfaceAll functionality implemented by a particular component. (F)

Class

(C)

Element Button (hot key)

Notation

5-315 © 2005 No Magic, Inc.

Page 310: MagicDraw UserManual

U M L D I A G R A M SImplementat ion Diagrams

5

ArtifactAn artifact represents a physical piece of information that is used or produced by a software development process. Examples of Artifacts include models, source files, scripts, and binary executable files. An Artifact may constitute the implementation of a deployable component.

(B)

Artifact Deployment SpecIt indicates set of properties that define how a component should be deployed.

InstanceObjectA particular instance of a classifier. It has a unique name, state, and classifier as the type of identifier.

(I)

(SHIFT+O)

Instance Deployment Spec

Association

(S)

LinkA relationship between specification element and implementation element.

(L)

Element Button (hot key)

Notation

© 2005 No Magic, Inc 5-316

Page 311: MagicDraw UserManual

U M L D I A G R A M SImplementat ion Diagrams

5

Generalization

(G)

Realization

(E)

(R)

DependencyShows an undirectional relationship.

(D)

Assembly connectorCan be applied from port to component part and vce versa, between two ports, between two parts.

DelegationCan be applied between provided and required interfaces and between ports and components.

Element Button (hot key)

Notation

5-317 © 2005 No Magic, Inc.

Page 312: MagicDraw UserManual

U M L D I A G R A M SImplementat ion Diagrams

5

Components

A component represents all kinds of elements that pertain to piecing together software applications. They can be simple files, such as DLLs or executables.

According to UML 2.0, now there is possibility to list component properties. The following compartment are available for component:

• Provided/required interfaces

• Realizations

DeploymentConnects Artifact to Node on which it is deployed. Deployment relationship may have associated deployment specification. This relationship between <<deploy>> dependency and <<deployment spec>>. Artifact or Instance is mapped into dependency without arrow

ManifestationConnects physical implementation Component to abstract Component.

Element Button (hot key)

Notation

© 2005 No Magic, Inc 5-318

Page 313: MagicDraw UserManual

U M L D I A G R A M SImplementat ion Diagrams

5

• Artifacts

For more general information about working with symbols, see Chapter 4, "Diagrams Basics."

Define the selected component in the Component Specification dialog box.

Component Specification dialog box

Figure 126 -- Component Specification dialog box

5-319 © 2005 No Magic, Inc.

Page 314: MagicDraw UserManual

U M L D I A G R A M SImplementat ion Diagrams

5

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

General Set general information about the component

Visibility Set component visibility, which defines component access level.• Public. The component can be accessed by any outside

object.• Package. Any classifier declared in the same package

(or a nested subpackage, to any level) can use this component.

• Private. The component can be accessed only from inside the current component.

• Protected. Any descendant of the component can see the component.

Resident Elements Model elements that are assigned to the component.

Name The name of the assigned model element.

Type Assigned model element type.

Visibility The visibility of the assigned model element. By default [private].

Owner The name of the owner of the assigned model element.

Edit The Edit dialog box appears. Edit elements name and/or visibility.

Assign The Select Model Elements dialog box appears. Select model elements you wish to assign.

Unassign Remove the selected assigned model element from the component.

Deployment Location Contains the nodes list, where the current component participates

Name The name of the node, which contains the current component.

Type The type of the model element (usually node) where the current component participates.

Owner The name of the owner of the model element in which the current component participates.

Edit The Node Specification dialog box appears.

ImplementationContains the list of artifacts that implement component

Name The name of the artifact

Type Denotes the type of an element that implements component.

Owner The owner of the artifact.

Edit The Artifact Specification dialog box appears.

Inner Components The list of the components that contains the current component.

Name The name of the inner component.

Type Shows that the inner element is component.

Edit The Component Specification dialog box appears. Edit the component.

© 2005 No Magic, Inc 5-320

Page 315: MagicDraw UserManual

U M L D I A G R A M SImplementat ion Diagrams

5

To assign classes, interfaces, and/or collaborations to the component

1 Double-click the component shape or choose Specification from the component’s shortcut menu. The Component Specification dialog box appears.

2 Click the Resident Elements tab.3 Click the Assign button. The Select Model Element dialog box appears. Select

model elements you wish to assign to a component.4 A component can be represented as both types and instances. The type and

instance dichotomy is the same for a class and an object. Component types can be regarded as a class, while component instances are types of objects. The names for component instances are underlined.

Nodes

Any computer or device that is relevant to the implemented system can be shown as a node. A node is drawn as a three-dimensional cube with a name inside it. Devices in a system are typically represented with a stereotype that specifies the device type. Nodes can be represented as types and as instances.

A node is shown as a figure that looks like a 3-dimensional view of a cube.

For more general information about working with symbols see Chapter 4, "Diagrams Basics."

Define the selected node in the Node Specification dialog box.

Add The Component Specification dialog box appears. Define the component.

Remove Remove the selected component.

Tab name Box name Function

5-321 © 2005 No Magic, Inc.

Page 316: MagicDraw UserManual

U M L D I A G R A M SImplementat ion Diagrams

5

Node Specification dialog box

Figure 127 -- Node Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

To assign/edit/remove components to/of the node

1 Double-click the node shape or choose Specification from the node shortcut menu. The Node Specification dialog box appears.

Tab name Box name Function

General Set general information about the node

Visibility • Public. The node can be accessed by any outside model element.

• Package. Any classifier declared in the same package (or a nested subpackage, to any level) can use that node.

• Private. Only the node itself, or elements nested within that node can see it.

• Protected. Classifiers derived from that node may see it.

Deployed ComponentsAssign components to a node

Name The name of the assigned component.

Type The type of the assigned component.

Owner The name of the owner of the assigned component.

Edit The Component Specification dialog box appears. Edit the selected component in the dialog box.

Assign The Select Model Element dialog box appears. Select a component you want to assign.

Unassign Remove the selected component from the node.

© 2005 No Magic, Inc 5-322

Page 317: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

2 Click the Resident Components tab.• To assign a component, click the Assign button. The Select Model

Element screen appears. Select a node you wish to assign to the node.

• To edit a component, assigned to a node, click the Edit button. The Component Specification dialog box appears.

• To remove the assigned component from the node, click the Unassign button.

NOTE After assigning components to a node, those components will not be shown on the diagram pane as assigned to the node. You may add those components to the node by drag-and-drop operation.

UML EXTENSION MECHANISMS

Stereotype

A stereotype is an extension mechanism that defines a new and more specialized element of the model based on an existing element. Stereotype can be based on all types of elements including classes, packages, components, and notes, as well as such relationships as associations, generalizations, and dependencies. A stereotyped element derives all base element properties and may have additional constraints.

Stereotypes are treated as separate model elements. For more general information about working with symbols see Chapter 4, "Diagrams Basics."

Define the selected stereotype in the Stereotype Specification dialog box.

To open the Stereotype Specification dialog box

• Double-click the stereotype shape or choose Specification from the stereotype shortcut menu.

1 From the Tools menu, choose Stereotypes and then choose Edit Stereotypes.-or-In the element Specification dialog box, Stereotypes tab, click the Edit button.

2 The Edit Stereotypes dialog box appears. 3 Choose the desired model element and click the Add button. The Select

Extension Element Storage dialog box appears. Select a package and click OK.-or-Select the desired stereotype and click Edit.

5-323 © 2005 No Magic, Inc.

Page 318: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

S T E R E O T Y P E S P E C I F I C A T I O N D I A L O G B O X

Figure 128 -- Stereotype Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

GeneralSet general information about the stereotype.

Icon The file name of the icon image file that represents the current stereotype. To choose the icon for the selected stereotype. Click the ‘…’ button. The Open dialog box appears.

Remove Remove the assigned icon from the current stereotype.

Base ClassesThe list of model elements to which the stereotype can be applied.

All The list of all model elements.

> Move the selected model element from the All to the Selected list.

< Move the selected model element from the Selected to the All list.

>> Move all model elements from the All to the Selected list.

<< Move all model elements from the Selected to the All list.

Selected The list of the selected model elements for which the current stereotype can be assigned.

Extended ElementsShows the model elements affected by the stereotype.

Name The name of the affected model element.

Type The type (class, use case, etc.) of that model element.

Owner The name of the owner (package, subsystem, or model) of the affected model element.

Edit The corresponding model element's Specification dialog box appears.

© 2005 No Magic, Inc 5-324

Page 319: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

To create a new stereotype

• Use the Stereotype button on the class diagram toolbar.

1 From the base class shortcut menu in the Browser, Model Extensions Tree, choose New, and then choose Stereotype.-or-From the Tools menu, choose Profiles. Choose the desired profile and then open the Stereotypes tab. Click the Add button

2 The Select Extension Elements Storage dialog box appears. Click OK and specify a new stereotype in the Stereotype Specification dialog box. For a detailed description of this dialog box, see Section “Stereotype Specification dialog box” on page 5-324.

NOTE You may open the Edit Stereotypes dialog box from the element Specification dialog box.

To export/import stereotypes

Since MagicDraw version 7.0, stereotypes must be exported using modules functionality. The detailed description about model partitioning in MagicDraw, see Section “Modules Functionality. Reusing project part - Partitioning” on page 3-63.

To create a stereotype with an image

1 From the Tools menu, choose Profiles. Choose the desired profile and then open the Stereotypes tab. Choose a model element for which you would like to create a stereotype with an icon. -or-In the element Specification dialog box, Stereotypes tab, click the Edit button, the Edit Stereotypes dialog box appears.

2 Click the Add button. The Stereotypes Specification dialog box appears. 3 Click the Icon “...” button and from the Open dialog box, select an image you

want to place for a stereotype. Click the Open button.4 Type the name of a stereotype and click OK in all opened dialog boxes.

To display a stereotype icon, as a main shape, on the diagram pane

From the shape, that has an assigned stereotype with an icon, shortcut menu, choose Suppress Content.

Defined Tags Name The name of the tag definition.

Type The type of the tag. It can be any model element.

Edit The Tag Definition Specification dialog box appears. Edit the selected tag definition.

Add The Tag Definition Specification dialog box appears. Define a new tag definition.

Remove Removes the selected tag.

Tab name Box name Function

5-325 © 2005 No Magic, Inc.

Page 320: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

In the table below, there are listed all predefined stereotypes for model elements.

NOTE The table contains also stereotypes that are imported from the <MagicDraw installation directory>/Stereotypes folder.

P R O F I L E S D I A L O G B O X , S T E R E O T Y P E S T A B

To open the Profiles dialog box, Stereotypes tab

• From the Tools menu, choose Profiles. The Profiles dialog box appears. Select the desired profile and Stereotypes tab. Here you may define your own stereotypes and edit them.

• In the element Specification dialog box, Stereotypes tab, click the Edit button. Select the desired profile and Stereotypes tab.

Figure 129 -- Profiles dialog box. Stereotypes tab

The Edit Stereotypes dialog box contains the following elements.

Element name Function

For Contains the names of model elements to which stereotypes apply (base classes.)

© 2005 No Magic, Inc 5-326

Page 321: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

U M L W E B E X T E N S I O N S T E R E O T Y P E S

This Web extension to the UML defines a set of stereotypes, tagged values and constraints that enable us to model Web applications. The stereotypes and constraints are applied to certain components that are particular to Web applications and allows us to represent them in the same model, and on the same diagrams that describe the rest of the system.

The principal element specific to Web applications is the Web page. There are several stereotypes that can be applied to a Web page, and additional stereotypes are assigned to other elements of HTML that represent architecturally significant components of the system (frames, targets and forms).

Available Contains stereotypes that apply to the selected model element.

Edit Edit the selected stereotype in the Stereotype Specification dialog box.

Add The Stereotype Specification dialog box appears. Add a new stereotype to the selected model element.

Remove Deletes the selected stereotype. NOTE If you remove the predefined stereotype, that removed

stereotype will be automatically imported after loading project for the next time.

OK Saves all actions performed during the session and exits the dialog box.

Cancel Cancels all actions performed during the session and exits the dialog box.

Help Displays the MagicDraw Help.

Element name Function

5-327 © 2005 No Magic, Inc.

Page 322: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

Server Page Stereotype

Client Page Stereotype

Form Stereotype

Metamodel Class

Class

Description A server page represents a Web page that has scripts executed by the server. These scripts interact with resources on the server (databases, business logic, external systems, etc). The object operations represent the functions in the script, and it’s attributes represent the variables that are visible in the page’s scope (accessible by all functions in the page).

Icon

Metamodel Class

Class

Description An instance of a client page is an HTML formatted Web page. Like any HTML page it is a mix of data, presentation and even logic. Client pages are rendered by client browsers, and may contain scripts that are interpreted by the browser. Client page functions map to functions in scripts tags in the page. Client page attributes map to variables declared in the pages script tags that are accessible by any function in the page (page scoped). Client pages may have the associations’ relations with other pages, client or server.

Icon

Metamodel Class

Class

Description A class with stereotype «form» is a collection of input fields that are part of a client page. A form class maps directly to the HTML form tag. Its attributes represent the HTML form input fields (input boxes, text areas, radio buttons, check boxes, and hidden fields). A «form» has no operations - they cannot be encapsulated in a form. Any operations that interact with the form would be the property of the page that contains the form.

Icon

© 2005 No Magic, Inc 5-328

Page 323: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

Frame Set Stereotype

Target Stereotype

JavaScript Stereotype

Link Stereotype

Metamodel Class

Class

Description A frame set is a container of multiple Web pages. The rectangular viewing area is divided up into smaller rectangular frames. Each frame may be associated with a single frame named «target», although not necessarily. The contents of a frame may be a Web page or another frame set. A frame set stereotyped class maps directly to a frameset Web page, as well as the HTML frame tag. Because a frameset is a «client page», it may have operations and attributes; browsers that do not render frames activate them.

Icon

Metamodel Class

Class

Description A target is a named compartment in a browser window in which Web pages can be rendered. The name of the stereotyped class is the name of the target. Typically a target is one frame in a window defined by a frameset. However, a target could be a completely new browser instance or window. «Targeted link» associations specify targets as the place where a new Web page is to be rendered.

Icon

Metamodel Class

Class

Description On a JavaScript enabled browser it is possible to simulate user-defined objects with JavaScript functions.

Icon

Metamodel Class

Association

5-329 © 2005 No Magic, Inc.

Page 324: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

Description A link is a pointer from a client page to another «Page». In a class diagram a link is an association between a «client page» and either another «client page» or a «server page». A Link association maps directly to the HTML anchor tag.

Icon None

© 2005 No Magic, Inc 5-330

Page 325: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

Targeted Link Stereotype

Frame Content Stereotype

Submit Stereotype

Builds Stereotype

Redirect Stereotype

Metamodel Class

Association

Description Similar to a «link» association, a «targeted link» is a link where the associated page is rendered in another target. This association maps directly to the HTML anchor tag, with the target specified by the tag target attribute.

Icon None

Metamodel Class

Association

Description A frame content association is an aggregation association expressing a frame containment of another page or target. A frame content association can also point to another frameset, indicating nested frames.

Icon None

Metamodel Class

Association

Description A «submit» association is always between a «form» and a «server page». Forms submit their field values to the server through «server pages» for processing. The Web server processes the «server page», which accepts and uses the information in the submitted form. This relationship indicates which page (or pages) is able to process the form, and which forms a «server page».

Icon None

Metamodel Class

Association

Description The «builds» relationship is a special relationship that bridges the gap between client and server pages. Server pages only exist on the server. They are used to build client pages. The «builds» association identifies which server page is responsible for the creation of a client page. This is a directional relationship, since the client page contains no knowledge of how it came into existence. A server page can build multiple client pages, but a client page can only be built by one server page.

Icon None

Metamodel Class

Association

5-331 © 2005 No Magic, Inc.

Page 326: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

Description A «redirect» relationship is a unidirectional association with another Web page. It can be directed both from and to client and server pages. If the relationship originates from a «server page» then it indicates that the processing of the page request may continue on with the other page. This does indicate that destination page always participates in the building of a client page, only that it could. This particular relationship is not completely structural, since the actual invocation of a redirection operation must be done programmatically in the code of the originating page. If the relationship originates from a «client page» then this indicates that the browser automatically requests the destination page, without user input. A time delay value can be set that specifies a delay (in seconds) before the second page is requested. This use of redirection corresponds to the META tag and HTTP-EQUIV value of "Refresh".

Icon None

© 2005 No Magic, Inc 5-332

Page 327: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

Object Stereotype

IIOP Stereotype

RMI Stereotype

Input Element Stereotype

Select Element Stereotype

Metamodel Class

Association

Description An association between a client page and an object that is embedded in it. The object is typically a Java Applet or ActiveX control. This association maps in part to the HTML <object> tag.

Icon None

Metamodel Class

Association

Description IIOP (Internet Inter-Orb Protocol) is a special type of relationship between objects on the client and objects on the server. It represents a communication mechanism other than HTTP for client server communications. Typically this relationship is between Java Beans on the client and Enterprise Java Beans on the server.

Icon None

Metamodel Class

Association

Description RMI (Remote Method Invocation) is a mechanism for Java Applets and Beans to send messages to other Java Beans on different machines. Typically this relationship is between Java Beans or Applets on the client and Enterprise Java Beans on the server.

Icon None

Metamodel Class

Attribute

Description An Input Element is an attribute of a «Form» object. It maps directly to the <input> tag in an HTML form. It is used to input a single word or line of text. The tagged values associated with this stereotyped attribute correspond to the <input> tag attributes. To complete the required values for the HTML tag; the attribute name is used as the <input> tag name, and the attribute’s initial value is the tag value.

Icon None

Metamodel Class

Attribute

Description An input control used in forms. The select control allows the user to select one or more items from a list. Most browsers render this control as a combo or list box.

5-333 © 2005 No Magic, Inc.

Page 328: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

TextArea Element Stereotype

Page Stereotype

Tag def in i t ions

A tag definition specifies the tagged values that can be attached to a kind of model element. Among other things, tag definitions can be used to define the virtual meta attributes of the stereotype to which they are attached.

A tagged value adds extra information to a model element that is secondary to the element’s semantics. It is often used to store management data about the state and progress of the project such as author, status, and tested. A tagged value is another way of adding language implementation data to a model for code generation tools.

A tag definition consist of two parts: name and value (example: Author = Joe). There are certain tags predefined in UML, others can be defined by the user.

Add tag definitions in the Tagged Values tab of model element Specification dialog box.

Icon None

Metamodel Class

Attribute

Description An input control used in forms that allows multiple line input.

Icon None

Metamodel Class

Component

Description A page component is a Web page. A browser may request it by name. A Page component may or may not contain client or server scripts. Typically Page components are text files accessible by the Web server, but they can also be compiled modules that are loaded and invoked by the Web server. Ultimately, when accessed by the Web server (as either a file or executable) a page produces an HTML formatted document that is sent in response to a browser’s request.

Icon

© 2005 No Magic, Inc 5-334

Page 329: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

T A G D E F I N I T I O N S P E C I F I C A T I O N D I A L O G B O X

To open the Tag Definition Specification dialog box

• In the Profiles dialog box, Tag Definitions tab, click the Add or Edit button.

Figure 130 -- Tag Definition Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box name Function

General Set general information about the tag definition

Name Type the name of the tag definition.

Multiplicity Specifies the number of data values that tagged values based on this tag must have, or, the number of model elements that can be associated to the related tagged values. • 0 - zero and only zero. • 1 - one and only one. • 0..1 - zero or one.• 0..* - from zero to any positive integer. • 1..* - from one to any positive integer. • * - any positive integer.

Type In the general case, where the tag type is a data type, this specifies the range of values of the tagged values associated with the tag definition. In the special case, where the tag type refers to a metaclass that is not a data type, the tag value references model elements that are instances of the metaclass.

5-335 © 2005 No Magic, Inc.

Page 330: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

T A G G E D V A L U E S P E C I F I C A T I O N D I A L O G B O X

To open the Tagged Value Specification dialog box

• In the Tag Definition Specification dialog box, Typed Values tab, click the Edit button.

• In the Tagged Values tab of the Specification dialog box, click the the Value button.

Figure 131 -- Tagged Value Specification

Default Value The default value of the tag definition.

Show In Diagrams

Shows tag definition on Diagram pane.

Base Classes Select base classes you want to assign to the current tag definition from the All list to the Selected list

Typed Values The tagged values that conform to this tag definition.

Value The name of the tagged value.

Owner The name of the owner of that value.

Edit The Tagged Value Specification dialog box appears.

Tab name Box name Function

© 2005 No Magic, Inc 5-336

Page 331: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

To define a new tag definition

1 From the base class shortcut menu in the Browser, Model Extensions Tree, choose New, and then choose Tag Definition.-or-From the Tools menu, choose Profiles and then Tag Definitions tab. Click the Add button.

2 The Select Extension Elements Storage dialog box appears. Select a package, click OK and specify a new tag definition in the Tag Definition Specification dialog box. For a detailed description of this dialog box, see Section “Tag Definition Specification dialog box” on page 5-335.

• Click the Tagged Values tab in the Specification dialog box for each model element and click the ‘...’ button. The Profiles dialog box, Tag Definitions tab appears. Define a name and value.

To import/export tag definition

Since MagicDraw version 7.0, stereotypes must be exported using modules functionality. The detailed description about model partitioning in MagicDraw, see Section “Modules Functionality. Reusing project part - Partitioning” on page 3-63.

P R O F I L E S D I A L O G B O X , T A G D E F I N I T I O N S T A B

To open the Profiles dialog box, Tag Definitions tab

• From the Tools menu, choose Profiles, then Tag Definitions tab, and then click Edit.

Tab name Box name Function

GeneralSet general information about the tagged value

Tag Definition Tag definition that specifies the tagged value.

‘…’ The Tag Definition Specification dialog box appears.

HTML Set tagged value text as HTML.

Value The list of values.

Edit Edit the selected value.

Add Adds a value.

Remove Removes the selected value.

5-337 © 2005 No Magic, Inc.

Page 332: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

© 200

5

• In the elements Specification dialog box, Tagged Values tab, click the Edit Tag Definitions button.

Figure 132 -- Edit Tag Definitions dialog box

Element name Function

For Contains the names of model elements to which defined tag definitions apply.

Available Contains tag definitions that apply to the selected model element.

Edit Edit the selected tag definitions in the Tag Definition Specification dialog box.

Add The Tag Definition Specification dialog box appears. Add a new tag definition to the selected model element.

Remove Deletes the selected tag definition.

OK Attaches the selected tag definition to the particular element and exits the dialog box.

Cancel Cancels all actions performed during the session and exits the dialog box.

Help Displays the MagicDraw Help.

5 No Magic, Inc 5-338

Page 333: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

T O D O I T E M

MagicDraw presents a TODO list. It is so called a list of tasks needed to do in the future and added by the user. In MagicDraw, TODO tasks are added as tag definitions with a name TODO, where a value is a text you need to use in the future.

To add a TODO task

1 Open the element Specification dialog box, Tagged Value tab.2 Click the Add button and choose TODO from the list.3 Type the desired text in the Value text box.4 Click OK.

To display TODO tasks

1 From the Edit menu, choose Find TODO.2 All model elements that contain TODO items will be displayed in the Browser,

Search Results tree.3 To open the desired model element on the Diagram pane, double-click it in the

From Diagrams tree or choose Go To from element shortcut menu.

G R O U P S

1 Create the desired profile (e.g. My Profile).

2 Create enumeration data type with the desired name (e.g. My Groups) in the already created profile.

3 Add enumeration literals to the created enumeration (e.g. 1 group, 2 group).4 Create a tag definition named Group: from the Tools menu, choose Profiles

and in the Profiles dialog box, Tag Definitions tab. In the Profiles drop-down list box choose your created profile My Profile and choose Tag Definition as an element for which you would like to create a tag definition, click Add. In the Extension Element Storage dialog box, select the created profile (in this case My Profile) and click OK. The tag definition will be created in it.

5 Define to the created tag definition Type as Enumeration My Groups. 6 Open the Stereotypes tab and set the stereotype TagGroup.7 Create other tag definitions for any base class element. For example Author and

in the set Tag definition as Groups. Then create a tagged value for it and choose from the list 1 group or 2 group.

Const ra in ts

A constraint is a semantic condition or restriction on model elements that must be enforced by a correct design of a system. It is represented as a linguistic, enclosed in braces ({}), statement in some formal (OCL, C++, and other), or natural language. There are 14 standard constraints in the UML such as association, global, parameter. You may also define your own constraints.

5-339 © 2005 No Magic, Inc.

Page 334: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

Object Constraint Language (OCL) is a formal language used to express constraints. These typically specify invariant conditions that must hold for the system being modeled.

OCL can be used for a number of different purposes:

• To specify invariants on classes and types in the class model.

• To specify type invariant for Stereotypes

• To describe pre- and post conditions on Operations and Methods

• To describe Guards

• As a navigation language

• To specify constraints on operations

Edit constraints in the Constraints tab of model element Specification dialog box.

To define a new constraint

1 From the base class shortcut menu in the Browser, Model Extensions Tree, choose New, and then choose Constraint.-or-From the Tools menu, choose Profiles and then Edit Constraints tab. Click the Add button.-or-Click the Constraints tab in the Specification dialog box for each model element and click the ‘...’ button. The Profiles dialog box, Constraints tab appears. Click the Add button.

2 The Select Extension Elements Storage dialog box appears. Select a package, click OK and specify a new constraint in the Constraint Specification dialog box. For a detailed description of this dialog box, see Section “Constraint Specification dialog box” on page 5-341.

• Click the Constraints tab in the Specification dialog box for each model element and click the Add button. Type the name and the expression of the constraint.

© 2005 No Magic, Inc 5-340

Page 335: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

C O N S T R A I N T S P E C I F I C A T I O N D I A L O G B O X

To open the Constraint Specification dialog box

In the Edit Constraints dialog box, click the Add or Edit button.

Figure 133 -- Constraint Specification dialog box

Refere to the Section “Specification dialog boxes” on page 4-133 for the information of the specification elements not covered in this section.

Tab name Box Function

General Set general information about the constraint

Name Enter the name of the constraint.

Expression Enter an expression of the constraint.

Check OCL Syntax

If selected, the expression is checked according Object Constraint Language (OCL)

Base ClassesThe list of model elements to which the constraint can be applied.

All The list of all model elements.

> Move the selected model element from the All to the Selected list.

< Move the selected model element from the Selected to the All list.

>> Move all model elements from the All to the Selected list.

<< Move all model elements from the Selected to the All list.

Selected The list of the selected model elements for which the current constraint can be assigned.

5-341 © 2005 No Magic, Inc.

Page 336: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

P R O F I L E S D I A L O G B O X , C O N S T R A I N T S T A B

In the Constraints tab of the Profiles dialog box, define common constraints for your project. Later you may attach them to the particular model element.

To open the Profiles dialog box, Constraints tab

• From the Tools menu, choose Profiles and then Constraints tab.

• Click the “...” button in the elements Specification dialog box, Constraints tab.

Figure 134 -- Profiles dialog box. Constraints tab

Constrained Elements The list of elements subject to the constraint

Name The name of the model element to which the current constraint is assigned.

Type The type of the model element to which the current constraint is assigned.

Edit The Specification dialog box of the selected model elements appears.

Tab name Box Function

© 2005 No Magic, Inc 5-342

Page 337: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

The Constraints tab of the Profiles dialog box contains the following elements.

Element name Function

For Contains the names of model elements to which defined constraints apply.

Available Contains constraints that apply to the selected model element.

Edit Edit the selected constraints in the Constraint Specification dialog box.

Add The Constraint Specification dialog box appears. Add a new constraint to the selected model element.

Remove Deletes the selected constraint.

OK Attaches the selected constraint to the particular element and exits the dialog box.

Cancel Exits the dialog box without saving changes.

Help Displays MagicDraw UML Help.

5-343 © 2005 No Magic, Inc.

Page 338: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

© 2005 No Magic, Inc 5-344

Page 339: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

5-345 © 2005 No Magic, Inc.

Page 340: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

© 2005 No Magic, Inc 5-346

Page 341: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

5-347 © 2005 No Magic, Inc.

Page 342: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

© 2005 No Magic, Inc 5-348

Page 343: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

5-349 © 2005 No Magic, Inc.

Page 344: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

© 2005 No Magic, Inc 5-350

Page 345: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

5-351 © 2005 No Magic, Inc.

Page 346: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

© 2005 No Magic, Inc 5-352

Page 347: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

5-353 © 2005 No Magic, Inc.

Page 348: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

© 2005 No Magic, Inc 5-354

Page 349: MagicDraw UserManual

U M L D I A G R A M SUML Extens ion Mechanisms

5

5-355 © 2005 No Magic, Inc.

Page 350: MagicDraw UserManual

U M L D I A G R A M SUML Ex tens ion Mechanisms

5

© 2005 No Magic, Inc 5-356

Page 351: MagicDraw UserManual

E X T E N S I O N D I A G R A M S 6

MagicDraw supports an extension to UML diagrams:

• Content diagram

• Robustness diagram

Also MagicDraw provides various types of other diagrams:

• Time diagram

• Web diagram

• CORBA IDL diagram

• DDL diagram

• WSDL diagram

• XML Schema diagram

Working with Diagrams

General information about working with diagrams see in Chapters “Diagrams Basics” and “UML Diagrams”.

In the Environment Options dialog box, Plugins pane, you may select what extension diagrams you want to be enabled or disabled.

Patterns

Various types of classes you may create in every class diagram using a Pattern Wizard. It contains GOF, Java, Junit, CORBA IDL, XML Schema, and WSDL design patterns.

You may also create new patters and edit existing ones using Java code or JPython scripts. For a detailed description, see MagicDraw Open Api user’s guide.

The detailed description of the Pattern Wizard, see in Section “Pattern Wizard” on page 7-432.

To open the Pattern Wizard

• In the class diagram, click the Class by Pattern button.

• From the class shortcut menu, choose Tools and then choose the Apply Pattern subcommand.

• Select a class and choose Apply Pattern from the Tools main menu.

© 2005 No Magic, Inc. 6-358

Page 352: MagicDraw UserManual

E X T E N S I O N D I A G R A M SContent Diagram

6

CONTENT DIAGRAMA Content Diagram is an extension of UML notation. The purpose of it is to generate or represent a project structure (diagrams) and relations between them. Content table works as a table of contents for a project.

All created diagrams have their own Specifications, in which you may specify their name, documentation, view relationships in which they participate, also add stereotypes, tagged values and constraints.

6-359 © 2005 No Magic, Inc.

Page 353: MagicDraw UserManual

E X T E N S I O N D I A G R A M SContent Diagram

6

Content Diagram Elements

Toolbar Button Button (Hot key)

Notation

Sticky Button

(Z)

Selection

(Escape)

Text Box

(X)

Text Box (HTML Text)

(SHIFT+X)

Note

(N)

Note(HTML Text)

(SHIFT+N)

Anchor to Note

(H)

Constraint

(SHIFT+H)

© 2005 No Magic, Inc 6-360

Page 354: MagicDraw UserManual

E X T E N S I O N D I A G R A M SContent Diagram

6

Content ShapeCreates a table of contents of all diagrams of the project.

Package

DependencyA relationship showing that one diagram depends on the other.

Class DiagramCreates a class diagram.

Use Case DiagramCreates a use case diagram.

Collaboration DiagramCreates a collaboration diagram.

Sequence DiagramCreates a sequence diagram.

Toolbar Button Button (Hot key)

Notation

6-361 © 2005 No Magic, Inc.

Page 355: MagicDraw UserManual

E X T E N S I O N D I A G R A M SContent Diagram

6

State DiagramCreates a state diagram.

Activity DiagramCreates an activity diagram.

Implementation DiagramCreates an implementation diagram.

Time DiagramCreates a time diagram.

Web DiagramCreates a web diagram.

CORBA IDL DiagramCreates a CORBA IDL diagram.

WSDL DiagramCreates a WSDL diagram.

XML Schema DiagramCreates a xml schema diagram.

Toolbar Button Button (Hot key)

Notation

© 2005 No Magic, Inc 6-362

Page 356: MagicDraw UserManual

E X T E N S I O N D I A G R A M SRobustness Diagram

6

ROBUSTNESS DIAGRAMRobustness Analysis involves analyzing the narrative text of use cases, identifying a first-guess set of objects that will participate in those use cases, and classifying these objects based on the roles they play.

• Boundary or Interface objects are what actors use in communicating with the system.

• Entity objects are usually objects from the domain model.

• Control objects (which usually are called controllers because they often aren't real objects), which serve as the “glue” between boundary objects and entity objects.

Robustness analysis serves as preliminary design within the project life cycle and provides the missing link between analysis and detailed design.

Four basic rules apply:

1 Actors can only talk to boundary objects. 2 Boundary objects can only talk to controllers and actors. 3 Entity objects can only talk to controllers. 4 Controllers can talk to boundary objects and entity objects, and to other

controllers, but not to actors Both boundary objects and entity objects are nouns, and that controllers are verbs. Nouns cannot talk to other nouns, but verbs can talk to either nouns or verbs.

Robustness DiagramCreates a robustness diagram.

DDL DiagramCreates a DDL diagram.

Content DiagramCreates a content diagram.

Separator

(W)

Toolbar Button Button (Hot key)

Notation

6-363 © 2005 No Magic, Inc.

Page 357: MagicDraw UserManual

E X T E N S I O N D I A G R A M SRobustness Diagram

6

Robstness Diagram Elements

Toolbar Button/Model Element Button (Hot key) Notation

Sticky Button

(Z)

Selection

(Escape)

Text Box

(X)

Text Box (HTML Text)

(SHIFT+X)

Note

(N)

Note(HTML Text)

(SHIFT+N)

Anchor to Note

(H)

Constraint

(SHIFT+H)

ActorAn actor represents a role played by an external person, process or a thing interacting with a system. One physical object may play several roles.

(A)

© 2005 No Magic, Inc 6-364

Page 358: MagicDraw UserManual

E X T E N S I O N D I A G R A M SWeb Diagram

6

WEB DIAGRAMWeb system consists from server applications, network, communicating protocol, and browser. Basically, user’s requests begin from starting browser and requesting document through network from server (host computer). Web server running on host computer, catches user request, locates document and delivers it to the requestor.

UML is a standard language for modeling software. However modeling specific web components cannot be done using just standard UML. Web-UML diagram provides extension to UML model, which enables to model web applications.

MagicDraw Web-UML diagram includes Web-UML elements (stereotyped UML elements) for modeling: client, server pages, web form, frame classes, java script class representation and target class, and web page component.

The detailed description of all stereotypes, find in the Section “UML Web Extension stereotypes” on page 5-327.

BoundaryActors use boundary objects to communicate with the system (sometimes called interface objects.)Class with stereotype “boundary”

(B)

ControlServes as the “glue” between boundary objects and entity objects.Class with stereotype “control”

(C)

EntityEntity objects usually are objects from the domain model.Class with stereotype “entity”

(E)

Robustness AssociationAssociation with default Association End A navigability = false and Association End B navigability = true values.

(S)

Separator

(W)

Toolbar Button/Model Element Button (Hot key) Notation

6-365 © 2005 No Magic, Inc.

Page 359: MagicDraw UserManual

E X T E N S I O N D I A G R A M SWeb Diagram

6

Reference: Building Web Applications with UML by Jim Conallen Copyright ©2000 by Addison Wesley Longman, Inc.

© 2005 No Magic, Inc 6-366

Page 360: MagicDraw UserManual

E X T E N S I O N D I A G R A M SWeb Diagram

6

Web Diagram Elements

Toolbar Button/Model Element

Button (Hot key)

Some examples

Sticky Button

(Z)

Selection

(Escape)

Text Box

(X)

Text Box (HTML Text)

(SHIFT+X)

Note

(N)

Note(HTML Text)

(SHIFT+N)

Anchor to Note

(H)

Constraint

(SHIFT+H)

6-367 © 2005 No Magic, Inc.

Page 361: MagicDraw UserManual

E X T E N S I O N D I A G R A M SWeb Diagram

6

Client Page

(SHIFT+C)

Server Page

(SHIFT+S)

Form

(SHIFT+F)

Frame

(SHIFT+E)

Target

(SHIFT+T)

Java Script

(SHIFT+J)

Class

(C)

Toolbar Button/Model Element

Button (Hot key)

Some examples

© 2005 No Magic, Inc 6-368

Page 362: MagicDraw UserManual

E X T E N S I O N D I A G R A M SWeb Diagram

6

Interface

(I)

Package

(P)

Subsystem

(Y)

Model

(M)

Realize

(R)

Realization

(E)

Dependency

(D)

Generalization

(G)

Association

(S)

Aggregation

A

Composition

(F)

Toolbar Button/Model Element

Button (Hot key)

Some examples

6-369 © 2005 No Magic, Inc.

Page 363: MagicDraw UserManual

E X T E N S I O N D I A G R A M SWeb Diagram

6

Builds

(B)

Link

(L)

Targeted Link

(SHIFT+L)

Frame Content

(SHIFT+O)

Submit

(U)

Object

(O)

RMI

(SHIFT+R)

IIOP

(SHIFT+I)

Toolbar Button/Model Element

Button (Hot key)

Some examples

© 2005 No Magic, Inc 6-370

Page 364: MagicDraw UserManual

E X T E N S I O N D I A G R A M SCORBA IDL Diagram

6

CORBA IDL DIAGRAMCORBA IDL diagram facilitates the creation of CORBA IDL elements. Also the following patterns are available for CORBA IDL: Interface, Value Type, Type Definition, Sequence, Array, Fixed, Union, Enumeration, Struct, Exception.

More information about CORBA IDL usage in MagicDraw, find in the MagicDraw Code Engineering User’s Guide, Chapter “ CORBA IDL Mapping to UML”.

Reference: UMLTM Profile for CORBATM Specification, Version 1.0, April 2002. http://www.omg.org/technology/documents/formal/profile_corba.htm

Page

(SHIFT+P)

Separator

(W)

Toolbar Button/Model Element

Button (Hot key)

Some examples

6-371 © 2005 No Magic, Inc.

Page 365: MagicDraw UserManual

E X T E N S I O N D I A G R A M SCORBA IDL Diagram

6

CORBA IDL Diagram Elements

Toolbar Button/Model Element

Button (Hot key)

Sticky Button

(Z)

Selection

(Escape)

Text Box

(X)

Text Box (HTML Text)

(SHIFT+X)

Note

(N)

Note(HTML Text)

(SHIFT+N)

Anchor to Note

(H)

Constraint

(SHIFT+H)

CORBA IDL Module

(M)

© 2005 No Magic, Inc 6-372

Page 366: MagicDraw UserManual

E X T E N S I O N D I A G R A M SCORBA IDL Diagram

6

CORBA IDL Interface

(I)

CORBA IDL Value

(V)

Class by PatternThe Pattern Wizard appears.

SHIFT+P

Generalization

(G)

Truncatable Generalization

Value Support Generalization

CORBA IDL Association

Association

(S)

Aggregation

(A)

Composition

(F)

Package

(P)

Toolbar Button/Model Element

Button (Hot key)

6-373 © 2005 No Magic, Inc.

Page 367: MagicDraw UserManual

E X T E N S I O N D I A G R A M SDDL Diagram

6

DDL DIAGRAMDDL diagram is used to draw database definition elements. DDL diagram simplifies creation of primary key, foreign key, triggers and etc.

The detailed description about DDL usage in MagicDraw, see MagicDraw Code Engineering User’s Guide, Chapter “DDL Script Engineering”.

Class

(C)

Interface

(I)

Dependency

(D)

Binding Dependency

(B)

Containment

(SHIFT+C)

Separator

W

Toolbar Button/Model Element

Button (Hot key)

© 2005 No Magic, Inc 6-374

Page 368: MagicDraw UserManual

E X T E N S I O N D I A G R A M SDDL Diagram

6

DDL Diagram Elements

Toolbar Button/ Model Element

Button (Hot key)

Sticky Button

(Z)

Selection

(Escape)

Text Box

(X)

Text Box (HTML Text)

(SHIFT+X)

Note

(N)

Note(HTML Text)

(SHIFT+N)

Anchor to Note

(H)

Constraint

(SHIFT+H)

Table

(T)

6-375 © 2005 No Magic, Inc.

Page 369: MagicDraw UserManual

E X T E N S I O N D I A G R A M SWSDL Diagram

6

WSDL DIAGRAMWSDL diagram is used to draw WSDL elements. Allows to create all elements used in wsdl file, except schema. Schema elements can be created using XMLSchema diagram. WSDL plugin has pattern for creating binding element.

WSDL plugin requires XMLSchema plugin.

View

(V)

Relationship

(R)

Foreign Key

(F)

database

(D)

schema

(S)

Separator

W

Toolbar Button/ Model Element

Button (Hot key)

© 2005 No Magic, Inc 6-376

Page 370: MagicDraw UserManual

E X T E N S I O N D I A G R A M SWSDL Diagram

6

WSDL Diagram Elements

Model Element Button (Hot key)

Sticky Button

(Z)

Selection

(Escape)

Text Box

(X)

Text Box (HTML Text)

(SHIFT+X)

Note

(N)

Note(HTML Text)

(SHIFT+N)

Anchor to Note

(H)

Constraint

(SHIFT+H)

WSDLmessage

(M)

6-377 © 2005 No Magic, Inc.

Page 371: MagicDraw UserManual

E X T E N S I O N D I A G R A M SWSDL Diagram

6

WSDLporttype

(T)

WSDLbinding

(B)

WSDLport

(SHIFT+P)

WSDLservice

(S)

WSDLdefinitions

(D)

WSDLtypes

(Y)

WSDLimport

(I)

Xmlns

(SHIFT+L)

XDSnamespace

(P)

Realization

(E)

Separator

(W)

Model Element Button (Hot key)

© 2005 No Magic, Inc 6-378

Page 372: MagicDraw UserManual

E X T E N S I O N D I A G R A M SXML Schema Diagram

6

XML SCHEMA DIAGRAMDiagram purpose is to create structure of xml schema file. Diagram allows quick draw of xml schema elements. These elements are stereotyped UML elements from class and implementation diagrams.

Also the following patterns are available for XML Schema: XSDcomplexType, XSDcomposition, XSDsimpleType, XSDsimpleType(XSDlist), XSDsimpleType(XSDunion), and Simple XSDrestriction.

The detailed description about XML Schema usage in MagicDraw, see MagicDraw Code Engineering User’s Guide, Chapter “XML Schema”.

Reference: http://www.w3.org/TR/xmlschema-2/

6-379 © 2005 No Magic, Inc.

Page 373: MagicDraw UserManual

E X T E N S I O N D I A G R A M SXML Schema Diagram

6

XML Schema Diagram Elements

Toolbar Button/Model Element

Button (Hot key)

Sticky Button

(Z)

Selection

(Escape)

Text Box

(X)

Text Box (HTML Text)

(SHIFT+X)

Note

(N)

Note(HTML Text)

(SHIFT+N)

Anchor to Note

(H)

Constraint

(SHIFT+H)

Class by Pattern

(SHIFT+P)

XSDcomplexType

(C)

© 2005 No Magic, Inc 6-380

Page 374: MagicDraw UserManual

E X T E N S I O N D I A G R A M SXML Schema Diagram

6

XSDsimpleType

(S)

XSDsimpleType(XSDlist)

(SHIFT+S)

XSDsimpleType(XSDunion)

(U)

XSDall

(L)

XSDchoice

(O)

XSDsequence

(Q)

XSDgroup

(G)

XSDattributeGroup

(T)

XSDschema

(SHIFT+M)

Containment

(SHIFT+C)

XSDnamespace

(P)

Toolbar Button/Model Element

Button (Hot key)

6-381 © 2005 No Magic, Inc.

Page 375: MagicDraw UserManual

E X T E N S I O N D I A G R A M STime Diagram

6

TIME DIAGRAM

Aggregation

(A)

Composition

(F)

Binding Dependency

(B)

XSDrestriction

(R)

XSDextension

(E)

XSDimport

(M)

XSDinclude

(D)

XSDredefine

(SHIFT+F)

xmlns

(SHIFT+L)

Separator

W

Toolbar Button/Model Element

Button (Hot key)

© 2005 No Magic, Inc 6-382

Page 376: MagicDraw UserManual

E X T E N S I O N D I A G R A M STime Diagram

6

Time Diagram Elements

Toolbar Button/Model Element

Button (Hot key)

Sticky Button

(Z)

Selection

(Escape)

Text Box

(X)

Text Box (HTML Text)

(SHIFT+X)

Note

(N)

Note(HTML Text)

(SHIFT+N)

Anchor to Note

(H)

Constraint

(SHIFT+H)

Classifier Role

(O)

Classifier Role <<CRconcurrent>>

6-383 © 2005 No Magic, Inc.

Page 377: MagicDraw UserManual

E X T E N S I O N D I A G R A M STime Diagram

6

Classifier Role <<SAshedRes>>

Concurrent Lifeline

(L)

Message: synchronous uninterpreted

(M)

Message <<RTevent>>,<<CRimmediate>>

Message <<CRimmediate>>

Message <<SAtrigger>>

)

Message to Self: synchronous uninterpreted

(S)

Recursive Message

(R)

Diagonal Message: synchronous uninterpreted

(D)

Separator

W

Toolbar Button/Model Element

Button (Hot key)

© 2005 No Magic, Inc 6-384

Page 378: MagicDraw UserManual

T O O L S 7

MagicDraw provides the following tools and wizards to help you perform the design tasks in your job quickly and easily:

• Reports – prepares HTML, PDF, or RTF report documents describing the model.

• Class Diagram Wizard – helps to create and customize new class diagrams.

• Package Overview Diagram Wizard – generates the package dependency diagram for packages in your project.

• Tools for Analysis – prepares diagrams and report documents of the relationships between classes in the UML model.

• Hierarchy Diagram Wizard

• Realization Diagram Wizard

• Content Diagram Wizard - generates content of diagrams that are used in the project.

• Sequence Diagram from Java Source Wizard - creates sequence diagram of Java method implementation.

• Pattern Wizard – creates various GOF, Java, Junit, CORBA IDL, and XML Schema design patterns.

• Creating Setters / Getters – creates getting and setting operators for attributes defined in the class.

• Implementing or Overriding Operations – creates defined operations down the inheritance tree.

• Model Transformation Wizard - is a data set, which fully describes the action of applying model transformation on a set of packages. Transformation type, parameters, packages set to transform and the destination of the model transformation results are the parts of model transformation.

• Metrics - allows measuring project by different viewpoints.

REPORTSThe Report dialog box is used for selecting the options to generate a report of the opened project to the HTML, PDF, RTF, XSL-FO, and PostScirpt formats.

MagicDraw report generation is based on XSL transformation and formatting.

© 2005 No Magic, Inc. 7-386

Page 379: MagicDraw UserManual

TO O L SReports

7

In XSL transformation, an XSLT processor reads XML document and XSLT style sheet. The processor outputs new XML document based on the instructions it finds in the XSLT style sheet. There is also special support for HTML output.

In XSL formatting, XML data is formatted for output to screen, paper or other media.

The figure below shows the report generation mechanism.

Since version 7.1, it is possible to generate reports from command line - Report Generator tool is presented. The description about Report Generator tool, see in Section “Report Generator Tool” on page 7-404.

To open the Report dialog box

Choose the Report command from the Tools menu. The Report dialog box appears.

Template Management tab

The Report dialog box allows you to select from an array of predefined report templates (styles), or you can create your own report template. The information in the Template Management tab

7-387 © 2005 No Magic, Inc.

Page 380: MagicDraw UserManual

TO O L SReports

©

7

is organized into trees. You may edit, delete, import, export, create your own template, make one of the templates as the default one.

Figure 135 -- Report dialog box. Template Management tab

The following report templates are available:

• Model Report. Describes your UML model from different viewpoints, which are already predefined in MagicDraw or you may create your own. Predefined templates:

• Behavioral Model Report. Includes behavioral elements in the report: class diagram elements, collaboration, activity, and state diagrams and their elements.

• Built-In. Includes all available model elements into the report.

• Static Model Report. Includes class and implementation diagrams elements.

• Use Case Report. Describes system functionality and actors. UC report is generated from tag definition values, which are listed in UC profile.

2005 No Magic, Inc 7-388

Page 381: MagicDraw UserManual

7

TO O L SReports

7

NOTE: Use Case report requires specifying model enrichment information (model actors and top-level UC diagrams).

• Software Design Description. Describes software design of your system. The document includes sections that describe software design goals, strategies, constraints and guidelines, system architecture and detailed design. NOTE: Software Design Description report requires specifying model enrichment information.

• Model Extension Report. Describes common UML model extension mechanisms (stereotypes, tagged values and constraints).

To create your own report template

1 In the left pane of the Report dialog box, select Model Report, Use Case Report, Software Design Description report, or Model Extension Report.

2 In the right pane, select the template, according which, you would like to create your own template and click the Clone button.

3 The Enter Style Name dialog box appears. Type the name of the new template and click OK.

4 Double click the newly created report template and specify its options in the appeared tabs.

To rename the selected report template

1 In the left pane of the Report dialog box, select Model Report, Use Case Report, Software Design Description report, or Model Extension Report.

2 In the right pane, select the template and click the Rename button.3 Type the new name in the Enter Style Name dialog box.

To delete the selected report template

1 In the left pane of the Report dialog box, select Model Report, Use Case Report, Software Design Description report, or Model Extension Report.

2 In the right pane, select the template and click the Delete button.

Import the desired report template

1 In the left pane of the Report dialog box, select Model Report, Use Case Report, Software Design Description report, or Model Extension Report.

2 In the right pane, click the Import button. 3 The Open dialog box appears. Choose the template you want to import and

click Open.NOTE All MagicDraw report templates (*.rst) are located in the <MagicDraw

installation directory>/data/report/report_types.

-389 © 2005 No Magic, Inc.

Page 382: MagicDraw UserManual

TO O L SReports

©

7

Export the selected report template

1 In the left pane of the Report dialog box, select Model Report, Use Case Report, Software Design Description report, or Model Extension Report.

2 In the right pane, select the template you want to export and click the Export button.

3 The Save dialog box appears. Select the directory where you want to save the selected template and click Save.

Set the selected report template as default

1 In the left pane of the Report dialog box, select Model Report, Use Case Report, Software Design Description report, or Model Extension Report.

2 In the right pane, select the template you want to set as default and click the Make Default button.

2005 No Magic, Inc 7-390

Page 383: MagicDraw UserManual

TO O L SReports

7

D O C U M E N T O P T I O N S

Property Name Description

Report Title The general title of the report. By default, the name of the report template is given.

Document Title The title of the generated document.

Company Name The name of the company.

Footer Text Text that will be displayed in the footer of the document.

Show Revision History If True, shows the table of revision history.

Revision History Table Rows

Specify the number of rows in the revision history table.

Revision Number Enter the number of the revision.

Revision Details Specify the status of the revision. By default - Initial Version.

Revision Author Type that name of the author.

Show Number of Total Pages

Select this check box, if you want that the number of pages will be displayed as e.g. 5-26.

Table of Contents LocationOnly for model report, use case report, and software design description.

Choose the place where the table of contents will be placed: Beginning of the Document, End of the Document, Not Included.In the table of contents, the list of hyperlinks of generated elements that represent classes, packages and diagrams. The hierarchy of the contents is listed top down: from packages to the elements that are included into the packages.

Documentation as HTMLOnly for model report.

Documentation is generated in html format (available only in HTML output reports)

Include DocumentationOnly for model report.

Includes documentation of the model elements in the generated report.

Include Full DescriptionsOnly for model report.

Includes the location (parent element) of the model element in the model dictionary index.

Include Model DictionaryOnly for model report.

Includes UML model dictionary table to the report.

Preformatted DocumentationOnly for model report.

Documentation is shown as it is entered. If not selected, documentation text is wrapped

Preserve Line BreaksOnly for model report.

Documentation has line breaks, even if the Preformatted Documentation is not selected. It has no effect is Documentation as HTML is selected.

Show Introduction SectionOnly for use case report, software design description, and model extension report.

Includes Introduction section with Purpose, Scope and Overview subsections (if selected).

Show Purpose SectionOnly for use case report, software design description, and model extension report.

Includes Purpose subsection in the Introduction section.

7-391 © 2005 No Magic, Inc.

Page 384: MagicDraw UserManual

TO O L SReports

©

7

M O D E L R E P O R T

Elements

Every Model Report template contains the specific list of elements (diagrams and model elements), which information will be included in the report. You may select elements that will be included in the report in the Elements section.

NOTE The list includes only those elements that contains unique data. E.g. you may not select Class, Implementation, and Sequence diagrams in this list as they do not contain specific data. You may include images of those diagrams in the Select Diagrams tab.

Document PurposeOnly for use case report, software design description, and model extension report.

Type the purpose of the generated document. This text will be included in the Purpose subsection.

Show Scope SubsectionOnly for use case report, software design description, and model extension report.

Includes Scope subsection in the Introduction section.

Document ScopeOnly for use case report, software design description, and model extension report.

Type the scope of the generated document. This text will be included in the Scope subsection.

Show Overview SubsectionOnly for use case report and software design description.

Includes Overview subsection in the Introduction section.

Document OverviewOnly for use case report and software design description.

Type an overview of the generated document. This text will be included in the Overview subsection.

Include MagicDraw Trademark

Includes a text “This document is generated by MagicDraw UML” in the footer.

Element name Function (if True)

Activity Diagram Includes activity diagrams in the generated report.

Actor Includes all available actors in the generated report.

Artifact Includes artifact report.

Attributes Includes all available attributes in the generated report.

Classifier Role Includes all available classifiers in the generated report.

Class Includes all available classes in the generated report.

Collaboration Diagram Includes collaboration diagrams in the generated report.

Comment Includes all available comments in the generated report.

Component Includes all available components in the generated report.

Property Name Description

2005 No Magic, Inc 7-392

Page 385: MagicDraw UserManual

TO O L SReports

7

Model Elements Options

In the Model Elements Options tab you may define general options how the model elements will be described in the report.

Component Instance Includes all available component instances in the generated report.

Constraint Includes all available constraints in the generated repor.t

Data Types Includes all available data types in the generated report.

Enumeration Includes all available enumerations in the generated report.

Enumeration Literal Includes all available enumeration literals in the generated report.

Extension Point Includes all available use case extension points in the generated report.

Instance Includes all available instances in the generated report.

Interface Includes all available interfaces in the generated report.

Node Includes all available nodes in the generated report.

Node instance Includes all available node instances in the generated report.

Operation Includes all available operations in the generated report.

Relations Includes relationships in the generated report.

Sequence Diagram Includes sequence diagrams in the generated report.

Signal Includes all available signals in the generated report.

State Diagram Includes state diagrams in the generated report.

Stereotype Includes all available stereotypes in the generated report.

Tag Definition Includes tag definitions in the generated report.

Use Case Includes all available use cases in the generated report.

Option name Function

Filter By Visibility Only operations and attributes with the selected type of visibility are included in the report. Possible choices: All, Public, Not Private.

Show Stereotypes Section Includes Stereotypes section when describing an element.

Show Tagged Values Section

Includes Tagged Values section when describing an element.

Show Constraints Section Includes Constraints section when describing an element.

Show Hyperlinks Section Includes Hyperlinks section when describing an element.

Show Relations Section Includes Relations section when describing an element. You may choose to show only associations.

Show Leaf Includes the Leaf section, informing if the described element is leaf.

Element name Function (if True)

7-393 © 2005 No Magic, Inc.

Page 386: MagicDraw UserManual

TO O L SReports

7

U S E C A S E R E P O R T

Use Case Report describes systems functionality and actors. UC report is generated from tag definition values, which are listed in UC profile.

Use Case report requires specifying model enrichment information - the defining of model actors and top-level UC diagrams - in the Use Case Model Wizard.

Use Case Model Wizard

Use Case Model Wizard is used for predefining the specific diagrams that describe different views of the use case model:

• Actors diagrams describes actors relationships in the system.

• Use case model diagrams represents use case model of the system.

These a

To open the Use Case Model Wizard

• From the Tools menu, choose Use Case Model Enrichment.

• Open the Report dialog box, select Use Case Report, and then click the Model Enrichment button.

Model Options

In the Model Options tab, select the sections that will be included in the Use Case Report.

Show Root Includes the Root section, informing if the described element is root.

Show Abstract Includes the Abstract section, informing if the described element is abstract.

Show Attributes Section Includes Attributes section when describing an element.

Show Operations Section Includes Operations section when describing an element.

Show Inner Elements Section

Includes Inner Elements section when describing an element.

Show Inner Relations Section

Includes Inner Relations section when describing an element.

Show Template Parameters Section

Includes Template Parameter section when describing an element.

Property name Function (if true)

Show Actors Section

Includes the description of actors in the report.

Show Use Case Model Section

Includes the description of use case model in the report.

Show Package Details

Includes the information of packages.

Option name Function

© 2005 No Magic, Inc 7-394

Page 387: MagicDraw UserManual

7-

TO O L SReports

7

Use Case Options

In this list select tag definitions you want include in the report. Navigate with buttons on the right.

S O F T W A R E D E S I G N D E S C R I P T I O N

Software Design Description report describes software design of your system. The document includes sections that describe software design goals, strategies, constraints and guidelines, system architecture and detailed design. This report is modeled according RUP, with some modifications.

Software Design Description report requires specifying model enrichment information, where you select diagrams, depicting software design views.

Model Options

Software Design Description report contains the following sections and subsections that you may choose to be included:

1 Introduction1.1 Purpose

2 Scope

3 Overview

4 System Overview5 Design Considerations

5.1 Assumptions and Dependencies

6 General Constraints

7 Goals and Guidelines

8 Architectural Strategies9 System Architecture

9.1 Use Case View

10Conceptual View

11Deployment View

12Process View

13Detailed Design13.1 Design Model

13.1.1 Component View

13.1.2 Data

13.1.3 MagicDraw Profile

13.1.4 UML Standard Profile

14Implementation Model

Option name Function

Show System Overview Section

Includes System Overview section in the report.

System Overview Click the “...” button and type the text you want to be displayed in the System Overview section.

395 © 2005 No Magic, Inc.

Page 388: MagicDraw UserManual

TO O L SReports

©

7

Show Design Consideration Section

Includes Design Considerations section in the report.

Show Dependencies Subsection

Includes Assumptions and Dependencies subsection in the report.

System Dependencies Click the “...” button and type the text you want to be displayed in the Dependencies section.

Show Constraints Subsection Includes Constraint subsection in the report.

System Constraints Click the “...” button and type the text you want to be displayed in the System Overview section.

Show Goals Subsection Includes Goals subsection in the report.

System Goals Click the “...” button and type the text you want to be displayed in the Goals section.

Show Architectural Strategies Section

Includes Architectural Strategies section in the report.

Architectural Strategies Click the “...” button and type the text you want to be displayed in the Strategies section.

Show System Architecture Section

Includes System Architecture section in the report.

Show Use Case View Subsection

Includes Use Case View subsection in the report. Select the diagrams that represent Use Case View in the Software Design Model Wizard.

Show Conceptual View Subsection

Includes Conceptual View subsection in the report. Select the diagrams that represent Conceptual View in the Software Design Model Wizard.

Show Deployment View Subsection

Includes Deployment View subsection in the report. Select the diagrams that represent Deployment View in the Software Design Model Wizard.

Show Process View Subsection Includes Process View subsection in the report. Select the diagrams that represent Process View in the Software Design Model Wizard.

Show Detailed Design Section Includes Detailed Design

Show Design Model Includes Design Model subsection in the report. Select the diagrams that represent Design Model View in the Software Design Model Wizard.

Show Subsystem Details Section

Includes subsection in the report. Select the diagrams that represent Design Model View in the Software Design Model Wizard.

Show Subsystem Classes Includes the description of classes of the subsystem.

Show Subsystem Process Includes Functionality and Processing section in the subsystem’s description.

Show Subsystem Actions Includes detailed description of actions, performed by subsystem.

Option name Function

2005 No Magic, Inc 7-396

Page 389: MagicDraw UserManual

7-

TO O L SReports

7

M O D E L E X T E N S I O N R E P O R T

Model Extension report describes common UML model extension mechanisms (stereotypes, tagged values and constraints) of your project.

Show Subsystem Interactions Includes Uses/Interactions section in the description of subsystem.

Show Subsystem Resources Includes Resources section in the description of subsystem.

Show Implementation Model Includes Implementation Model subsection in the report. Select the diagrams that represent Implementation View in the Software Design Model Wizard.

Property name Function (if true)

Show Stereotypes

Includes stereotypes description in the report.

Stereotypes Table Style

Choose table style of the description of stereotypes: Simple or Extended.

Show Tag Definitions

Includes tag definitions description in the report.

Show Global Tag Definitions

Include default tag definitions.

Option name Function

397 © 2005 No Magic, Inc.

Page 390: MagicDraw UserManual

TO O L SReports

7

Select Packages tab

From the Select Package tab, select one package from which you want the report will be generated. By default, the Data package is selected and all model elements are included in the report.

Figure 136 -- Report dialog box. Select Packages tab

© 2005 No Magic, Inc 7-398

Page 391: MagicDraw UserManual

7-

TO O L SReports

7

Select Diagrams tab

From the Select Diagrams tab, select diagrams from which images are added to the report. By default, no diagrams are selected.

Figure 137 -- Report dialog box. Select Diagrams tab

Include All Diagrams includes all available diagrams in the report.

Include Selected Diagrams allows to choose the diagrams you want to include in the report.

399 © 2005 No Magic, Inc.

Page 392: MagicDraw UserManual

TO O L SReports

©

7

Output Opt ions tab

Figure 138 -- Report dialog box. Output Options tab

Element name Function

Report File Enter the directory and the name of the report where the generated report will be saved, or click the ‘…’ button, to select the location directory and the file name in the Open dialog box.NOTE Follow the file naming rules of the operation system you

are using. If an incorrect name is provided, MagicDraw notifies you with the error message.

2005 No Magic, Inc 7-400

Page 393: MagicDraw UserManual

7-

TO O L SReports

7

Repor t Customizat ion

There is possibility to customize MagicDraw reports by editing XSL files.

The final report generation result is determined by the three parameters: report type (e.g. Model Report), report style (e.g. Default) and report output format (e.g. PDF).

Each report type can have one ore more report styles, and each report style can have up to six report output formats (HTML browsable and printable, XSL Formatting Objects, PDF, PS and RTF).

Report Output Format

Select the type of the report you want to be displayed:• HTML Browsable (*.html) Generates a report that is easy to browse. With

the browsable table of contents, you may easily find information you want on different pages.NOTE: HTML report is not available for Use Case Report, Software Design Description, and Model Extension Report.

• HTML Printable (*.html) Generates a report on one screen. You may easily print and analyze printed report.NOTE: HTML report is not available for Use Case Report, Software Design Description, and Model Extension Report.

• XSL Formatting Objects (*.fo) • Portable Document Format (*.pdf)• Post Script (*.ps)• Rich Text Format (*.rtf)

Report Paper Size

Choose the size or paper for all reports, excluding HTML reports.

Page Orientation

Choose the Portrait or Landscape page orientation for all reports, excluding HTML reports.

Generate Generates the report according to the appropriated options.

Export Creates report.properties file according to options specified in the Report Wizard. Choose the directory where you want to save this file.This file is used for generating reports from console.The description about Report Generator tool, see in Section “Report Generator Tool” on page 7-404.

Display in Viewer

After the generation, the generated report is opened in the corresponding viewer.

Save Configuration

Customize the report and save its configuration if you want to generate the report from command line, or you would like other users to use your configuration.

Select Configuration

Import already created report configuration.

Close Closes and exits the Report dialog box.

Help Displays MagicDraw Help.

Element name Function

401 © 2005 No Magic, Inc.

Page 394: MagicDraw UserManual

TO O L SReports

©

7

The concrete values of these three parameters (report type, style and output format) define the location of the "Main.xsl" file. MagicDraw takes the project file (XML) and appropriate "Main.xsl" file (XSLT) as input for report generation.

The "Main.xsl" file location pattern is:

<MD_install_dir>/data/report/report_types/<reportType>/xsl/<reportStyle>/<outputFormat>/Main.xsl,

-where-

• <MD_install_dir> is MagicDraw installation directory,

• <reportType> - report type name,

• <reportStyle> - report style name,

• <outputFormat> - report output format has three possible values (HTML_BROWSABLE, HTML_PRINTABLE and XSL_FO).

Some location examples:

NOTE There is no need to have separate XSL files for PDF, PS and RTF output formats, as XSL-FO is converted to one of these formats by FO formatter.

N E W R E P O R T S T Y L E C R E A T I O N E X A M P L E

Task:

Add new report style (named "My Style") for Model Report. Only HTML browsable report output format will be implemented.

Implementation:

Report Type Report Style

Output Format "Main.xsl" file location directory(under "<MagicDraw install dir>/data/report/report_types" directory)

Model Report Default HTML Browsable Model Report/xsl/Default/HTML_BROWSABLE

Model Report Default HTML Printable Model Report/xsl/Default/HTML_PRINTALBE

Model Report Default XSL Formatting Objects

Model Report/xsl/Default/XSL_FO

Model Report Custom XSL Formatting Objects

Model Report/xsl/Custom/XSL_FO

Use Case Report Default XSL Formatting Objects

Use Case Report/xsl/Custom/XSL_FO

Step Create item Where Item Description

1 Directory "My Style

"<MagicDraw install dir>/data/report/report_types/Model Report/xsl

Report Style directory.

2005 No Magic, Inc 7-402

Page 395: MagicDraw UserManual

TO O L SReports

7

After completion of these steps the new item "My Style" in the "Report Style" combo box (for "Model Report") will be available. Select this style and the "HTML Browsable" report output format to make MagicDraw use the newly created (or customized) XSL file for report generation.

NOTE The "Main.xsl" file is placed in the "HTML_BROWSABLE" directory and is intended to generate HTML (browsable) report. But this is not necessary. The real output format depends on the XSL file, which will describe the transformation. In principle the destination output format can be any format the XSL transformation can produce - HTML, XML or plain text. The real meaning of placing the "Main.xsl" file in "HTML_BROWSABLE" directory is that this transformation (without formatting) will be performed when the "HTML Browsable" report output format is selected during report generation.

2 Directory "HTML_BROWSABLE

"<MagicDraw install dir>/data/report/report_types/Model Report/xsl/My Style

The "Main.xsl" file for HTML browsable report generation will be stored here.

3 XSL file "Main.xsl

"<MagicDraw install dir>/data/report/report_types/Model Report/xsl/My Style/HTML_BROWSABLE

The "Main.xsl" file is a XSLT file, which will be used to generate "Model Report" with "My Style" report style and HTML browsable output format.

Step Create item Where Item Description

7-403 © 2005 No Magic, Inc.

Page 396: MagicDraw UserManual

TO O L SReports

7

F O N T S I N P D F A N D P S R E P O R T S

Support for custom fonts is added by creating font metric files (written in XML) from the actual font files, and registering them with FOP (FO formatter for PDF and PS reports). Currently only Type 1 and TrueType fonts can be added.

1. Font metric file creation

FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it. FOP also includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it.

To facilitate the metrics file creation the batch file is shipped with MagicDraw installs (data/report/conf/fonts/fontMetricsFile.bat).

Usage example: "fontMetricsFile.bat C:\WINNT\Fonts\tahoma.ttf tahoma"

The font metrics file "tahoma.xml" will be created.

NOTE All font metrics files must reside in the "data/report/conf/fonts" directory.

2. Registering fonts

FOP should know how to find and use the font metrics files. It is done by registering them. Add entries for your custom fonts, regardless of font type, to the configuration file (data/report/conf/userconfig.xml) in a manner similar to the following:

<font metrics-file="tahoma.xml" kerning="yes"embed-file="C:\WINNT\Fonts\tahoma.ttf"><font-triplet name="Tahoma" style="normal" weight="normal"/></font>

After registering fonts it is possible to use them in PDF and/or PS reports.

For more detailed information please follow the link: http://xml.apache.org/fop/fonts.html.

Repor t Generator Tool

S T A R T I N G R E P O R T G E N E R A T O R

Report generator launcher is generate_reports.exe. It requires to pass project and config parameters. Project parameter value is path to project file. config parameter value is path to report configuration file. For example:

generate_reports.exe -Dproject=c:\test\project.xml.zip -Dconfig=c:\config.properties

G E N E R A T I N G C O N F I G U R A T I O N F I L E

Configuration file contains report generation options.

Configuration file can be generated in the Report: open the Report, select all needed options and click Save Configuration button to save the selected options.

© 2005 No Magic, Inc 7-404

Page 397: MagicDraw UserManual

7-

TO O L SClass Diagram Wizard

7

Configuration file options:

Generated reports are placed in the same directory where MagicDraw UML is installed or you may choose other directory.

CLASS DIAGRAM WIZARDThe Class Diagram Wizard helps you create a new class diagram when all classes and their relationships are already created and specified. You may choose which classes, packages, and relationships will be included in a new class diagram, and the details of class representation (attributes, operations, accessibility) to be configured. The Class Diagram Wizard frees you from creating the class diagram manually. The Class Diagram Wizard, along with its dialog boxes, guide you through several steps and collect information along the way. It will automatically create a new class diagram and all the necessary elements.

Option Name Description

GENERATE_ALL_DIAGRAMS true to generate all project diagrams otherwise generate diagrams listed in DIAGRAM_LIST option.

GENERATE_RECURSIVELY Generate recursively: true or false

PAGE_SIZE Report page size for *.rtf, *.pdf, and xsl_fo output formats.

REPORT_STYLE Style name

REPORT_PACKAGES Package ID, separated by commas. If no value is specified, the report is generated for root package (Data package)

REPORT_FILE Name of the report, which also shows the directory of the report where the generated report will be save, e.g. C:\Reports\shop\index.html

IMAGE_FORMAT Image format: PNG or JPG

REPORT_PROPERTIES Template of the report: e.g. for Model Report: Built-In, Behavioral Model Report, or Static Model Report.

REPORT_TYPE Name of the used report type: Model Report, Use Case Report, Software Design Description, or Model Extension Report.

DIAGRAM_LIST List of diagrams to generate, if GENERATE_ALL_DIAGRAMS value is false. Values are diagram ID separated by comma.

OUTPUT_FORMAT Output format: HTML_BROWSABLE, HTML_PRINTABLE, RTF, PDF, XSL_FO, or PS

405 © 2005 No Magic, Inc.

Page 398: MagicDraw UserManual

TO O L SClass Diagram Wizard

©

7

To start the Class Diagram Wizard

From the Tools menu, choose New Class Diagram Wizard. The main Class Diagram Wizard appears.

Figure 139 -- Class Diagram Wizard. Diagram name

Type or leave the default the name of a new diagram in the Type Class Diagram name text box.

Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button.

Buttons available in the Class Diagram Wizard, parent package window:

• Next> – proceeds to the next step - Select Elements.

• Cancel – cancels the wizard.

2005 No Magic, Inc 7-406

Page 399: MagicDraw UserManual

TO O L SClass Diagram Wizard

7

• Help – displays MagicDraw Help

Figure 140 -- Class Diagram Wizard. Select Elements

• All list – contains all model elements.

• Selected list – contains all the elements that are added to the class diagram.

Buttons available in the Class Diagram Wizard, select elements window:

• Add – adds selected model elements from the All to the Selected list.

• Add All – adds all elements located in the same hierarchy level as the selected element to the Selected list.

• Add Recursively – adds all selected elements in the selected package and all elements from nested packages to the Selected list.

• Remove – removes the selected element from the Selected list.

• Remove All – removes all selected elements.

• <Back – returns to the previous dialog box. Correct data entered in the previous step.

• Next> – proceeds to the next step - Select Relationships.

• Finish – finishes the configuration of your class diagram. All other options will be set by default. The Class Diagram Wizard exits and the created class diagram is displayed.

7-407 © 2005 No Magic, Inc.

Page 400: MagicDraw UserManual

TO O L SClass Diagram Wizard

©

7

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

Figure 141 -- Class Diagram Wizard. Select Relationships

Select relationships you wish to include in the class diagram:

• Generalization – relationship between a more general and a more specific element (inheritance, extension).

• Realization – relationship between model elements where one of the elements implements the interface defined by the other model element.

• Association – semantic relationship between classes.

• Dependency – usage relationship between UML model elements.

Buttons available in the Class Diagram Wizard, select relationships window:

• <Back – returns to the previous dialog box. Correct data, entered in the previous step.

• Next> – proceeds to the next step - Specify Symbols Properties.

• Finish – finishes the configuration of your class diagram. All other options will be set by default. The Class Diagram Wizard exits and the created class diagram is displayed.

• Cancel – cancels the wizard.

2005 No Magic, Inc 7-408

Page 401: MagicDraw UserManual

7

TO O L SClass Diagram Wizard

7

• Help – displays MagicDraw Help

Figure 142 -- Class Diagram Wizard. Specify Symbols Properties

Select options for elements to be represented in the class diagram.

NOTE If the Suppress Attributes and the Suppress Operations check boxes are selected, the class is displayed only as a rectangular with the class name in it.

Buttons available in the Class Diagram Wizard, symbols properties window:

• Reset To Defaults - if changes were made to element properties, values will be set to default.

• <Back – returns to the previous dialog box. Correct data is entered in the previous step.

• Finish – finishes the configuration of your class diagram. All other options will be set by default. The Class Diagram Wizard exits and the created class diagram is displayed.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

-409 © 2005 No Magic, Inc.

Page 402: MagicDraw UserManual

TO O L SPackage Dependency Wizard

©

7

PACKAGE DEPENDENCY WIZARD The Package Dependency Diagram Wizard generates diagrams containing packages (created within a project) and shows the relationships between them. The diagram may reflect all packages in the project, or just those chosen. The Package Dependency Diagram Wizard collects all the information needed to both analyze dependencies and to generate a new diagram.

To start the Package Dependency Diagram Wizard

Choose the Package Dependency Wizard from the Diagrams menu, Diagram Wizards submenu.

Figure 143 -- Package Dependency Diagram Wizard. Diagram name

Type the name for a newly created diagram in the Type Class Diagram name text box.

Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button.

Buttons available in the Package Dependency Diagram Wizard, specify name and package window:

• Next> – proceeds to the next step - Select Packages.

2005 No Magic, Inc 7-410

Page 403: MagicDraw UserManual

7-

TO O L SPackage Dependency Wizard

7

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help

Figure 144 -- Package Dependency Diagram Wizard. Select Package.

• All list – contains all packages.

• Selected list – contains all packages that are added to the diagram.

Buttons available in the Package Dependency Diagram Wizard, selected packages window:

• Add – adds selected package from the All to the Selected list.

• Add All – adds all packages located in the same hierarchy level as the selected element to the Selected list.

• Add Recursively – adds all selected elements in the selected package and all elements from nested packages to the Selected list.

• Remove – removes the selected element from the Selected list.

• Remove All – removes all selected elements.

• <Back – returns to the previous dialog box. Correct data, entered in the previous step.

• Next> – proceeds to the next step - Specify Symbols Properties.

• Finish – finishes the configuration of your class diagram. All other options will be set by default. The Package Dependency Diagram Wizard exits and the created class diagram is displayed.

• Cancel – cancels the wizard.

411 © 2005 No Magic, Inc.

Page 404: MagicDraw UserManual

TO O L SPackage Overv iew Diagram Wizard

©

7

• Help – displays MagicDraw Help

Figure 145 -- Package Dependency Diagram Wizard. Specify Symbols Properties

Select options for elements to be represented in the class diagram.

Buttons available in the Package Dependency Diagram Wizard, symbols properties window:

• Reset To Defaults - if changes were made to element properties, values will be set to default.

• <Back – returns to the previous dialog box. Correct data is entered in the previous step.

• Finish – finishes the configuration of your class diagram. All other options will be set by default. The Package Dependency Diagram Wizard exits and the created class diagram is displayed.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

PACKAGE OVERVIEW DIAGRAM WIZARD The Package Overview Diagram Wizard allows to create diagram for every package from selected scope (reversed packages). Created diagram displays content of packages – inner packages with inner elements connected with available relations.

To start the Package Overview Diagram Wizard

• Choose the Package Overview Diagram Wizard from the Diagrams menu, Diagram Wizards submenu.

2005 No Magic, Inc 7-412

Page 405: MagicDraw UserManual

7-

TO O L SPackage Overv iew Diagram Wizard

7

• Invoke the package shortcut menu, choose Tools and then Package Overview Diagram Wizard.

• From the Tools menu, choose the Model Visualizer command. The Model Visualizer dialog box appears. In the wizards list, select the Package Overview Diagram Wizard. Double click or in the Model Visualizer dialog box, click the Start button.

Figure 146 -- Package Dependency Diagram Wizard. Diagram name

Type the name for a newly created diagram in the Type Class Diagram name text box.

The Add diagrams into their own package option button -while creating new package overview diagrams, adds diagrams in the same package they are created.

The Add all diagrams into selected package - while creating new package overview diagrams, add diagrams in the selected package. Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button.

Buttons available in the Package Overview Diagram Wizard, specify name and package window:

• Next> – proceeds to the next step - Select Packages.

• Cancel – cancels the wizard.

413 © 2005 No Magic, Inc.

Page 406: MagicDraw UserManual

TO O L SPackage Overv iew Diagram Wizard

©

7

• Help – displays MagicDraw Help

Figure 147 -- Package Overview Diagram Wizard. Select Package.

Select the packages, which will be represented in new diagram. For every selected package diagram will be created.

If some selected package is read-only and package for diagrams is not specified, warning on pressing the Next button will be displayed

Buttons available in the Package Overview Diagram Wizard, selected packages window:

• <Back – returns to the previous dialog box. Correct data, entered in the previous step.

• Next> – proceeds to the next step - Define Advanced Options.

• Cancel – cancels the wizard.

2005 No Magic, Inc 7-414

Page 407: MagicDraw UserManual

7-

TO O L SPackage Overv iew Diagram Wizard

7

• Help – displays MagicDraw Help

Figure 148 -- Package Overview Diagram Wizard. Define Advanced Options

Set the advanced properties for elements to be represented in the diagrams.

If you want to see created class diagram all elements structure in the created diagram, select the Show all elements option button (default option).

If Show only packages option will be selected, only package content class diagram will be created.

The Analyze and show package dependencies check box - creates dependencies among, on level packages. Analyzes are performed of all inner elements, recursively by all criteria.

The Show inner packages in the package shape check box - displays one level inner packages in every package shape, connected with dependencies.

The Assign hyperlinks to created diagrams check box - adds active hyperlink to every package, referenced to inner diagram of this package.

Buttons available in the Package Overview Diagram Wizard, define advanced options window:

• <Back – returns to the previous dialog box. Correct data is entered in the previous step.

• Next> - proceeds to the next step - Select Relationships.

• Finish – finishes the configuration of your diagram. All other options will be set by default. The Package Overview Diagram Wizard exits and the created diagram is displayed.

• Cancel – cancels the wizard.

415 © 2005 No Magic, Inc.

Page 408: MagicDraw UserManual

TO O L SPackage Overv iew Diagram Wizard

7

• Help – displays MagicDraw Help.

Figure 149 -- Package Overview Diagram Wizard. Select Relationships

Select relationships you wish to include in the class diagram:

• Generalization – relationship between a more general and a more specific element (inheritance, extension).

• Realization – relationship between model elements where one of the elements implements the interface defined by the other model element.

• Association – semantic relationship between classes.

• Dependency – usage relationship between UML model elements.

Buttons available in the Package Overview Diagram Wizard, select relationships window:

• <Back – returns to the previous dialog box. Correct data is entered in the previous step.

• Next> - proceeds to the next step - Specify Symbols Properties.

• Finish – finishes the configuration of your class diagram. All other options will be set by default. The Package Dependency Diagram Wizard exits and the created class diagram is displayed.

• Cancel – cancels the wizard.

© 2005 No Magic, Inc 7-416

Page 409: MagicDraw UserManual

TO O L STools for Analys is

7

• Help – displays MagicDraw Help.

Figure 150 -- Package Overview Diagram Wizard. Select Relationships

Select options for elements to be represented in the diagram.

Buttons available in the Package Overview Diagram Wizard, symbols properties window:

• Reset To Defaults - if changes were made to element properties, values will be set to default.

• <Back – returns to the previous dialog box. Correct data is entered in the previous step.

• Finish – finishes the configuration of your diagram. All other options will be set by default. The Package Overview Diagram Wizard exits and the created diagram is displayed.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

TOOLS FOR ANALYSISMagicDraw contains tools that help you analyze the relationships between elements created in the UML model. It is also possible to analyze the inheritance and dependency relationships between classes.

Select a class in the Browser tree or on the Diagram pane. Choose Tools from the class shortcut menu, and then choose analysis tool.

7-417 © 2005 No Magic, Inc.

Page 410: MagicDraw UserManual

TO O L STools for Analys is

©

7

Hierarchy Diagram Wizard

The Hierarchy Diagram Wizard collects largest hierarchies and allows to display every of them as separate diagram or all in one diagram.

To start the Hierarchy Diagram Wizard

• From the Diagrams main menu, choose the Diagram Wizards command and then Hierarchy Diagram Wizard.

• From the Tools menu, choose the Model Visualizer command. The Model Visualizer dialog box appears. From the wizards list, select the Hierarchy Diagram Wizard.

• From the model element shortcut menu, choose Tools and then Hierarchy Diagram Wizard.

Figure 151 -- Hierarchy Diagram Wizard. Specify Name and Package

Type the name for a new diagram in the Type diagram name field.

Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button.

Buttons available in the Hierarchy Diagram Wizard, specify name and package window:

2005 No Magic, Inc 7-418

Page 411: MagicDraw UserManual

TO O L STools for Analys is

7

• Next> – proceeds to the next step - Select Scope.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help

Figure 152 -- Hierarchy Diagram Wizard. Select Scope

Select packages where to search hierarchy elements and add the from the All to the Selected list.

Buttons available in the Hierarchy Diagram Wizard, select scope window:

• <Back – returns to the previous dialog box. Correct the data entered in the previous step.

• Next> – proceeds to the next step - Select Hierarchies.

• Cancel – cancels the wizard.

7-419 © 2005 No Magic, Inc.

Page 412: MagicDraw UserManual

TO O L STools for Analys is

©

7

• Help – Displays MagicDraw Help

Figure 153 -- Hierarchy Diagram Wizard. Select Hierarchies.

The Add all hierarchies into one diagram check box creates only one diagram for all selected hierarchies. This option is enabled only if selected hierarchies can be added into one diagram (the same diagram type).

All available hierarchies are listed in the Parent Element column. In the Children Count column, number of model elements is presented.

The Show outside parent check box shows hierarchies, when derived packages are in the scope, but specializations is from outside scope.

The Show outside children check box counts outside derived elements from displayed hierarchies. Otherwise hierarchy will be not fully displayed and diagram may be not valid.

Buttons available in the Hierarchy Diagram Wizard, select hierarchy window:

• <Back – returns to the previous dialog box. Correct data, entered in the previous step.

• Next> – proceeds to the next step - Specify Symbols Properties

• Finish – finishes the configuration of your class diagram. All other options will be set by default. The Hierarchy Diagram Wizard exits and the generation starts.

• Cancel – cancels the wizard.

2005 No Magic, Inc 7-420

Page 413: MagicDraw UserManual

TO O L STools for Analys is

7

• Help – displays MagicDraw Help

Figure 154 -- Hierarchy Diagram Wizard. Specify Symbols Properties

Select options for elements to be represented in the diagram.

Buttons available in the Hierarchy Diagram Wizard, symbols properties window:

• Reset To Defaults - if changes were made to elemet properties, values will be set to default.

• <Back – returns to the previous dialog box. Correct data is entered in the previous step.

• Finish – finishes the configuration of your class diagram. All other options will be set by default. The Hierarchy Diagram Wizard exits and the created diagram is displayed.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

Real i zat ion Diagram Wizard

The Realization Diagram Wizard shows table of largest elements groups that realizes some interface.

To start the Hierarchy Diagram Wizard

• From the Diagrams main menu, choose the Diagram Wizards command and then Realization Diagram Wizard .

7-421 © 2005 No Magic, Inc.

Page 414: MagicDraw UserManual

TO O L STools for Analys is

7

• From the Tools menu, choose the Model Visualizer command. The Model Visualizer dialog box appears. From the wizards list, select the Realization Diagram Wizard.

• From the model element shortcut menu, choose Tools and then Realization Diagram Wizard.

Figure 155 -- Realization Diagram Wizard. Specify Name and Package

Type the name for a new diagram in the Type diagram name field.

Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button.

Buttons available in the Realization Diagram Wizard, specify name and package window:

• Next> – proceeds to the next step - Select Scope.

• Cancel – cancels the wizard.

© 2005 No Magic, Inc 7-422

Page 415: MagicDraw UserManual

TO O L STools for Analys is

7

• Help – displays MagicDraw Help

Figure 156 -- Realization Diagram Wizard. Select Scope

Select packages where to search hierarchy elements and add the from the All to the Selected list.

Buttons available in the Realization Diagram Wizard, select scope window:

• <Back – returns to the previous dialog box. Correct the data entered in the previous step.

• Next> – proceeds to the next step - Select Implementations.

• Cancel – cancels the wizard.

7-423 © 2005 No Magic, Inc.

Page 416: MagicDraw UserManual

TO O L STools for Analys is

7

• Help – Displays MagicDraw Help

Figure 157 -- Realziation Diagram Wizard. Select Implementations

The Add all implementations into one diagram check box creates only one diagram for all selected realizations. This option is enabled only if selected realizations can be added into one diagram (the same diagram type).

All available implementations are listed in the Specialization Element column. In the Implementations Count column, number of model elements is presented.

The Show outside specializations check box show realizations, when derived interfaces are in the scope, but specializations is from outside scope.

The Show outside implementations check box count outside derived elements from displayed realizations. Otherwise realization will be not fully displayed and diagram can be not valid.

Buttons available in the Hierarchy Diagram Wizard, select hierarchy window:

• <Back – returns to the previous dialog box. Correct data, entered in the previous step.

• Next> – proceeds to the next step - Spedify Symbols Properties.

• Finish – finishes the configuration of your class diagram. All other options will be set by default. The Realization Diagram Wizard exits and the generation starts.

• Cancel – cancels the wizard.

© 2005 No Magic, Inc 7-424

Page 417: MagicDraw UserManual

TO O L STools for Analys is

7

• Help – displays MagicDraw Help

Figure 158 -- Realization Diagram Wizard. Specify Symbols Properties

Select options for elements to be represented in the diagram.

Buttons available in the Realization Diagram Wizard, symbols properties window:

• Reset To Defaults - if changes were made to elemet properties, values will be set to default.

• <Back – returns to the previous dialog box. Correct data is entered in the previous step.

• Finish – finishes the configuration of your class diagram. All other options will be set by default. The Realization Diagram Wizard exits and the created diagram is displayed.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

7-425 © 2005 No Magic, Inc.

Page 418: MagicDraw UserManual

TO O L SContent Diagram Wizard

7

CONTENT DIAGRAM WIZARDThe Content Diagram Wizard generates content of all diagrams, usable in the project.

To start the Content Diagram Wizard

1 From the Diagrams main menu, choose Diagram Wizards and then Content Diagram Wizard.

Figure 159 -- Content Diagram Wizard. Specify Name and Package

Type the name for a new diagram in the Type diagram name text box.

Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button.

Buttons available in the Content Diagram Wizard, type diagram name window:

• Next> – proceeds to the next step - Parent package.

• Cancel – cancels the wizard.

© 2005 No Magic, Inc 7-426

Page 419: MagicDraw UserManual

TO O L SContent Diagram Wizard

7

• Help – displays MagicDraw Help

Figure 160 -- Content Diagram Wizard. Select Diagrams Types.

Select what types of the diagrams will be included to the content diagram.

Buttons available in the Content Diagram Wizard, types of diagrams window:

• <Back – returns to the previous dialog box. Correct data, entered in the previous step.

• Next> – proceeds to the next step - Select objects.

• Cancel – cancels the wizard.

• Help - displays MagicDraw Help.

7-427 © 2005 No Magic, Inc.

Page 420: MagicDraw UserManual

TO O L SSequence Diagram from Java Source Wizard

7

Figure 161 -- Content Diagram Wizard. Select diagrams.

Buttons available in the Content Diagram Wizard, select objects window:

• Add – adds selected objects from the All list to the Selected list.

• Add All – adds all packages located in the same hierarchy level as the selected element to the Selected list.

• Add Recursively – adds all selected elements in the selected package and all elements from nested packages to the Selected list.

• Remove – removes the selected element from the Selected list.

• Remove All – removes all selected elements.

• <Back – returns to the previous dialog box. Correct data, entered in the previous step.

• Finish – finishes the configuration of your content diagram. All other options will be set by default. The Content Diagram Wizard exits and the created content diagram is displayed.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

SEQUENCE DIAGRAM FROM JAVA SOURCE WIZARDThe Sequence Diagram from Java Source Wizard allows visualizing Java method implementation with UML Sequence diagram. UML Sequence diagram can not show Java code 100% correctly, so MagicDraw provides mechanism that generates diagram that reflects essential of Java method content.

To start the Sequence Diagram from Java Source Wizard

1 From the Tools menu, choose the Model Visualizer command. The Model Visualizer dialog box appears.

2 In the Model Visualizer dialog box, in the wizards list, select the Sequence Diagram from Java Source Wizard.

3 Double click or click the Start button. The Sequence Diagram from Java Source Wizard is opened.

• From the Diagrams menu, choose the Diagram Wizards command and then Sequence Diagram from Java Source Wizard.

• Create class with operation. Create new code engineering Java set. Add class to this set. In the Browser, Code engineering sets tree, select the RTMethod node. Invoke its shortcut menu. Select the Reverse Implementation command. The Sequence Diagram from Java Source Wizard is opened (method is selected in wizard).

© 2005 No Magic, Inc 7-428

Page 421: MagicDraw UserManual

TO O L SSequence Diagram f rom Java Source Wizard

7

• Create class with operation. Select operation in the Browser. Invoke operation shortcut menu, choose the Reverse Implementation command. The Sequence Diagram from Java Source Wizard is opened (method is selected in wizard).

• In the Sequence diagram create call message. Select it on diagram pane. Invoke message shortcut menu. Choose the Reverse Implementation command. The Sequence Diagram from Java Source Wizard is opened (method is selected in wizard).

Figure 162 -- Sequence Diagram from Java Source Wizard. Specify Name and Package

Type the name for a new sequence diagram in the Type diagram name text box. By default, name of the class and method will be given to the sequence diagram.

Choose the package that will contain the created diagram. The hierarchy of UML model packages is displayed in the Select package for diagram list window. Choose the package that will be the parent for the newly created diagram from the Data tree or create a new package by clicking the New button.

Buttons available in the Sequence Diagram from Java Source Wizard, Specify Name and Package window:

• Next> – proceeds to the next step - Select Operation.

• Cancel – cancels the wizard.

7-429 © 2005 No Magic, Inc.

Page 422: MagicDraw UserManual

TO O L SSequence Diagram from Java Source Wizard

7

• Help – displays MagicDraw Help

Figure 163 -- Sequence Diagram from Java Source Wizard. Select Operations.

Select method (operation), which will be displayed in the sequence diagram. If wizard is invoked from operation shortcut menu or from Sequence diagram, operation and Java source file is already selected.

In the Select Java source file field, specify the Java source file, if this file cannot be found automatically.

Buttons available in the Sequence Diagram from Java Source Wizard, Select Operation window:

• <Back – returns to the previous dialog box. Correct data, entered in the previous step.

• Next> – proceeds to the next step - Select Classes for Diagram.

• Cancel – cancels the wizard.

© 2005 No Magic, Inc 7-430

Page 423: MagicDraw UserManual

TO O L SSequence Diagram f rom Java Source Wizard

7

• Help - displays MagicDraw Help.

Figure 164 -- Sequence Diagram from Java Source Wizard. Select Classes for Diagram.

The Analyze and split long expressions in diagram check box - if expression contains calls and cannot be displayed as call message, then every call will be shown as separate call message with temporary variable initialization. In final expression message these calls will be replaced into appropriate temp variable names.

The Create return message check box- displays return message for every call message.

The Wrap message text check box - specifies the maximum message text length in pixels, to wrap longer message.

Buttons available in the Sequence Diagram from Java Source Wizard, select classes for diagram window:

• <Back – returns to the previous dialog box. Correct data, entered in the previous step.

• Next> - proceeds to the next step - Specify Symbols Properties.

• Finish – finishes the configuration of your sequence diagram. All other options will be set by default. The Sequence Diagram from Java Source Wizard exits and the created sequence diagram is displayed.

• Cancel – cancels the wizard.

7-431 © 2005 No Magic, Inc.

Page 424: MagicDraw UserManual

TO O L SPat tern Wizard

7

• Help – displays MagicDraw Help.

Select options for elements to be represented in the sequence diagram.

Buttons available in the Sequence Diagram from Java Source Wizard, specify symbols properties window:

• <Back – returns to the previous dialog box. Correct data, entered in the previous step.

• Finish – finishes the configuration of your sequence diagram. All other options will be set by default. The Sequence Diagram from Java Source Wizard exits and the created sequence diagram is displayed.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

NOTE: You can extend created sequence diagram by method. Select method (message), which you want to be displayed more detail including referenced classes and other defining methods and from the message shortcut menu, choose Reverse Implementation command. The Sequence Diagram from Java Source Wizard appears.

PATTERN WIZARDIn MagicDraw, you may find various GOF, Java, Junit, CORBA IDL, and XML Schema design patterns.

You may also create new patters and edit existing ones using Java code or JPython scripts. For a detailed description, see MagicDraw Open Api user’s guide.

© 2005 No Magic, Inc 7-432

Page 425: MagicDraw UserManual

TO O L SPattern Wizard

7

To open the Pattern Wizard

• In the class diagram, click the Class by Pattern button.

• Choose Tools from the class shortcut menu and then choose the Apply Pattern subcommand.

• Select a class and choose Apply Pattern from the Tools main menu.

Figure 165 -- Pattern Wizard

The Pattern Wizard has three main collections of customizable options, which are represented by hierarchy tree on the left side of the dialog box:

Category Design Pattern

Properties

GofTemplates described in the Design Patterns of Reusable Object-Oriented Software

Adapter Interface ClassAdapter ClassAdaptee ClassNOTE The Next > button is activated.

In the Adapter Operations screen, add or remove operations you want to use.

7-433 © 2005 No Magic, Inc.

Page 426: MagicDraw UserManual

TO O L SPat tern Wizard

7

Bridge AbstractionImplementorImplementor is: Abstract Class or InterfaceName of ReferenceSuffix of the Concrete ImplementorNOTE The Next > button is activated.

In the Deriver Classes screen, add or remove classes you want to use.

Composite Component ClassComposite ClassNOTE The Next > button is activated.

In the Composite Operations screen, add or remove operations you want to use.

Decorator Component ClassDecorator ClassConcrete Decorator ClassNOTE The Next > button is activated.

In the Decorator Operations screen, add or remove operations you want to use.

Observer Subject ClassObserver ClassConcrete Subject ClassConcrete Observer Class

Proxy Subject ClassProxy ClassReal Subject ClassNOTE The Next > button is activated.

In the Proxy Operations screen, add or remove operations you want to use.

Singleton Singleton class

Visitor Visitor ClassImplementation Style: visit (MyClass), visitMyClass (MyClass)NOTE The Next > button is activated.

In the Elements to Visit screen, select classes and interfaces you want to visit.

JavaSpecific Java design patterns

Main Main class

Category Design Pattern

Properties

© 2005 No Magic, Inc 7-434

Page 427: MagicDraw UserManual

TO O L SPattern Wizard

7

EJB

Entity

Message Driven

Session

Sichronize NamesEJB NameEJB ClassRemote InterfaceHome InterfaceLocal InterfaceLocal Home InterfaceDisplay NameLarge IconSmall IconAbstract Schema NameCmp VersionPersistence TypeReentrantPrimary Key Class

EJB NameEJB ClassDisplay NameLarge IconSmall IconAcknowledge ModeDestination TypeSubscripting DurabilityMessage SelectorTransaction Type

Sichronize NamesEJB NameEJB ClassRemote InterfaceHome InterfaceLocal InterfaceLocal Home InterfaceDisplay NameLarge IconSmall IconSession TypeTransaction TypeNOTE The Next > button is activated.

In the Remote Methods screen, add or remove operations you want to use.

Category Design Pattern

Properties

7-435 © 2005 No Magic, Inc.

Page 428: MagicDraw UserManual

TO O L SPat tern Wizard

7

Java RMI Java RMI ClassRemote InterfaceNOTE The Next > button is activated.

In the Remote Methods screen, add or remove operations you want to use.

JUnitJUnit is a regression testing framework. It is used by the developer who implements unit tests in Java. JUnit is Open Source Software. The provided templates let to create the constructions, implemented in the JUnit framework. For more information, look at http://www.junit.org.

TestCase TestCase ClassCreate suite()Create Constructor TestCase(String)Create runTest()Create setUp()Create tearDown()

Tested Class

Tested ClassTestCase ClassCreate suite()Create Constructor TestCase(String)Create runTest()Create setUp()Create tearDown()NOTE: The Next > button is activated.

In the Tested Operations pane, add or remove operations you want to use.

XML SchemaSpecific XML design patterns

XSDcomplexType

Target ClassContent: XSDcomplex content, XSDsimple content.

XSDcompositor

Target ClassCompositor: XSDall, XSDchoice, XSDsequenceParticle

XSD simpleType

Target ClassContent: XSDrestriction, XSDlist, XSDunion

XSD simpleType(XSDlist)

Target ClassItem Type

XSD simpleType(XSDunion)

Target Class

Category Design Pattern

Properties

© 2005 No Magic, Inc 7-436

Page 429: MagicDraw UserManual

TO O L SPattern Wizard

7

SimpleXSDrestricton

Target ClassStereotype: XSDsimpleType, XSDsimpleContentBaseMin ExclusiveMax ExclusiveMax InclusiveMin InclusiveTotal DigitsFraction DigitsLengthMin LengthMax LengthWhite SpacePattern

WSDLSpecific WSDL design pattern

Binding Use the Binding pattern when you want to create binding of some PortType.

CORBA IDLSpecific CORBA IDL design patterns

Interface NameAbstractLocal Interface

Value Type NameAbstractCustom Value Type

Type Definition

NameType Definition Specifier: typedef, boxed valueBase Type

Sequence NameBase TypeSequence SizeAnonymous

Array NameBase TypeArray SizeAnonymous

Fixed NameDigitsScaleAnonymous

Union NameDiscriminator Type

Enumeration

Name

Struct Name

Exception Name

< Back Go back to the Pattern screen.

Category Design Pattern

Properties

7-437 © 2005 No Magic, Inc.

Page 430: MagicDraw UserManual

TO O L SCreat ing Set ters / Get ters

7

CREATING SETTERS / GETTERSSetters and getters are common operations that contain almost every class. With the help of MagicDraw UML, set and get operations for class attributes can be generated automatically.

To create a setter or getter

• From the shortcut menu of the selected class, choose Tools, and then choose Create Setters/Getters. The Select Attributes/Association Ends dialog box appears.

• Add a tagged value "getter/setter for attribute=attribute_name" to the selected class.

Figure 166 -- Select Attributes dialog box

Next > Go to the other appropriated screen.

Finish Finishes and implements the wizard. The appropriated classes and interfaces are created.

Cancel Cancels the wizard without implementing your actions.

Help The MagicDraw Help is displayed.

Box Function

All Contains names of all attributes defined within the selected class.

Category Design Pattern

Properties

© 2005 No Magic, Inc 7-438

Page 431: MagicDraw UserManual

TO O L SImplement ing or Overr id ing Operat ions

7

The names of created operations (setters) are combined according to the following format:

public void set + <attribute name> (<attribute type> <attribute name>)For example, if you have an attribute called x of type int, then the generated setter will look that way:

public void setx (int x) The names of created operations (getters) are combined according to the following format:

public <attribute type> get + <attribute name> ( )For example, if you have an attribute called x of type int, then the generated setter will look this way:

public int getx ();

IMPLEMENTING OR OVERRIDING OPERATIONSWhen you inherit classes from the base class, which 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.

The command Implement/Override Operations command can be invoked in 2 cases:

• When one classifier inherits operations from the base classifier (Generalization relationship).

• When some classifier implements Interface (Realization relationship).

Selected Contains the selected attributes.

> Moves the selected attribute from the All list to the Selected list. Setter for that attribute will be generated.

< Moves selected attribute from the Selected list to the All list.

>> Moves all attributes from the All list to the Selected list. Setters for all of them will be generated.

<< Moves all attributes from the Selected to the All list.

Prefix to Remove Type a prefix of an attribute (-, ….) you want remove while generating setters or getters.

Create Setters Generates setters for the selected attributes.

Create Getters Generates getters for the selected attributes.

Prefix for Setter Choose a prefix for the generated setter (operation). Possible choices: set or Set

Prefix for Getter Choose a prefix for the generated getter (operation). Possible choices: get;is, Get;Is; get, or Get. NOTE Get is used for every getter, is is used if the type

of an attribute is set as Boolean.

OK Generates setters or/and getters for attributes that are in the Selected Items list.

Cancel Exits the dialog box without any changes.

Help Displays MagicDraw Help

Box Function

7-439 © 2005 No Magic, Inc.

Page 432: MagicDraw UserManual

TO O L SModel Transformat ion Wizard

7

To start the Implement/Override Operations tool

From the shortcut menu of the selected class, choose Tools. Then, choose Implement/Override Operations. The Select Operations to Implement/Override dialog box appears.

Figure 167 -- Select Operations to Implement/Override dialog box

TIP!: Double-click the item name, and it will be moved to the opposite list.

MODEL TRANSFORMATION WIZARDModel transformation is a data set, which fully describes the action of applying model transformation on a set of packages. Transformation type, parameters, packages set to transform and the destination of the model transformation results are the parts of model transformation.

T Y P E S O F T H E T R A N S F O R M A T I O N S

The available from/to types of transformations are:

Box Function

All Contains names of all operations defined within the selected class.

Selected Contains the selected operations.

> 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.

OK Generates operations that are in the Selected list.

Cancel Exits the dialog box without any changes.

Help Displays MagicDraw Help

© 2005 No Magic, Inc 7-440

Page 433: MagicDraw UserManual

TO O L SModel Transformat ion Wizard

7

• Any to Any - this transformations makes possibility to copy all or part of the model to the other package without making changes or change destination model by applying some transformation mapping rules.

• UML to XML Schema - this transformation helps to create XML Schema models from pure UML models. Basically this transformation is copying of source model, and then applying necessary stereotypes according to the XML schema modeling rules.

• XML Schema to UML - derives pure UML model from XML Schema. It is copying of the source model striping the unnecessary stereotypes. Reverse transformation can loose some information in the destination model because derives more abstract model from more specific.

• Generic DDL to Oracle DDL - helps to create more specidic Oracle DDL models from Generic DDL. In this transformation, mapping will be performed using appropriate Oracle DDL types.

• UML to Generic DDL - helps to create generic DDL models from UML models. It is copying elements from the source to destination and applying appropriate stereotypes. The transformation works only with classes, packages and association relationships.

• UML to Oracle DDL - helps to create Oracle DDL models from UML models. In this transformation, mapping will be performed using appropriate Oracle DDL types.

• DDL to UML - derives UML model from DDL model.

M O D E L T R A N S F O R M A T I O N W I Z A R D

To start the Model Transformation Wizard

• From the Tools main menu, choose the Model Transformations command.

• Select the package(s), from the shortcut menu, choose Tools and then the Transform command.

7-441 © 2005 No Magic, Inc.

Page 434: MagicDraw UserManual

TO O L SModel Transformat ion Wizard

7

Figure 168 -- Model Transformation Wizard. Select transformation type

Types of the transformations are displayed in the list window.

Buttons available in the Model Transformations Wizard, Select transformation type window:

• Next> – proceeds to the next step - Select source/destination.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

Figure 169 -- Model Transformation Wizard. Select source/destination

The Transformation Source tree displays all project data - packages with inner elements, which can be selected as source for transformation.

© 2005 No Magic, Inc 7-442

Page 435: MagicDraw UserManual

TO O L SModel Transformat ion Wizard

7

The Place transformation model in package radio button specifies the package to which source will be transformed. Click the ‘...’ button to invoke the Destination Package dialog box. Select existing package from the Packages tree or create a new one.

The Transform in place radio button specifies that source package structure will correspond to destination package.

Buttons available in the Model Transformations Wizard, Select source/destination window:

• <Back – returns to the previous dialog box.

• Next> – proceeds to the next step - Select type mappings.

• Finish – finishes the configuration of transformation. All other options will be set by default. The Model Transformations Wizard exits and results of transformation appear in the project.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

Figure 170 -- Model Transformation Wizard. Select type mappings

The Transformation type map profile combo box displays default or manually created mapping profiles, which specifies the mapping rules that should be applied to model during transformation.

The From type and To type fields displays type mappings of the selected transformation profile.

The Run type mapping in reverse order check box allows to make opposite type mapping in transformation.

Buttons available in the Model Transformations Wizard, Select type mapping window:

• <Back – returns to the previous dialog box.

• Next> – proceeds to the next step - Specify transformation details. (This button is disabled in Any to Any transformation).

7-443 © 2005 No Magic, Inc.

Page 436: MagicDraw UserManual

TO O L SModel Transformat ion Wizard

7

• Finish – finishes the configuration of transformation. The Model Transformations Wizard exits and results of transformation appear in the project.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

Figure 171 -- Model Transformation Wizard. Specify transformation details

The Transformation Details table displays various properties of specific transformation, selected in the Model Transformation Wizard Step1. You can change the default value of the element here.

The Reset to Defaults button changes transformation properties to default values.

Buttons available in the Model Transformations Wizard, Specify transformation details window:

• <Back – returns to the previous dialog box.

• Finish – finishes the configuration of transformation. The Model Transformations Wizard exits and results of transformation appear in the project.

• Cancel – cancels the wizard.

• Help – displays MagicDraw Help.

M O D E L T R A N S F O R M A T I O N M A P P I N G

When transforming the model, it is possible to map types, used in the classes of the transformation. This mapping is usually used to map primitive types from one domain into appropriate primitive types in another domain.

The map is a collection of rules “from type - to type”. The following elements can be used in creating mapping rules. They are stored in the Model Transformation Profile.

© 2005 No Magic, Inc 7-444

Page 437: MagicDraw UserManual

TO O L SModel Transformat ion Wizard

7

To create transformation mapping rules

1 Import or use Model_Transformation_Profile.xml.zip.2 To the newly created rules package, apply stereotype with name <<

typeMap>>.3 Choose standard types, which will used in transformation mapping and create

dependency relationship from one type to another. Apply stereotype with name <<map>> to dependency.

This example shows that after transformation, all int types will be transformed to char.

Note: To change behavior of the mapping, read the section

4 Start the Model Transformations Wizard. In Step 3 Select type mapping, open the Transformation type map profile combo box and choose the package, containing mapping rules.

5 Finish wizard. Transformation mapping according to created rules will be performed to transformed model.

T R A N S F O R M A T I O N M A P P I N G P O S S I B I L I T I E S

To change behavior of mapping, set appropriate tags on dependency relationship:

• Default type mapping can be applied both ways. For example, if you have type map from int to char, you may use it to change all int types to char. But if you select the Run type mapping in reverse order check box in the Select type mappings Step3 of the Model Transformation Wizard - type map will be applied in reverse order - all char will be changed to int. To change such behavior, create value for the direction tag in the Dependecy Specification dialog box.

7-445 © 2005 No Magic, Inc.

Page 438: MagicDraw UserManual

TO O L SModel Transformat ion Wizard

7

Default value is "both". Change to "forward" to have this mapping valid only forward or to "reverse" - for reverse only.

• If you want to apply direction order for all dependencies, you may set value for defaultDirection tag in the Package Specification dialog box. This package has <<typeMap>> stereotype. At first direction tag is checked on <<map>> dependency, then if not found - defaultDirection tag on <<typeMap>> package and last default value is set.

• You may have several <<map>> relationships from one source or to one destination. In such case one of relationships must have "default" tag set. Dependencies from one source without (or with several) default tag (set) are invalid. Also dependencies to one destination with "reverse" or "both" direction order set must have one with default tag.

• Transitive mapping for the elements (eg. Type1 -> Type2 -> Type3) are not supported.

• You may also control mapping behavior of the type inheritance in source model. By default, derived subtypes are also mapped by parent rule (unless of course they have their own rules for mapping). If blockInheritedSourceTypes tagged value is set - derived types are not affected by this rule.

Here T1, T2, T5 are types in the source domain T2, T4 - types in destination domain. Now, having these two mappings (T1 ->T2 and T3 ->T4), the following is true: T1 and all the types, derived from it (like T5) are mapped to the T2 type, except T3 and any of the types, derived from it - these are mapped to the T4.

Now consider that blockInheritedSourceTypes is set:

© 2005 No Magic, Inc 7-446

Page 439: MagicDraw UserManual

TO O L SModel Transformat ion Wizard

7

In this case, T3 and types, derived from it are still mapped to the T4; the T1 is still mapped to T2; but the T5 and all the other types, inherited from T1 are NOT mapped to T2, as in previous case.

• Control of mapping behavior of the type inheritance in destination model also is possible. This is only effective on second (and successive) application of the transformation. By default derived subtypes in the destination model are not overwritten - they are considered suitable substitutes of their parent.

Here T1 is a type in the source domain, T2, T4 - types in the destination domain. Now, having this mapping (T1 ->T2), on the first application of the transformation type T1 in the source model will be mapped to type T2 in the destination model. Lets say, when user refines the destination model - changes the type on the destination model attribute from T2, to more specific - T4 (this situation will be rather common - for example, user refines attribute type from string to basic URI in the XML schemas, or from Integer to nonNegativeInteger, etc.). In essence, 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 that the blockInheritedDestinationTypes taged value is applied:

In this case, type T4 has no special treatment. If the user applies transformation, T1 is mapped to T2. Lets say the user now refines destination model - changes attribute type from T2 to T4. If the user now reapplies (updates destination) transformation, the attribute type will be overwritten - T4 reset back to T2.

• When user loads the type map in reverse direction, roles of the "blockInheritedSourceTypes" and "blockInheritedDestinationTypes" are transposed (unless of course "direction" mandates, that this mapping is not used in reverse direction).

• A special type EmptySourceType is used to indicate that the attributes with no type should be mapped with this dependency.

7-447 © 2005 No Magic, Inc.

Page 440: MagicDraw UserManual

TO O L SModel Transformat ion Wizard

7

• A special type EmptyDestinationType is used to indicate that the attributes in the destination classes should have no type after remapping (type removal).

• A special type AnySourceType. This type is a template, it matches any type in the source model (see mapping rules for type inheritance). By using this type, together with the inheritance mapping rules, user can, for example, specify, that any other types, that were not defined by the mapping should be interpreted by this mapping. This rule says - any other type in the source model should be stripped in the destination model.

• ·A special type AnyDestinationType. This type is a template, it matches any type in the destination model (see mapping rules for type inheritance).

M O D E L T R A N S F O R M A T I O N U P D A T E

When reapplying transformation, relationships are retrieved from their storage, and used to find the model elements in destination model, corresponding to the given model element in the source model.

If there are model elements in the source model, that have no mapping - this means, that the elements are newly added. The usual rules for the transformation are used (the same behavior, as if the transformation was applied the first time) for these model elements.

If the model elements already have mapping, then there are 2 options: to update the properties of the mapped element, or to leave transformation model intact.

To update transformed model

• From the destination package shortcut menu, choose Tools and then Update Transformed Model. The Model refresh options dialog box appears:

Figure 172 -- Model refresh options dialog box

The Change destination properties according to source option overwrites elements properties in destination model with the properties from the source model (but only elements, which are connected with mapping dependencies ).

The Leave destination properties intact option does not overwrite properties in destination model with the properties from the source model (retaining the changes, which user has made to the destination model, but ignoring changes, which user has made to the source model).

NOTE:

© 2005 No Magic, Inc 7-448

Page 441: MagicDraw UserManual

TO O L SMetr ics

7

This update options works only for already created elements data (renaming, changing type, etc.), which have type mapping dependencies. If new elements are added to source, after update in both cases copies of new elements will be created in destination model. If element was deleted from source, it will not be removed in destination after update.

METRICSMagicDraw metrics functionality allows measuring project by different viewpoints.

Three kinds of metrics are available:

• UML model metrics

• System metrics

• Requirements metrics.

UML model metrics consist of packages, classes, and diagrams measurement by different points of view (e.g. number of classes, inheritance tree depth, etc.).

System metrics provides model analysis using most popular Object Oriented projects metrics: Halstead, McCabe, Chidamber and Kemerer defined metrics (e.g. cyclomatic complexity, weighted methods per class).

Requirements metrics consist of function points and use case metrics. As these two metrics groups are very close to each other, it is considered that use case metrics are part of function points metrics. Use case metrics measure the number of use cases in project and user case analysis through selected tagged values (e.g. priority).

Analysis results are displayed in a table and user is able to select which metrics shall be displayed. Also it is possible to export metrics to a file.

Metrics are implemented as a plugin and are accessible through Open API.

A metric is a digit that measures model or is counted according model measuring. Each metric has lower metric limit and highest metric limit specified. Metrics that are out of boundaries of these limits shall be marked:

• Too low value font color is blue.

• Too high value font color is red. Note: if highest limit is equal 0, metric is never be marked as too high (in red font color).

Metr ics su i tes

Metric suites may be created in MagicDraw.

Metrics suite contains:

• List of metrics that shall be counted.

• Specified properties for each selected metric.

7-449 © 2005 No Magic, Inc.

Page 442: MagicDraw UserManual

TO O L SMetr ics

7

There are three predefined metrics suites: System Metrics, UML Model Metrics and Requirements Metrics.

You may create your own metrics suite by cloning existing suite and specifying suite properties. You are also allowed to edit predefined metrics suites. All metric suites can be imported or exported in order to exchange with other users.

Display ing metr ics

Metrics are counted according properties defined in selected metrics suite. Metrics can be counted for whole project or for selected packages, classes, interfaces or diagrams. The results are displayed in the Metrics window, which is placed at the bottom of MagicDraw application.

Metrics window contains two tabs:

• Data tab. Counted metrics for selected suite is displayed. Metrics results are displayed in a metrics table. Only counted metrics are included into metrics table.

• Graphics tab. Selected metric is displayed as a graphic.

Metrics table displays packages, classes, interfaces and diagrams. Also elements that contain packages, classes, interfaces and diagrams as inner elements shall be displayed to depict tree structure, but metrics shall not be counted for these elements.

If value may not be counted for a class, interface, package, or diagram, the cell is left empty.

The results of the metrics table may be filtered by:

• All

• Packages

• Classes – classes and interfaces shall be displayed

• Diagrams

• Package Violations – only rows that contain packages violations shall be displayed.

• Class Violations – only rows that contain classes’ and interfaces’ violations shall be displayed.

Metrics table structure:

Model Element Metric1 Metric2 Metric3 … …. MetricN

PackageA value value value value value value

Inner class1 value value value value value value

Inner class2 value value value value value value

© 2005 No Magic, Inc 7-450

Page 443: MagicDraw UserManual

TO O L SMetr ics

7

When filter Classes, Diagrams, or Class Violations is selected, the owner is displayed next to element: c1 (Classes::Package1)

Invoking Metr ics

To invoke Metrics functionality:

From the Tools menu, choose Metrics or from class/package/interface/diagram shortcut menu, choose Tools, and then Metrics.

The Metrics dialog appears.

Figure 173 -- Metrics dialog box

Element Desription

Metrics Suite All suits that are created in Metrics Suites dialog are available in this combo box.

Calculate For Combo box contains two values:• Whole Project – metrics will be calculated for a whole project.• Selection – metrics will be calculated only for the selected

items. After clicking the “…” button, the Select Elements dialog appears.

Metrics Options Button invokes Metrics Options dialog.

Calculate Metrics window appears.

7-451 © 2005 No Magic, Inc.

Page 444: MagicDraw UserManual

TO O L SMetr ics

7

Select Elements dialog box:

Figure 174 -- Select Elements dialog box

Packages, classes and diagrams are displayed in this dialog. Selecting any element, selects all elements recursively. Unselecting element, unselects elements recursively.

Unselecting the child element, unselects all parent elements. E.g. if Data package was selected, all model is selected. Clearing checkbox next to Package View package will clears all checkboxes next to inner Package View elements and next to Data package. Other packages remain selected.

M E T R I C S W I N D O W

Metrics window is implemented as JIDE GUI window. It is placed at the bottom of application, like the Messages window.

© 2005 No Magic, Inc 7-452

Page 445: MagicDraw UserManual

TO O L SMetr ics

7

Data tab contains metrics table:

Figure 175 -- Metrics window

Selected metrics rows or cells can be copied into clipboard. Selecting shortcut menu command Copy or shortcut Ctrl+C copies the selected metric.

GUI element Desription

Expand Current Branch

Expands all elements in selected branch in results table.

Collapse Current Branch

Collapses all elements in selected branch in results table.

Refresh Recalculates metrics results according current model.

Metrics Options Metrics Options dialog box appears.

Export Export Metrics dialog box appears.

Compare Metrics With…

Open dialog box appears. Select text file to compare with currently opened metric set.

Print Prints metrics table. Print dialog appears.

Filter Combo box contains values:• All• Packages• Classes• Diagrams• Package Violations• Class Violations

7-453 © 2005 No Magic, Inc.

Page 446: MagicDraw UserManual

TO O L SMetr ics

7

Expor t ing metr ics

Selected metrics rows and columns or entire metrics table may be exported to metrics results file. Metrics results may be exported to *.txt and *.html formats.

In *.txt format metrics are separated by tabs in below listed form:

Element Metric1 Metric2 Metric3 …. MetricN

Package Package1 value value value …. Value

Class class1 (Package1::class1) value value value …. Value

Class class2 (Package2::class2) value value value …. Value

Here Metric1 .. MetricN – the metric name abbreviation.

At the bottom of file technical information is displayed. Text ”Elements ID” are added after elements metrics, and elements IDs will be printed. This information is needed for metrics comparance.

In *.html format information is given in the below shown form:

Here Metric1 .. MetricN – the metric name abbreviation. Each metric name is hyperlinked with metric description. Metric description can be opened in a separate window after clicking on the hyperlink.

NOTE: *.html format is suitable for viewing metrics. If you want to copy metrics table to other program, please use *.txt format.

Metrics Report

Element Metric1 Metric2 Metric3 …. MetricN

Package Package1 (Package1) value value value …. Value

Class class1 (Package1::class1) value value value …. value

© 2005 No Magic, Inc 7-454

Page 447: MagicDraw UserManual

TO O L SMetr ics

7

Metrics export is done through Export Metrics dialog box:

Figure 176 -- Export Metrics dialog box

Compar ing metr ics

Counted metrics can be compared with metrics that are saved in *.txt file. Metrics may be compared only when metrics window is opened.

Comparison results are displayed in the same metrics table. Metrics that have increased cell are filled with red color; decreased metrics cells are filled with blue. Metrics that are not found in other file cells are filled with grey color.

Metrics comparison can be canceled with Esc.

Metr ics Opt ions

Metrics suits are managed in the Metrics Options dialog box.

To open the Metrics Options dialog box:

• From the Tools menu, choose Metrics and then Metrics Options

Element Description

Metrics Output File:

Path and file name of metrics results output file. The “…” button allows to select location and file.

Output Type: Combo box contains values:• Text (*.txt)• HTML (*.html)

Export selected rows only

The whole metrics table is exported to a file when this checkbox is cleared.Only selected table rows and header row are exported to the file, when the checkbox is selected.

7-455 © 2005 No Magic, Inc.

Page 448: MagicDraw UserManual

TO O L SMetr ics

7

• In the Metrics dialog box, click the Metrics Options button.

On the left side of dialog defined metrics suites are displayed. Metrics suites can be cloned, renamed, removed, exported and imported using buttons or shortcut menu. Predefined metrics sets cannot be renamed or removed. One the right side the suit properties are displayed:

Figure 177 -- Metrics Options dialog box

Element Description

Metrics suites list All created metrics suites are displayed in a list.

Metrics suites list buttons:Clone RenameRemoveImportExport

• Clone – clone the selected suite. • Rename – rename the selected suite.• Remove – remove the selected suite.• Import – import new suite. The Open dialog box appears.• Export – export the selected suite. The Save dialog box appears.All these commands are available from each metric suite shortcut menu.

Metrics tree Tree is intended to select metrics that will be counted for a metrics suite. All metrics are displayed in metrics tree.

Properties list Metric properties are displayed individual for each property.

© 2005 No Magic, Inc 7-456

Page 449: MagicDraw UserManual

7

TO O L SMetr ics

7

Select All Select all metrics.

Clear All Clear all metrics.

Reset to Default Predefined MagicDraw metrics are reset to the default metrics suite.User created metrics suites are reset to the selected predefined metrics suite. Dialog box Reset Metrics Suite appears:

Description Selected metric description is displayed in this area.

OK Save all changes and close dialog box.

-457 © 2005 No Magic, Inc.

Page 450: MagicDraw UserManual

TO O L SMetr ics

7

Metr ics proper t ies

PropertiesGroup

Property Description

General Calculate Defines what shall be counted: • Local – inside package (class). • Global - inside package (class) recursively• Average – metrics shall be counted from the lowest level of

the elements tree. Each upper level metric shall be counted as average of current object metric and all lower level metrics:Average_element_metric = (Element_metric_value (if may be counted separately) + sum (inner_elements_metrics_values)) / (1 (if element_metric_value was counted) + count_of_inner_elements_that_have_metrics_counted)Average metric value should be rounded into the lower value (e.g 1.5 = 1, 1.6 =2)

• Min – lowest level metrics shall be counted. Each upper level metric shall be set to minimum of current object metric and all lower level metrics (except the metrics that are equal 0).Min_element_metric = min (Element_metric_value, min (inner_elements_metrics_values)) Here metric_value > 0

• Max – lowest level metrics shall be counted. Each upper level metric shall be set to maximum of current object metric and all lower level metrics.Max_element_metric = max (Element_metric_value, max (inner_elements_metrics_values))Here metric_value > 0

Lowest limit Package Recommended lowest metric value for package. Editable.

Class Recommended lowest metric value for class and interface. Editable.

Diagram Recommended lowest metric value for diagram. Editable.

Highest limit Package Recommended highest metric value for package. Editable. Note: if highest limit is equal 0, metric shall never be marked as too high (in red font color).

Class Recommended highest metric value for class and interface. Editable.Note: if highest limit is equal 0, metric shall never be marked as too high (in red font color).

Diagram Recommended highest metric value for diagram. Editable.Note: if highest limit is equal 0, metric shall never be marked as too high (in red font color).

© 2005 No Magic, Inc 7-458

Page 451: MagicDraw UserManual

TO O L SMetr ics

7

Example of metrics calculation for calculating number of classes (NC) for this tree:

Include This properties group defines if specified information shall be included when counting metric.

Weight This properties group defines if specified information shall be included when counting metric.

Calculated metric values with different aggregation:

Element Local Global Average Min Max

Top 1 8 1 1 2

Inner1 2 4 1 2 2

C1 0 0 0 0 0

C2 2 2 1 2 2

c_in1 0 0 0 0 0

c_in2 0 0 0 0 0

Inner2 1 3 1 1 2

C3 2 2 1 2 2

c_in3 0 0 0 0 0

c_in4 0 0 0 0 0

C4 0 0 0 0 0

PropertiesGroup

Property Description

7-459 © 2005 No Magic, Inc.

Page 452: MagicDraw UserManual

TO O L SMetr ics

7

© 2005 No Magic, Inc 7-460

Page 453: MagicDraw UserManual

TO O L SMetr ics

7

7-461 © 2005 No Magic, Inc.

Page 454: MagicDraw UserManual

TO O L SMetr ics

7

© 2005 No Magic, Inc 7-462

Page 455: MagicDraw UserManual

M A G I C D R A W U S E R ’ S M A N U A L

I n d e x

INDEX

Aabstract

class 185, 235operation 197

Abstract (generalizable element) 140, 218abstraction 227action state 296, 299

defining arguments 301defining entry action for 301defining multiplicity 301set as dynamic 301

actions 260in state and activity diagrams 287types of 263

activation bar 266, 271active

class 185object 264

activity diagram 294incompatibilities between Rose and MagicDraw

108incompatibilities between Together and Mag-

icDraw 113actor 231

working with 233addOnly 192aggregation 180

creating 223argument

in action state 301of action 264of binding dependency 227

assigningclassifier to classifier role 252classifier to collaboration 215classifier to instance 247instance to collaboration 215model element to a package 145model elements to component 321state to object flow state 308

Assignment (action type) 263association 179

in class diagram 218in implementation diagram 316

in use case diagram 218instance of 248n-ary 220navigability of 224with a role 191

association class 220association end 220

changeability of 225instance of 248multiplicity of 224qualifier of 225visibility of 224

association role 244, 252asynchronous message/stimulus 255attribute 188

creating new 188defining initial value of 247multiplicity 192scope of 192show only public 207type modifier of 191type of 191

attributescontrolling the list of 185, 235representing as association 191sorting of 208suppressing compartment 207

Bbalking message/stimulus 255binding dependency 227browser

changing position 87changing size 87closing or reopening 87code engineering sets in 89Containment tree 87creating model elements and diagrams in 95Diagrams tree 91displaying full information in 88Documentation tab 96functions of 85Inheritance tree 92Model Extensions tree 93multiple selections 96sorting alphabetically 87structure 85Zoom tab 97

CCall (action type) 263

© 2003 No Magic, Inc. 464

Page 456: MagicDraw UserManual

M A G I C D R A W U S E R ’ S M A N U A L

I n d e x

operation for 263Call (event type) 290Change (event type) 290changeability

of association end 225changeable 192child element 216class 183

active 185analyzing 185composite object 248creating setters and getters 438defining as abstract, leaf, root and/or active

185, 235description of 183design patterns 205inner elements of 185owner of 145parameterized 199show/hide package name 145suppressing attributes 207suppressing operations 207

class diagram 176elements in 178incompatibilities between Rose and MagicDraw

107incompatibilities between Together and Mag-

icDraw 112wizard 405

classifieras scope 192assign to an instance 247assigning to a collaboration 215assigning to classifier role 252

classifier roleassigning classifier to 252defining multiplicity of 252in collaboration diagram 244, 251in sequence diagram 266relationships between 252

closingall opened projects 84diagram 122

code engineeringchecking syntax 90creating new set 89editing set 89

code generation 90changing properties of 90

collaboration 214assigning an instance 215assigning classifier to 215

collaboration diagram 242changing numbering in 258incompatibilities between Rose and MagicDraw

107incompatibilities between Together and Mag-

icDraw 113instance level 242specification level 242

compartments of class 183component 314, 318

assigning model elements 321diagram 312instance 314view 176

Component View package 44composite

object 248state 280

composition 223concurrency of operation 198concurrent

composite state 282operation 198regions 285state 282substates 280

condition 264conditional branch 271constraints 339

show-hide on symbol 144showing on class 208

content diagram 359copying/cutting

among different projects 95in the Browser 95of text 133symbol on a diagram 132using drag and drop 132

CORBA IDL diagram 371create (action type) 263

instantiation of 263creating

backup file 47displaying already created relationships 129elements and diagrams in Browser 95new attribute 188new code engineering set 89new diagram 120new operation 193new project style 53paths between shapes 129stereotypes 325

© 2003 No Magic, Inc. 465

Page 457: MagicDraw UserManual

M A G I C D R A W U S E R ’ S M A N U A L

I n d e x

Ddata

creating several shapes of the same 127Data package 44data types 201DDL diagram 374decision point 298deep history state 286defining

model elements 133deleting

all model elements 96from the Browser 95symbol or model element 129

dependency 226abstraction 227binding 227in implementation diagram 317permission 228usage 229

deployment diagram 312deployment view 176design patterns 205Destroy (action type) 263destroying sequence object 271diagram

closing 122creating 120defining properties of 58information table 125opening 121renaming 122saving as image 49

diagramsactivity 294class 176collaboration 242content 359CORBA IDL 371DDL 374implementation 312model management 174robustness 363sequence 265state 274use case 230web 365WSDL 376XML Schema 379, 382

displayrelated elements 127

do activity action 288documentation of MagicDraw 14drag and drop

copying 132from browser to diagram 132multiple symbols 132source code files 133

drawingmore than one shape 126shape 126symbol from the Browser 95

dynamicaction state 301choice point 287

Eediting

code engineering set 89editions of MagicDraw 13effect action 293entry action 288, 299

defining for action state 301enumeration 200, 203enumeration literal 204event 275, 288exit action 288exporting

project to XMI format 106, 111stereotypes 325tag definition 337

extend 232, 238extension point 235

adding to use case 237

Ffeatures of MagicDraw 13final state 286, 302frozen 192

Ggeneralizable elements 218

defining as 218generalization

grouping into tree 217generate

code from the selected set 90getter 438grid 163

size 164snapping to 164style 164

© 2003 No Magic, Inc. 466

Page 458: MagicDraw UserManual

M A G I C D R A W U S E R ’ S M A N U A L

I n d e x

visibility of 164grouping

diagrams in Browser 91generalization paths into tree 217of model elements 208, 210realizations into tree 226

guard expression 293Guarded 198

Hhistory state 286HTML text 150hyperlink 150

for model element 150

Iimage

available formats 48saving as 49

implementation diagram 312elements in 314incompatibilities between Rose and MagicDraw

109incompatibilities between Together and Mag-

icDraw 114implicit event 299include 232, 240incompatibilities

between MagicDraw and Rose 107between MagicDraw and Together 112

initial valuedefining for attribute 247showing on attribute 207

inner elementsof class (inserting) 185

installationother platforms 22system requirements 20UNIX 22using no install 22Windows 21

instance 316as scope 192assign classifier to 247assigning to collaboration 215composite object 248in collaboration diagram 244, 245of association 248of association end 248of component 314of node 315

instantiation 263interface 315interface style

making changes to 41Metal 41Motif 41multiple windows 42Windows 41

internal transition 283, 290

Jjunction point 287JVM (Java Virtual Machine)

for Mac OS X 21for Solaris 21for Windows 21

Llayout 153Leaf

class 185operation 197

Leaf (generalizable element) 140, 218lifeline 266, 271

concurrent 267, 271link 248

in class diagram 182in collaboration diagram 244in implementation diagram 316

link attribute 183link end 248link to self 244logical view 175Look and Feel themes 41

MMac OS X

installation 22JVM 21

MagicDrawappearance of 40documentation 14editions 13environment options 24features 13support 17updating 22

message 254branching of 271changing numbering of 258defining action for 258

© 2003 No Magic, Inc. 467

Page 459: MagicDraw UserManual

M A G I C D R A W U S E R ’ S M A N U A L

I n d e x

diagonal 267in collaboration diagram 245

asynchronous 255balking 255synchronous 255time-out 255

in sequence diagram 272asynchronous 272balking 272call 273create 273destroy 274return 273send 273synchronous 272terminate 274time-out 273uninterpreted 274

predecessor of 259recursive 267to self 267uninterpreted 267

model 213development of 12static structural 176

model elementdefining 133saving as image 49

model management 177modules functionality 63moving

of all model elements 96symbol 132

MS Officecopying to 133

multiobjectcreating 247

multiple windows 42multiplicity

defining for classifier role 252for dynamic action state 301of an attribute 192of association end 224

Nname

specifying for a shape 126n-ary association 220navigability

of association 224node 314, 321

assigning components to 322

note 169adding hyperlink to 150retrieving documentation 171text as HTML in 150

note anchor 169numbering

changing 258numbers

show/hide on collaboration diagram 258

Oobject diagram 242object flow state 305

assigning state 308defining classifier for 308

openingdiagram 121diagram from Browser 91last project on startup 51project 50specification dialog box 133

operationas query 198concurrency 198creating new 193defining 193defining as abstract, leaf, or root 197for subsystem 212functions of 193parameter of 196return type 197return type of 195scope of 198show only public 207showing signature of 207visibility 198

operationscontrolling the list of 185, 235generation of setters and getters 185, 234managing 439sorting of 208suppressing compartment 207

orderingof attributes 208of operations 208

Ppackage 178, 208, 315

adding inner elements 209changing header position 210Component View 44

© 2003 No Magic, Inc. 468

Page 460: MagicDraw UserManual

M A G I C D R A W U S E R ’ S M A N U A L

I n d e x

Data 44dependency wizard 410, 412showing assigned model elements 210

parameterof an operation 196

parameterized class 199defining of 199

parent element 216partition 309partitioning 63paste 132

with new data 132path 120

changing style of 129defining properties of 58drawing 129

patterns See design patternspermission 228predecessor 259presentation options

for class 206primitive 205printing 165process view 176programming language data type 205project

dividing into modules 63multiple projects 83opening of 50packages of 44reusing project parts 63

propertieschanging code generation 90

pseudostate 274, 286

Qqualifier

of association end 225

Rrealization 225

grouping into tree 226in implementation diagram 317

recurrence 264registering MagicDraw 22relationship

displaying on diagram 129renaming

diagram in Browser 92reports 386Return (action type) 263

return typeof an operation 197

reversechanged files 90code engineering set 90

robustness diagram 363Root

class 185operation 197

Root (generalizable element) 140, 218Rose

exporting model to XML 104importing model 105XMI model exchange 104

SSave (dialog box) 47Save As Image (dialog box) 49, 50saving 46

as image 49formats 47in .mdf format 46project 47project as template 48

scopeof operation 198

script 264selection 131

all symbols of the same type 132multiple 131multiple (in the Browser) 96of all model elements 96of all symbols 132of symbol 131

Send (action type) 263separator 170

adding hyperlink to 150sequence diagram

incompatibilities between Rose and MagicDraw 108

incompatibilities between Together and Mag-icDraw 113

model elements in 266overview 265

Sequential 198setter 438shallow history state 286shape

defining properties of 58definition 120drawing more than one shape 126

© 2003 No Magic, Inc. 469

Page 461: MagicDraw UserManual

M A G I C D R A W U S E R ’ S M A N U A L

I n d e x

drawing of 126shortcut keys

assigning 164Signal (event type) 290signal receipt 309

trigger event for 309signal sending 298, 308

defining an action 308smart manipulation 130Solaris

JVM 21sorting

of attributes 208of operations 208

state 275, 278, 296concurrent 282internal 280

state diagramincompatibilities between Rose and MagicDraw

108incompatibilities between Together and Mag-

icDraw 113model elements in 275

state machine 274statechart diagram See state diagramstereotypes

Builds 331Client Page 328creating of 325defining properties of 58Form 328Frame Context 331Frame Set 329IIOP 333importing 325Input Element 333JavaScript 329Link 329Object 333Page 334Redirect 331RMI 333Select Element 333Server Page 327show/hide on a symbol 144showing on class 208Submit 331Target 329Targeted Link 331Text Area 334working with 323

stimulus 254

asynchronous 255balking 255changing numbering 258changing numbering of 258defining action for 258main information about 245synchronous 255time-out 255

stub state 277subactivity state 302submachine state 282substate 280subsystem

adding operation to 212description 210realization elements 210specification elements 210

support for MagicDraw 17swimlane 309symbols 120

defining properties 144formatting 58moving 132presentation of

constraint 150note 169note anchor 150separator 150text box 150

synch state 285defining bound number 285

synchronization barhorizontal 277, 298vertical 277, 298

synchronous 255system boundary 231

Ttagged values

show/hide on a symbol 144showing on class 208working with 334

templateparameterized class See parameterized classsaving as 48

Terminate (action type) 263text box 150

adding hyperlink 150text as HTML in 150

text editorchoosing 90

Time (event type) 290

© 2003 No Magic, Inc. 470

Page 462: MagicDraw UserManual

M A G I C D R A W U S E R ’ S M A N U A L

I n d e x

time-out 255TODO 339Together

exporting model to XML 110importing model 110XMI model exchange 109

transition 291, 297differences in state and activity diagrams 292effect action for 293guard expression for 293to self 277trigger event for 293

trigger eventfor a signal receipt 309for a transition 293

type modifier 191type of an attribute

showing full path 207

UUninterpreted (action type) 263Unix

installation 22updating MagicDraw 22usage 229use case

adding extension point 237description of 235extension point 235

use case diagram 230incompatibilities between Rose and MagicDraw

107incompatibilities between Together and Mag-

icDraw 112use case view 175

Vvisibility

for operation 198of association end 224showing on attribute 207showing on operation 207

Wweb diagram 365web extension 327Windows

interface style 41JVM 21

wizards 386workspace 45

WSDL diagram 376

XXMI 47

exporting project to 106, 111XML Schema diagram 379, 382

Zzooming 162

adjusting step size 163fit in window 162to maximum size 163to original size 163using Browser 97zoom in 163zoom out 163

© 2003 No Magic, Inc. 471


Recommended