question

Rocio A avatar image
0 Likes"
Rocio A asked Logan Gold commented

Token label declaration

Hello,

1725618112125.png


In this custom code, if I do not have the ptointermedio label defined for the token at any point in the Process Flow, why does it not give an error?

At what point is the ptointermedio label defined so that it does not cause errors?

This is the process Flow on which the process is based:

1725618231153.png

Thank you.

FlexSim 24.1.1
labeltokenscustomecodedefinition
1725618112125.png (28.6 KiB)
1725618231153.png (42.0 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.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

Assigning a value to a label will create the label if it is not yet present. Only trying to read a non-existant label will cause an error.

Writing

  1. token.labelName = 1;

is the same as writing

  1. token.labels.assert("labelName").value = 1;

in that regard.

Note that this is only true for labels, not other subnodes or attributes.

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