Separator - Split 1 item into 2 & Route them based on label

Separator - Split 1 item into 2 & Route them based on label

ana_pc2
Not applicable
20 Views
4 Replies
Message 1 of 5

Separator - Split 1 item into 2 & Route them based on label

ana_pc2
Not applicable

[ FlexSim 20.2.3 ]

Hello everybody,

I have a small question about how to split an item into 2, and route them based on a label. Please find attached a basic example model where the Separator - Send To Port Custom Code is still unfinished:

Object item = param(1); 
Object current = ownerobject(c); 

/**Custom Code*/ 

if (item.Type == 1) 
{
    return 1;  // return both splits to port 1; 
}
else 
{     
// send 1 split to port 2;          
// & send the other split to port 3; 
}


I hope it makes sense what I am trying to do 🙂

Thanks for your help!

Ana.

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

ana_pc2
Not applicable
0 Likes
Message 3 of 5

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

@ana.pc2, let a queue do the round robin send action.

The separator sends items by “Port by case“ or “by expression”. A queue at exit port 2 or port 2 and 3 sends items in round robin property.


Message 4 of 5

joerg_vogel_HsH
Mentor
Mentor

This answer uses an object as a replacement for a source code. A model is still an imitation of reality. If you don’t want to show objects, which are present just for a logic purpose, then you can still hide them.

0 Likes
Message 5 of 5

ana_pc2
Not applicable

Yes, it could be an option. I was just wondering if it could be done on the same separator, but thanks for the reply! I will do that 🙂

0 Likes