Peoplesoft Process Scheduler

Process Scheduler - Centralized tool to managae batch processes.

Architecture -
  • No external clients and so no listener process.
  • Server processes (PSAESRV) in a process scheduler domain respond to tuxedo service requests  (e.g. RunAeAsync, ChkAeStatus) issued by PSPRCSRV.
  • Process Scheduler Server Agent (PSPRCSRV) - starts with reading Max PSAESRV server settings, validating the PSAESRV server setup and initializes itself with checking processes cancels. It periodically polls the request table PSPRCSRQST (polling frequency is determined by user defined SleepTime - 15 seconds as default and HeartBeat time- on heartbeat alarm, it checks server state, default is 60 seconds), cancels the processes, and if finds a request in PSPRCSRQST table, submits the command line with parameters or sends service request (RunAesync) to initiate a process on Application Engine Tuxedo server (PSAESRV), updates its run status to Initiated and updates SessionID with ProcessID of the that process in PRCSRQST table.
  • The started process is responsible for updating Run Status in PRPRCSRQST accordingly before finishing execution.
  • During polling cycle, the Agent (PSPRCSRV)-
    • Cancels processes that have been cancelled through Process Monitor page.
    • Checks processes with a Run Status of Initiated and Processing to determine if it is actually running.
Distribution Agent (PSDSTSRV)
  • Responds to PostReport service request and transfers finished reports, trace files and log files to Report Repository, creates transfer log, publish messages to create folders on report repository for each of the process instance and report Id, once the files are successfully transferred, it deletes corresponding log_output directory.
  • Report distribution options restrict access to these reports based on UserID and RoleID.
  • For distribution agent to pass authentication-
    • UserID to start process scheduler server domain must have ProcessSchedulerAdmin role.
    • Report Node should be correctly defined.


When the prcs domain is started, the admin process BBL starts and boot the server processes in order - PSMSTPRC, PSAESRV, PSDSTSRV, PSPRCSRV and PSMONITORSRV.

PSPRCSRV and PSDSTSRV both checks the status of each process in report list table - PS_CDM_LIST. An entry in this table is inserted when PSPRCSRV initiates a process request with output destination type - Web or if server definition page is setup to transfer log/trace to Report Repository. When process complete, status is report list table is updated to Generated indicating files are ready to be transferred to report repository. PSPRCSRV now sends a tuxedo request (PostReport) to PSDSTSRV via DSTQ queue to initiate transfer. A Report Repository can be setup on Windows/UNIX machine and one repository can be used by multiple peoplesoft databases.



Application Engine Server (PSAESRV) - Application Engine is a threaded Tuxedo server process and it starts with advertising services - RunAeAsync and ChkAeStatus. Once it first receives a RunAeAsync service request to execute an application engine process, it loads the Java VM Library, creates a Java VM instance and executes the service request.


Run Control - Values and/or parameters telling the system where and when to run a report and to determine the content of a report are saved as a database record called the Run Control. The next time report is run and same Run ControlID is specified, system itself completes the settings.

- Several run controls for same report to manage different situations, and one run control may be applied to several reports when all of these reports require same parameters.

- A run control ID is stored in minimum two tables as -
  1. Tools' run control table - PSPRCSRQST, it stores information required by process scheduler such as output type, format distribution, destination, dependency etc.
  2. Application run control table - PS_PRCSRUNCNTL. Application run control table stores information required to run a process such as deptid, emplid. This table is keyed by userid and run control id.

Running a Process/Submitting a Process Request
Process scheduler's System Process Request page shows all the jobs and processes that user has security to run. On this page, different parameters are Server Name, Run Date, Time, Time Zones etc., Recurrence, Output Destination, Distributions and Output Type drop-down list. 
Output Types -
  • File - output is sent to file given in Output Destination field.
  • Printer
  • Email- option available for SQR, PS/nVision, XML Publisher and Crystal Reports.
  • Web - output alongwith log/trace is sent to Report Repository.
  • Window - output sent to report repository and also to a new web browser window. This output is not available if -
    • REN Server is not active, and
    • User does not have REN Server Report Window permission.
* Distribution link is to access Distribution Detail page.
* Fomat - if output format is set at process definition level, it cannot be changed from System Process Request window.


Report Distribution Settings - on Distribution Detail page, settings are Folder Name, Retention Days and Distribute To.

