question

Cindy avatar image
0 Likes"
Cindy asked Felix Möhlmann answered

How to know if there ar items in a floor storage in process flow

Im working on a model where i want to process different items, im doing so in process flow, but i dont know how to put in a conditional decide if there are objects on a floor storage to follow one processs or if there are no products to follow a different process.

1708962129147.png

I was trying to do it with a wait for event activity but if i use it the token will be stuck in there, and if i dont put that wait for event then the token label i need will not exist, so i just want to put in the conditional decide if there are objects in the specific floor storage.

I was trying to put in the condition this line of code but it only works if i have the wait for event put in there.

objectexists(token.RBC) && token.RBC.up == Model.find("RBC") 

How can i solve this problem?

FlexSim 23.0.0
processs flowfloorstorageconditional
1708962129147.png (57.2 KiB)
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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered
Model.find("RBC").subnodes.length 

returns the number of items currently in the "RBC" object.

Instead of using multiple Decide activities in a row, you can also write multiple checks into one as custom code. Returning a different connector rank for each.

if(Model.find("RBC").subnodes.length == 0) {
   return 1;    // First connector if RBC is empty
}
if(Model.find("PL").subnodes.length == 0) {
   return 2;    // Second connector if PL is empty
}
if(Model.find("PQ").subnodes.length == 0) {
   return 3;    // Third connector if PQ is empty
}
...
5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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