question

Leo L6 avatar image
0 Likes"
Leo L6 asked Jeanette F commented

Pulling from list by expression

Hello,

In the following sample model I created a situation where an item is pushed to a list with a label, the label then changes value as it moves to another queue. I then use a pull from list in the process flow to pull items of one specific value. However it pulls items that are the wrong value. It pulls items that are type 1 as opposed to only pulling items that are type 2. Attached the sample model:

listpulltest.fsm

Thanks in advance!

FlexSim 22.2.2
process flowlistpulling from lists
listpulltest.fsm (36.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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Leo L6, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

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

When you use "value.item" FlexSim does not know what type of variable it is dealing with at that point, so it treats it as a Variant value. For Variants, type is a method to read their, well, type; whether they are a string, number, node or array. The item is a node for which "type" will return the number 2. So the list field takes on the value 2 for all tokens that are pushed to the list.

Either change the label name to something else that doesn't double as method for Variants or use one of the tow expressions below.

// Tell FlexSim that "item" is an object
value.item.as(Object).type

// Tell Flexsim specifically that "type" is a label node
value.item.labels["type"].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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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