I am attempting to use the rest client to query a webservice for data. The flow is as follows:
- POST request with the query that returns a cursor Id (Get Initial Cursor)
- GET request with the cursor ID to retrieve the first batch of 5000 rows
- Along with the data, the response contains the next and previous cursor id (Extract Cursor Id, Get data with cursor)
- Use the next cursor from the request in step 2 to get more data and possibly another next cursor.
- If next cursor is missing from the response, no more data is available.
What is the best way to implement a looping construct to keep retrieving data till 'next cursor' is unavailable?
Below is the diagram of my transformation: