ERXFetchSpecificationBatchIterator fsIterator = new ERXFetchSpecificationBatchIterator(fs, ec);
// Loop for a period of time
while (fsIterator.hasNext() && !_isStopped) {
@SuppressWarnings("unchecked")
NSArray<ResultItem> batch = fsIterator.nextBatch();
for (ResultItem resultItem : batch) {
resultItem.setWorkflowState(ResultItem.WORKFLOW_CHECKING_FACTORIAL);
performFactorialProcessing(resultItem);
resultItem.setWorkflowState(ResultItem.WORKFLOW_PROCESSING_COMPLETE);