Using the Process Scheduler SQR API

Application programs that are written in SQR can update selected process request fields at runtime using a PeopleSoft-provided API. This is to be used for SQR reports.

Include Files

Include File Description

PRCSDEF.SQC

Contains the procedure Define-Prcs-Vars. Initializes the fields that are used in the API.

PRCSAPI.SQC

Contains the procedure Get-Run-Control-Parms:

  • Retrieves the three parameters that are described in the following table.

  • Updates the run status of the process request to Processing.

    Contains the procedure Prsc-Run-Status. Performs the process request table update.

SQRs should be defined to accept the following parameters from the command line.

Parameter Description

Process Instance

Required so that the SQR knows which process request to update.

User ID

Indicates the user ID key to the Run Control table.

Run Control ID

Indicates run control ID key to the Run Control table.

All SQRs use the procedure Get-Run-Control-Parms, which is defined in PRCSAPI.SQC. For example:

Begin-Procedure Get-Run-Control-Parms
    input $prcs_process_instance 
					 ‘Please press ENTER (Do not input a value)’
    if not isnull($prcs_process_instance)
        let #prcs_process_instance = to_number
				($prcs_process_instance)
        input $prcs_oprid 
							‘Please press ENTER (Do not input a value)’
        let $prcs_oprid = upper($prcs_oprid)
        input $prcs_run_cntl_id 
							‘Please press ENTER (Do not input a value)’
    else
        let #prcs_process_instance = 0
    end-if
    if #prcs_process_instance > 0
        let #prcs_run_status = #prcs_run_status_processing
        do Update-Prcs-Run-Status
        let #prcs_run_status = #prcs_run_status_successful
    end-if
end-procedure

The three input commands correspond to the three values in the command line:

%%INSTANCE%% %%OPRID%% %%RUNCNTLID%%

When you run the SQR through SQR Windows (SQRW) and don’t enter any input values, the SQR interprets this as having been run outside PeopleSoft Process Scheduler. Therefore, it prompts for other input parameters that otherwise come from Run Control tables.

An API-aware SQR program in PeopleSoft Process Scheduler must update the run status of the request to:

  • Processing upon receiving control.

  • Success or No Success upon completion.

Note:

All other SQR runtime parameters should reside in a run control record that is keyed by user ID and run control ID.