The reason for that warning message is that the batch itself is done cooking, but none of the items in the batch reported a status back to PDG. When that happens PDG assumes that all of the items have the same status as the batch itself. The warning exists because typically that occurs when there's a problem with the way the scheduler is handling batch work items.
Normally, the notification for starting and stopping a batch comes from RPC calls from a job running out of process. When running in-process it's not possible to use that same mechanism. To partially fix that, I've exposed two new API methods that will be available in the next daily build (
H18.5.492) which can be used instead. Both methods can only be called on in-process batch sub items, or they'll throw an exception.
pdg.WorkItem.startSubItem(wait=True)This method will ensure that the dependencies for the sub item are cooked, and will put the item into the cooking state. The
wait argument is needed because a batch can be created with the
pdg.batchActivation.First activation mode, which will start cooking the batch as soon as the first sub item's dependencies are ready. The batch is then responsible for waiting for the dependencies on subsequent items.
pdg.WorkItem.cookSubItem(state, duration=0)Marks a batch sub item as completed with the specified state.
Here is an example of an in-process batch cook implementation that could be used in a Python Processor's onCookTask callback:
import time
for sub_item in work_item.batchItems:
sub_item.startSubItem(True)
time.sleep(1) # Process the batch sub item -- in this example, just sleep
sub_item.cookSubItem(pdg.workItemState.CookedSuccess)
Additional, here's an example .gif of that cooking -- note that the UI will correctly display the batch sub items as cooking after calling
startSubItem, and downstream dependencies can begin processing after calling
cookSubItem.