Send to port by itemtype

Send to port by itemtype

edward_ellis
Not applicable
17 Views
2 Replies
Message 1 of 3

Send to port by itemtype

edward_ellis
Not applicable

Hi I have a quick question. I want to validate the itemtype and in the case that it has getitemtype(item) == 1 or 2 I want it to go to certain ports. It is working when I state getitemtype(item) == 1 but how do I add to validate for 2 as well?

Do I use commas, or, what do I do to validate the itemtype for both 1 or 2?

Thank you for your help!

Edward Ellis

0 Likes
Accepted solutions (1)
18 Views
2 Replies
Replies (2)
Message 2 of 3

adrian_haws
Not applicable

Edward,

If you want to send itemtype 1 for port 1 and itemtype 2 to port 2 you can use the "Port by Case" picklist option in a fixed resource's "Send to Port" field. This is what that might look like:

3409-port-by-case.png

If you want to send an item to port 1 if itemtype is 1 or 2 you would choose "Conditional Port" with syntax like this:

3411-conditional-port.png

Message 3 of 3

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

3429-send-to-simplified-case-structure.jpg

switch(getitemtype(item))
{
	case 1: 
	case 2: 
		return 1;
	default: 
		return 0;
}

As long as there isn't a break or return-command the structure is computing from above to bottom. If case 1 becomes true the code executes in the case 2 the return value. Otherwise default:

0 Likes