Looping and conditions

Created on 1 February 2023, over 1 year ago
Updated 4 February 2023, over 1 year ago

Hello!

There seems to be an issue (?) with loops and conditions or actions that are "outside of the loop" (in a "branch"). Please see the screenshot.

The condition (e.g. currentHours more than 10) is correctly checked/run three times, but only for the first/same item (the item is a profile that has been removed with the removePlayer popFromList action at the beginning of the loop). The message at the end of the ">10 hours open branch" should show the other target_ids as well (12 and 73, but not 3 times 154). The rest works fine (all values of the multi-value field of each profile are set correctly).

I noticed that the same happens with actions that are not in "direct connection" (but rather an "open branch" of the loop). Essentially, when a condition or action that is not within the main loop, they are only executed for the first item that has been popped of the list

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.1

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria coreteamvn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coreteamvn
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    This may have to do with the sequence of processing and could potentially be correct indeed. But it's hard to tell from a screenshot.

    Imagine, the processing enters the loop and gets to the junction item. There is looks for its successors and finds 2 of them. One goes up, the other goes right. If it goes right first, it remains in the loop and gets to the same junction again. There is goes right again and still remains in the loop to get back to the junction. This is happening as long as loop goes.

    When it's done with the loop, then it goes back in the execution stack to the point where it found more than one successor, and starts processing the remaining ones. The processing then goes back in the stack until all remaining successors have been processed.

    That could explain the behaviour you described. If that assumption is correct, you need to change the sequence in which it finds the successors at the junction. Usually, BPMN.io returns the successors in the order they have been created. But it does not provide any visual indicator of the sequence, unfortunately. However, that's not an implementation issue, that doesn't even seem to exist in the BPMN standard in the first place, interesting enough.

    To verify that assumption, you could follow the debug log and verify there, in which order the successors get processed.

  • πŸ‡¦πŸ‡ΉAustria coreteamvn

    Hello JΓΌrgen!

    Thanks for your info. It was indeed helpful and now it works.

    I guess I was wrong in assuming the display action reading starting with "checkpoint: loadedProfile" (see loopScreenshot) is going to get called with every loop run. Instead, it only gets fired once. There was no condition check before (other than the list item >0 count at the beginning of the loop).

  • πŸ‡¦πŸ‡ΉAustria coreteamvn

    the screenshot (loopDisplayWithinLoop) shows the output difference when display action is within loop (sequentially and not parallel).

  • Status changed to Closed: works as designed over 1 year ago
Production build 0.69.0 2024