How to Link with Classes in Use Case Flow of Events

The Flow of Events tool is invaluable for describing and documenting user flows. Often, these flows include references to data structures. Traditionally, this involved manual entry. This tutorial explores a more efficient approach.

March 07, 2012
Views: 94,244
PDF Download
Compatible: Enterprise, Professional

However, as your project evolves, data structures may undergo changes. Such modifications can render references in your flows of events outdated, sometimes without immediate notice. If these inconsistencies come to light, a manual remedy would involve searching for all outdated entries and updating them one by one. This manual process is not only time-consuming but also prone to accuracy issues due to the high volume of input. Furthermore, what if you missed a crucial flow of events in your collection of use case diagrams?

But what if there was a way to synchronize these changes automatically? Fortunately, there is.

What This Tutorial Covers

In this tutorial, we will show you how to add classes and attributes to a flow of events such that the flow of events will stay up-to-date with any changes made to the data structures being referenced.

We will be using a simple use case diagram example below.

sample use case diagram

Software Tool We'll Be Using

For this tutorial, we will be using Visual Paradigm. You are welcome to download a free 30-day evaluation copy of Visual Paradigm to follow along with the example. No registration, email address, or obligation is required.

Steps to Create a Class Diagram

We will now create a class diagram to document our data structure, elaborating on the use case Process Order.

  1. In the use case diagram, select the use case Process Order and click the Sub Diagrams icon.
    click the sub diagrams icon
    Select Add > Other Diagrams > UML Diagrams > Class Diagram.
    select class diagram on menu
  2. In the new class diagram, click on any white space. You will notice that the diagram is initially named Process Order, derived from the use case. You may change it to something else if desired; for now, we will leave it as is.
    name of class diagram
  3. From the Diagram Toolbar, drag Class onto the diagram. Name it Customer.
    create the customer class
  4. To add an attribute, right-click Customer and select Add > Attribute.
    right click to add attribute
  5. Name it name. Press ENTER.
    add attribute called name
    Drawing Tips
    After entering the attribute's name and pressing ENTER, a new row will be inserted below for the next attribute. If you do not need it, you can press the ESC key to delete it. The focus will then return to the previous row, highlighted in dark red. Clicking on the diagram background will deselect the highlight.


    drawing tip to remove last row
  6. Add another attribute named address.
    add an attribute called address
  7. Add another attribute named tel.
    add an attribute called tel
  8. We will now create a relationship between Customer and a new class. Click Customer and drag the Association > Class icon to the right. Release your mouse button where you want to place the new class.
    add a class called order
  9. Add an attribute called orderNumber.
    add an attribute called ordernumber
  10. Add an attribute called remarks.
    add an attribute called remarks
  11. A customer may place more than one order. To depict this, we will make the relationship one-to-many. Place your mouse pointer on the right end of the association (near the Order class) and right-click on the bubble. Select Multiplicity and then * (the asterisk).
    set multiplicity
    An asterisk will be displayed to indicate the multiplicity.
    association with asterick

Steps to Create a Flow of Event

We will now create a flow of events to document user flows for the use case Process Order.

  1. Right-click on the use case Process Order.
    open use case details
  2. In the Process Order Details window that opens, select the Flow of Events tab.
    flow of events tab
  3. Click on the first row (in the white space). Type Login to the System. Press ENTER.
    Type Click new Order. Press ENTER.
    Type Select customer. Press ENTER.
    enter the first 3 steps
  4. To further elaborate step 3, we will now indent the fourth row, which will become step 3.1. Click Increase Indent.
    indent step
  5. Type Search customer by (leave a space at the end after 'by').
    mouse cursor to add attribute
  6. At the position of the mouse cursor shown above, right-click and select Add Class...
    right click and select Add Class
  7. A dialog box will open displaying associated classes. Expand to Ordering System > Process Order > Customer. Select name under Customer. Click OK.
    select attribute called name
    Upon clicking OK, the attribute's name will then appear in the flow of events.
    attribute name added to flow of events
  8. Type ' or ' after the newly added attribute name. Similarly, add another attribute address.
    attribute address added to flow of events

What happens if we change the data structure?

In the Customer class, let's say we want to change the attribute name to customerName. In the class diagram, double-click on name and rename it to customerName.


change attribute from name to customerName

If you return to the flow of events, you will see that the attribute change has already been reflected automatically.


flow of events automatically updates