question

Esther J2 avatar image
0 Likes"
Esther J2 asked Esther J2 commented

Access puller label from back orders of internal list

Is it possible to access the label of a puller token that's sitting on the Back Orders of an internal list?

I know that with a global list, I can use a command such as: List("List1").backOrders()[1].puller.labelName

Is there an equivalent command for internal lists?

Thanks in advance!

FlexSim 21.2.4
listspullerlabelnamelist back ordersinternal list
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 Esther J2 commented

You can read that information from the tree. The following code assumes a single (global) instance.

1660113061941.png

treenode backOrders = Model.find("/Tools/ProcessFlow/ProcessFlowName/List>stats/instances/ProcessFlow/list>variables/partitions/1/backOrders");
int typeLabelValue = getsdtvalue(backOrders.subnodes[1], "puller").as(Token).Type;

Note that the developers do not guarantee forward compatability when reading values directly from the tree like this, as the tree structure might change in future releases.

(The 'as.(Token)' isn't strictly necessary, but it makes accessing valid methods/properties for the puller token easier when writing the code (such as 'entryTime' for example).)


1660113061941.png (18.5 KiB)
· 5
5 |100000

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

Esther J2 avatar image Esther J2 commented ·

Thanks for the response! I'm not able to get the second line of the code to work. The error that gets returned is:

exception: FlexScript exception: <no path> c: <no path> i: <no path>

If it'll be helpful, this is what that section of the tree looks like:

1660163614184.png

0 Likes 0 ·
1660163614184.png (65.5 KiB)
Felix Möhlmann avatar image Felix Möhlmann Esther J2 commented ·
The first mention of 'List' in the path in line 1 is the name of the list activity (forgot to mention that, sorry). Did you replace it with "List_Loc1" when testing the code? That could explain the error, because the "backOrders" node would be NULL.
0 Likes 0 ·
Esther J2 avatar image Esther J2 Felix Möhlmann commented ·

Yes, I did replace it with "List_Loc1". The value I get back for the "backOrders" node is 0 (according to the Script Console output), but when I try to run the second line it gives the error described above.

0 Likes 0 ·
Show more comments