Processing a Paginated List of Case References

When a paginated list of case references is returned by a method on a case class or case reference, the list object has a hasMoreResults attribute that can be used to determine whether there are more pages of results that could be returned.

Paginated lists can be returned by the following the findAll() method:

Example

This example shows how to use a paginated list to iterate through a returned list of customers.

	var maxOrderCount = 0;
	var name = "";
	var index = 0;
	var pageSize = 100;

	while (true) {
		var custRefs = bpm.caseData.findAll('com.example.ordermodel.Customer', index, pageSize);
		for (var ix = 0; ix < custRefs.size(); ix++) {

				// Process the case reference...

			}
		}
		if (custRefs.hasMoreResults) {
			index += pageSize;
		} else {
			break;
		}
	}