question

David Besson avatar image
3 Likes"
David Besson asked Brandon Peterson commented

How to pull a batch (size OR maxWaitTime reached) with Process Flow

Flowitems arrive in a Queue and are pushed to a list.

A Fixed Resource Process Flow tells a Processor to pull a batch of flowitems on this list. The batch size is specified with a label on the Processor and the Processor can process only one batch at a time.

How can I also pull all the flowitems in the Queue when one of them reaches a maximum wait time, although the batch size is not reached ? The maximum wait time is for example defined with a label on the Queue.

This wait time is NOT the wait time of the "Pull from List" activity, BUT the time that the flowitem was spent in the queue.

how-to-pull-a-batch-size-or-maxwaittime-reached-wi.fsm

Thanks for your help!

FlexSim 16.1.0
process flowlist
5 |100000

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

Brandon Peterson avatar image
4 Likes"
Brandon Peterson answered Brandon Peterson commented

David,

I would use two pull from list activities. The first one would pull a single item but would leave the entries on the list and would not have a max wait time. Basically it would act like a gate that holds the token until the first item arrives (you could also use a wait for event activity and listen to the queue). The second pull from list would be the same one that you have now but would use the max wait time functionality. Now, because we waited in the first pull from list activity for the arrival of the first flowitem, the max wait time is the same as the time that the first flowitem is waiting.

Hope this helps!

Brandon

· 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.

David Besson avatar image
0 Likes"
David Besson answered

A solution could be to change the Process Flow as follow:

And to change the OnEntry trigger of the Queue : each flowitem sends a delayed message when it is supposed to reach the maximum WaitTime, which triggers the "item Delay message" activity.

This activity is followed by a "Release token" activity, which destroy the token in the "Wait BatchSize" activity.

Your remarks are welcome!

how-to-pull-a-batch-size-or-maxwaittime-reached-wi.fsm


5 |100000

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