Poll

Typically, the client polls the feeds periodically to process all entries that appear in a feed. The polling orchestration combines the techniques of navigating through feed pages and limiting the entries returned.

Follow these steps to ensure that the polling mechanism is reliable and the client processes the entries chronologically.

  1. Decide whether future-dated events should be processed once they become effective or immediately. The former approach requires implementation using the entries' updated date. The latter requires implementation using the entries' published date attribute. The approach determines the filtering parameters (updated-min or published-min) and sorting parameter value (updated:asc or published:asc ) to be used respectively. For more details about date effectivity in HCM Atom feeds, see Manage Date Effective Entries.
  2. Read the feed by specifying the last processed timestamp from the previous poll.
  3. Gather new entries potentially going through all the pages, in a manner that is not impacted by entries published in between the calls.
  4. Process the entries by incrementing the last processed timestamp.

This pseudo code provides details of the polling pattern with future-dated events processed once effective.

pageSize = 10
page = 1

updatedMin = lastProcessedEntry (for the first time set to beginning of time)
repeat {
    entries = GET /feed?updated-min=${updatedMin}&page-size=${pageSize}&page=${page}&orderBy=updated:asc
       
    foreach entry : entries {
        process entry
       
        if (processed successfully) {
            lastProcessedEntry = entry.updatedDate
        }
      	else {
             break repeat
        }
    }
    
    page++
}
while (entries.size == pageSize)