question

G C avatar image
3 Likes"
G C asked Matt Long commented

Process Flow + Item Array + Data controls

help1.fsm

See attached model.

I have an array of items that I want to set item# and color based on the token label "setItemLabel"

The logic I have in the custom code activity will only set the data controls for the first item in the array.

I need help writing the code necessary to apply the data controls desired to all items in the array at the custom code activity.

If successful, the transporter will unload all 5 items. The items will then change to itemtype 6 and be colored purple.

FlexSim 16.0.1
process flowarrayitem type
help1.fsm (31.3 KiB)
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

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matt Long commented

I updated this model to reflect the changes you wanted.

I added an Assign Labels activity in the Unload Items subflow to record off the current item. The Unload activity now references this label and I moved your Custom Code activity into this subflow and it also references the new item label.


unload.gif (241.0 KiB)
unload.png (8.1 KiB)
setarraycolor.fsm (31.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.

Matt Long avatar image Matt Long commented ·

500-setarraycolor.fsm Since the Run Sub Flow activity let's you set labels on the created tokens, you could move your Current Item activity's logic into the Unload Items activity. Then you can just leave the label access as Label Access on Parent Only as the assigned labels will be given to each individual token and not the parent.

1 Like 1 ·