Search This Blog

Showing posts with label process. Show all posts
Showing posts with label process. Show all posts

Saturday, March 20, 2010

Process status check

If we want to enforce a validation for the user beofre running a proess, then get the runstatus from the PSPRCSRQST table. Then using the translate values for the runstatus field, see the status of the process, based on which we can restrict the user to run the process.

Some status values are:
" " - When Process is ran first time
9 - When last process status is not equal to Success
17 - When last process status is not equal to Success with Warning
2 - When last process status is not equal to Delete

Tuesday, December 29, 2009

Security Processes

Refresh SJT_OPR_CLS and Refresh SJT_CLASS_ALL are Security process.

When to execute Refresh SJT_OPR_CLS process

On the Roles - Permission Lists page

• Add a permission list with data permission to a role that is already assigned to one or more users.

• Remove a permission list with data permission from a role that is already assigned to one or more users.

On the User Profile component

Add a row security permission list.

• Delete a row security permission list.

• Add a role with data permission.

• Delete a role with data permission.

• Clone an existing profile that has data permission through roles or a row security permission list.

•Deactivate a user.

You can refresh SJT_OPR_CLS in real-time by using the subscriptions on the USER_PROFILE and ROLE_MAINT messages or on demand using the SCRTY_OPRCLS app

engine process.

Run the Refresh SJT_CLASS_ALL process when

• Add a new department to a department security tree.

• Delete a department from a department security tree.

• Move a department to another parent node in a department security tree.

• Modify a department security tree.

Wednesday, November 25, 2009

Batch Scheduling

The People Tools process scheduler allows you to run jobs on a regular schedule. This wiki page goes through the two ways to set up batch scheduling using recurrences.

Batch Scheduling Terminology

However, before setting up batch scheduling, there's some terminology that you'll need to be aware of:

·       A job is a collection of one or more processes that run together.

·       A recurrence defines a regular event. For example a daily recurrence would be for every day of the week. A recurrence includes a start request date and time, an end request date and time, and repeat information (e.g. repeat every 1 hour for 24 hours).

·       A schedule job set definition is a job that has been scheduled to run on a regular basis (with a recurrence) using specific run control(s) and parameters.

The navigations you'll need to know are:

·       People Tools > Process Scheduler > Jobs

·       People Tools > Process Scheduler > Recurrences

·       People Tools > Process Scheduler > Schedule Job set Definitions

Recurrences through the Process Scheduler

The first (and simplest) way to schedule something to run on a regular basis is to select a recurrence when you schedule a process through the process scheduler. For example, if you wanted to run the system audit process through system process requests each day, navigate to People Tools > Process Scheduler > System Process Requests then select the system audit process to be run. At the process scheduler request page, you would then select a recurrence. Here's an example screenshot.

You can use this technique for any process you can run through the process scheduler and gives you access to this page first.

Now if you go to the process monitor you'll see your SYSAUDIT process running as per normal, but it now includes a green recurrence icon after the process name that looks like this:

Note that you will probably end up with two items in the process monitor. The first item is your request running today and the second will be the queued request for tomorrow (or sometime in the future depending on your recurrence). You can see this in the screenshot above. Process instance 2173557 was initiated on 05/01/2009 and has run to success and posted. Process instance 2173558 will run on 06/01/2009 at 12:02:00 AM and is currently set to queued.

You can also click on the green recurrence icon to manage the process further. This gives you:

·       The ability to hold (suspend) the recurrence. This will change the run status to Hold. The ability to stop the request recurring

·       The ability resume the recurrence if it has been stopped or set to hold.

·       A request list with a history of the process requests that have already run through this recurrence and if/when the process will recur next

Using this method works well for simple recurrences for a single process or jobs. If you want more advanced options such running a job with difference run controls for each process then you'll need to use a schedule job set definition.

Schedule Job set Definitions

A schedule job set definition needs to run on a job. So the first step might be to create a job with one or more processes in it. For this example, I’m using the delivered All Process Types ALLTYPES Sob. This runs a COBOL, a Crystal Report and a SQR report and is available through system process requests.

