query slot by classtype of storageObject

query slot by classtype of storageObject

xucq
Not applicable
29 Views
4 Replies
Message 1 of 5

query slot by classtype of storageObject

xucq
Not applicable

[ FlexSim 20.1.3 ]

Hi

I want to query slot by classtype of storageobject. How to write the query sentence?

The usual query sentence is "Variant slots = Storage.system.querySlots("WHERE slot.levelID = "+level_id,0);"

Thank you.

0 Likes
Accepted solutions (1)
30 Views
4 Replies
Replies (4)
Message 2 of 5

joerg_vogel_HsH
Mentor
Mentor

@xu.chunqi, can you be a bit more precise what you want to achieve? What is level_id? - A label, a previous level. Do you want to get as a result an array of slots ordered in a special design? Thanks!

0 Likes
Message 3 of 5

xucq
Not applicable

In my model, there are two classes of rack , one is Rack, the other is FloorStorage.

When I choose slot to store items, I want choose FloorStorage.

I want to use querySlots to find slot, but I donnot know how to write the query sentence.

0 Likes
Message 4 of 5

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

I suggest you choose the rack by name:

Variant slots = Storage.system.querySlots("WHERE slot.storageObject.name = 'FloorStorage1'",0);

or pointer

Variant slots = Storage.system.querySlots("WHERE slot.storageObject = $1",0,Model.find("FloorStorage1"));

or if you have more objects then with clause IN

Array myRacks = [Model.find("FloorStorage1")];
Variant slots = Storage.system.querySlots("WHERE slot.storageObject IN $1",0,myRacks);
Message 5 of 5

xucq
Not applicable

Hi Joerg, thank you very much!

0 Likes