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.

Regards.
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ā€¦
ā€˜-ā€™

Thanks!

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.