question

khadijam avatar image
0 Likes"
khadijam asked Julie Weller commented

Read from Table to Token

Hi,

Looking for help as a newbie.

I have a table of products (see example below) each with different parameters associated with it.

I would like to be able to generate tokens and add the labels regarding the raw materials from each row to the token (while knowing what each product is). My desired end result is to have for example:

Product A - RawMaterial1 10, RawMaterial2 10.

I would really appreciate any help!


Product A / batch Product B / batch Product C / batch
Raw Material 1 10 20 22
Raw Material 2 10 25 10
FlexSim 23.1.1
tokenstables
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·

@KhadijaM , you store data typically by labels at tokens. So you have to know how to assert a label, declare an initial value, change a label value. On the other hand you need to know how to read a table cell value. I assume you are familiar with value assignments in a programming language. If you aren’t then there are templates you can use from picklist options in triggers or process flow activities. Please look for table and treenode Flexscript Class API in manual.

https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Table.html

https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Tree/treenode.html#Property-labelProperties

https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Tree/treenode.html#Property-labels

https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/ProcessFlow/Token.html#Property-labelProperties

0 Likes 0 ·
khadijam avatar image khadijam Joerg Vogel commented ·
Thank you Joerg!!
0 Likes 0 ·
Julie Weller avatar image Julie Weller commented ·

Hi @khadijam, was my answer helpful? If so, please click the "Accept" button at the bottom of the answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

Julie Weller avatar image
0 Likes"
Julie Weller answered Julie Weller commented

Hi @KhadijaM! I would just use the schedule source activity. You can set the time they arrive, the quantity, and add any labels you want! Let me know if that helps!

1689601523804.png

Additionally if you wanted more control over the arrivals you could use a date/time source and choose the distribution of when the tokens are created.


1689601523804.png (42.1 KiB)
· 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.

khadijam avatar image khadijam commented ·

Thank you Julie & Jordan, I had forgotten to reply but your answer did help and I'm now able to use a global table as a reference. :) Really appreciate it!

1 Like 1 ·
Julie Weller avatar image Julie Weller khadijam commented ·
Yay! We're glad to hear it!
0 Likes 0 ·