Conditional Port

Conditional Port

manocher_djassemi
Not applicable
126 Views
4 Replies
Message 1 of 5

Conditional Port

manocher_djassemi
Not applicable

@Ben Wilson

I am using conditional port in a Separator. I have entered:

content(node("Rack1", model())) <=30

If True Port 1 If False Port 2

The Separator is connected to Rack1 (port 1) and a queue (port 2).

When I run the model, all items flow to Rack1, none goes to queue even when <=30 condition is met as can be observed. Any solution will be appreciated.

Manocher

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

cameron_pluim
Not applicable
Accepted solution

If the Rack is connected to outport 1, you could use the following:

if(content(outobject(current,1)) <= 30) {
	return 1;
} else {
	return 2;
}
Message 3 of 5

Ben_WilsonADSK
Community Manager
Community Manager

@Manocher Djassemi,

That code should have worked, assuming your rack is named "Rack1".

Can you attach your model?

0 Likes
Message 4 of 5

manocher_djassemi
Not applicable

That solved the problem. Thanks

0 Likes
Message 5 of 5

manocher_djassemi
Not applicable

I am using the following codes in Flow tab of a Separator. Port 1,2,and 3 are connected to 3 racks.

While the first IF condition sends item 9 to port 2, the second one does not send the item 8 to port 3. It keep sending it to port 1. I ran the model long enough to make sure the condition >=5 is met. Is there anything wrong with these codes? Thanks

if(content(outobject(current,1)) >= 5&&getitemtype(item)==9) {

return 2;

if(content(outobject(current,1)) >= 5&&getitemtype(item)==8) {

return 3;

} else {

return 1;

}}

0 Likes