question

Laurenz Peleman avatar image
0 Likes"
Laurenz Peleman asked Jacob Gillespie converted comment to answer

ProcessFlow: empty array label turns to numeric 0 spontaneously

Hello everyone

I discovered a nasty bug in my processFlow model, in which I need a "itemsToMove" Array label assigned to the token. At the beginning of the model, the array is empty, so that a zero-sized array is assigned to the label, so far so good. However, the moment the token jumps to the next block, the zero-sized array is replaced by a numeric 0 all at once, without any code requesting it to do this. The problem is, for some reason, I haven't been able to reproduce this error in a smaller model yet. Maybe someone knows what could have happened solely with this explanation, otherwise I will try to compose a smaller model with the same bug.

Thanks in advance, kind regards

Laurenz

Choose One
processflow
· 4
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 ·

Don't you think that you assigned a Variant to the label instead of an Array.

0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ Joerg Vogel commented ·

@Jörg Vogel If a value is assigned to a label, that value is converted to a Variant. A Variant can represent an Array, so when you assign an Array to a label value, that Array is converted to a Variant that represents an Array.

1 Like 1 ·
Matt Long avatar image Matt Long commented ·

@Laurenz Peleman

If you post your model we can take a look and see what's going on. I don't know what activity the token is going through, but somewhere you're assigning a value to that label.

0 Likes 0 ·
Jeff Nordgren avatar image Jeff Nordgren commented ·
@Laurenz Peleman

Did any of the above comments help? Do you still need more help or have you resolved your problem? Please let us know so that we can help.

Thanks.

0 Likes 0 ·

1 Answer

Laurenz Peleman avatar image
0 Likes"
Laurenz Peleman answered

My apologies for the late response. In the meantime I have figured out the cause of the error: in the Custom code I wrote for the Assign labels block in ProcessFlow, I assigned the empty array to the label explicitly using the command

token.label = emtyArray

without return statement. Apparently, this caused the label to be set to numeric 0 automatically, as a kind of default, when the token left the Assign labels block.

Kind regards,

Laurenz Peleman

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

Mischa Spelt avatar image Mischa Spelt commented ·

Consider writing

return [];

for the custom code block then, or just entering [] in the popup field directly.

1 Like 1 ·
Jeff Nordgren avatar image Jeff Nordgren commented ·
@Laurenz Peleman

Glad you were able to figure it out. If you need us, you know where to find us. Good job.

0 Likes 0 ·