question

Felix Sims avatar image
0 Likes"
Felix Sims asked Adrian Haws commented

Token stuck in subflow.

I have a token that is not moving after the subflow is completed. I have it routed to a finish activity, but it is not moving.

screenshot-16.png

1400-1398-multiple-resources-autosave.fsm

FlexSim 16.1.0
subflow
5 |100000

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

Matt Long avatar image
0 Likes"
Matt Long answered Matt Long commented

The Run Sub Flow creates child tokens in a Start activity and then waits until those tokens reach a Finish activity and are destroyed. Sending the child tokens through a Sink causes them to not notify the parent token. Change your Sink to a Finish and it will work.

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

Adrian Haws avatar image
0 Likes"
Adrian Haws answered Adrian Haws commented

Hi Felix,

What's going on is that you've created two child tokens from the "Create Tokens" activity within the subflow, and those are the tokens that finish the subflow. The main subflow token is destroyed, and the child tokens can't return to the "Run Sub Flow" since they're not the same tokens. A way to accomplish the same thing is to set the quantity in the "Run Sub Flow" activities to each be two. I attached updated model for your convenience.


· 8
5 |100000

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