Hello @Vns
I see that now. In this case you will want to add an On Entry trigger to the combiner. Start with the picklist option Update Combiner Component List with Labels.

This option has you update the component list from a global table. We will edit it to look like the following.
Object current = ownerobject(c);
Object item = param(1);
int port = param(2);
{ // ************* PickOption Start ************* //
/***popup:CombinerComponentListLabel*/
/**Update Combiner Component List*/
string tablename = /** \nTable: *//***tag:table*//**/"tablename"/**/;
string labelname = /** \nLabel: *//***tag:label*//**/"nooftote"/**/;
/** \n\nNote:
This option should only be used on Combiners.*/
/**\n*/
if (port == 1) {
//The trigger on entry code fires each time a flow item enters the combiner.
//For this reason we check to make sure that the port entered is equal to 1
//because only the container will enter through port 1.
//The component list in a combiner is set up as a table. This allows us to use the cell commands to obtain the node that contains
//the number of items to retrieve from each port. Once you know what node contains the information you can use the setnodenum
//command to set the component list number based on the global table.
Table thelist = getvarnode(current, "componentlist");
treenode thesum = getvarnode(current, "targetcomponentsum");
thesum.value = 0;
thelist[1][1] = item.labels[labelname].value;
inc(thesum, item.labels[labelname].value);
}
} // ******* PickOption End ******* //
I also changed the pull requirement to wait to change the Matched Order label till all the totes required had been pulled.
/**Custom Code*/
treenode current = ownerobject(c);
treenode item = param(1);
int port = param(2);
int MatchedOrder = current.MatchedOrder;
if (MatchedOrder != 0) {
//We previously matched an item so pull the matching order from the other queue
if (item.pallet_id == MatchedOrder) {
//see if capacity has been met
if((getvarnum(current, "currentcomponentsum")+1) == getvarnum(current, "targetcomponentsum")){
current.MatchedOrder = 0;
}
return 1;
}
return 0;
}
int Order = item.pallet_id;
//Search the opposite queue for the same order
int otherPort = port % 2 + 1; //Grab the other port rank so we look at the other queue
treenode queue = current.as(Object).inObjects[otherPort];
for (int i = 1; i <= queue.subnodes.length; i++) {
if (queue.subnodes.pallet_id == Order) {
//Found a matching order, save the order on a label
current.MatchedOrder = Order;
//Now pull the item that just entered the original queue
return 1;
}
}
//No matches, pull nothing
return 0;
test1_2.fsm