I found the following code that changes the target batch size for a Combiner based on the length of the queue before it.
Object current = ownerobject(c);
Object item = param(1);
int port = param(2);
{ // ************* PickOption Start ************* //
/***popup:CompleteTray*/
/***tag:description*//**CompleteTray*/
/***tag:tray*//**/
if (current.inObjects[2].subnodes.length == 0)
{
treenode targetComponent = getvarnode(current, "targetcomponentsum");
int newTarget = current.subnodes.length;
setnodenum(targetComponent, newTarget);
}/**/
; // leave a no-op statement in case they leave it empty
} // ******* PickOption End ******* //
Is it possible to do that with a queue batch size instead of a Combiner Target?
The queue after the processor has a predermined batch size value but when the queue before the processor is empty, the batch size changes to however many objects are already in the queue. It will also have to have a delay time for the batch size to change so the last object in the processor can join the rest of the batch.