question

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

What does this exception mean ?

FlexSim 23.0.3
sub flow
1677676624719.png (153.1 KiB)
looptest.fsm (41.4 KiB)
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
1 Like"
Felix Möhlmann answered

You are trying to read the label "Type" on an object (node) that does not exist. In your model this happens because at the time when unloading items of type 2 or 3, previously unloaded items might already have been destroyed. But because the (empty) entry in the array "item1" persists, a token is created for that empty entry in the subflow and then tries to read the label to determine whether it should be unloaded - which triggers the error.

You should remove unloaded items from the array or add a Decide activity to the start of the subflow that first determines whether "token.item1[token.Rank]" actually points at a valid object ("objectexists(...)").

Another tip: In general you should be careful when using the "Label Access On Parent Only" option. If the subflow token only needs to read labels then this is safe. But any label it writes to will be updated/created on the parent token. So when the first token sets "Destination" to Queue1 for example, the second token might change this to Queue2. In your case the timing works out that this is not an issue but it easily could be if you wanted to access the destination again later, after some time has passed.

I'll attach an adjusted version of your model that removes unloaded items from the array and handles the labels a bit differently to be hopefully more robust.

looptest_fm.fsm


looptest-fm.fsm (41.5 KiB)
5 |100000

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