Once you have a job, navigate to the Schedule JobSet Definitions page (PeopleTools > Process Scheduler > Schedule Jobset Definitions) and select Add a New Value. For this example:

·       The schedule name will be All Types Example

·       The job name is ALLTYPES (and needs to exist first)

By default a new jobset definition has a status of inactive. You'll want to leave it inactive until you know it is working correctly - especially for more volatile processes. You'll need to also specify a run control ID. Note that this is user specific - the user that creates the schedule jobset is the one that the processes will be running under. For this reason, a lot of organizations create their own batch scheduling user (e.g. PSBATCH) for the specific purpose of running batch processes and jobs. All run controls, and schedule job set definitions are then configured using that user. In this example, I'm just using the default run control ID which is my operator ID as this will always exist.

The next step is to set a begin date and time. This will be the date and time from which the job set will begin. You'll also need select your recurrence (daily for this example). You can also specify a process scheduler server if specifically required. However, it might be better to let People Tools decide what server to use. In this example, the ALLTYPES job includes a crystal report that will need to run on an NT server, however, the other processes should run on a Unix server.

Next, you'll need to specify schedule job set items. This is effectively where you choose the run controls to be used by your job/processes. Use the left hand side tree view to expand your job (click on the icons) and then for each of the three processes, specify a run control ID (I’m using my operator ID). Note that these run control IDs need to already exist and be configured before you set them up in the job set items.

Also, for the ALLTYPES job, the crystal process (XRFAPFL) needs to have its server settings changed so that the server option is Specific Server and the server name is PSNT. This is because crystal reports can only run on Windows process schedulers servers.

The final tab, schedule job set requests, is for informational purposes. It tells which requests have already been processed and when the next one is queued to run.

Before you set the job set definition status to active, use the Run Now button to run the job set definition once to check it runs to success. Also note that when you save the schedule job set definition, it may clear the recurrence name - this appears to be a bug?

Go to the process monitor and you should see the ALLTYPES job running, and hopefully it runs to success for you. Also, you should see the job set definition calendar icon. Clicking on this icon tells gives you all the schedule job set requests.

Note that your job set definition may change status to completed. This indicates that the job set has finished running and there are no more recurrences for it to process. The job set will not run again with a status of completed. Change this back to active and ensure that your recurrence settings are correct.

Recurrences

In both examples, I've been using the Daily recurrence, which I believe is delivered with People Tools. However you might want to create your own recurrence with a different recurrence pattern, and request settings.

To do this, navigate to People Tools > Process Scheduler > Recurrences, add a new value and give it an informative name.

You'll need to choose between the options, schedule next recurrence when current request is initiated OR prior recurrence has completed. This essentially specifies whether to schedule the future recurrence before or after the current recurrence process request has completed. You can choose a regular recurrence pattern, or use the customize dates option to specify one or more values in the run on specific dates grid. For example if you have a process that runs on two specific dates in a given calendar year, you can set them up this way.

The start and end request options are straightforward. The repeat is used to repeat a process within the recurrence pattern. For example if you might want your process to run every day, however, on each day you may also want it to run every 6 hours for the 24 hours of the day. That is, run 4 times each day (24 hours in day / repeat every 6 hours = 4 repeats).

The do not schedule processes missed from the recurrence pattern prevents the process scheduler from playing catch up if the start request date/time is before the current date/time. If you want processes to play catch up, then leave this unchecked, otherwise, set it to checked.

Friday, September 18, 2009

Process Schedule WalkThrough

PeopleSoft Process Scheduler (PSPRCSRV) is a centralized tool that enables application developers, system administrators, and application users to manage PeopleSoft batch processes. Using PeopleSoft Pure Internet Architecture, you can access a list of processes through a web browser and queue and run a process request. Process requests using PeopleSoft Pure Internet Architecture have the added functionality of new distribution options that enable you to distribute output through the web in different formats (HTML, PDF, Excel, and so on) to other users based on their user or role ID

