2

Can someone tell me how the depicted transitions work in UML, what entry exit transitions are executed? What's the order of execution, assuming the transitions have actions associated with them? Is this even legal in UML?

enter image description here

1 Answer 1

3

Yes it's legal.

The order if you're doing it hierarchical is from outermost to innermost on Entry and from the innermost to the outermost on Exit. To make things more complicated, you need to understand, when do you actually leave the state.

Let's have a look at two lines going from C to A.

The first one goes up, out of A, then curves back and returns to A. This means you exit C, B, A and then enter A and that will be the execution order of the activities. Note, that if there is any activity on the transition itself, it will be executed between the activity upon exiting the A and the activity upon entering the A. So we have exit C, exit B, exit A, transition, entry A.

The second line goes to the right, but stops at A border. It means, you never exit (nor re-enter) A. You do however exit C and then B and in that order would the exit activities be executed. If there is any transition activity, it will run last. So we have exit C, exit B, transition.

The entry behaves in the opposite order (so respectively exit A, transition, entry A, entry B, entry D for curved and transition, entry B, entry D for straight)

Finally the on starting on the Start pseudostate within B and going to C remains within B all the time, so the only activities will be transition, entry C.

Sign up to request clarification or add additional context in comments.

2 Comments

You should mention that due to the missing guards the order is pretty random.
That is correct. I have focused on the order of execution of each of the transactions separately. With the current diagram defining the full order of activities of all transitions is impossible. On the other hand, UML exams tend to have this kind of diagrams with a question "which order is possible" and 4 possible orders. Then you have to validate it based on the information I've provided (and the fact that we will start states A, B and C at first, why I will leave to the reader ;-) )

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.