question

ana.pc2 avatar image
0 Likes"
ana.pc2 asked ana.pc2 commented

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

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.

FlexSim 20.2.3
flexsim 20.2.3separatorsend to port
· 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.

ana.pc2 avatar image ana.pc2 commented ·
0 Likes 0 ·
examplemodel.fsm (26.4 KiB)

1 Answer

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered ana.pc2 commented

@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.


· 2
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

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 0 ·
ana.pc2 avatar image ana.pc2 commented ·

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 0 ·