Synchronous v/s Asynchronous Processing
CGI Advantage HRM communicates with NextGen Payroll through REST API calls. There are two types of processing that HRM COBOL currently supports.
Synchronous processing
Online check (OCHK) or Paycheck Calculator are initiated by HRM users and they need to be Synchronous in nature, which means for the action that is initiated by the user, an immediate response is expected. This is accomplished by keeping the REST call synchronous and once HRM initiates the call, it waits for NextGen Payroll to serve and send the response back to HRM so it can show results back to the user on the front-end application.
Asynchronous processing
The majority of COBOL processes are Asynchronous in nature. They are run as offline batch jobs and are usually heavy on data processing, which can run up to a few hours. REST calls need to be handled quickly and it is not recommended to be kept on a longer wait time.
For all such batch job-based executions, HRM makes Asynchronous REST calls. NextGen Payroll receives the call and immediately responds with either a “Success” or “Failed” message to indicate the call reception status back to HRM. The REST request/response cycle ends there. Another thread starts serving the request on the NextGen Payroll side while the HRM polls the REST_REQ_LOG table for a return code. Once the processing ends on the NextGen Payroll side, it writes the return code to the REST_REQ_LOG table, no matter whether processing was successful or failed. Upon seeing this return code, HRM will continue job execution on its end and completes it.