I have to find X number of slots where X is the number of items I need to put into the rack. I currently have "Find slot" in a sub flow with X child tokens. Is there a way to pull multiple slots in Find slot without having to iterate?
I have to find X number of slots where X is the number of items I need to put into the rack. I currently have "Find slot" in a sub flow with X child tokens. Is there a way to pull multiple slots in Find slot without having to iterate?
The Find Slot activity is designed to find (and assign) a slot for a single item. You can use "Storage.system.querySlots()" in custom code instead to get an array of slots. Note that "hasSpace" will only be guaranteed to be true for the item you used in the query. You also have to assign the slot. To make sure items are only assigned to slots with space, you would have to check the requirement for each item individually (if you want/need to place more than one item per slot)
The code below assigns each item in the "token.Items" array to the first slot with space, for example.
Array Items = token.Items.clone(); Array Slots = Storage.system.querySlots("WHERE slot.hasSpace($1)", 0, Items[1]); while(Items.length && Slots.length) { if(Slots[1].as(Storage.Slot).hasSpace(Items[1])) { Storage.Item SI = Storage.Item(Items.shift()); SI.assignedSlot = Slots[1]; } else { Slots.shift(); } }
14 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved