Open topic with navigation

TIBCO Business Studio™ - BPM Edition 5.4.0

# 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;
    		}
    	}

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Business Studio™ - BPM Edition

Copyright © 2015-2023. Cloud Software Group, Inc. All Rights Reserved.