The primary role of Process Scheduler is to support the PeopleSoft application environment. With a PeopleSoft application, you might want to perform certain processes (such as running programs, batch programs, reports, and so on) in the background of the online system. Running reports, posting journal entries, loading benefit enrollment forms, and calculating payroll deductions are all examples of processes that you might want to perform independently of the PeopleSoft application.

Using PeopleSoft Process Scheduler can streamline your business practices by enabling you to take advantage of the distributed computing environment at your site, whereby you can schedule performance-sensitive jobs to run on a powerful server while the online system is still available to end users.

PeopleSoft Application Server

The application server runs the appropriate SQL against the database to add a row to the Process Request table (PSPRCSRQST) for the submitted process request. Process Monitor also uses SQL to fetch the process status from the Process Request table.

PeopleSoft Process Scheduler Server Agent

The PeopleSoft Process Scheduler Server Agent is the component that resides on a server and runs as a process; that is, after it is initiated, it runs continuously in the background and requires no user interaction until it receives a request to shut down. Although the PeopleSoft Process Scheduler Server can run on the application server machine, it can also run on any supported batch server or database server

Database Server

The database server houses the Process Request tables that contain a variety of data that are related to the requests, such as command line parameters, output options, and process status.

For the Distribution Agent to pass authentication, you must ensure that the following rules are enforced:

Distribution Agent (PSDSTSRV)

Report distribution in the PeopleSoft system is closely associated with PeopleSoft Process Scheduler. Process Scheduler uses the PeopleSoft Process Scheduler Server Agent to run the reports and log files that you submit using a process request. When they have finished, the Distribution Agent transfers these reports and log files to the Report Repository where you can view them from a web browser using PeopleSoft Pure Internet Architecture. You can transfer the following files to the Report Repository:

Run Control ID's

To run a report, you must tell the system when and where you want the report to run. For example, you might tell the system to run the report on the database server at midnight or on a Microsoft Windows server every Sunday afternoon, or you might tell it to run the report immediately. For most reports, you must also set parameters that determine the content of the report, such as the business unit or time period on which to report.

A run control is a database record that provides values for these settings. Instead of entering the same values each time you run a report, you create and save a run control with those settings. The next time that you run the report, you select the run control, and the system completes the settings.

You can create run controls that apply to several related reports. For example, suppose that all of the reports that you run at the end of a month require the same parameters: business unit, department, and from and to dates. You can create a single run control that provides values for these parameters and use it for every report.

A run control ID is used as a key (with a user ID) for records that contain the parameters that a process needs at runtime. Storing the parameters in a table that the process can query using the run control ID and user ID enables the process to run without user intervention. Run control IDs are stored in a minimum of two tables: an application run control table and the Tools Run Control table (PSPRCSRQST). You can examine the PS_PRCSRUNCNTL table as a sample application run control table.

The PeopleTools Run Control table stores information that is required by PeopleSoft Process Scheduler, such as output type, format, distribution, file dependency, and destination. The application run control table stores information that is required to run a process, such as the from date, department ID, employee ID, and so on. All application run control tables are keyed by user ID and run control ID.

Process Scheduler configuration file (psprcs.cfg)

When Process Scheduler submits a request, the system creates a new subdirectory to store the log, trace, and reports that were generated by the request. This subdirectory is created in the directory that is specified in the Log/Output Directory parameter in the Process Scheduler configuration file psprcs.cfg. When a high volume of requests is being processed by the Process Scheduler server, limitations imposed by the operating system can prevent additional directories from being generated for the new requests. For instance, certain UNIX flavors only allocate 32K Inodes for a directory.

Process Moniter

After you submit a job using the Process Scheduler Request page, use Process Monitor to review the status of scheduled or running processes. You can view all processes to see the status of any job in the queue and control processes that you initiated. Process Monitor consists of two pages: the Process List page and the Server List page.

Use the Process List page to monitor the process requests that you submit. If a process encounters an error, or if a server is down, you can find out almost immediately. You can also see what processes are queued to run in the future.

