question

Marco Baccalaro avatar image
0 Likes"
Marco Baccalaro asked Marco Baccalaro edited

Process flow-create more tokens in the same code

In the attached model I have created 5 tokens on source OnReset.

This makes the Process Flow not work well:

  • At first, in the Event List I have 5 Delay Activity StepStartActivityEvent (this is the origin of the problem)
  • Then, going on step by step, 5 TimerEvents are created for the 5 tokens and the first StepStartActivityEvent is deleted
  • Then other 4 TimerEvents are created and another StepStartActivityEvent is deleted
  • Another 3 TimerEvents are created and another StepStartActivityEvent is deleted
  • Another 2 TimerEvents are created and another StepStartActivityEvent is deleted
  • Finally another TimerEvent is created and the last StepStartActivityEvent is deleted
This is a simple model but I saw that this problem causes strange things such as that token go to next activity after being pushed to a list and without being pulled.

This problem doesn't happen when I create the 5 tokens in the same time but in different events such as OnExit trigger of 5 different items. But it happen if I create a token OnCreation for 5 items created in the same simulation time. Is it a bug that will be solved or there are some rules to apply on tokens creation through code?

FlexSim 16.0.1
process flowtokensonreset
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

·
Brenton King avatar image
1 Like"
Brenton King answered Marco Baccalaro edited

You shouldn't be creating tokens on reset, it causes problems. The developers recommend that you use a scheduled source that creates them at time zero. Will this work for you?


· 1
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 ·

Sure, it works. Thank you. I’ll keep in mind this rule: do not create tokens on reset.

Just one thing to notice: if I send a delayed message and I create more than

one token in it I have the same problem.

I solve the problem if I send n messages and create a token in every message event.

So the problem is not on creating tokens on reset but on creating them all

from the same event.

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.