question

iceagesimulator avatar image
0 Likes"
iceagesimulator asked Natalie White edited

Assign token label based on the label value of a flow item in a container

There is a label named 'Type' on a flowitem box, which is on a container pallet. I want to assign the box label 'Type' to a label on a token in process flow, where a token is created when the pallet enters a queue. Therefore the assigned 'item' on the token is the pallet. I tried accessing the box's label using the subnodes method in order to get the label value on the pallet:

item.subnodes[1].Type

However, I get the following error:

FlexScript exception: cannot access subnodes property on non-treenode Variant


How do I go about assigning a label value to a token, in process flow, from a value of a label on a box on top of a pallet?

examplescreenshot.jpg

AssignTokenLabelFromBoxLabelOnPallet.fsm

FlexSim 23.1.1
labelscontainer flow itemsubnodes array
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

Natalie White avatar image
0 Likes"
Natalie White answered Natalie White edited

Hi @IceAgeSimultor,

To access the box's label, you should type "token.item.subnodes[1].Type" instead of "item.subnodes[1].Type"

This is because the "Assign Label" activity cannot access the item directly. You need to first reference the token, which contains the label "item," which references the pallet.

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

iceagesimulator avatar image iceagesimulator commented ·
Thank you, this solved the issue!
0 Likes 0 ·