1

Below I have a join node which synchronize branches A and B:

         |
-----A-->|
         |
         |-->action-->
         |
-----B-->|
         |

I know join waits until receiving tokens from both A and B, but what will happen in this situation:

Tokens a1 and a2 receive from branch A before b1 which is a token from B?

  • Does a2 override a1?
  • Does join synchronize a1 and b1 and a2 must wait for b2 to be accepted?
hasanghaforian
  • 13,858
  • 11
  • 76
  • 167

1 Answers1

2

It's like Tetris if you turn your picture 90 degrees clock wise. Tokens from A and B pile up at each ControlFlow. If all ingoing flows have one token the Join takes them (the lowest Tetris layer) away and emits a single one (your Tetris score :-). The other tokens fall down one layer and the game repeats.

See also my explanation at Difference between behavior of fork/join nodes toward tokens with other nodes of Activity diagrams

qwerty_so
  • 35,448
  • 8
  • 62
  • 86