How to Use Duration Constraint in Sequence Diagram?

In a UML sequence diagram, a duration message is used to indicate the passage of time of message. It's especially useful when you want to model a real-time system. With Visual Paradigm, you can add duration constraint to messages in one click. This tutorial will demonstrate this how to define duration constraint in sequence diagram.

August 16, 2010
Views: 137,587
PDF Download
  1. Download Online Book Store.vpp. You can also find this file at the bottom of this tutorial.
  2. Open the downloaded .vpp file in Visual Paradigm. To open a project, select Project > Open from the application toolbar.
  3. Let's take the following UML sequence diagram as an example:
    sample sequence diagram
  4. Assume you need to specify the time limit between the Browse message and the Book List message. You therefore have to add a duration constraint between them. Move the mouse over the Browse message and click the Duration Constraint button.
    click duration constraint
  5. Drag it from the Browse message to the Book List message and then release the mouse.
    drag line
  6. Enter the constraint detail inside the caption. For example, it should take more than 3 seconds but less than 5 minutes. You can enter > 3s & < 5mins.
    enter duration
  7. The duration constraint between the Browse message and the Book List message is shown below:
    created result
  8. On the other hand, you can add a duration constraint not only between two messages, but also on the message itself. Let's try to add a duration constraint on the Query message. Move the mouse over the Query message and click the Duration Constraint button.
    add duration constraint
  9. Assume it should take less than 10 seconds. Enter < 10s inside the caption.
    enter duration
  10. The duration constraint for the Query message is shown below:
    duration result