Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Getting Started with Papyrus UMLLight
Getting Started with Papyrus UMLLight
Contents
- 1 Introduction
- 2 Installing Papyrus UMLLight
- 3 Starting Papyrus UMLLight
- 4 Online Shopping System (OSS) Project Overview
- 5 Use Case Modeling
- 6 Documentation View
- 7 Adding Structure to models
- 8 Use Case Analysis
- 9 Supplementary material
Introduction
Getting Started with Papyrus UMLLight is a tutorial that will let you:
- Learn how to download and install Papyrus UMLLight.
- Become familiar with the various aspects of the modeling environment such as workspaces, menus, views, perspectives and palettes.
- Become familiar with the elements that make up the“Papyrus UMLLight” UML subset.
- Through the implementation of a sample modeling project, become familiar with a simple model development approach that will enable you to understand the usage and purpose of the elements that are provided by Papyrus UMLLight.
What this tutorial is and is not
what this tutorial IS | What this tutorial Is NOT |
---|---|
An overview of the Papyrus UMLLightuser interface | A UML specification tutorial (but we do talk about the UML elements we use) |
An overview of the UML diagrams and elements available in Papyrus UMLLight | An exhaustive tutorial on all UML diagrams, entities, and semantics |
An hands-on experience developing a UML model with Papyrus UMLLight | A tutorial advocating a specific method for modeling software systems |
Papyrus UMLLight and Papyrus
What is Papyrus
- * A complete open Source model editor that Conform to UML, SysML, and other Object Management Group (OMG) standards
- * [An Eclipse Project [1] where this project resides.
- * A family of modeling tools:
- * Papyrus itself (both tool and platform) ("Papyrus")
- * Papyrus for information modeling ("Papyrus-IM")
- * Papyrus for Real-time ("Papyrus-RT")
- * and now Papyrus UMLLight
- * A family of modeling tools:
What is Papyrus UMLLight
A specialized variant of Papyrus that provides:
- * a streamlined user interface for creating, viewing, and editing models using:
- * an optimized “Foundation level” subset of UML;
Comparing Papyrus and Papyrus UMLLight
Papyrus UMLLight personae.
Discussions with early stakeholders enabled the Papyrus UMLLight team to define the following three user personae, describing the users targeted by this product.
Papyrus UMLLight User personae. | ||
---|---|---|
Name | Short Description | Detailed description |
Nicole | a Papyrus novice, is knowledgeable in UML but not familiar with Papyrus or Papyrus UMLLight | Nicole is already knowledgeable in UML at or above the OCUP2 Foundation or intermediate level contents.
Nicole's goal in using Papyrus UML Light is to quickly get familiar with Papyrus UML Light and how it supports UML-based modeling. Ze appreciates and benefits from Papyrus UML Light's streamlined editor with the most common concepts of UML, so that ze can focus on getting to know the Papyrus UML Light user interface and way of working without being exposed to the full spectrum of UML model elements. |
Steve | a student and novice in UML, Papyrus, and Papyrus UMLLight | Steve is new to the modeling world and has no or very limited familiarity with the UML. Steve is starting to learn about UML and faces the dual tasks of learning to use UML at the same time as learning to use a UML modeling tool.
Using Papyrus UML Light, Steve will be exposed to fewer language and tool concepts at a time, which results in a lowering of the learning curve.,In addition, the alignment of Papyrus UML Light to OCUP2 (Foundational) is beneficial, as it ensures that ze first deals with the most most important concepts of UML before tackling the more complex aspects. |
Brisha | a basic UML User | Brisha only uses UML from time to time and then only for basic purposes such as documentation or, presentations, discussions, etc. Ze is not interested in a full model-based engineering tool or method and rather uses it to "sketch" using UML to ensure common understanding of the graphics. As such, ze only needs the basic concepts of UML. In this context, an easy to use UML modeling tool such as Papyrus UML Light, which provides a reduced, targeted user interface and ease of use is easiest to adopt. |
Recognize yourself in these personae? This product is for you!
Installing Papyrus UMLLight
To install Papyrus UMLLight, follow these steps:
1. Ensure that you have Java 8 (or later) installed and configured for your operating system.
2. Go to: https://wiki.eclipse.org/Papyrus_UMLLight#Downloads
3. The list of downloads for different operating environments will be displayed:
- * Papyrus UML Light 0.0.1 RC2* for Windows 64bit
- * Papyrus UML Light 0.0.1 RC2* for Linux 64bit
- * Papyrus UML Light 0.0.1 RC2* for MacOS X 64bit
4. To download the archive, click on the link for your development environment.
5. Extract the executable from the downloaded archive into the proper location for applications on your operating system.
- Tip: On MacOS and some Linux, you may need to use “gunzip” followed by “tar xvf” to successfully extract the archive.
6. You are now ready to start using Papyrus UML Light!
Starting Papyrus UMLLight
1. Double-click on the Papyrus UMLLight application you installed in the previous step.
2. A dialog is shown asking you to select a workspace.
About Workspaces
- Workspaces are folders on your computer where your modeling project's files, including models, are stored.
1. Click on browse to select a folder that will hold your work.
2. Click “Launch” to start Papyrus UMLLight
3. The main sections of the Papyrus UMLLight modeling environment's workspace are shown bellow.
- And with more information about each sections:
Palettes
- Palettes are the toolboxes of the Papyrus UMLLight modeling environment and are found attached to the right side of the diagram area.
Palette Structure
Customized Palettes
In addition to the common tools, every Papyrus UMLLight diagram has a customized palette” containing the model elements that can be used with that diagram. You can think of it as your modeling “toolbox”. Each Papyrus UMLLight diagram’s palette is customized to meet the simplification goals of Papyrus UMLLight.
Diagram Palettes
Views of all the Papyrus UMLLight Palettes (in alphabetical order)
- Before we go any further, let's have a look at the tutorial project so we can start implementing it!
Online Shopping System (OSS) Project Overview
The Online Shopping System (OSS) is a web-based system that allows customers to
- browse and search for products available in the catalogue and view their information;
- Add/remove products to/from a virtual shopping cart;
- View the content of the chopping cart;
- Purchase shopping cart products using a Credit or an online payment service (e.g., PayPal)
- Have the purchased items delivered.
Actors and use cases
Given these descriptions, we can deduce the following preliminary list of actors and use cases:
Actors | Customer | Product Manager | Payment Service | Product Database |
---|---|---|---|---|
Use Cases | Login | Add product | Accept Payment Request | Store product information |
Find (browse/search for) products | Remove product | Return payment status | Store shopping carts | |
Add product to cart | Update product (e.g., pricing) | |||
View Cart | List existing products | |||
Checkout |
More use cases and actors will naturally be discovered as we go through the creation of the model that will describes the OSS system.
Use Case Modeling
- Use case modeling is about visualizing the environment and requirements of the system being built.
Therefore it is about about users, their needs, and how they interact with the system being built, as well as how the OSS system interacts with other systems.
- Before We start, let's understand the main concepts of use case modeling.
Basic Use Case Diagram Concepts
Basic Use Case Diagram Concepts | |
---|---|
Nodes | |
Subject | The subject represents the system under consideration ("OSS" in our case) to which a set of use cases applies. As such, it also represents the boundary between our system and it's interactions with the "outside world." What is inside the subject constitutes the functionality of the system and what lies outside represent elements that interact with OSS, by providing input or services. |
Actor | An Actor models a role played by an entity that interacts with the subject (e.g., by exchanging signals and data) but which is external to the subject, e.g., users accessing OSS or providing a service, e.g., an bank's payment service). As you can see, both people and external systems actors can be actors. |
Use Case | A use case is the specification of a set of actions performed by the system, which yields observable results of value to one or more actors or other stakeholders of the system. { Adapted from UML Superstructure Specification, v2.4.1}.Use cases are typically described as a sequence of steps. This sequence can be illustrated by using a sequence diagram to model the sequence of steps and can also be expressed textually (an example is provided a the end of this tutorial for those interested). |
Comment | Textual annotation attached to a set of elements. |
Edges | |
Association | The association relationship is used to link actors to the use cases affected by them.* The association relationship, being bidirectional, does not indicate directionality and can therefore be draw in either direction. |
Generalization | The “Generalization” relationship is used to specify inheritance/generalization relationships between use cases or actors.* The relationship is drawn from the specialized entity to the general entity. |
Include | Simplify a use case by decomposing it into smaller use cases with the goal of increasing modularity and reusability.* The include relationship is drawn from the including element to the included element.* A use case "A" included in use case"B indicates that "B" requires "A" to accomplish its goals. |
Extend | The extend relationship is drawn from the extender element to the extended element.* a use case "C" Extends use case "D" indicates that use case "C" is an optional part of use case D. |
Comment Link | The comment link is used to connect a comment to the element to which the comment applies. |
Creating the OSS Use Case model
Rejoice! The time has come for you to start modeling!
Create and initialize the OSS Project
First, you need to create a project For your OSS model:
. From the Papyrus UMLLight main menu, select “File >New UML Light Project” to create the OSS project.
2. In the '"New UML Light Model Project" resulting dialog, set the project name to "OSS"
3. Note that the model name is automatically given the same name as the project.
4. Leave the location as is (default).
5. Click on [Next] to display the"initialization information" dialog.
6. check the box left of the "Light Use Case Diagram.
- This will create an empty use case diagram as part of the project creation.
7, Click on "Finish"
Your project has been created and it is displayed in the workspace:
What was created
Before we move on, let's look at what was created...
The project Explorer
In the project explorer, There is now an entry titled "OSS" That is the project you just created as stored on disk. If you expand it, it will look like this:
The Model Explorer
Start by expanding the OSS Model element in the project explorer![OSSModelExplorer.png](/images/9/9b/OSSModelExplorer.png)
The model elements under OSS have been created as part of the initial model creation.You can see that a "Light Use Case Diagram has been created as expected. In addition, Papyrus UMLLight also automatically includes a library of UML primitives that define data types. Those will be useful later in the tutorial.
The workspace is now ready for the creation of the use case model
Populate the OSS Use Case Diagram
Adding the Subject
- In the palette, click on the Subject
and then click in the middle of the diagram to create the subject.
- Note that the subject object is also visible in both the model explorer and in the Properties view. Each of these views (diagram, model explorer, and property) provide a representation of the same, single model element in each of these particular contexts. Each “view” provides a set of information about that model element.
- Rename the subject to "OSS" by clicking on the Subject to display its properties view and, from the the properties view, change the value of the name property to "OSS". You will notice that the name also changes in the diagram and Model Explorer.
- Now Click and drag an actor from the palette to a location at the left of the subject. Drag and drop is another way to place elements on a diagram.
- Rename the actor to “Customer” to match the list of actors in the system.
- To complete this diagram, add a use case named “sign-in” to the subject and then add an association from the Customer to the use case, indicating that the customer starts the sign-in use case.
The diagram should now look like this:![]()
Complete the use case diagram
Now that you know how to add use case diagram elements, Use the information from the Actors and Use Cases table to complete the use case diagram.
When done, Your use case diagram should be similar to:
Tips
Documentation View
The documentation view provides a mechanism to add documentation to a model element. Although this is useful in many areas of modeling, it is very helpful when doing use case analysis at the beginning of the project where you can use this capability to add textual information to better textually describe the actors and to provide a textual description of the use cases. To show the documentation view and edit its content, right-click on a model element on a diagram and select “Show Documentation view” and the Properties view will display the documentation view.
Adding documentation to a use case
- Right-click on the "FindProducts" use case and select "Show Documentation View" command
- In the "Find Products" input, add your documentation for that use case.
Example of the documentation view.
This is an example of a use case's requirements documented with using user stories.
Adding Structure to models
- Using packages to add structure and layers to a model
- The purpose of packages is to contain other NamedElements in order to organize a
model, typically to manage groups of similar or related model elements.
- Examples of package usage:
- * Separating common elements into logical groups
- * Separating parts of the model using packages also enables reams to work in parallel on different packages (although this is out of the scope of this tutorial).
- :: An example of the use of packages can be seen in the implementation of a layered model architectures (e.g., with presentation, business, persistence layers).
- * The use of packages also facilitate the visualization of a coarse level of traceability across the development lifecycle.
Package Diagram
- Build a simple package diagram for a layered model development approach
Creating the package diagram
- Click on the model in the model explorer.
- From the main toolbar, Select Papyrus > “New Diagram > Light Package Diagram.
- Name the diagram “Packaging exercise” and click “OK”
- The use case diagram has been replaced by the new diagram Package in the model editor, but is still available as a tab if you need to get back to it. As you create new diagrams, they will be listed there until you close them.
- As well, the palette has changed to display the tools for package diagrams.
- Using the palette, add a package at the top left of the diagram and name it “Use Case Model
- Add another package below and slightly to the right of the Use Case Model package and name it “Design Model”.
- Draw a dependency from the left side of the Design Model package to the bottom of the Use Case Model
- To make the dependency look better, click in the middle of the dependency and drag left and down to make a nice elbow connector.
- This dependency indicates that the “Design Model” is dependent on one or more element found in the “Use Case Model” package.
- In the Model Explorer, you can now the use case model elements into their UseCase model package and do the same for the design models elements into the Design package.
- . Your diagram and model should look similar to:
Use Case Analysis
- Moving from use cases to design
What do we mean by "Use Case Analysis"?
Using activity and Sequence Diagrams
- At the use case analysis level, Activity and Sequence diagrams are used to provide the bridge between the use case and the system design models.
- Sequence diagrams and activity diagrams provide two complementary graphical views of use cases
- * Activity diagrams focus on the description of the use cases as a workflow or process
- * Sequence diagrams focus on the order of the message with regards to time.
Activity Diagrams
Role of Activity diagrams
- At the use case level, the role of activity diagrams is to describe the use cases as a sequence of 'actions' performed by the system and the different actors
Basic Activity Diagram Concepts
Refer to the activity diagram palette for the icons associated with the following model elements.
Basic Activity Diagram Concepts | |
---|---|
Nodes | |
Name | Description |
Initial Node | Acts as a starting point for executing an Activity |
Input Pin | Holds input values to be consumed by an Action |
Output pin | Holds output values produced by an Action |
Value Pin | Provides a value by evaluating a ValueSpecification |
Opaque Action | Action not specified within UML, e.g., using normal language. |
Call Behavior Action | Directly invokes a Behavior |
Edges | |
Name | Description |
Control Flow | Used to control the execution of ExecutableNodes |
ObjectFlow | ActivityEdge that can carry,object,tokens that may hold values |
Creating an activity diagram for a customer purchase
In this exercise, you will create an activity diagram for a customer purchase.
Sequence Diagrams
- This happens then that happens: Creating a sequence diagram for the Login use case
Role of sequence diagrams
- At the use case analysis level, the role of sequence diagrams is to describe the use cases as a sequence of interactions between the system and the different actors
- * Sequence diagrams also include the specification of the main internal actions executed by the system in the execution of the use cases.
- While UML provides a rich set of concepts/notations for sequence diagrams the subset provided by Papyrus UMLLight is more than adequate for our purpose.
Basic Sequence Diagram Concepts
Refer to the sequence diagram palette for the icons associated with the following model elements.
Basic Sequence Diagram Concepts | |
---|---|
Nodes | |
Name | Description |
LifeLine | A Lifeline represents a single individual participant (e.g., instance of an actor) in the sequence diagram. |
Action Execution Specification | The specification of a single executable unit of functionality. |
Behavior Execution Specification | Whereas the Action was a single unit of functionality, behaviour is a specification of events that may occur dynamically over time (e.g., an ordered set of actions. |
Interaction Use | Allows the reuse of an interaction from within another one. Tip: Often seen as an "include" relationship in the use case diagram. |
Edges | |
Name | Description |
Sync Call Message | A message generated by a synchronous call to an operation - a reply is automatically provided |
Async Call Message | A message generated by an asynchronous call to an operation. A reply message is not provide but is expected. |
Reply message | Used to reply to an Async Call Message |
Create message | Create a new lifeline |
Delete message | Delete (end) a an existing lifeline |
Creating a sequence diagram for a TBD
State Machine Diagrams
- Creating a state machine diagram for the TBD
Role of State Machine Diagrams
- At the use case analysis level, the role of State Machine Diagrams is to describe the various states of the system or its components and the possible transition between these states.
Basic State Machine Diagram Concepts
Refer to the sequence diagram palette for the icons associated with the following model elements.
Basic State Machine Diagram Concepts | |
---|---|
Nodes | |
State | Situation during which an invariant condition holds |
Initial | Where the system starts |
FinalState | Indicate the completion of the state machine |
Choice | Dynamic conditional branching to select a continuing path |
Junction | Connect multiple Transitions into compound paths between
States |
Comment | Textual annotation attached to a set of elements. |
Edges | |
Transition | Represents a path from a single source element to another single element |
Comment Link | Represents a link from a comment to the element being commented upon. |
Supplementary material
UML
The OMG defines the purpose of the UML as:
“Providing system architects, software engineers, and software developers with tools for analysis, design, and implementation of software-based systems as well as for modeling business and similar processes.”
UML Model
A UML Model is:
- representation of a software-oriented system
- a set of UML elements that describe your software/system’s structure and functionality
A UML Diagram is
- A view of related model elements providing insight as to the structure and behaviour of the software/system.