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.

Matt Long avatar image Matt Long commented ·

Tokens won't be destroyed if they still have children, so depending on your desired functionality, you may want to change the Create Tokens activities into Run Sub Flows so the parents don't exit their Run Sub Flow activities before the task sequences are finished.

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

Felix Sims avatar image Felix Sims commented ·

@Adrian Haws if the quantity is now two then that means each token goes through the process time. For example if delay 'insert pin' = 7 and delay 'glue pin' =10 my total time comes out to be 20 instead of 10. Is there a way to fix this. I tried to divide by the number of workers but in the end i'm using a statistical distribution so I can't divide the process time by two.

0 Likes 0 ·
Felix Sims avatar image Felix Sims Felix Sims commented ·

@Adrian Haws I fixed it by using a table for the time and created a global variable to use the function gettablenum(----) / global variable. This may not have been the best way and maybe you have a better way.

0 Likes 0 ·
Adrian Haws avatar image Adrian Haws Felix Sims commented ·

@Felix Sims See answer by @Matt Long

0 Likes 0 ·
Show more comments
Felix Sims avatar image Felix Sims commented ·

@Adrian Haws this is the attachment with the dashboard showing how much operators are utilized in regards to the last comment we made. 1442-1438-1400-1398-multiple-resources-autosave-1.fsm

0 Likes 0 ·
Adrian Haws avatar image Adrian Haws Felix Sims commented ·

@Felix Sims The only problem is that in the "Create Subflow" activities where you create two tokens each, the box for "Label Access on Parent Only" is checked. This means that each of the child tokens has an array of two operators (since the parent token gets the label value from each token), which messes things up. All you have to do is uncheck that box.

1 Like 1 ·
Adrian Haws avatar image Adrian Haws Felix Sims commented ·

@Felix Sims I reposted this question here, since it is a separate issue and can be helpful to others.

0 Likes 0 ·