question

sara S2 avatar image
0 Likes"
sara S2 asked sara S2 commented

How to set the condition "a list is empty" in decide activity?

Hello,

How to set the condition "a list is empty" in decide activity?

(FlexSim version 19.0.0)

Regards.

Other
Other (please specify)
process flowdecide activity
· 2
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

List("yourGlobalList").entries().length

2 Likes 2 ·
sara S2 avatar image sara S2 Joerg Vogel commented ·

@joerg.vogel, thank you for your help.

0 Likes 0 ·

1 Answer

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered tannerp commented
It would be easier to you a pull from list activity. Check the "use max wait timer" box. In the max wait timer, choose No Wait for the amount of time, and when it fires, send the token to connector 2.

What this means is that the token will do a test pull. If there are items on the list, the the pull succeeds, and the token will go out connector 1. If you don't want to remove the items from the list, just check the "leave items on list" box. If there are no items on the list, the max wait timer will fire, and send the token out connector 2.

· 14
5 |100000

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

sara S2 avatar image sara S2 commented ·

@jordan.johnson, thank you for the reply.

I need to use a "Decide" activity in the process flow. Is there an expression to use for list like for the model objects (for example: Model.find("Queue").subnodes.length == 0)? If not, would you please explain the solution you recommend with figures because I didn't understand exactly how this should be.

0 Likes 0 ·
tannerp avatar image tannerp sara S2 commented ·

@sara.s2,

You can check the box for "Use Max Wait Timer" and then release the token to connector 2 if the wait timer goes off (fails). I set up an example model that only has one item on the list. The first token pulls the item, then the second token fails and is sent to a different connector, similar to a Decide activity.

Hope this helps!

list max wait timer.fsm

1 Like 1 ·
sara S2 avatar image sara S2 tannerp commented ·

@tanner.p, thank you for your help.

1 Like 1 ·
Show more comments
sara S2 avatar image sara S2 commented ·

@jordan.johnson, thank you for your help.

0 Likes 0 ·