UML – How to Create a UML Sequence Diagram

sequence-diagramuml

I am trying to draw a sequence diagram for "post a job" use case.

The description is as follow:

Basic flow:

  1. This use case begins when the employer selects the “Post a new Job” option.
  2. System displays the job form.

  3. The employer fills the form with the following information:
    Job title,
    type and category (selected from a list),
    Job description,
    Job requirements (required skills and qualifications).
    Any other specific instructions or notes.

  4. The employer selects application method: through the website or as instructed in step 5 and submits form.

  5. System displays an option whether he/she wants to post another job or continue to payment.

  6. The employer selects “proceed to payment” option.

  7. System calculates the total amount.

  8. System displays the amount and asks the user to press “confirm”.

  9. The employer confirms the amount.

  10. Make payment use case is performed.

  11. System displays a message that job/s are posted successfully and direct to main employer page.

Alternate flow:

  1. Post Multiple Jobs

If in step 5 of the basic flow the employer decides to post a second job then:

  1. Steps 3-5 are repeated

  2. A 10% discount is applied to the total if 3 or more jobs are posted (step 7).

  3. The use case resumes with step 6

I am facing two issues:

  1. In step 5, how can I represent "post another job" and "continue" options? and the employer choice.

  2. In step 1 in alternate flow, how can I represent repletion of previous steps?

Here is my attempt:

enter image description here

Best Answer

Sequence diagrams have fragments. These are represented by a box around the operations and a label. Two labels are "alt" and "loop". The box for "alt" form can be divided into multiple sections for different flows while the "loop" fragment can include the notation for the guard condition.

I would represent this as a loop fragment around steps 3-5, with a guard condition around the choice of posting another job, to indicate that it loops until the user no longer wants to post another job. I'd capture the discount in an alt block around the cost computation step.

There are a few pages that describe this: MSDN, UML Diagrams, Agile Modeling.

Related Topic