list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

Use Case Diagrams

A UML use case diagram can be drawn from the useCase requirements of a model (see Requirements). No extra syntax is needed: the diagram is built from what the requirements already say.

  • Each useCase requirement is drawn as an ellipse, showing its identifier and its what text.
  • The who of a use case is drawn as an actor, associated with the use case. An actor named by several use cases is drawn once.
  • include is drawn as a dashed arrow labelled «include» to each included use case.
  • isA is drawn as a generalization arrow to each parent use case.

The steps and conditions of a use case are not part of a use case diagram. They are shown in the requirements document generated by PlainRequirementsDoc.

To draw the diagram, add the following to an Umple file:

generate GvUseCaseDiagram;

Or use the command line:

umple -g GvUseCaseDiagram your_model.ump

This produces a Graphviz file ending in ucd.gv, which dot turns into an image.

In UmpleOnline, choose Use Case Diagram in the Live View menu, or GraphViz Use Case under Diagram Type in the options panel. It is also in the Generate menu as Use Case Diagram (GraphViz SVG).


Use cases of an online shop, with actors, include and isA

// Use cases of an online shop. Generating GvUseCaseDiagram
// draws each one as an ellipse, each who as an actor,
// include as a dashed arrow and isA as a generalization.

req UC1 useCase {
  who { customer }
  what { place an order }
  include UC3;
}

req UC2 useCase {
  who { returning customer }
  what { place an order using a saved address }
  isA UC1;
}

req UC3 useCase {
  what { pay for the order }
}

req UC4 useCase {
  who { store administrator }
  what { cancel an order }
  include UC5;
}

req UC5 useCase {
  what { refund the payment }
}

      

Load the above code into classic UmpleOnline
Load the above code into UmpleOnline V2

 

A use case that specializes one use case and includes another

req UC4 useCase {
  what { place an order }
  userStep 1 { review the cart }
  systemResponse 1 { show the order total }
}

req UC5 useCase {
  what { authenticate the customer }
  userStep 1 { enter email and password }
  systemResponse 1 { open a session }
}

req UC6 useCase {
  who { returning customer }
  what { place an order using a saved address }
  isA UC4;
  include UC5;

  userStep 1 { confirm the saved address }
  systemResponse 1 [address still valid] { show the order summary }
  systemResponse 1 [address no longer valid] { ask for a new address }
  userStep 2 { pay }
}

      

Load the above code into classic UmpleOnline
Load the above code into UmpleOnline V2