question

mm_y_2406 avatar image
1 Like"
mm_y_2406 asked Jeanette F commented

How to search if a specific label of a specific label of a token exist?

I want to check if my label of label of the token = token.Pallet.Destination exist using objectexists(token.labels["labelName"]) but it doesnt work. What should I use instead?

FlexSim 23.1.0
check if exist
· 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.

1 Answer

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

When checking for the labels you either do it in two steps: Check if "Pallet" exists, then check if "FinalDestination" exists.

  1. objectexits(data.token.labels["Pallet"]) && objectexits(data.token.Pallet.labels["FinalDestination"])
  1. data.token.Pallet? && data.token.Pallet.FinalDestination?

Or you chain multiple checks together, but this only works with class properties, as described here, so the expression becomes slightly more convoluted.

  1. objectexists(data.token.labels["Pallet"]?.value?.labels["FinalDestination"]?.value)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.