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

1 Answer 1


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.

  • Thank you for your prompt answer. I am trying to perform it as you said, but if I created a loop between steps 3-5 with a guard condition as you specified, isn't it like saying the option will be displayed to employer from the first time?
    – Arwa
    Nov 6, 2016 at 13:19
  • @Arwa I don't understand what you mean by that. The first thing in a sequence diagram is an actor (in this case, I'm guessing the employer) invoking some functionality of the system to display the form. This is outside the loop. When you get to Step 5, you either return to Step 3 (or even Step 2 - a blank form) or go to Step 6, so it's the last item in the loop fragment. Honestly, I'd treat 5 and 6 as the same step with an alternate flow - you either add a new job or continue to payment.
    – Thomas Owens
    Nov 6, 2016 at 13:23
  • @Arwa I tried to sketch a sequence diagram, but there's insufficient information. I only know one element of your system and not enough about the classes to make anything meaningful. Perhaps if you post your current sequence diagram in the question, I can sketch out what I was thinking at some point today and put it in the answer.
    – Thomas Owens
    Nov 6, 2016 at 13:35
  • @ThomasOwens I think OP is trying to introduce the alternative flow at step 1 in the sequence. May be it would be better (for the sake of the readability) to draw a different diagram for such "alternative" sequence.
    – Laiv
    Nov 6, 2016 at 15:09
  • I uploaded my diagram, I tried to include the loop, but my question is, [selection=post new job] acts as a condition for the loop right? so can this loop be executed at least once?
    – Arwa
    Nov 6, 2016 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.