question

sanaz karamimoghaddam avatar image
0 Likes"
sanaz karamimoghaddam asked sanaz karamimoghaddam commented

Labels are not being read by the token only when array content is one

Hi all!

I have a pull from item list activity on the process flow that pulls information from different partitions on a list. I assign a label to the token that stores the information of the items that are being pulled on it. (Assign to: Label items) Sometimes there is only one item being pulled, and sometimes there are more. in the latter case, the information are stored in an array, which I am reading from later in the process flow. When ever the items that are being pulled are more than one (array content >1) there is no problem and the information can be read by the other labels. but whenever array content is 1, labels cannot read that information. I even separated the labels for condition 1 (array content ==1), which doesn't use command value from label array and directly reads from getlabel(token,""). and condition 2 is when content is more that 1, and I use read label array and then read other labels from the value I get from this label. But it did not work either.

FlexSim 16.2.1
pull from listlabel array
· 2
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

Matt Long avatar image
2 Likes"
Matt Long answered Matt Long commented

Without seeing your model is hard to tell exactly what's going on, but here are some tidbits of information:

arraysize(): Be aware that if the quantity pulled was only 1 and you call arraysize() on that label, the return value will be 0.

Array Size: There are pick options within the activities that will give you the array size and will return 1 if the label is NOT an array.

Value from Label Array: If you're using the pick option Value From Label Array and the quantity is 1, the index value is ignored and the value of the label is returned.

getlabel(): If you use the getlabel() command on a label that may be referencing one treenode or an array of treenodes, the return value will be dependent upon what you're setting it to. For example:

  1. treenode temp = getlabel(token, "items");

temp will be the first element in the array if items is an array, or it will be the value of items if it is a reference to another treenode.

  1. treenodearray temp = getlabel(token, "items");

If the label items is storing a treenodearray, then you get back the treenodearray. If it's storing a single treenode, then a treenodearray of size 1 will be created and returned.

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