while (queryProcessorRun.next())
{myTable = queryProcessorRun.getNo(1);
MyIndivudalTaskService processIndivudalTaskService = new MyIndivudalTaskService ();
processIndivudalTaskService.parmSalesId (myTable .OrderNum);
processIndivudalTaskService.parmLineNum (myTable .LineNum);
processIndivudalTaskService.parmQty2Delv(shortPicksOrderProcessorTable.ProcessedQty);
processIndivudalTaskService.batchInfo().parmCaption(strFmt("Processing for Purch order %1", myTable .OrderNum, myTable .linenum));
batchHeader.addTask(processIndivudalTaskService);
batchHeader.addRuntimeTask(processIndivudalTaskService, BatchHeader::getCurrentBatchTask().RecId);
//This is where you are listing the added service to a List
taskServiceList.addEnd(processIndivudalTaskService);
}
//This is where your code adds the header to a batch:
MyProcessCompletePurchTableController processCompletePurchTableController = new MyProcessCompletePurchTableController ();
processCompletePurchTableController.parmHeaderPurchId(_orderNum);
batchHeader.addRuntimeTask(processCompleteSalesTableController, BatchHeader::getCurrentBatchTask().RecId);
Now you need to ensure that the header waits till all the lines get executed without any error:
while (listEnu.moveNext())
{
MyIndivudalTaskService taskService = listEnu.current();
batchHeader.addDependency(processCompletePurchTableController, taskService, BatchDependencyStatus::Finished);
}
batchHeader.save();
No comments:
Post a Comment