question

Kyle S avatar image
0 Likes"
Kyle S asked Kyle S commented

How do I get all Items in a batch to go to the same random port?

I am building a model and have a few things I am unable to get the model to execute how I would like it to.

1. A few days ago someone assisted with the coding for the batching by SKU custom code in the source triggers. However after the items go to the first queue I would like them to be sent to one of the remaining queues randomly in the full batch quantity. When I use the random queue entry it sends each batch to different queues. After this step items are individually moved throughout the process so a combiner would not be ideal.

2. I have included the setup for a process flow I have that generates orders. I had to remove the current model and so the process flow does not function in the attached model. I am just looking for help with the "Assign Labels: SKU & QTY" step. I have the SKU and QTY setup by quantities from historical data but when the system gets the number of SKUs in the order from the "Get Order Data" label it pulls from all those historical quantities creating orders larger than we produce. Ideally I would like to set a max quantity on this so there is only a max of 52 items per order but am not sure if this is possible.


Any help is appreciated.

FlexSim Model.fsm

process flowbatchingqueues
flexsim-model.fsm (35.9 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.

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Kyle S commented

A queue has got an On Finishing Collection trigger. You set a random value in a label at your queue. In Send to port you read this label value.

Restriction: If another batch finishes before all previous batched items left, this gets messed up. If this can happen, you have to step through all items in a loop to assign an output port label, which is read in send to port OR you explicitly release each item by command releaseitem through a port number.

· 6
5 |100000

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