question

Marco Baccalaro avatar image
2 Likes"
Marco Baccalaro asked Marco Baccalaro commented

Order of execution in Process Flow

Hello,

I want to fully understand the order of execution in FlexSim and I still have a doubt on how Process Flows works.

In the attached models I have two different behaviors if I push to a list from a trigger of an object (or from a script) and if I do the same from a Custom Code activity of a Process flow:

  1. If I push to the list outside of the Process Flow more items together, they can be pulled separately by different tokens that flow one by one to the next activity
  2. If I push to the list by a Process Flow more items together, they are pulled separately, but the tokens wait on the "Pull from List" activity until all the pushes are done

I have attached two examples:

  1. Push from Trigger - Uses the On Entry of the Queue to push - At every Push, the token that pull
  2. Push from Process Flow - Uses the "Push to List" custom code of the Process Flow "Push Process Flow" to push - On the "Pull Process Flow" the tokens don't move from the Pull From List activity until every push is completed

Why do I have these different behaviors?

Is there a guideline on these "order of execution" aspects?

Thank you.

order-of-execution-question-push-from-trigger.fsm

order-of-execution-question-push-from-process-flow.fsm

FlexSim 19.0.2
order of execution
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Joshua S avatar image
0 Likes"
Joshua S answered Marco Baccalaro commented

So in process flow, each token takes its turn in flowing from one activity to another, so the token that is running the code to push everything to the list currently has priority, and other tokens will not be allowed to flow unit it is done with its task.

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Marco Baccalaro avatar image Marco Baccalaro commented ·

Good to know. So I split the activities and it works.

order-of-execution-question-push-from-process-flow.fsm

This is very important to know.

Is it there a section on the manual where things like this are documented? Or where can I find these important rules?

Thank you.

0 Likes 0 ·
Joshua S avatar image Joshua S ♦ Marco Baccalaro commented ·

There really isn't any reference material on this, Since FlexSim is single threaded, then things occur in an order, and with process flow, tokens execute one at a time. While it might seem like alot of operations occur at zero time, there is still a hierarchy to when they are executed.

0 Likes 0 ·
Marco Baccalaro avatar image Marco Baccalaro Joshua S ♦ commented ·

Yes, I know it, that's why it's important to know what happens before and after in the same time. I suggest to dedicate just a page on the manual to list these "rules" on the execution order.

By the way, I understood this one now, thank you.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.