How many tokens arrive at each position?

Hello, everyone.
I am a student and I am trying to understand how the tokens behave in this process model. My answers are incorrect and I keep trying to tackle them from different logic, but I am still learning and cannot fully grasp how the behaviour of tokens will be. Any assistance is really greatly appreciated! Thank you :blush:

Hello! Welcome to community my brother! \o
Let’s go! Let’s do one path at a time and arrive at the solution:

Exercise 1:

Upper path - Start:

  • Variable A = true… then start process A.
  • In the exclusive gateway, validation follows the path of variable C, since C = true and D = false.
  • In the parallel gateway, the single token that arrived there is divided into 3, one for each of the tasks, but we have the message that only 2 out of 3 passed, so in the complex gateway only 2 tokens arrive (Pos 1 = 2).
  • This complex gateway is convergent, that is, junction, so when the 2 tokens arrive there, they join in only 1, and then only 1 token arrives in Pos 2.

Upper path response = Pos 1 = 2 tokens // Pos 2 = 1 token.

2nd path - Start.

  • Variable B = true… the token follows the lower path, waits 11 seconds and proceeds to the exclusive gateway. But notice that subprocess A has a non-interruptible timer that creates one more token.
  • Knowing that another token was created by the timer, we have 2 tokens arriving at Pos 4 and as the next gateway is also exclusive, the tokens will not join, and it will first evaluate the variable “e” and if it does not satisfy the condition, it will evaluate the variable “f”, as the variable “e” satisfies the condition, this will make 2 tokens arrive at Pos 5.

Answer to question 1 = [2] [1] [2].

Exercise 2

  • Variable “a” and “b” are true, so it will start by both paths.

Upper path: Subprocess A.

  • The variable “c” is false and the variable “d” is true.
    This will make the token go to the terminate event, ending all of subprocess A once and for all. When the token reaches the terminate event, all tokens of subprocess A disappear, as they end each and every task at once, even without having completed it. Therefore, no token will arrive at Pos 3. (Pos 3 = 0 token).

Bottom path:
As the variable “b” is true, the token will go to the timer and wait 11 seconds. The timer of subprocess A will not be activated because the subprocess was terminated with the Terminate Event. So we will only have one token in pos 4 and 1 token in pos 5.

Answer question 2 = [0] [1] [1].

I believe these are the answers.
If not, please let me know so I can take a closer look.

Hope this helps.

William Robert Alves

I read this slightly differently, so I come up with a slightly different answer…

I agree with the first two answers.
However, we don’t know how long “Upper Path” is taking, so if it finishes in under 5s, the second token might not be created. Thus, I would answer [2][1][?]

Also, while it’s not valid BPMN (both outgoing paths of the exclusive join are active), the intended outcome isn’t clear… Is the author hoping that a new token will be spawned on each loop? That would further indicate that Position 5 is ?

Agreed, however the token should then move on to Pos 3 since that is not within Subprocess A.

However, since we don’t know how long it takes to complete Task A.1, it is possible that the time in Subprocess A fires, so both Pos 4 and Pos 5 are indeterminate. [1][?][?]

Excellent @GotnOGuts .

I thought about this too when I saw it, but in my answer, I considered Task A.1 to be a Service task of simple complexity, which would perhaps take only 1 second to be completed, and therefore would not reach 3 seconds, since the validation of the exclusive gateway takes milliseconds…

Regarding the 2 “true” paths of the exclusive gateway, looking at Camunda’s behavior, I believe that it will first evaluate the condition of the variable “e” and then the condition of the variable “f”, because in this case the variables would be evaluated by the “alphabetical sequence”.

So the expected behavior would be:

  • The variable “e” will be the main evaluation, if in any condition it is == true, follow the happy path.
  • If the variable “e” is false and “f” is true, follow the path below.
  • If both variables come “false”… then we’re screwed! But I assume that the previous task in theory should not let both variables come as false :smiley:

But in fact, your observation was of great importance.

Thanks for the contribution brother :heart: :rocket:! @GotnOGuts

William Robert Alves

Agreed, however the token should then move on to Pos 3 since that is not within Subprocess A.

You are right @GotnOGuts .
When a token reaches a terminate event it will terminate the other tokens of this subprocess and will reach the “end event”, I disregarded this fact.

So correcting my answer number 2: [1] [1] [1].

But as our friend above said that he put [1] [1] [1] and it was wrong, then possibly it is [1] [2] [1], because they must be considering that task A.1 took more than 3 seconds.

Really, this BPM seemed very confusing…


That’s why I said that the answer would be [1][?][?] because the instructions said it it’s not clear how many, answer ? rather than a specific number.