What is a possible order of these actions in this Activity Diagram?

  softwareengineering

uml activity diagram

Context: This is from a practice exam, and we aren’t sure what the proper answer was

Question: What is a possible order of actions for this activity diagram?

Options:

  • A->B->D or A->B->C->D

  • A->B->C->D or A->B->C->D->E

  • A->B->C->D->E or C->A->B->E

  • A->B->C->D or C->A->B->E

  • Diagram is illegal

The first bar is called a FORK (where the flows after it happen simultaneously), the second bar is called a JOIN (where the flows join/sync up together)
There is inconsistent behavior, C would need to happen at the same time as A->B->D or A->B->E and neither are options in the question.

A fellow student argues that it would be the 4th option because C just needs to happen at some point in the sequence (before the join).

What option do you think is right?

1

In an exam setting with a multiple-choice question like that, where you don’t immediately see what the right answer must be, you go into elimination mode: Strike off the answer options that are (clearly) wrong, and hopefully you are left with one option that is the least wrong or could actually be right.

In this case,

  • the diagram is valid, so that removes option 5.
  • a choice must be made between D and E, so any sequence that includes both must be wrong. That eliminates options 2 and 3.
  • option 1 has a proposed execution order that doesn’t include C, which also is inconsistent with the diagram. So, strike option 1.
  • option 4 shows 2 valid orderings out of a much larger set of possible orderings. While that makes the option look incomplete, it is not wrong either. Given the set of options, this is the least wrong one and therefor most likely the one you are expected to give.

6

they are all wrong

“Forks are used to split an incoming transition into concurrent multiple transitions”

so the answer is:

parallel(A->B->(D or E), C)

Hopefully you have a quantum computer to make sure concurrency is strictly obeyed!

4

LEAVE A COMMENT