Setting Sub-directory structure of Log-output directory/Report Repository -
These meta variables can be used to specify the sub-directory structure-
  • %PS_SERVERDIR%
  • %REPORTID%
  • %OPRID%
  • %JOBNAME%
  • %SERVER%
  • %PRCSTYPE%
  • %DBNAME%
  • %CURRDATE%
To alter the sub-directory structure of Report Repository, modify Report Node definition stored in PS_CDM_DIST_NODE by setting CDM_DIR_TEMPLATE field.


Process Monitor - This is a view of PSPRCSRQST.

Process Request Run Status - diferent run status are
1 Cancel - User requested to cancel scheduling, monitor updates to this status.
2 Delete -
3 Error- program associated with process request encountered an error while processing transaction within program.
4 Hold - user requested scheduling to be put on hold. Process Monitor updates to this status.
5 Queued - Status is assigned to a new process request. Request remains queued until a PSPRCSRV picks up the new request. ProcessRequest() function updates this status.
6 Initiated - Process scheduler updates to this status after 1) acknowledging the new request, 2) validates the parameters associated with request, and 3) submits the command line to start process.
7 Processing - batch program updates indicating that the program is running.
9 Success -
10 No Success -
11 Posted -
16 Pending - ProcessRequest() peoplecode function updates this status, indicates that an item of a new PSJob request is waiting for a previous item in job to complete. When this previous job completes successfully, PSPRCSRV changes the status of this Job to Queued.
19 Restart - Batch program updates indicating process which encountered an error is attempting to restart.
Warning -
Blocked
Cancelled- PSPRCSRV successfully cancelled the request after the process has been started. PSPRCSRV updates to this status.


Process Details page -  On Actions tab, important fields are
1) Process Request Parameters - helps in eliminating configuration problems
2) Command Line - useful when trying to isolate a request related problem originating outside of process scheduler. Copy command line and run outside process scheduler.


Server Status-
(N) PeopleTools > Process Scheduler > Process Monitor > Server List
Running - server is active and querying PSPRCSRQST. 
Down - server is down.
Suspended - Disk Low - current log_output directory is below the disk threshold specified in psprcsrv.cfg. Server will not schedule any new requests until space becomes available.
Suspended - Offline - Server suspended as current time not within allowed operation time defined in server defintion.
Overload - amount of memory used exceeds the percentage value threshold defined. Server will wait to launch new requests.
Running with No Report Node

Server Activity page- to view associated Process Catagories and Process Types for 1) Priority, 2) Max Concurrent, and 3) Active


Server Details page-
SleepTime - After each sleep, the process scheduler performs a number of checks e.g. determines which Process Requests (not PSJobs) are due to be scheduled and which can be scheduled given the load characterstics of the server in descending order of priority. (Default is 15 seconds)
HeartBeat - (default is 60 seconds), on each HeartBeat, the server performs some tests particularly it checks its status record (PSSERVERSTAT) to determine whether it has been instructed to suspend or shutdown.

Process Scheduler Configuration Files -
psprcsrv.val
psprcsrv.cfx
psprcsrv.ubx
psprcsrv.ubb
psprcsrv.env, and
psprcs.cfg


Process Scheduler Steps - when a process is scheduled to run via a component in PIA-
  1. Component sets up a run control record that is used to pass process-specific parameters. (INSERTS into PSPRCSRQST)
  2. Output destination options are inserted into run control detail record - PS_PRCSRUNCNTL_DTL.  Sequence numbers are incremented and then selected from PS_PRCSSEQUENCE.
  3. Distribution and Content request records are inserted - PS_PRCSRQSTDIST, PS_CDM_AUTH, PS_CDM_LIST.
  4. PSPRCSPARMS - This table holds the parameters for the process request. These parameters mostly come from process type definition. A record is inserted alongwith certain environment variables e.g. %SERVER%, %DBBIN%, %ACCESSID%, %ACCESSPSWD% etc..Environment variables are set by process scheduler at run time.
  5. PSPRCSQUE - It holds information needed to schedule the request and to check that it is still running. When the process is initiated, the operating system process ID of client process is stored in SESSIONIDNUM. [This column is updated with 0 when the process was submitted by user.] The information from this table is needed if the process scheduler needs to kill the process. 
  6. PSPRCSRQST - table holds information about start and end time of each process which can be viewed from Process Monitor page.
* When a SQR is run, SESSIONIDNUM contains the ProcessID of the PSSQR wrapper program which calls the SQR program. For Application Engine programs, the SERVERID of PSAESRV is stored in PSPRCSQUE.SESSIONIDNUM and not the PID of the server process.


No comments:

Post a Comment

Followers