Use the Server List page to view information about each of the PeopleSoft Process Scheduler Server Agents that are defined in the system.

Report Manager

Any user who maintains the content of Report Manager must be assigned a Report Manager administrator role in PeopleSoft Security. With this administrator role, the user can:

A super user role is also available that allows you to delete and update all report output in Report Manager. Super users are allowed to delete the report entry and update the distribution list or expiration date of report entries.

The difference between the administrator (ReportDistAdmin) and super user (ReportSuperUser) roles is that the administrator role can access and update any report in the Report Manager. The super user role can update only reports that they are authorized to view.

Report Purge Process

When PeopleSoft Process Scheduler is set to perform a periodic purge on the System Purge tab in the system settings, it triggers the Application Engine program PRCSYSPURGE. This program purges both the Process Request and Report Manager tables. As part of the Report Manager cleanup, it also purges the reports from the Report Repository and archives the data into the Report Archive table.

If multiple Process Schedulers are running against the same database, and each has its own Report Repository, PRCSYSPURGE is initially responsible for the purge process. It will remove all entries from the PS_CDM_LIST table and then purge all reports that match its server name or report node from its report repository. The PRCSYSPURGE program then inserts entries to the PS_CDM_LIST_PURGE table where neither the server name nor the report node name matches. If the PRCSYSPURGE program detects that more than one Process Scheduler is active, it schedules the Application Engine PRCSRVCLN program to run on all the other active Process Scheduler servers. The PRCSRVCLN program checks whether the server uses its own Report Repository and if so, the program deletes reports from the report Repository that is used by the server.

Report Nodes

The report distribution node defines how your reports are moved to the Report Repository, where you can view them from Report Manager. Reports are moved using XCOPY, FTP, or HTTP and HTTPS, depending on the type of server that you are using.

Batch Timings

Batch Timings reports are provided so that you can monitor the performance of your application engine programs. The Process Scheduler - Batch Timings page applies to the Statement Timings data that is stored in the (table) option.

For the Batch Timings feature to record data, you must enable it using the Configuration Manager Trace tab. In the Application Engine group, select the Statement Timings (table) option.

Job and Jobsets

PeopleSoft Process Scheduler enables you to schedule one or more processes as a group. In this context, job describes this type of process group.

A process is a single task, program, or routine, such as a Structured Query Report (SQR) report or COBOL program that runs either on the client or on a server. A job consists of one or more processes of the same or different types that are submitted as a unit and can run either in series or parallel. They require the scheduling support that only a server environment can offer and all processes must be API-aware.

Scheduled JobSets enable you to schedule a recurring job using a schedule JobSet definition. Each process within a job can be altered to set up its own output destination options or set the operating system where the process is to be scheduled.

Using PSADMIN utility

Use the PSADMIN utility to configure and administer the PeopleSoft Process Scheduler Server Agent. PSADMIN is supported on only Windows 2000 and UNIX. However, in some cases, you can run the PSADMIN utility on operating systems that are not supported application servers.

Configuring a PeopleSoft Process Scheduler server is similar to configuring application servers and web servers. From the PeopleSoft Process Scheduler Administration menu, you invoke a text-driven interface that prompts you for parameter values. All of the PeopleSoft Process Scheduler server configuration information for a specific database is contained in the PSPRCS.CFG configuration file, and the PSADMIN provides an interface to edit this file.

PeopleSoft automatically archives the Process Scheduler configuration file whenever it is changed. The older version is archived as PSPRCS_<Time Stamp>.CFG, and the current version becomes psprcs.cfg. The archive directory path is <PS_Home>\Appserv\prcs\<database>\Archive\. (for example, c:\pt844\Appserv\prcs\fin844\Archive\).

Posting non-process scheduler reports to the report repository

The process of posting reports and files to the Report Repository is performed by the Distribution Agent server. When using PeopleSoft Process Scheduler, the transfer is triggered by the Process Scheduler server when it detects that a process request, such as SQR or Crystal, has generated a report and is ready to be posted.

