Package Name: RMS_ASYNC_PROCESS_SQL

Spec file name: rmsasyncprocs.pls

Body file name: rmsasyncprocb.pls

Function Level Description – ENQUEUE_STKLGR_INSERT

Function: ENQUEUE_STKLGR_INSERT
           (O_error_message          IN OUT  RTK_ERRORS.RTK_TEXT%TYPE,
            I_rms_async_id           IN      RMS_ASYNC_STATUS.RMS_ASYNC_ID%TYPE)

This function adds the RMS_ASYNC_ID associated with the JOB_TYPE STKLGR_INSERT to the asynchronous queue which is created when entering data into theSTOCK_LEDGER_INSERTS table. It also creates entries in the RMS_ASYNC_STATUS and RMS_ASYNC_RETRY tables to track the status of the asynchronous job.

Function Level Description – ENQUEUE_STKLGR_INSERT_RETRY

Function: ENQUEUE_STKLGR_INSERT_RETRY
           (O_error_message          IN OUT  RTK_ERRORS.RTK_TEXT%TYPE,
            I_rms_async_id           IN      RMS_ASYNC_STATUS.RMS_ASYNC_ID%TYPE)

This function inserts the RMS_ASYNC_ID associated with a STKLGR_INSERT event into the asynchronous queue again for re-processing. It is invoked through the asynchronous job log form.

Function Level Description – NOTIFY_STKLGR_INSERT

Procedure: NOTIFY_STKLGR_INSERT (context     raw,
                                 reginfo     sys.aq$_reg_info,
                                 descr       sys.aq$_descriptor,
                                 payload     raw,
                                 payloadl    number)

This procedure is called during the de-queue process. This procedure calls the function CORESVC_STKLEDGR_INSERTS_SQL.PROCESS_STKLEDGR_INSERTS for stock ledger and budget table creation. Once the stock ledger and budget table creation is completed successfully it calls the function RMS_ASYNC_PROCESS_SQL.WRITE_SUCCESS to update the status of the RMS_ASYNC_ID as success. If there is a failure in stock ledger and budget table creation, it calls the function RMS_ASYNC_PROCESS_SQL.WRITE_ERROR to update the status to ‘error’ and update the error message. The user is notified about the success/failure of the stock ledger and budget table creation process.