Rhapsody Modeler Tutorial
Rhapsody Modeler Tutorial
Before using the information in this manual, be sure to read the “Notices” section of the Help.
This edition applies to IBM® Rational® Rhapsody® 7.5 and to all subsequent releases and
modifications until otherwise indicated in new editions.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP
Schedule Contract with IBM Corp.
ii
Contents
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Modeler Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Modeler Tutorial Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Using Rational Rhapsody Modeler Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
UML Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Tutorial Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Creating the Handset Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Creating Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Module 1:
Creating Use Case Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Goals of this Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Exercise 1.1: Creating a Functional Overview UCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Drawing the Functional Overview UCD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Drawing a Boundary Box and Actors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Drawing the Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Entering a Use Case Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Associating Actors with Use Cases. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Drawing Generalizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Adding Remarks to Model Elements and Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Exercise 1.2: Creating the Place Call Overview UCD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Drawing the Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Entering a Use Case Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Drawing Generalizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Adding Requirement Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Exercise 1.3: Drawing the Data Call Requirements Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Creating the Data Call Requirements UCD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Adding Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Drawing and Defining the Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Module 2:
Creating Structure Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Goals of this Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Exercise 2.1: Creating a Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Drawing the Block Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Drawing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Drawing More Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Setting the Object Stereotype and Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Drawing Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Specifying Port Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Drawing Flows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Allocating the Functions Among Subsystems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Exercise 2.2: Drawing the Connection Management Structure Diagram. . . . . . . . . . . . . . . . . . . 77
Creating the Connection Management Structure Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Exercise 2.3: Drawing the Data Link Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Creating the Data Link Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Exercise 2.4: Drawing the MM Architecture Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Creating the MM Architecture Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Module 3:
Creating Object Model Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Goals of this Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Exercise 3.1: Creating the Subsystem Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Drawing the Subsystem Architecture OMD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Module 4:
Creating Sequence Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Goals for this Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Exercise 4.1: Creating the Place Call Request Successful SD . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Drawing the Place Call Request Successful Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Exercise 4.2: Drawing the NetworkConnect SD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Moving Events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Exercise 4.3: Drawing the Connection Management Place Call Request Success SD . . . . . . 118
Creating the Connection Management Place Call Request Success SD . . . . . . . . . . . . . . . . . . . . . . . . 119
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
iv Modeler Tutorial
Table of Contents
Module 5:
Creating Activity Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Goals for this Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Exercise 5.1: Creating the MMCallControl Activity Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Drawing the MMCallControl Activity Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Exercise 5.2: Drawing the InCall Subactivity Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Opening the InCallSubactivity Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Drawing Action Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Drawing a Default Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Drawing Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Drawing a Timeout Transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Exercise 5.3: Drawing the RegistrationMonitor Activity Diagram . . . . . . . . . . . . . . . . . . . . . . . 140
Creating the RegistrationMonitor Activity Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Module 6:
Creating a Statechart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Goals for this Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Exercise 6.1: Creating the CallControl Statechart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Drawing the CallControl Statechart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Module 7:
Generating a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Producing an Internal Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Using the Internal Report Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Rational Rhapsody v
Table of Contents
vi Modeler Tutorial
Getting Started
Welcome to the IBM® Rational® Rhapsody® Modeler Edition and IBM® Rational® Rhapsody®
Modeler Corporate Edition Tutorial.
Rational Rhapsody is the visual programming environment (VPE) of choice for real-time,
embedded software developers. Rational Rhapsody goes beyond defining requirements and
designing a solution. It implements your solution from design diagrams, automatically generating
ANSI-compliant code that is optimized for the most widely used real-time, embedded target
environments. Rational Rhapsody is the industry leading Model-Driven Development environment
based on UML 2.0 and SysML for systems, software, and test, and has the unique ability to extend
its modeling environment to allow both functional and object oriented design methodologies in
one environment.
Rational Rhapsody generates full production C++, C, Java, or Ada code for a variety of target
platforms based on UML 2.0 behavioral and structural diagrams as well as providing reverse
engineering of code for reuse of your intellectual property within a Model-Driven environment.
Rational Rhapsody Modeler Edition helps users develop easy to understand systems and software
designs, including structure and intended behavior of a system. It helps users increase productivity
and shorten design cycles.
Rational Rhapsody 1
Getting Started
When the wireless user initiates a call, the network receives the request, and validates and registers
the user; once registered, the network monitors the user’s location. In order for the network to
receive the call, the wireless telephone must send the minimum acceptable signal strength to the
network. When the network receives a call, it directs it to the appropriate registered user.
For this tutorial, you create a project called Handset. Modeler contains a sample handset model
that you can use to review the modules in this tutorial. The sample model is located in the
directory:
<Rational Rhapsody installation folder>\Samples\Handset (Tutorial)
Note
To minimize the complexity of the tutorial, the operations have been simplified to focus on
the function of placing a call.
2 Modeler Tutorial
Modeler Tutorial Objectives
Create a project
Create a Use Case Diagram
Create a Structure Diagram
Create an Object Model Diagram
Create a Sequence Diagram
Create an Activity Diagram
Create a Statechart
Rational Rhapsody 3
Getting Started
UML Diagrams
The UML specification includes the following diagrams:
Use case diagrams show the main functions of the system (use cases) and the entities
(actors) outside the system.
Structure diagrams show the system structure and identify the organizational pieces of
the system.
Object model diagrams show the structure of the system in terms of classes, objects, and
blocks, and the relationships between these structural elements.
Sequence diagrams show sequences of steps and messages passed between structural
elements when executing a particular instance of a use case.
Activity diagrams specify a flow for classifiers (classes, actors, use cases), objects,
blocks, and operations.
Statecharts show the behavior of a particular classifier (class, actor, use case), object, or
block over its entire life cycle.
Collaboration diagrams provide the same information as sequence diagrams,
emphasizing structure rather than time.
Component diagrams describe the organization of the software units and the
dependencies among units.
Deployment diagrams show the nodes in the final system architecture and the
connections between them.
4 Modeler Tutorial
Tutorial Setup
Tutorial Setup
Creating the Handset Project
This section describes how to start Rational Rhapsody Modeler and how to create the handset
project and the packages.
Starting Modeler
To start Modeler:
1. From the Start menu, click Programs, click IBM Rational > click IBM Rational
Rhapsody Modeler <version number>, and then click Rhapsody.
Note: Modeler opens with the Tip of the Day dialog box. If you want to see another
tip, click Next Tip. If you prefer not to see tips on startup, clear the Show Tips
on StartUp check box.
2. Click Close to close the Tip of the Day dialog box.
1. From the File menu, click New or click the icon. The New Project dialog box
appears.
3. In the In folder box, type the path to the directory, or browse to find an existing directory,
where the project files are placed.
Note: To avoid overwriting the handset sample project provided with Modeler, make
sure you do not create your project in
<Rational Rhapsody installation folder>\Samples\Handset
(Tutorial)
Rational Rhapsody 5
Getting Started
5. Click OK. The Modeler dialog box appears asking if you want to create a Handset
directory. Click Yes.
Modeler creates a new project in the Handset subdirectory and opens the
Handset.rpy project.
Note: If the Browser Window does not display, from the View menu, click Browser.
Creating Packages
Packages are used to divide the model into functional domains or subsystems, which consist of
objects, object types, functions, variables, and other logical artifacts. They are organized into
hierarchies to provide a high level of partitioning.
Note
To establish traceability between analysis and implementation, the RequirementsPkg,
AnalysisPkg, and ArchitecturePkg packages can be referenced from the software
implementation model (even if it is a different Modeler project) to establish traceability
from design to analysis.
To create and organize the model into packages:
a. To rename it, click on Default once and let the cursor hoover over it until the cursor
blinks.
3. In the Browser Window, right-click Packages and click Add New Package. A package,
with the default name package_n, where n is equal to or greater than 0, is created.
6 Modeler Tutorial
Tutorial Setup
ArchitecturePkg
SubsystemsPkg
The Packages category should resemble this example:
Rational Rhapsody 7
Getting Started
1. From the File menu, click Project Properties and the Features dialog box displays.
2. Click the Properties tab, click the View Common arrow, and then click All.
8 Modeler Tutorial
Tutorial Setup
Rational Rhapsody 9
Getting Started
Summary
In this section, you have performed the following:
For ease of presentation, this guide organizes the sections by diagram type and general workflow.
However, when modeling systems, diagrams are often created in parallel or may require elements
in one diagram to be planned or designed before another diagram can be finalized. For example,
you might identify the communication scenarios using sequence diagrams before defining the
flows, flow items, and port contracts in the structure diagrams. In addition, you might perform
black-box analysis using activity diagrams, sequence diagrams, and statecharts, and white-box
analysis using sequence diagrams before decomposing the functions for the system into subsystem
components.
10 Modeler Tutorial
Module 1:
Creating Use Case Diagrams
Use Case Diagrams (UCDs) model relationships between one or more users (actors) and a system
or class (classifier). They enable you to specify requirements for system behavior.
Rational Rhapsody 11
Module 1: Creating Use Case Diagrams
In this exercise, you develop a Functional Overview UCD, as shown in the following illustration.
12 Modeler Tutorial
Exercise 1.1: Creating a Functional Overview UCD
1. In the Browser Window, right-click AnalysisPkg, click Add New > Diagrams, and then
click Use Case Diagram. The New Diagram dialog box appears.
Modeler automatically adds the Use Case Diagrams category and the Functional
Overview UCD to the Browser Window.
Rational Rhapsody 13
Module 1: Creating Use Case Diagrams
14 Modeler Tutorial
Exercise 1.1: Creating a Functional Overview UCD
In this procedure, you draw a boundary box and actors, as shown in the following illustration.
2. Click in the upper, left corner of the drawing area and drag to the lower right. A boundary
box called System Boundary Box is created.
3. Rename the boundary box to Handset Protocol Stack by typing “Handset Protocol
Stack” and pressing Enter.
5. Click on the left side (outside) of the Handset Protocol Stack boundary box. An actor
with a default name of actor_n, where n is equal to or greater than 0, is created.
Rational Rhapsody 15
Module 1: Creating Use Case Diagrams
Note: Do not include spaces in the names of the actors. Use an underscore instead.
7. Draw another actor called Network on the right side of the Handset Protocol Stack
boundary box.
8. In the Browser Window, expand the AnalysisPkg package and the Actors category to
view the newly created actors.
16 Modeler Tutorial
Exercise 1.1: Creating a Functional Overview UCD
In this procedure, you draw the following use cases, as shown in the following illustration:
Rational Rhapsody 17
Module 1: Creating Use Case Diagrams
2. Click in the boundary box. A use case with a default name of usecase_n, where n is equal
to or greater than 0, is created.
3. Rename the use case to Place Call by typing “Place Call” and pressing Enter.
Note: To resize the use case, click Select , click the use case element, place the
cursor over one of the small boxes , and then drag the element to the desired
size.
4. Repeat Steps 2 and 3 to create the following use cases:
Supplementary Service
Receive Call
Provide Status
5. In the Browser Window, expand the AnalysisPkg package and the Use Cases category to
view the newly created use cases.
18 Modeler Tutorial
Exercise 1.1: Creating a Functional Overview UCD
1. In the Browser Window, expand the AnalysisPkg package and Use Cases category,
right-click Place Call, and click Features. The Features dialog box appears.
Rational Rhapsody 19
Module 1: Creating Use Case Diagrams
2. Click the Description tab and type the following text: “General function of the system is
that it must be able to place various types of calls.”
Note: Click the ellipsis icon next to the Description box to use the internal text
editor.
3. Click OK to apply the changes and to close the Features dialog box.
4. Repeat Steps 1 through 3 for the rest of the use cases:
20 Modeler Tutorial
Exercise 1.1: Creating a Functional Overview UCD
In this procedure, you show the associations between actors and the relevant use cases, as shown in
the following illustration.
Rational Rhapsody 21
Module 1: Creating Use Case Diagrams
2. Click the edge of the MMI actor and then click the edge of the Place Call use case. An
association line with the name label highlighted is created. Press Enter.
itsPlace Call - The role played by the Place Call use case in relation to this actor
itsReceive Call - The role played by the Receive Call use case in relation to this
actor
The Network actor has two new relations:
itsProvide Status - The role played by the Provide Status use case in relation to
this actor
itsReceive Call - The role played by the Receive Call use case in relation to this
actor
22 Modeler Tutorial
Exercise 1.1: Creating a Functional Overview UCD
Drawing Generalizations
A Generalization is a relationship between a general element and a more specific element. The
more specific element inherits the properties of the general element and is substitutable for the
general element. A generalization lets you derive one use case from another.
In this procedure, you draw generalizations indicating that Supplementary Service use case (a
more specific case of placing and receiving a call) is derived from the Place Call use case and the
Receive Call use case, as shown in the following illustration.
Rational Rhapsody 23
Module 1: Creating Use Case Diagrams
To draw a generalization:
2. Click the Supplementary Service use case and draw a line to the Place Call use case.
4. Click the Supplementary Service use case and draw a line to the Receive Call use case.
5. In the Browser Window, expand the AnalysisPkg package, the Use Cases category, and
then the Supplementary Service use case to view the newly created generalizations.
Note: Place Call and Receive Call are SuperUseCases for the Supplementary
Service use case.
24 Modeler Tutorial
Exercise 1.1: Creating a Functional Overview UCD
In this procedure, you add a comment to the Functional Overview UCD, as shown in the following
illustration.
Rational Rhapsody 25
Module 1: Creating Use Case Diagrams
To add a remark:
Note: If the Common Diagram Tools is not open, from the View menu, click
Toolbars, and then click Common Drawing.
2. Click in the top section of the diagram.
“This is a mock up solution of a generic protocol stack which handles voice and
supplementary service calls. The use case diagram shows the functional requirements of
the system.”
4. In the Browser Window, expand the AnalysisPkg package and the Comments category
to view the newly added comment.
26 Modeler Tutorial
Exercise 1.2: Creating the Place Call Overview UCD
In this exercise, you develop the Place Call Overview UCD, as shown in the following illustration.
Rational Rhapsody 27
Module 1: Creating Use Case Diagrams
1. In the Browser Window, expand AnalysisPkg package, right-click Use Case Diagrams,
and then click Add New Use Diagram. The New Diagram dialog box appears.
Modeler automatically adds the Place Call Overview UCD to Use Case Diagrams
category in the Browser Window.
28 Modeler Tutorial
Exercise 1.2: Creating the Place Call Overview UCD
Rational Rhapsody 29
Module 1: Creating Use Case Diagrams
1. In the Browser Window, expand the AnalysisPkg and Use Cases category.
2. Click the Place Call use case and drag it to the top center of the drawing area.
5. Rename the use case to Data Call by typing “Data Call” and pressing Enter.
Note: To resize the use case, click Select , click the use case element, place the
cursor over one of the small boxes , and then drag the element to the desired
size.
6. Repeat Steps 3 through 5 to create a Voice Call use case.
7. In the Browser Window, expand the AnalysisPkg package and the Use Cases category to
view the newly created use cases.
30 Modeler Tutorial
Exercise 1.2: Creating the Place Call Overview UCD
1. In the Browser Window, expand the AnalysisPkg package and Use Cases category,
right-click Data Call, and click Features. The Features dialog box appears.
Rational Rhapsody 31
Module 1: Creating Use Case Diagrams
“The stack must be able to originate and receive data requests of up to 384 kbps.
Data calls can be originated or terminated while active voice calls are in progress.”
Note: Click the ellipsis icon next to the Description box to use the internal text
editor.
3. Click OK to apply the changes and to close the Features dialog box.
4. Repeat Steps 1 through 3 for the Voice Call use cases. Type the following text:
“The user must be able to place or receive voice calls, either while transmitting or
receiving data, or standalone. The limit of the voice calls a user can engage in at
once is dictated by the conference call supplementary service.”
5. Click OK to apply the changes and to close the Features dialog box.
32 Modeler Tutorial
Exercise 1.2: Creating the Place Call Overview UCD
Drawing Generalizations
In this procedure, you draw generalizations to show that the Data Call and the Voice Call use
cases derive from the Place Call, as shown in the following illustration.
To draw a generalization:
2. Click the Data Call use case and draw a line to the Place Call use case.
Rational Rhapsody 33
Module 1: Creating Use Case Diagrams
34 Modeler Tutorial
Exercise 1.2: Creating the Place Call Overview UCD
1. In the Browser Window, right-click the RequirementsPkg package, click Add New, and
then click Requirement. A requirement with a default name of requirement_n, where n
is equal to or greater than 0, is created.
2. Rename the use case to Req.1.1 by typing “Req.1.1” and pressing Enter.
3. Right-click Req.1.1 and then click Features. The Features dialog box appears.
4. Click the Description tab and type the following text: “The mobile shall be fully
registered before a place call sequence can begin.”
5. Click OK to apply the changes and to close the Features dialog box.
Req.1.2 - “The mobile shall have a signal strength within +/- 1 of the minimum
acceptable signal.”
Req.3.1 - “The mobile shall be able to place short messages while registered.”
Rational Rhapsody 35
Module 1: Creating Use Case Diagrams
Req.3.2 - “The mobile shall be able to receive short messages while registered.”
Req.4.0 - “The mobile shall be able to receive data calls at the rate of 128 kbps.”
Req.4.1 - “The mobile shall be able to send data at the rate of 384 kbps.”
Req.4.2 - “The mobile shall be able to receive streaming video at 384 kbps.”
Req.5.6 - “The mobile shall be able to receive a maximum of 356 characters in a
short message.”
Req.6.2 - “The optimal size of messages the mobile can send in a text message is
356 characters.”
7. In the Browser Window, expand the RequirementsPkg and the Requirements category
to view the newly created requirements elements.
Note
Modeling requirement elements in Rational Rhapsody Developer enables you to provide
requirements traceability without a Requirements Management (RM) tool. Requirements
traceability is the ability to describe and follow the life of a requirement, in both a forward
and backward direction. It supports requirements verification and validation, prevents the
introduction of unspecified features, and provides visibility to derived requirements that
need to be specified and tested.
36 Modeler Tutorial
Exercise 1.2: Creating the Place Call Overview UCD
Req.1.1
Req.4.1 Req.4.2
1. In the Browser Window, expand the RequirementsPkg package and the Requirements
category.
2. Click Req.1.1 and drag it to the right of the Place Call use case.
3. Select Req.4.1 and drag it to the lower left of the Data Call use case.
4. Select Req.4.2 and drag it to the lower right of the Data Call use case.
Rational Rhapsody 37
Module 1: Creating Use Case Diagrams
Setting the Display Option to Show the Requirement the Element Name
In this procedure, you set the display option to show the requirement the names of the elements, as
shown in the following illustration.
38 Modeler Tutorial
Exercise 1.2: Creating the Place Call Overview UCD
1. Right-click Req.1.1 in the diagram and click Display Options. The Requirement
Display Options dialog box appears.
3. Click OK.
4. Repeat Steps 1 through 3 for Req.4.1 and Req.4.2 to Name.
Rational Rhapsody 39
Module 1: Creating Use Case Diagrams
Drawing Dependencies
A dependency is a direct relationship in which the function of an element requires the presence of
and may change another element. You can show the relationship between requirements, and
between requirements and model elements using dependencies.
In this procedure, you draw dependencies between the requirement elements and the
use cases, as shown in the following illustration.
40 Modeler Tutorial
Exercise 1.2: Creating the Place Call Overview UCD
To draw dependencies:
2. Click the Req.1.1 requirement and draw a line to the Place Call use case.
3. Click the Req.4.1 requirement and draw a line to the Data Call use case.
4. Click the Req.4.2 requirement and draw a line to the Data Call use case.
6. In the Browser Window, expand the RequirementsPkg package and the Requirements
category to view the dependency relationships.
Rational Rhapsody 41
Module 1: Creating Use Case Diagrams
In this procedure, you set the following types of dependency stereotypes, as shown in the
following illustration:
1. Double-click the dependency between Req.1.1 and Place Call. The Features dialog box
appears.
42 Modeler Tutorial
Exercise 1.2: Creating the Place Call Overview UCD
3. Click OK to apply the changes and to close the Features dialog box.
Rational Rhapsody 43
Module 1: Creating Use Case Diagrams
In this exercise, you develop a Data Call Requirements UCD, as shown in the following
illustration.
44 Modeler Tutorial
Exercise 1.3: Drawing the Data Call Requirements Diagram
1. Right-click the RequirementsPkg package, click Add New, and then click Use Case
Diagram. The New Diagram dialog box appears.
Modeler automatically adds the Use Case Diagrams category and the new Data
Call UCD to the RequirementsPkg package in the Browser Window. A new
drawing area opens.
Rational Rhapsody 45
Module 1: Creating Use Case Diagrams
Adding Requirements
In this procedure, you add requirements to the Data Call UCD, as shown in the following
illustration.
46 Modeler Tutorial
Exercise 1.3: Drawing the Data Call Requirements Diagram
1. In the Browser Window, expand the RequirementsPkg package and the Requirements
category.
2. Click Req.4.2 and drag it to the top left of the drawing area.
4. Click Req.3.2 and drag it to the top center of the drawing area.
Note
See the Setting the Display Option to Show the Requirement the Element Name procedure to
set the display option of the requirements to Name.
Rational Rhapsody 47
Module 1: Creating Use Case Diagrams
48 Modeler Tutorial
Summary
2. Draw a dependency line from Req.4.2 to Req.4.1, and then set the Stereotype to derive.
3. Draw a dependency line from Req.4.1 to Req.4.0, and then set the Stereotype to derive.
4. Draw a dependency line from Req.4.0 to Req.3.2, and then set the Stereotype to trace.
5. Draw a dependency line from Req.5.6 to Req.3.2, and then set the Stereotype to trace.
6. Draw a dependency line from Req.6.2 to Req.5.6, and then set the Stereotype to derive.
Summary
In this module, you created UCDs that show the functions and requirements of the wireless
telephone and placing a call. You became familiar with the parts of a UCD and created the
following:
Requirements traceability, coverage, and impact analysis can be performed using the using the RG
in conjunction with these Rational Rhapsody editions:
Rational Rhapsody 49
Module 1: Creating Use Case Diagrams
50 Modeler Tutorial
Module 2:
Creating Structure Diagrams
Structure diagrams define the system structure and identify the large-scale organizational pieces
of the system. They can show the flow of information between system components, and the
interface definition through ports. In large systems, the components are often decomposed into
functions or subsystems.
Rational Rhapsody 51
Module 2: Creating Structure Diagrams
1. In the Browser Window, right-click the ArchitecturePkg package, click Add New, and
then click Structure Diagram. The New Diagram dialog box appears.
52 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
Modeler automatically creates the Structure Diagrams category and the new block
diagram to the ArchitecturePkg package in the Browser Window. A new drawing
area opens.
1. Draw blocks.
2. Draw objects.
3. Draw ports.
4. Draw flows.
Rational Rhapsody 53
Module 2: Creating Structure Diagrams
Drawing Objects
An object is an entity with a well-defined boundary and identity that encapsulates state and
behavior. State is represented by attributes and relationships, whereas behavior is represented by
operations, methods, and state machines.
The handset model contains the following three system components or functions:
2. Click the top center of the drawing area. (You can also use click-and-drag.) Rational
Rhapsody creates an object with a default name of object_n, where n is equal to or
greater than 0.
4. Click the Object button in the Diagram Tools, but this time click the upper right of the
drawing area and rename the object MobilityManagement.
5. Click the Object button , but this time click the bottom right of the drawing area and
rename the object DataLink.
Note: You can use the tools on the Layout toolbar to help you with the layout of
selected elements in your diagram. Keep in mind that the last element selected
is used as the default. Plus, if you want to move a drawn element (including
labels) on a drawing more precisely, click one or more elements, press the Ctrl
key and use the standalone directional arrow keys. You can also use the
directional arrows on the numeric keypad with NumLock not active.
54 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
2. On the General tab, in the Stereotype box, select the Subsystem in PredefinedTypes
Cpp check box, as shown in the following figure:
Note: After you make your selection, Subsystem appears in the box.
3. Click Apply to apply your changes.
4. With the Features dialog box still open, set the stereotype to Subsystem for the
MobilityManagement and DataLink objects.
5. When done setting stereotypes, click OK to close the Features dialog box.
6. Right-click one of the objects (for example, ConnectionManagement) and select Display
Options. The Display Options dialog box opens.
Rational Rhapsody 55
Module 2: Creating Structure Diagrams
c. In the Image View group, select the Enable Image View check box select the Use
Associated Image option button; click the Advanced button to open the Advanced
Image View Options dialog box and select the Structured option button click OK to
close the dialog box.
The object appears on your drawing with its label underlined. This is the default style
for the appearance of the label. In addition, the object shows the image associated
with it. The number in the upper left corner shows the multiplicity for the object.
8. Set the same display options for the other objects (for example, MobilityManagement
and DataLink if you already did ConnectionManagement).
9. Save your model. Your Handset System structure diagram and browser should resemble
the following figure:
56 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
2. Click the upper, left corner of the drawing window. (You can also use click-and-drag.)
Rational Rhapsody creates an object with a default name of object_n, where n is equal to
or greater than 0.
4. Create another object, but this time click the bottom center of the drawing area and rename
the object Net.
In this task, you are going to define and set the stereotype for the UI and Net objects to Actor to
indicate that the objects are actors. You also going to set the UI object type to MMI in
AnalysisPkg and the Net object type to Network in AnalysisPkg.
1. Double-click the UI object, or right-click and select Features. The Features dialog box
opens.
b. Type Actor in the Name box of the dialog box that appears click OK. After you
make your selection, Actor appears in the Stereotype box, as shown in the following
diagram.
Note: This step is necessary if you are creating the handset model from scratch
because there are no stereotypes created for the ArchitecturePkg package yet.
If you are using the handset model provided with the Rational Rhapsody
product you will see an Actor in Architecture check box in the list for the
Stereotype box, because this stereotype would have already been created for
the package.
Rational Rhapsody 57
Module 2: Creating Structure Diagrams
4. Rational Rhapsody displays a message stating that turning object to be of a specific type
will cause the loss of current object features. Click Yes to continue.
5. Click OK to close the dialog box.
6. Open the Features dialog box for the Net object and set the following options:
8. Rational Rhapsody displays a message stating that turning object to be of a specific type
will cause the loss of current object features. Click Yes to continue.
9. Click OK to close the dialog box.
10. Right-click one of the objects (for example, UI) and select Display Options. The Display
Options dialog box opens.
58 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
Drawing Ports
A Port is a distinct interaction point between a class or object and its environment. Ports enable
you to capture the architecture of the system by specifying the interfaces between the system
components and the relationships between the subsystems. A port appears as a small square on the
boundary of a class, object, or block.
In this procedure, you draw several ports, as shown in the following illustration.
To draw ports:
2. Click on the right edge of the UI object to place the port. A port with a default name of
port_n, where n is equal to or greater than 0, is created.
This port represents the access point where user interface messages flow in and out.
Rational Rhapsody 59
Module 2: Creating Structure Diagrams
60 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
Drawing Flows
Flows specify the exchange of information between system elements. They enable you to describe
the flow of data and commands within a system at a very early stage, before committing to a
specific design.
In this procedure, you draw several flows between the objects and block, as shown in the following
illustration.
To draw a flow:
Rational Rhapsody 61
Module 2: Creating Structure Diagrams
2. Click the ui_req port, click the call_req port, and then press Enter. A flow line appears
between ui_req object and call_req block.
62 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
In this procedure, you change all flows to bidirectional to indicate that information can flow in
either direction between system elements, as shown in the following illustration.
Rational Rhapsody 63
Module 2: Creating Structure Diagrams
64 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
As the system specification evolves, such as by defining the communication scenarios using
sequence diagrams, you can refine the flow items to relate to the concrete implementation and
elements. See Module 4: Creating Sequence Diagrams for more information on defining scenarios.
In this procedure, you specify the flow items for the block and object flows, as shown in the
following illustration.
Rational Rhapsody 65
Module 2: Creating Structure Diagrams
1. Double-click the flow between the ui_req port and the call_req port. The Features dialog
box appears.
4. In the Name box, type “CallRequests” and click OK to save the changes and close the
Flow Item dialog box.
5. Click OK to save the changes and to close the Features dialog box.
66 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
6. Repeat Steps 1 through 5 to specify the flow items for the flows between:
The network port and the mm_network port. Create three flow items called:
– RegistrationStatus
– CallStatus
– CallRequestsToMM
These flow items represents the relay of information between the main call
control logic (ConnectionManagement), and user location
(MobilityManagement).
The mm_dl port and the dl_in port called Registration.
This flow item represents all network information into and out of the system.
7. In the Browser Window, expand the ArchitecturePkg package and the Flows and the
Flow Items categories to view the newly created flows and flow items.
Contract-based ports - Define a contract that specifies the precise allowable inputs and
outputs of a component. A contract-based port can have the following interfaces:
– Provided Interfaces - Characterize the requests that can be made from the
environment. A provided interface is denoted by a lollipop notation.
– Required Interfaces - Characterize the requests that can be made from the
port to its environment (external objects). A required interface is denoted by a
socket notation.
Provided and Required Interfaces enable you to encapsulate model elements by defining the
access through the port. The following figure shows an example of the port interfaces.
Provided Required
interface interface
Noncontract-based ports - Called rapid ports, enable you to relay messages to the
appropriate part of the structured class through a connector. They do not require a contract
to be established initially, but allow the routing of incoming data through a port to the
appropriate part.
Rational Rhapsody 67
Module 2: Creating Structure Diagrams
Rational Rhapsody Developer and Designer for Systems Engineers are able to execute models
with rapid port, allowing testing up front, before the design is finalized.
In this procedure, you specify the provided and required interfaces for the mm_dl and dl_in ports,
as shown in the following illustration.
Note
Depending on your workflow, you might identify the communication scenarios using
sequence diagrams before defining the port contracts. See Module 4: Creating Sequence
Diagrams for more information.
68 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
3. Click the Provided folder and then click the Add. The Add new interface dialog box
appears.
Rational Rhapsody 69
Module 2: Creating Structure Diagrams
4. In the Interface list, click <New> and then click OK. The Interface dialog box appears.
70 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
9. Type “AlertCnf” and click OK. A message displays that an event with the selected name
could not be found. Click Yes to create the new event. The reception is added to the
Operations tab.
10. Repeat Steps 8 and 9 to add a “ChannelOpen” reception.
11. Click OK to close the dialog box and return to the Features dialog box.
12. Click the Required folder and then click the Add. The Add new interface dialog box
appears.
13. In the Interface list, click <New> and then click OK. The Interface dialog box appears.
16. Click the Operations tab, click <New>, and then click Reception.
17. Type “Alert” and click OK. A message displays that an event with the selected name
could not be found. Click Yes to create the new event. The reception is added to the
Operations tab.
Rational Rhapsody 71
Module 2: Creating Structure Diagrams
19. Click OK to close the dialog box and return to the Features dialog box. The Contract tab
window reappears, listings the interfaces you just created.
21. In the Browser Window, expand the ArchitecturePkg package and the Interfaces
category to view the newly created provided and required interfaces to the mm_dl port.
Expand the Events category to view the newly created receptions.
22. To specify the port interfaces for the dl_in port, do the following:
72 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
Reversing a Port
You can reverse ports so that the provided interfaces become the required interfaces, and the
required interfaces become the provided interfaces.
In this procedure, you reverse the dl_in port, as shown in the following illustration.
To reverse a port:
3. Under Attributes, select the Reversed check box. A red message appears stating that the
contract is reversed.
4. Click OK to apply the changes and to close the Features dialog box.
Rational Rhapsody 73
Module 2: Creating Structure Diagrams
Note
For ease of presentation, this section includes both the system and subsystem structure
diagrams. Depending on your workflow, you might perform further black-box analysis with
activity diagrams, sequence diagrams, and statecharts, and white-box analysis using
sequence diagrams before decomposing the functions of the system into subsystem
components.
In this procedure, you create the following subpackages, which represent the functional
subsystems: CM_SubsystemPkg for ConnectionManagement, DL_SubsystemPkg for
DataLink, and MM_SubsystemPkg for MobilityManagement, as shown in the following
illustration.
74 Modeler Tutorial
Exercise 2.1: Creating a Block Diagram
1. In the Browser Window, right-click SubsystemPkg, click Add New, and then click
Package. A package with the default name package_n, where n is equal to or greater
than 0, is created within the SubsystemsPkg package.
3. Repeat Steps 1 and 2 to create two additional packages called DL_SubsystemPkg and
MM_SubsystemPkg.
Organizing Elements
In this procedure, you allocate the subsystem blocks from the Block Diagram in the
ArchitecturePkg package to their respective packages in the SubsystemsPkg package by moving
the following elements:
1. In the Browser Window, expand the ArchitecturePkg package and the Blocks category.
3. Click the DataLink block and drag it into the DL_SubsystemPkg package.
Rational Rhapsody 75
Module 2: Creating Structure Diagrams
4. Click the MobilityManagement block and drag it into the MM_SubsystemPkg package.
The blocks are removed from the ArchitecturePkg package and added to the
SubsystemPkg packages, as shown in the following figure.
You can decompose the system-level blocks in the Block Diagram into sub-blocks and
corresponding structure diagrams to show their decomposition. In the subsequent sections, you
create the following subsystem structure diagrams:
76 Modeler Tutorial
Exercise 2.2: Drawing the Connection Management Structure Diagram
In this exercise, you develop a Connection Management Structure diagram, as shown in the
following illustration.
Rational Rhapsody 77
Module 2: Creating Structure Diagrams
1. In the Browser Window, expand the CM_SubsystemPkg package and the Blocks
category.
Modeler automatically adds the Structure Diagrams category and the Connection
Management Structure diagram to the Browser Window. A new drawing area opens
with the ConnectionManagement block and its ports, as defined in the Block Diagram.
78 Modeler Tutorial
Exercise 2.2: Drawing the Connection Management Structure Diagram
Drawing Objects
In this procedure, you draw the objects that represent the activities performed by Connection
Management, as shown in the following illustration.
To draw objects:
2. Click in the upper, left corner of ConnectionManagement block and drag to the desired
size. An object with a default name of object_n, where n is equal to or greater than 0, is
created.
Rational Rhapsody 79
Module 2: Creating Structure Diagrams
1. Click and drag the call_req port to the right side of the ConnectionManagement block.
2. Click and drag the network port to the left side of the ConnectionManagement block.
80 Modeler Tutorial
Exercise 2.2: Drawing the Connection Management Structure Diagram
Drawing Ports
In this procedure, you draw new ports on the CallControl object, as shown in the following
illustration.
To draw ports:
3. Click the right edge of the CallControl object, type “cc_in,” and then press Enter.
This port relays messages from the user interface.
Rational Rhapsody 81
Module 2: Creating Structure Diagrams
Drawing Links
A Link is an instantiation of an association. You can specify links without having to specify the
association being instantiated by the link; you can specify features of links that are not mapped to
an association. There must be at least one association that connects one of the base classes of the
type of one of the objects to a base class of the type of the second object.
In this procedure, you draw links between the objects and ports, as shown in the following
illustration.
2. Click the cc_mm port, click the network port, and then press Enter.
82 Modeler Tutorial
Exercise 2.2: Drawing the Connection Management Structure Diagram
Note: You can use the Stamp icon for repetitive drawing actions. For example,
when creating more than one link, click the Stamp icon first before clicking the
Link icon. Once you have created a link, you can keep creating new links
without clicking the Link icon each time. Click the Stamp icon again when
you are done drawing links.
4. In the Browser Window, expand the CM_SubsystemPkg package, the
ConnectionManagement category, and:
Rational Rhapsody 83
Module 2: Creating Structure Diagrams
In this exercise, you develop a Data Link diagram, as shown in the following illustration.
1. In the Browser Window, expand the DL_SubsystemPkg package and the Blocks
category.
2. Right-click DataLink, click Add New, and then click Structure Diagram. The New
Diagram dialog box appears.
Modeler automatically adds the Structure Diagrams category and the DataLink diagram
to the Browser Window. A new drawing area opens with the DataLink block and its
ports, as defined in the Block Diagram.
84 Modeler Tutorial
Exercise 2.3: Drawing the Data Link Diagram
Drawing Objects
In this procedure, you draw the RegistrationMonitor object that represent the activities
performed by DataLink, as shown in the following illustration.
To draw objects:
2. Click in the center of DataLink block and drag to the desired size. An object with a
default name of object_n, where n is equal to or greater than 0, is created.
Rational Rhapsody 85
Module 2: Creating Structure Diagrams
Drawing Ports
In this procedure, you draw a new port on the RegistrationMonitor object, as shown in the
following illustration.
To draw ports:
2. Click the right edge of RegistrationMonitor object, type “reg_request,” and then press
Enter. This port relays registration requests and results.
86 Modeler Tutorial
Exercise 2.3: Drawing the Data Link Diagram
Drawing Links
In this procedure, you draw a link between an object and a port, as shown in the following
illustration.
2. Click the reg_request port, click the dl_in port, and then press Enter.
Rational Rhapsody 87
Module 2: Creating Structure Diagrams
4. Click the Contract tab, click the Provided folder icon, and then click Add. The Add new
interface dialog box appears.
Modeler displays a message that the port is not realized. Click Yes to add the realization.
8. Click OK to save the changes and to close the Features dialog box.
Modeler automatically adds the newly created objects, links, and ports to the DataLink
block in the Browser Window.
88 Modeler Tutorial
Exercise 2.4: Drawing the MM Architecture Diagram
In this exercise, you develop a MM Architecture diagram, as shown in the following illustration.
1. In the Browser Window, expand the MM_SubsystemPkg package and the Blocks
category.
2. Right-click MobilityManagement, click Add New, and then click Structure Diagram.
The New Diagram dialog box appears.
Rational Rhapsody 89
Module 2: Creating Structure Diagrams
1. Click and drag the mm_network port to the right side of the MobilityManagement
block.
2. Click and drag the mm_dl port to the left side of the MobilityManagement block.
90 Modeler Tutorial
Exercise 2.4: Drawing the MM Architecture Diagram
Drawing Objects
In this procedure, you draw the objects that represent the activities performed by
MobilityManagement, as shown in the following illustration.
To draw objects:
Rational Rhapsody 91
Module 2: Creating Structure Diagrams
Drawing Ports
In this procedure, you draw a new port on the RegistrationMonitor object, as shown in the
following illustration.
To draw ports:
2. Click the left edge of MMCallControl object, type “mm_cc,” and then press Enter.
This port relays information to ConnectionManagement.
3. Click the right edge of the MMCallControl object, type “cc_in,” and then press Enter.
This port sends and receives information from the DataLink.
92 Modeler Tutorial
Exercise 2.4: Drawing the MM Architecture Diagram
Drawing Links
In this procedure, you draw links between the objects and ports, as shown in the following
illustration.
Note: You can use the Stamp icon for repetitive drawing actions. For example,
when creating more than one link, click the Stamp icon first before clicking the
Link icon. Once you have created a link, you can keep creating new links
without clicking the Link icon each time. Click the Stamp icon again when
you are done drawing links.
Rational Rhapsody 93
Module 2: Creating Structure Diagrams
94 Modeler Tutorial
Summary
3. In the Contract list, click In. Modeler automatically adds the provided and required
interfaces to the Contract tab.
4. Under Attributes, select the Behavior check box. Modeler displays a message that the
port is not realized. Click Yes to add the realization.
5. Click OK to save the changes and to close the Features dialog box.
Modeler automatically adds the newly created objects, links, and ports to the
MobilityManagement block in the Browser Window.
Summary
In this module, you created a system-level structure diagram, and then decomposed that diagram
into functions to show how the software systems trace to the system functional blocks. You
became familiar with the parts of a structure diagram and created the following:
Blocks
Objects
Ports
Flows
Links
You are now ready to proceed to the next module, where you define how the system components
are interconnected using object model diagrams.
Note
With Rational Rhapsody Developer, you can build and animate the parts of the
model you created. This lets you determine whether the model meets the
requirements and identify defects early on in the design process.
Rational Rhapsody 95
Module 2: Creating Structure Diagrams
96 Modeler Tutorial
Module 3:
Creating Object Model Diagrams
Object Model Diagrams (OMDs) specify the structure of the classes, objects, and interfaces in
the system and the static relationships that exist among them. Rational Rhapsody Developer code
generator directly translates the elements and relationships modeled in OMDs into production
quality C++, C, Java, and Ada source code.
Rational Rhapsody 97
Module 3: Creating Object Model Diagrams
1. In the Browser Window, right-click the SubsystemsPkg package, click Add New, and
then click Object Model Diagram. The New Diagram dialog box appears.
Modeler automatically creates the Object Model Diagrams category and the new
OMD to the SubsystemPkg package in the Browser Window. A new drawing area
opens.
1. Add blocks.
2. Add objects.
3. Draw links.
98 Modeler Tutorial
Exercise 3.1: Creating the Subsystem Architecture
Adding Blocks
The Subsystem Architecture OMD contains the subsystems defined in the block diagram.
1. In the Browser Window, expand the CM_SubsystemPkg package and Blocks category.
2. Click the ConnectionManagement block and drag it to the upper, left side of the drawing
area. The ConnectionManagement block and its ports are added to the diagram.
3. In the Browser Window, expand the MM_SubsystemPkg package and Blocks category.
4. Click the MobilityManagement block and drag it to the upper, right side of the drawing
area.
5. In the Browser Window, expand the DL_SubsystemPkg package and Blocks category.
6. Click the DataLink block and drag it to the lower, right side of the drawing area.
Note: Use the Display Options dialog box to set Name only as the Display name for
the blocks.
Rational Rhapsody 99
Module 3: Creating Object Model Diagrams
Adding Objects
The Subsystem Architecture OMD contains the UI object defined in the block diagram. The UI
object interacts with ConnectionManagement to establish and clear calls, and request and receive
data services.
In this procedure, you add the UI object, as shown in the following illustration.
1. In the Browser Window, expand the ArchitecturePkg package and the Objects category.
2. Select the UI object and drag it to the bottom, left side of the OMD. The UI object and its
port are added to the diagram.
Note: When Modeler adds the blocks and objects to the diagram, it places the ports on
the boundary. Change the placement of ports by selecting a port and dragging it
to another location, if necessary.
Drawing Links
The Subsystem Architecture OMD shows the flow of information, realized as links. A link is an
instantiation of an association.
In this procedure, you draw links between the objects and ports, as shown in the following
illustration.
To create a link:
Summary
In this module, you created an OMD, which shows how the system components are interconnected
OMDs. You became familiar with the parts of an OMD and added the following elements:
Blocks
Objects
Links
You are now ready to proceed to the next module, where you define the message exchange
between subsystems and subsystem modules when placing a call using sequence diagrams.
Note
With Rational Rhapsody Developer, you can build and animate the parts of the model you
created. This lets you determine whether the model meets the requirements and identify
defects early on in the design process.
Sequence Diagrams (SDs) describe how structural elements communicate with one another over
time, and identify the required relationships and messages. SDs can be used at different levels of
abstraction. At higher levels of abstractions, SDs show the interactions between actors, use cases,
and blocks. At lower levels of abstraction and for implementation, SDs show the communication
between classes and objects.
Sequence diagrams have an executable aspect and are a key animation tool in the Rational
Rhapsody Developer and Designer for Systems Engineers editions. When you animate a model,
Rational Rhapsody Developer dynamically builds SDs that record the object-to-object or block-to-
block messaging.
Place Call Request Successful - identifies the message exchange when placing a call
NetworkConnect - identifies the scenario of connecting to the network
Connection Management Place Call Request Success - identifies the message exchange
between functions when placing a call
For ease of presentation, this section includes all sequence diagrams. Depending on your
workflow, you might first identify the high-level communication scenario of placing a call and
then refine the high-level structure diagram and OMDs, before defining the communication
scenarios of the modules.
1. In the Browser Window, right-click the SubsystemsPkg package, click Add New, and
then click Sequence Diagram. The New Diagram dialog box appears.
3. Under Operation Mode, click Design and then click OK to close the dialog box. Modeler
automatically creates the Sequence Diagrams category and the new SD to the
SubsystemPkg package in the Browser Window. A new drawing area opens.
3. Draw messages.
In this procedure, you draw the actor lines that represent the two objects, MMI and Network, as
shown in the following illustration.
1. In the Browser Window, expand the ArchitecturePkg package and the Objects category.
2. Click the UI object and drag it at the beginning of the SD. An actor line is created.
3. Click the Net object and drag it at the end of the SD.
In this procedure, you draw the classifier roles that represent the system components,
ConnectionManagement, MobilityManagement, and DataLink, as shown in the following
illustration.
2. Click ConnectionManagement and drag it next to the UI object. A classifier role with the
name of the function in the names pane is created.
3. In the Browser Window, expand the MM_SubsystemPkg package and the Blocks
category.
5. In the Browser Window, expand the DL_SubsystemPkg package and the Blocks
category.
Note: To add white space to (or remove it from) a sequence diagram (such as between
actors lines and classifier roles), press Shift and drag the actor line or classifier
role to its new location.
Drawing Messages
A Message represents an interaction between objects, or between an object and the environment.
A message can be an event, a triggered operation, or a primitive operation.
In this procedure, you draw events that represent the exchange of information when placing a call,
as shown in the following illustration. These events are as follows:
To draw messages:
4. Rename the message PlaceCallReq. Modeler asks if you want to realize the message.
Click Yes.
In this procedure, you draw an interaction occurrence, as shown in the following illustration.
2. Draw the interaction occurrence below the Alert message and across the
MobilityManagement instance line and the Net actor line. The interaction occurrence
appears as a box with the ref label in the top corner.
In this exercise, you develop a NetworkConnect SD, as shown in the following illustration.
Drawing Messages
In this procedure, you draw events, as shown in the following illustration.
To draw messages:
In this procedure, you set a time interval of 3 seconds in which MobilityManagement checks for
a connection request, as shown in the following illustration.
Modeler draws two horizontal lines at the start and end points of the time interval, and a
two-headed vertical arrow in the middle, indicating the time lapse between the two points.
Moving Events
The ArchitecturePkg package contains the sequence diagrams that detail the design of the system
and the flow of information. When you draw messages on the SDs, several messages are added to
the Events category in the ArchitecturePkg package. To make these events available for model
execution, you need to move them from the ArchitecturePkg package to the SubsystemsPkg
package.
To move events:
1. In the Browser Window, expand the ArchitecturePkg package and the Events category.
Modeler automatically creates the Events category in the SubsystemsPkg package and
adds the Alert event.
In this exercise, you develop a Connection Management Place Call Request Success SD, as shown
in the following illustration.
3. Under Operation Mode, click Design and then click OK to close the dialog box.
Modeler automatically creates the Sequence Diagrams category and the new SD to
the SubsystemPkg package in the Browser Window. A new drawing area opens.
1. In the Browser Window, expand the ConnectionManagement block and the Parts
category.
2. Click CallControl and drag it next to the system border. A classifier role with the name of
the function in the names pane is created.
5. In the Browser Window, expand the MobilityManagement block and the Parts
category.
6. Click MMCallControl and drag it next to Connection.
7. In the Browser Window, expand the DataLink block and the Parts category.
Drawing Messages
When the system receives a request to place a call, it validates and registers the user; once
registered, it monitors the user’s location. The call and connection are confirmed, the connection is
set up, and confirmation is provided.
In this procedure, you draw events using slanted lines, and primitive operations using horizontal
lines and messages-to-self.
To draw messages:
Modeler adds the new realized events and primitive operations to the part to which the
message is passed. For example, Modeler adds locationUpdate to the Operations
category in the MMCallControl part.
Summary
In this module, you created SDs, which identify the message exchange between subsystems and
subsystem modules when placing a call. You became familiar with the parts of an SD and created
the following:
System border
Classifier roles and actor lines
Interaction occurrences
Events and primitive operations
Time intervals
You are now ready to proceed to the next module, where you identify the functional flow of users
placing a call and registering users on the network using activity diagrams.
Note
With Rational Rhapsody Developer, you can generate code and animate the parts of the
model you have created, showing the actual behavior on a generated sequence diagram.
Activity Diagrams show the dynamic aspects of a system and the flow of control from activity to
activity. They describe the essential interactions between the system and the environment, and the
interconnections of behaviors for which the subsystems or components are responsible. They can
also be used to model an operation or the details of a computation. In Rational Rhapsody
Developer, you can animate activity diagrams to verify the functional flow.
MMCallControl - identifies the functional flow of users placing a call, which includes
registering users on the network, providing their current location, and obtaining an
acceptable signal strength
InCall - identifies the flow of information once the system connects the call
RegistrationMonitor - identifies the functional flow of registering users on the network,
which includes monitoring registration requests and sending received requests to the
network
1. In the Browser Window, expand the SubsystemsPkg package, the Packages category,
the MM_SubsystemPkg package, the Blocks category, the MobilityManagement block,
and the Parts category.
2. Right-click the MMCallControl part, click Add New, and then click Activity Diagram.
Modeler automatically creates an Activity Diagram in the Browser Window under the
MMCallControl part. A new drawing area opens.
1. Draw swimlanes.
3. Draw states.
4. Draw a subactivity.
5. Draw a default connector.
6. Draw transitions.
Drawing Swimlanes
Swimlanes organize activity diagrams into sections of responsibility for actions and subactions.
Vertical, solid lines separate each swimlane from adjacent swimlanes. To draw swimlanes, you
first need to create a swimlane frame and then a swimlane divider.
To draw swimlanes:
2. Click to place one corner, then drag diagonally to draw the swimlane frame.
4. Click the middle of the swimlane frame. Two swimlanes, called swimlane_n and
swimlane_n+1, where n is an incremental integer starting at 0, are created.
5. Rename the swimlane on the left Location. This swimlane tracks the location of users.
6. Rename the swimlane on the right SignalStrength. This swimlane tracks the signal
strength of users.
In this procedure, you draw action elements, as shown in the following illustration.
Note: You can use the Stamp tool for repetitive drawing actions. For example,
when creating more than one action element, click the Stamp icon first before
clicking the Action icon. Once you have created an action element, you can
keep creating new action elements without clicking the Action icon each time.
Click the Stamp icon again when you are done drawing action elements.
2. In the top section of the drawing area, click-and-drag to create an action element and then
press Ctrl+Enter.
4. In the Name box, type “Idle” and then click OK. This indicates that no call is in progress.
Note: For each action element, set the display options (right-click the action element
and click Display Options) to Name to show the action element name on the
diagram.
5. In the lower section of the Location swimlane, draw an action element and then press
Ctrl+Enter.
8. In the SignalStrength swimlane draw an action element and then press Ctrl+Enter.
10. In the Name box, type “CheckSignal” and then click OK.
11. In the Location swimlane, above LocationUpdate, draw an action element and then press
Ctrl+Enter.
12. Double-click the action element. The Features dialog box appears.
13. In the Name box, type “Registering” and then click OK.
Defining an Action
To define an action:
1. Double-click the Registering action element. The Features dialog box appears.
3. Click OK to apply the changes and to close the Features dialog box.
2. Click to the right of the Idle action element, click its edge, and then press Ctrl+Enter.
Drawing a Subactivity
A Subactivity represents the execution of a non-atomic sequence of steps nested within another
activity. It looks like an action element with a subactivity icon in its lower, right corner, depicting a
nested activity diagram.
In this procedure, you draw the InCall subactivity, which indicates that the call has been
established.
To draw a subactivity:
Drawing Transitions
Transitions represent the response to a message in a given action element. They show the next
action element. In this procedure, you draw the following transitions:
Note
To change the line shape of a transition, right-click the line, click Line Shape, and then
click one of the following: Straight, Spline, Rectilinear, or Reroute.
2. Click the InCall subactivity action and then click the Idle action.
Labeling Elements
Modeler enables you to assign a descriptive label to an element. A labeled element does not
have any meaning in terms of generated code, but enables you to easily reference and locate
elements in diagrams and dialog boxes. A label can have any value and does not need to be
unique.
In this procedure, you label the transition between Registering and LocationUpdate.
To label an element:
2. Click the L button icon next to the Name box. The Name and Label dialog box
appears.
3. In the Label field, type “Registering” and click OK to close the Name and Label dialog
box.
Note
To display the label, right-click the transition and click Display Options and then click
Show Label.
1. Click the Draw Fork Synch Bar icon in the Diagram Tools.
2. Click-and-drag between the Idle action and the swimlanes. Modeler adds the fork
synchronization bar.
3. Click the Activity Flow icon and draw a single incoming transition from Idle to the
synchronization bar.
4. Type “PlaceCallReq” and then press Ctrl+Enter. This transition indicates that the
interface has initiated a call request.
1. Click the Draw Join Synch Bar icon in the Diagram Tools.
2. Click-and-drag between the swimlanes and InCall. Modeler adds the join synchronization
bar.
3. Click Activity Flow icon and draw the following incoming transitions to the
synchronization bar:
5. Type “ChannelOpen” and then press Ctrl+Enter. This transition indicates that the channel
is open and the call can be established.
In this procedure, you draw a timeout transition that monitors the signal strength of transmissions
every three seconds.
Note: Rational Rhapsody Developer creates real time timeouts in the generated code
for the tm transition.
3. Click OK to apply the changes and to close the Features dialog box.
Modeler displays the transition name with the action command.
6. Click OK to apply the changes and to close the Features dialog box.
Modeler displays the transition name with the action command.
Note: To display the transition name without the action, type the transition name as
the label using the Features dialog box. Then right-click the transition and
click Display Options and then click Show Label.
Modeler automatically adds the action elements and transitions to the
MMCallControl part in the Browser Window.
In this exercise, you develop an InCall Subactivity Diagram, as shown in the following illustration.
Note: You can use the Stamp tool for repetitive drawing actions. For example,
when creating more than one action element, click the Stamp icon first before
clicking the Action icon. Once you have created an action element, you can
keep creating new action elements without clicking the Action icon each time.
Click the Stamp icon again when you are done drawing action elements.
2. In the top section of the InCall action element, click-and-drag and then press Ctrl+Enter.
3. Double-click the new action element. The Features dialog box appears.
4. In the Name box, type “VoiceData” and then click OK. The VoiceData action element
processes voice data.
5. In the bottom section of the InCall action element, click-and-drag and then press
Ctrl+Enter.
6. Double-click the new action element. The Features dialog box appears.
7. In the Name box, type “CheckSignal” and then click OK. The CheckSignal action
element checks the signal strength on the network.
Note
For each action element, set the display options to Name to show the name on the diagram.
2. Click above VoiceData, then click VoiceData, and then press Ctrl+Enter.
Drawing Transitions
To draw a transition:
3. Type “tm(15000)” and then press Ctrl+Enter. Modeler automatically adds the newly
created action elements and transitions to the Browser Window.
In this exercise, you develop a RegistrationMonitor Activity Diagram, as shown in the following
illustration.
1. In the Browser Window, expand the SubsystemsPkg package, the Packages category,
the DL_SubsystemPkg package, the Blocks category, the DataLink block, and the Parts
category.
2. Right-click the RegistrationMonitor part, click Add New, and then click Activity
Diagram.
Modeler automatically creates an Activity Diagram in the Browser Window under the
RegistrationMonitor part. A new drawing area opens.
Note: You can use the Stamp tool for repetitive drawing actions. For example,
when creating more than one action element, click the Stamp icon first before
clicking the Action icon. Once you have created an action element, you can
keep creating new action elements without clicking the Action icon each time.
Click the Stamp icon again when you are done drawing action elements.
2. In the upper section of the drawing window, click and drag and then press Ctrl+Enter.
3. Double-click the new action element. The Features dialog box appears.
6. Double-click the new action element. The Features dialog box appears.
8. Below the InitiateRequest action element, click and drag and then press Ctrl+Enter.
9. Double-click the new action element. The Features dialog box appears.
10. In the Name box, type “Success” and then click OK.
Note: For each action element, set the display options to Name to show the name on
the diagram.
Defining an Action
In this procedure, you specify an action for the InitiateRequest action element.
To define an action:
3. Click OK to apply the changes and to close the Features dialog box.
Drawing Transitions
To draw transitions between actions states:
2. Draw a transition from the Idle action element to the InitiateRequest action element.
2. Draw a transition from the InitiateRequest action element to the Idle action element.
Modeler automatically adds the newly created action elements and transitions to the
RegistrationMonitor part in the Browser Window.
Summary
In this module, you created activity diagrams and a subactivity diagram, which show the
functional flow of placing a call and registering users. You became familiar with the parts of an
activity diagram and created the following:
Swimlanes
Action elements
Subactivity states
Default connectors
Transitions and timeout transitions
Fork synchronization bar and join synchronization bar
You are now ready to proceed to the next module, where you identify the action element-based
behavior when the system receives call requests and connects calls using a statechart.
Note
In Rational Rhapsody Developer, you can generate code and animate the parts of the model
you have created. This lets you determine whether the model meets the requirements, and
identify defects early on in the design process.
Statecharts (SCs) define the behavior of classifiers (actors, use cases, or classes), objects, and
blocks, including the states that they can enter over their lifetime and the messages, events, or
operations functions that cause them to transition from state to state.
Statecharts are a key animation tool used to verify the functional flow and moding. Statecharts can
be animated to view the design level of abstraction and graphically show dynamic behavior.
1. In the Browser Window, expand the SubsystemsPkg package, the Packages category,
the CM_SubsystemPkg package, the Blocks category, the ConnectionManagement
block, and the Parts category.
2. Right-click the CallControl part, click Add New, and then click Statechart.
Modeler automatically adds the Statechart category and the new statechart in the
Browser Window under the CallControl part. A new drawing area opens.
Drawing States
A State is a graphical representation of the status of an object. It typically reflects a certain set of
its internal data (attributes) and relations.
To draw a state:
2. In the top section of the drawing area, click-and-drag. A state with a default name of
state_n, where n is equal to or greater than 0, is created.
3. Type “Idle” and then press Enter. This state indicates that no call is in progress.
4. In the center of the drawing area, draw a larger state called Active. This state indicates that
the call is being set up or is in progress.
2. In the top section of the Active state, draw a state called ConnectionConfirm.
3. In the bottom section of the Active state, draw a state called Connected.
2. Click to the right of the Idle state, then click the Idle state, and then press Ctrl+Enter.
Drawing Transitions
Transitions represent the response to a message in a given state. They show what the next state be.
A transition can have an optional trigger, guard, or action. In this procedure, you draw transitions
with triggers.
To draw transitions:
5. Create a transition from the Active state to the Idle state called Disconnect and then press
Ctrl+Enter. This transition indicates that the user has disconnected or the network has
terminated the call.
Note
To change the line shape, right-click the line, click Line Shape, and then click one of the
following: Straight, Spline, Rectilinear, or Reroute.
3. Click OK to apply the changes and to close the Features dialog box. The transition now
includes an action.
6. Click OK to apply the changes and to close the Features dialog box.
In this procedure, you draw a timeout transition in which ConnectionConfirm waits thirty
seconds before returning to the Idle state if a connect confirmation is not made.
Modeler automatically adds the newly created states and transitions to the
CallControl part in the Browser Window.
Summary
In this module, you created a statechart, which identifies the state-based behavior when the system
receives call requests and connects calls. You became familiar with the parts of a statechart and
created the following:
Note
Rational Rhapsody Developer generates the full behavioral code for statecharts and also
allows model level debugging by animating the statecharts.
You have completed the handset model.
The internal reporting facility is particularly useful for quick print-outs that the developer needs to
use for debugging the model. The reports are not formatted for formal presentations.
Report Options - Specifies which elements to include in the report. The possible values
are as follows:
– Include Relations - Include all relationships (associations, aggregations, and
compositions). By default, this option is checked.
– Include Subclasses - List the subclasses for each class in the report. By
default, this option is checked.
Scope - Specifies the scope of the report. The possible values are as follows:
– Selection - Include information only for the selected elements.
– Configuration - Include information for all elements in the active component
scope. This is the default value.
Operations - Specifies which operations to include in the report. The possible values are
as follows:
– All - Include all operations. This is the default value.
– Public - Include only the public operations.
Attributes - Specifies which attributes to include in the report. The possible values are as
follows:
– All - Include all attributes. This is the default value.
– Public - Include only the public attributes.
Include Statechart - If the project has a statechart, this option specifies whether to list the
states and transitions in the report. By default, this option is checked.
Include Method’s Body - Specifies whether to include the code for all method bodies in
the report. By default, this option is checked.
Include Types - Specifies whether to list the types in the report.By default, this option is
checked.
Include Use Case - Specifies whether to list the use cases in the report.By default, this
option is checked.
Include Actors - Specifies whether to list the actors in the report. By default, this option is
checked.
Include Diagrams - Specifies whether to include diagram pictures in the report. By
default, this option is not checked.
Include Components - Specifies whether to include component information
(configurations, folders, files, and their settings) in the report. By default, this option is
not checked.
Include Derived Operations - Specifies whether to include generated operations (when
the property CG::CGGeneral::GeneratedCodeInBrowser is set to True). By
default, this option is not checked.
To locate specific items in the report online, in the Edit menu, click Find and type in the
search criteria.
To print the initially generated report, in the File menu, click Print menu option.
The initially generated report is only a view of the RTF file that the facility created. This file is
located in the project directory (parallel to the.rpy file) and is named RhapsodyRep<num>.rtf.
If you wish, open the RTF file using a word processor that handles RTF format, such as Microsoft
Word.