Reports that were generated outside of the PeopleSoft Process Scheduler either by being run manually or by a third-party scheduler, can be posted to the Report Repository using the PostReport PeopleCode class object. The PostReport PeopleCode class updates the Report Manager with the information for the new report, including the list of users and roles authorized to view the report. The request is sent to the Distribution Agent that is identified by the ServerName of the process scheduler server specified in the request.

Using the PostReport PeopleCode class object implies that a PeopleCode function has been written using this class and is invoked either from an Application Engine or an Application Server.

Sending a single request through an Application Engine can incur a large overhead; therefore, PeopleSoft recommend running the program from PSDAEMON using the POSTRPT_DMN Application Engine program.

The POSTRPT_DMN program monitors for any requests to post by searching for new XML files in a designated directory. The XML file contains all the parameters required by the PostReport PeopleCode class object to post the request to the Report Repository. The program reads the parameters using the POST_REPORT_XML file layout


 

Wednesday, September 16, 2009

Running a Process using PeopleCode and displaying the result in a PDF file specifying the URL where it has to be published

Local number &RptId, &count;

Local ProcessRequest &pr;

Local string &crystal_server, &orderno, &oprid, &RPT_NAME, &concatenate;

Component any &ProcInst, &Runstatus, &Runid, &Disstatus;

 

 

If CRSE_SESSN_SRCH.SESSION_STATUS.Value <> "A" Then

  

   Error (MsgGetText(31000, 1, "Report will be generated only for Active Sessions."))

End-If;

 

 

 

 

&RPT_NAME = "REVRPT";

&oprid = %OperatorId;

SQLExec("SELECT SERVERNAME FROM PS_PRCSDEFN WHERE PRCSNAME = :1", &RPT_NAME, &crystal_server);

 

If None(&crystal_server) Then

   SQLExec("SELECT A.SERVERNAME, B.ORDERNO FROM PS_SERVERCLASS A, PSSERVERSTAT B WHERE A.PRCSTYPE = 'Crystal' AND B.SERVERNAME = A.SERVERNAME AND B.SERVERSTATUS = '3' ORDER BY B.ORDERNO", &crystal_server, &orderno);

End-If;

 

&pr = CreateProcessRequest();

 

&pr.ProcessType = "Crystal";

&pr.ProcessName = &RPT_NAME;

&pr.RunControlID = "RUN007";

 

If All(&crystal_server) Then

   &pr.RunLocation = &crystal_server

Else

   &pr.RunLocation = "Server"

End-If;

 

&pr.Schedule();

 

If &pr.Status = 0 Then

   &ProcInst = &pr.ProcessInstance;

  

   Repeat

      SQLExec("SELECT RUNSTATUS,RUNSTATUSDESCR ,DISTSTATUS FROM PS_PMN_PRCSLIST WHERE PRCSNAME=:1 AND PRCSTYPE='Crystal' and OPRID=:2 AND PRCSINSTANCE=:3", &RPT_NAME, &oprid, &ProcInst, &Runid, &Runstatus, &Disstatus);

     

     

      If (&Runid = "3" And

            &Runstatus = "Error") Then

        

         Error MsgGetText(20008, 3, "Report not generated");

         Break;

      End-If;

     

     

   Until (&Runid = "9" And

      &Disstatus = "5" And

      &Runstatus = "Success");

  

End-If;

 

If (&Runstatus = "Success") Then

  

   SQLExec("SELECT CONTENTID FROM PS_CDM_FILELIST_VW WHERE CDM_FILE_TYPE='PDF' AND PRCSINSTANCE=:1", &ProcInst, &RptId);

  

   SQLExec("SELECT URL FROM PS_CDM_LIST_VW WHERE PRCSINSTANCE=:1", &ProcInst, &url);

  

   &concatenate = &url | "/" | &RptId | "/" | &RPT_NAME | "_" | &ProcInst | ".PDF";

  

  

   DIT_REVIEW_WRK.GENERATE_BTN_ESP.Value = &concatenate;

  

   ViewURL(&concatenate, True);

End-If;