question

Jane T avatar image
0 Likes"
Jane T asked Jane T commented

Is there a way to access the 'View Tokens' table using flexscript?

I would like to access the list of tokens in the 'View Tokens' button section of process flow using FlexScript. I would like to access it using flexscript (or access it IN the process flow in a block or something) so I can apply queries to the tokens in the simulation for decision making purposes.

FlexSim 20.1.3
process flowlabelstokenstable queriesview tokens
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

·
Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Jane T commented

One way you could do something similar is to use a Zone. Just have all the tokens you care about enter and exit a Zone. The Zone has a feature called Subsets. Subsets define a WHERE filter on a query. You can get statistics from Subsets, such as how many tokens are currently in the subset, with the getstat() command:

getstat(zone, "SubsetContent", STAT_CURRENT, instance, "SubsetName")

You can use the getactivity() command to get a reference to the zone. If you are in a general flow, than "instance" can be 0. Here's an example: ZoneDemo.fsm


zonedemo.fsm (36.8 KiB)
· 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.

Jane T avatar image Jane T commented ·
Hi Jordan, thank you for your answer. I had never thought about using zones before ! Geat idea :) 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.