This chapter provides an overview of ProcessRequest class and discusses the following topics:
Data type of a ProcessRequest object.
Scope of a ProcessRequest object.
Options for items in jobs and jobsets.
Values for output type and format.
Alternative option to specify email or web attributes.
ProcessRequest class built-in function.
ProcessRequest class methods.
ProcessRequest class properties.
ProcessRequest examples.
The ProcessRequest class provides properties and a method for scheduling a pre-defined process or job. You must define the process or the job (using Process Scheduler Manager) before you can schedule it using the ProcessRequest class.
The properties of this class contain the same values as those required by Process Scheduler Manager for scheduling a process or job. Values you provide for these properties may override the equivalent values set in Process Scheduler Manager, depending on the override settings you make in PeopleSoft Process Scheduler pages.
Starting with PeopleSoft 8.4, PeopleSoft supports only the ProcessRequest class to schedule a process or a job in PeopleCode. The ScheduleProcess PeopleCode function is no longer supported. Any existing PeopleCode functions containing this deprecated function must be modified to use the ProcessRequest class to schedule a request.
This chapter assumes that the reader has working knowledge of PeopleSoft Process Scheduler.
See Also
Enterprise PeopleTools 8.46 PeopleBook: PeopleSoft Process Scheduler
A ProcessRequest object is declared using the ProcessRequest data type. For example:
Local ProcessRequest &RQST;
A ProcessRequest object can be instantiated only from PeopleCode. However, if you need to access the Process Schedule Manager from outside of PeopleCode, for example, in a Visual Basic program, you can use the Process Schedule Manager API.
This object can be used anywhere you have PeopleCode, that is, in message subscription PeopleCode, Component Interface PeopleCode, record field PeopleCode, and so on.
See Also
Enterprise PeopleTools 8.46 PeopleBook: PeopleSoft Process Scheduler
A key feature of PeopleSoft Process Scheduler is the option to create a Job Definition consisting of other jobs. A job containing a job is called a jobset. Process Scheduler Server schedules the items within these jobs according to how the jobset is defined through the Process Scheduler Manager.
The ProcessRequest class requires the following properties to handle jobsets:
JobName: indicates the name of the job that an item belongs to.
PrcsItemLevel: indicates a job item’s process item level within a jobset.
JobSeqNo: indicates a job item’s job sequence number within the Process Item Level.
The following is a simple example of a job containing only a single process:
Process |
PrcsItemLevel |
JobName |
JobSeqNo |
3SQR |
0 |
|
0 |
XRFAPFL |
1 |
3SQR |
1 |
XRFPANEL |
2 |
3SQR |
2 |
XRFPCFL |
3 |
3SQR |
3 |
The following is an example of a jobset containing multiple jobs:
Process |
PrcsItemLevel |
JobName |
JobSeqNo |
MULTIJOB |
0 |
|
0 |
AP_APY2015 |
1 |
MULTIJOB |
1 |
AP_PSTPYMNT |
1 |
MULTIJOB |
2 |
BI JOBS |
1 |
MULTIJOB |
3 |
BIJOB01 |
2 |
BI JOBS |
1 |
BIIVC000 |
3 |
BIJOB01 |
1 |
BIIVCLN |
3 |
BIJOB01 |
2 |
BIIVCPN |
3 |
BIJOB01 |
3 |
BIIVCEN |
3 |
BIJOB01 |
4 |
BIJOB02 |
2 |
MULTIJOB |
2 |
BIIVC000 |
3 |
BIJOB02 |
1 |
BIIVCLC |
3 |
BIJOB02 |
2 |
BIIVCPC |
3 |
BIJOB02 |
3 |
BIIVCEN |
3 |
BIJOB02 |
4 |
BIJOB03 |
2 |
MULTIJOB |
3 |
BIIVC000 |
3 |
BIJOB03 |
1 |
BIIVCLN |
3 |
BIJOB03 |
2 |
BIIVCPN |
3 |
BIJOB03 |
3 |
BIIVCEN |
3 |
BIJOB03 |
4 |
BICURCNV |
3 |
BIJOB03 |
5 |
BILDAR01 |
3 |
BIJOB03 |
6 |
BILDGL01 |
3 |
BIJOB03 |
7 |
BIGNAP01 |
3 |
BIJOB03 |
8 |
All the class methods that are used to change options for items within a job or jobset, use these attributes as optional parameters.
If a method is used without specifying any of these parameters, the system assumes the changes apply to all items within a jobset.
If one or more of these attributes are specified, the method applies the changes to items matching the value of these attributes.
In the case where a JobName is specified, the changes apply to all items within the specified job.
Specific methods used to manipulate options within a job or jobset include:
AddDistributionOption
SetEmailOption
SetItemFolder
SetOutputOption
When manipulating the options within a job or jobset, you must specify the process type and process name in the CreateProcessRequest function when instantiating a ProcessRequest object. This is required as the class needs to retrieve the job item information from the job definition for a specific job or jobset. The class uses this information to alter items within the job or jobset based on subsequent method calls made prior to scheduling the request. If the process type and process name are not specified when instantiating the ProcessRequest object, all PeopleCode programs trying to use any of the methods return an error message:
The method can not be used because the ProcessRequest is not properly initialized
In the previous jobset example, the ProcessRequest must be instantiated as follows:
Local ProcessRequest &RQST; &RQST = CreateProcessRequest("PSJob", "MULTIJOB");
The following code examples use the previous example MULTIJOB, and show how items can be altered within a job or jobset:
Change all items in the Jobset to “Web” with reports generated in PDF format:
&RQST.SetOutputOption("Web", "PDF", "", "MULTIJOB");
Alternatively, this can also be coded as follows:
&RQST.SetOutputOption("Web", "PDF", "");
Change the output option for job BIJOB02 to “Email” with reports generated in HTM format:
&RQST.SetOutputOption("Email", "HTM", ", "BIJOB02");
Change the output option for BIIVCPN in job BIJOB01 to “File” in LP (LinePrinter) format:
&RQST.SetOutputOption("File", "LP", "BIJOB01", 3, 3);
Change all items in level three to “Web” in PS (PostScript) format:
&RQST.SetOutputOption("Web", "PS", "", "", 3);
The values for output type and format are based on the generic process type assigned to a process type definition. The following table provides a cross-reference listing for all delivered process type definitions.
Generic Process Type |
Process Type |
AppEngine |
Application Engine, Optimization Engine |
COBOL |
COBOL SQL |
Crystal |
Crystal, Crystal Check |
Cube |
CubeBuilder, HyperCube Builder |
SQR |
SQR Process, SQR Report |
Winword |
Winword |
nVision |
nVision, nVision-Report, nVision-ReportBook |
Data Mover |
Data Mover |
Other |
Essbase |
The following table lists all the values for OutDestType delivered with PeopleTools.
However, the values and defaults can be customized through Process Scheduler Manager. Please refer to the PeopleSoft Process Scheduler documentation for additional information on how to accurately determine the values for your system.
Generic ProcessType |
Valid OutDestTypes |
Defaults |
AppEngine |
FILE, WEB, WINDOW |
WEB |
COBOL |
NONE, WINDOW, WEB |
NONE |
Crystal |
WEB, WINDOW, EMAIL, FILE, PRINTER |
WEB |
Cube |
NONE |
NONE |
nVision |
WEB, WINDOW, EMAIL, FILE, PRINTER, DEFAULT |
DEFAULT |
SQR |
WEB, WINDOW, EMAIL, FILE, PRINTER |
WEB |
WinWord |
WINDOW, WEB |
WEB |
Data Mover |
WEB,WINDOW, FILE |
WEB |
OTHER |
WEB, WINDOW, EMAIL, FILE, PRINTER, NONE |
NONE |
Similar to the OutDestType, the formats and defaults for a generic process type can be customized through Process Scheduler Manager. The following table lists the values and defaults as delivered.
Generic ProcessType |
OutDestType |
Valid OutDestFormats |
Default |
AppEngine |
WINDOW |
PDF, XLS, TXT, HTM |
TXT |
AppEngine |
FILE |
PDF, XLS, TXT, HTM |
TXT |
AppEngine |
WEB |
PDF, XLS, TXT, HTM |
TXT |
COBOL |
NONE |
NONE |
NONE |
COBOL |
WEB |
TXT |
TXT |
COBOL |
WINDOW |
TXT |
TXT |
Crystal |
PRINTER |
RPT |
RPT |
Crystal |
FILE |
RPT, RTF, TXT, PDF, HTM, XLS, DOC |
|
Crystal |
WINDOW |
RPT, RTF, TXT, PDF, HTM, XLS, DOC |
|
Crystal |
WEB |
RPT, RTF, TXT, PDF, HTM, XLS, DOC |
|
Crystal |
|
RPT, RTF, TXT, PDF, HTM, XLS, DOC |
|
Cube |
NONE |
NONE |
NONE |
Data Mover |
FILE |
TXT |
TXT |
Data Mover |
WINDOW |
TXT |
TXT |
Data Mover |
WEB |
TXT |
TXT |
nVision |
|
HTM, XLS |
XLS |
nVision |
FILE |
HTM, XLS |
XLS |
nVision |
PRINTER |
HTM, XLS |
XLS |
nVision |
WINDOW |
HTM, XLS |
XLS |
nVision |
WEB |
HTM, XLS |
XLS |
nVision |
DEFAULT |
DEFAULT |
DEFAULT |
SQR |
|
CSV, HP, HTM, LP, PDF, PS, SPF,OTHER |
|
SQR |
FILE |
CSV, HP, HTM, LP, PDF, PS, SPF,OTHER |
|
SQR |
PRINTER |
HP, LP, PS, WP |
PS |
SQR |
WEB |
CSV, HP, HTM, LP, PDF, PS, SPF,OTHER |
WEB |
SQR |
WINDOW |
CSV, HP, HTM, LP, PDF, PS, SPF,OTHER |
WEB |
WinWord |
NONE |
NONE |
NONE |
WinWord |
WEB |
DOC |
DOC |
WinWord |
WINDOW |
DOC |
DOC |
OTHER |
NONE |
NONE |
NONE |
To set the Email or Web attributes in PeopleTools versions prior to release 8.4, your PeopleCode program was similar to the following:
To Set Attributes For Web
The following example shows how to set web attributes in PeopleTools version prior to release 8.4.
&RQST.OutDestType = "Web"; &RQST.OutDestFormat = "PDF"; &RQST.OutDest = "User : VP1,Role :Managers";
Set Attributes For Email
The following example shows how to set email attributes in PeopleTools version prior to release 8.4.
Local string &Subject ; Local string &Text; &Subject = "SQR Report: Cross Reference Listing"; &Text = "This text will be displayed as the text of this email "; &RQST.OutDestType = "Email"; &RQST.OutDestFormat = "PDF"; &RQST.OutDest = "User : VP1,Role : MANAGERS"; &RQST.EmailSubject = &Subject; &RQST.EmailText = &Text; &RQST.EmailAttachLog = False;
In PeopleTools 8.4, methods are provided that set the email or web options. The sample code shown previously can be modified as follows:
Set Attribute for Web
Modify the previous example for setting web attributes as follows:
&RQST.SetOutputOption("Web", "PDF", ""); &RQST.AddDistributionOption("User", "QEDMO"); &RQST.AddDistributionOption("Role", "MANAGERS");
Set Attribute for Email
Modify the previous example for setting email attributes as followings:
Local string &Subject ; Local string &Text; &Subject = "SQR Report: Cross Reference Listing"; &Text = "This text will be displayed as the text of this email "; &RQST.SetOutputOption("Email", "PDF", ""); &RQST.SetEmailOption(&Subject, &Text, False); &RQST.AddDistributionOption("User", "QEDMO"); &RQST.AddDistributionOption("Role", "MANAGERS");
You can define a process to be file dependent, which means associating a file with a process that gets scheduled once the system detects the presence of the file.
You can use the PrcsApi class methods for detecting files associated with a process, as well as for displaying additional messages about the process as it's running.
The PrcsApi class is an Application Package class that you must import into your PeopleCode in order to use its methods.
For example, you could use the PrcsApi class with a PeopleSoft Application Engine program. In the Application Engine process PROCESS_EDI, you could create a file dependency (using the FileName ProcessRequest property) and make the process dependent on the file /vendor/edi*.data.
On 10/23, the system detects the file /vendor/edi_1023.data and schedules the process PROCESS_EDI. In the Application Engine program, you can refer to the file that started the process using the getAllFileNames PrcsApi class method.
On 10/24, the system detects the file /vendor/edi_1024.data and schedules the process PROCESS_EDI. The process is started from a different file, and can access that file, so duplicate processing doesn't occur.
See Also
In this section, we discuss the ProcessRequest class methods. The methods are discussed in alphabetical order.
Syntax
AddDistributionOption(DistIdType, DistId [, JobName] [, PrcsItemLevel] [, JobSeqNo])
Description
Use the AddDistributionOption method to set the distribution options for any job item in the main job. Distribution options enable you to distribute output in different formats (HTML, PDF, Excel, and so on) to other users based on their user ID or role ID.
This function is valid only if the output destination for the request is routed either to Web or Email.
Parameters
DistIdType |
Specify the distribution ID type as a string. This identifies if the value passed in the DistID is either a user or role. Values for this parameter are:
|
DistID |
Specify the distribution ID as a string. |
JobName |
Specify the name of the job that this item belongs to as a string. |
PrcsItemLevel |
Specify the job item's process item level within the main job as a number. |
JobSeqNo |
Specify the job item's job sequence number within the Process Item Level as a number. |
Returns
Returns a number: 0 if successful, 1 if system detected an error in the parameter passed.
Example
The following example grants access to the QEDMO user all reports in MULTIJOB from the Web, while users with role of MANAGERS have access to reports created in the BIJOB03 job.
&RQST.SetOutputOption("Web", "PDF", ""); &RQST.AddDistributionOption("User", "QEDMO", "MULTIJOB" ); &RQST.AddDistributionOption("Role", "MANAGERS", "BIJOB03");
See Also
ProcessRequest class: SetEmailOption method, SetOutputOption method.
Syntax
PrintJobHTMLRpt()
Description
Use the PrintJobHTMLRpt method to generate an HTML report file displaying all items in a job or jobset in a tree as defined in the Job Definition component.
Parameters
None.
Returns
An HTML report as a string
Example
The following code:
Local ProcessRequest &JobRQST; Local string &sHTML; &JobRQST = CreateProcessRequest("PSJob", "SQRXRF"); &sHTML = &JobRQST.PrintJobHTMLRpt();
generates the following HTML file:
Example HTML file
See Also
ProcessRequest class: PrintJobRqstRpt method, PrintSchdlHTMLRpt method.
Syntax
PrintJobRqstRpt(ProcessInstance, ItemInstance [, PrintJobTree] [, PrintDistList] [, PrintNotifyList] [, PrintSystemMessage] [, PrintApplicationMessage] [, PrintParamList])
Description
Use the PrintJobRqstRpt method to generate an HTML report file displaying the current status of a specific process, job, or jobset.
Parameters
ProcessInstance |
Specify the ProcessInstance number assigned to the process, job, or jobset |
ItemInstance |
Specify either to display all items in a job or jobset, or just a specific item.
|
PrintJobTree |
Specify whether to have the job tree displayed in the HTML report. This parameter takes a string value:
|
PrintDistList |
Specify whether you want the list of Users and Roles who will be the recipient of a report generated for a job item displayed in the HTML report. This parameter takes a string value:
|
PrintSystemMessage |
Specify whether you want to have the message specified from the Process Definition or Job Definition page displayed in the HTML report. This parameter takes a string value:
|
PrintApplicationMessage |
Specify whether you want the application messages displayed in the HTML report. These are the application messages that can be viewed from the Message Log subpage of the Process Monitor Detail page. This parameter takes a string value:
|
PrintParamList |
Specify whether you want the parameter list for a job item displayed in the HTML report. This parameter takes a string value:
|
Returns
An HTML report as a string.
Example
The following PeopleCode program:
Local ProcessRequest &JobRQST; Local string &sHTML; Local string &sPRINT_JOBTREE; Local string &sPRINT_DISTLIST; Local string &sPRINT_SYSMESSAGE; Local string &sPRINT_APPLMESSAGE; Local string &sPRINT_PARAMLIST; &sPRINT_JOBTREE = "0"; &sPRINT_DISTLIST = "1"; &sPRINT_SYSMESSAGE = "1"; &sPRINT_APPLMESSAGE = "1"; &sPRINT_PARAMLIST = "1"; &JobRQST = CreateProcessRequest(); &sHTML = &JobRQST.PrintJobRqstRpt(PMN_PRCSLIST.PRCSINSTANCE, 0, &sPRINT_JOBTREE, &sPRINT_DISTLIST, &sPRINT_SYSMESSAGE, &sPRINT_APPLMESSAGE, &sPRINT_PARAMLIST);
Creates the following HTML report:
Example HTML report
See Also
ProcessRequest class: PrintJobHTMLRpt method, PrintSchdlHTMLRpt method.
Syntax
PrintSchdlHTMLRpt([PrintJobTree] [, PrintDistList] [, PrintNotifyList] [, PrintMessageList] [, PrintParamList])
Description
Use the PrintSchdlHTMLRpt method to generate an HTML report file displaying all items in a job or jobset as defined in the Scheduled Jobset Definition component.
Parameters
PrintJobTree |
Specify whether to have the job tree displayed in the HTML report. This parameter takes a string value:
|
PrintDistList |
Specify whether you want the list of Users and Roles who will be the recipient of a report generated for a job item displayed in the HTML report. This parameter takes a string value:
|
PrintNotifyList |
Specify whether you want the list of Users and Roles who will be notified for the status of a job item displayed in the HTML report. This parameter takes a string value:
|
PrintMessageList |
Specify whether you want the messages that will be emailed upon completion of a job item displayed in the HTML report. This parameter takes a string value:
|
PrintParamList |
Specify whether you want the parameter list for a job item displayed in the HTML report. This parameter takes a string value:
|
Returns
An HTML report as a string
Example
The following code:
Local string &sHTML; Local string &sPRINT_JOBTREE; Local string &sPRINT_DISTLIST; Local string &sPRINT_NOTIFYLIST; Local string &sPRINT_MESSAGELIST; Local string &sPRINT_PARAMLIST; &sPRINT_JOBTREE = "1"; &sPRINT_DISTLIST = "0"; &sPRINT_NOTIFYLIST = "0"; &sPRINT_MESSAGELIST = "0"; &sPRINT_PARAMLIST = "0"; &JobRQST = SetupScheduleDefnItem("Sample", "MULTIJOB"); &sHTML = &JobRQST.PrintSchdlHTMLRpt(&sPRINT_JOBTREE, &sPRINT_DISTLIST, &sPRINT_NOTIFYLIST, &sPRINT_MESSAGELIST, &sPRINT_PARAMLIST);
Creates the following HTML report:
Example HTML report
See Also
ProcessRequest class: PrintJobHTMLRpt method, PrintJobRqstRpt method.
Syntax
RunJobSetNow()
Description
Use the RunJobSetNow method to schedule a jobset based on settings defined in the Scheduled Jobset Definition component.
Parameters
None.
Returns
None. To verify that the method executed successfully, check the value of the Status property.
Example
/* Create the ProcessRequest Object & Run the Scheduled JobSet Now */ Local ProcessRequest &JobRQST; Local integer &instanceList; &JobRQST = SetupScheduleDefnItem("Sample","MULTIJOB"); &JobRQST.RunJobSetNow(); &instanceList = &JobRQST.ProcessInstance;
See Also
ProcessRequest class: Status property.
Syntax
Schedule()
Description
Use the Schedule method to insert a request in the Process Request table which runs according to the values in the properties of the ProcessRequest object. To successfully schedule a process or job, certain properties are required.
If you’re scheduling a single process, you must assign values to the following properties:
RunControlID
ProcessName
ProcessType
If you're scheduling a job where job item changes are not made, you must assign values to the following properties:
RunControlID
JobName
If you're scheduling a job where job item changes are made, you must assign values to the RunControlID.
Note. You don't have to assign the JobName in this instance because it's set with the CreateProcessRequest function.
Parameters
None.
Returns
None. To verify that the method executed successfully, check the value of the Status property.
Example
&MYRQST.Schedule(); If &MYRQST.Status = 0 then /* Schedule succeeded. */ Else /* Process (job) not scheduled, do error processing */ End-If;
See Also
ProcessRequest class: RunControlID property, JobName property, ProcessName property, ProcessType property, Status property.
Syntax
SetEmailOption(EmailSubject, EmailText, EmailAddress, EmailWebReport, EmailAttachLog [, JobName] [, PrcsItemLevel] [, JobSeqNo])
Description
Use the SetEmailOption method to set the email options for all job items in the main job.
Parameters
EmailSubject |
Specify the text used in the subject of the email sent at completion of this job email subject as a string. You can specify a Null ("") for this parameter. |
EmailText |
Specify the email text sent at completion of this job as a string. You can specify a Null ("") for this parameter. |
EmailAddress |
Specify the email address of the person you want an email sent to at the completion of this job. To send more than one email address, separate the addresses with a semicolon. |
EmailWebReport |
Specify whether to attach the web report to the email sent at the completion of this job. This parameter takes a Boolean value: True, attach the web report, False, don't attach the web report. This parameter can be set only to True when the OutDestType property for the request is "Web". |
EmailAttachLog |
Specify whether to attach the log file to the email sent at the completion of this job. This parameter takes a Boolean value: True, attach the log file, False, don't attach the log file. |
JobName |
Specify the name of the job that this item belongs to as a string. |
PrcsItemLevel |
Specify the job item's process item level within the main job as a number. |
JobSeqNo |
Specify the job item's job sequence number within the Process Item Level as a number. |
Returns
None.
See Also
ProcessRequest class: SetItemFolder method, SetOutputOption method, AddDistributionOption method.
Syntax
SetItemFolder(PortalFolder [, JobName] [, PrcsItemLevel] [, JobSeqNo])
Description
Use the SetItemFolder method to associate a report folder with any job items jobset.
The folder that you specify must have already been created using the System Settings component in Process Scheduler Manager.
Parameters
PortalFolder |
Specify the name of the report folder to use for the job item as a string. The folder that you specify must have already been created using Report Manager. |
JobName |
Specify the name of the job that this item belongs to as a string. |
PrcsItemLevel |
Specify the job item's process item level within the main job as a number. |
JobSeqNo |
Specify the job item's job sequence number within the Process Item Level as a number. |
Returns
None.
Example
&RQST.SetItemFolder("GENERAL", "MULTIJOB", 1, 2);
See Also
ProcessRequest class: AddDistributionOption method.
Syntax
SetOutputOption(OutputType, OutputFormat, OutputDest [, JobName] [, PrcsItemLevel] [, JobSeqNo])
Description
Use the SetOutputOption method to modify the output option of one or more job items in the main job.
Note. This method can also be used for a single process.
The job sequence number and job level are optional. They are required only when the same process name is referenced more than once in a job and the user intends to modify the output option of only one item.
If the ProcessRequest object contains an invalid output type for a process, you won't be able to successfully schedule a process or job.
The values for OutputType, OutDestFormat, and OutputDestination are dependent upon each other as well as on other values.
See Values for Output Type and Format.
Parameters
OutputType |
Specify the output type as a string. |
OutputFormat |
Specify the output format as a string. |
OutputDestination |
Specify the output destination as a string. |
JobName |
Specify the name of the job that this item belongs to as a string. |
PrcsItemLevel |
Specify the job item's process item level within the main job as a number. |
JobSeqNo |
Specify the job item's job sequence number within the Process Item Level as a number. |
Returns
None.
Example
&RQST.SetOutputOption("Email", "HTM", "", "MULTIJOB", 1, 2);
See Also
ProcessRequest class: OutDest property, OutDestFormat property, OutDestType property.
Syntax
UpdateRunStatus()
Description
Use the UpdateRunStatus method to change the RunStatus for a specific process, job, or jobset.
Parameters
None.
Returns
None.
Example
Local ProcessRequest &RQST; &RQST = CreateProcessRequest(); &RQST.ProcessInstance = 5; &RQST.RunStatus = 1; /* Cancel the request */ &RQST.UpdateRunSttus();
See Also
ProcessRequest class: RunStatus property.
In this section, we discuss the ProcessRequest class properties. The properties are discussed in alphabetical order.
Description
This property specifies whether or not a log file is attached to the email sent at completion of this job (or process). This property takes a Boolean value.
This property is read-write.
Example
&RQST.EmailAttachLog = False; /* Do not attach Log File */
Description
This property specifies the text used in the subject of the email sent at completion of this job (or process). This property takes a string value.
This property is read-write.
Example
&RQST.EmailSubject = "SQR Report: Cross Reference Listing";
Description
This property specifies the text of the email sent at the completion of this job (or process). This property takes a string value.
This property is read-write.
Example
&RQST.EmailText = "This text will be displayed as the text of this email ";
You can also use the text from a message in the message catalog for this property.
&RQST.EmailText = MsgGetText(65, 117, "Sample text for email with two parameters", &MessageParm1, &MessageParm2);
Description
This property specifies whether an email is sent to recipients of the report after it is posted to the report repository. The URL for the report is included in the email. This option is applicable only when the OutDesType for the request is Web. This property takes a Boolean value: True, the web report should be attached, False otherwise.
This property is read-write.
Description
This property contains the name of a file to be used with file dependant processing, that is, processes which are initiated only after a file becomes available.
For a file dependent process, the FileName property is set to override the file name specified in the process definition. You must specify the complete file path and extension for the file, as a string.
This property works with the RunLocation property. If you don't specify a run location, any value assigned to this property is ignored.
This property is read-write.
Example
The following code example initiates QE_AETESTPRG once the c:\import\ediData.dat file becomes available on PSNT server.
Local ProcessRequest &rqst1; &rqst1 = CreateProcessRequest(); &rqst1.RunControlId = "2"; &rqst1.ProcessType = "Application Engine"; &rqst1.ProcessName = "QE_AETESTPRG"; &rqst1.RunLocation = "PSNT"; &rqst1.FileName="c:\import\ediData.dat"; &rqst1.Schedule();
See Also
ProcessRequest class: RunLocation property.
Setting Process Definition Options
Description
This property contains the name of a job that you’ve defined in PeopleSoft Process Scheduler.
To schedule a job, you must assign values to JobName and RunControlID for the Schedule method to succeed.
If you’re scheduling a job, you don’t need to set the ProcessType property.
This property is read-write.
Example
&MYRQST.JobName = "3SQR";
See Also
ProcessRequest class: RunControlID property.
Description
This property enables you to specify a language code for the process or job. If you don't specify a language code, PeopleSoft Process Scheduler first looks in the process run control table to retrieve a language code. If there isn't a value there, PeopleSoft Process Scheduler uses the user's language code specified in the User Definition table.
This property takes a string value.
This property is read-write.
Example
&MYRQST.LanguageCd = "ESP" /* Spanish */
Description
Use the NotifyTextMsgNum property to specify the message that should be displayed to the end user in the Event Notification popup display. This property takes a numeric value.
Note. You must specify both the message set and message number for the message to be displayed to the end user.
This property is read-write.
Example
&RQST.NotifyTextMsgSet = 65; &RQST.NotifyTextMsgNum = 237;
See Also
Description
Use this property to specify the message set of the text message to be displayed to the end user in the Event Notification popup display. This property takes a numeric value.
Note. You must specify both the message set and message number for the message to be displayed to the end user.
This property is read-write.
Example
&RQST.NotifyTextMsgSet = 65; &RQST.NotifyTextMsgNum = 237;
See Also
Description
This property specifies the output destination for the process or job to be scheduled as a string.
Values depend on the setting for the OutDestType property:
If OutDestType is FILE, OutDest must be the name of a directory. If the OutDest property isn’t set, it defaults to the setting in the Process profile. If the Process Profile was not updated with a default destination, the Process Scheduler server that picked up the request sets the directory based on the Log/Output Directory setting found in the Process Scheduler Configuration file.
If OutDestType is PRINTER, OutDest must be the name of a printer. If the OutDest property isn’t set, it defaults to the setting in the Process profile. If the Process Profile was not updated with a default printer, the Process Scheduler server that picked up the request sets the printer based on the Default Printer setting found in the Process Scheduler Configuration file.
If OutDestType is WEB or EMAIL, OutDest should contain the list of User IDs, Role IDs, or email addresses (for email only). If you don't set this property, it's automatically assigned to the person who submitted the request.
If OutDestType is WEB, PeopleSoft Process Scheduler uses the OutDest property to determine who has access to the output.
If OutDestType is EMAIL, PeopleSoft Process Scheduler uses the OutDest property to determine who to send the report output to.
In both these cases, to identify whether it’s a User ID or a Role ID, the value has to be preceded by one of the following:
U: Username or User: Username for a UserID
R: Rolename or Role: Rolename for a Role ID
If the ID is not preceded by either of these identifiers, Process Scheduler assumes it's an email address.
Note. Each ID must be separated by a semi-colon (;).
The following are two examples:
&RQST.OutDest = "U:PTDMO;R:Employee;[email protected]" &RQST.OutDest = "User:PS;Role:Employee;[email protected];[email protected]"
For any other value of OutDestType, this property has no effect.
You can specify directory and printer names using the UNC (Uniform Naming Convention) protocol.
This property is read-write.
Example
&MYRQST.OutDest = "C:\TEMP";
See Also
ProcessRequest class: OutDestType property.
Managing PeopleSoft Process Scheduler
Description
This property specifies the output format for the process or job to be scheduled as a string. Values depend on your settings for the ProcessType and OutDestType properties:
The values for OutDestType, OutDestFormat, and OutDest are dependent upon each other as well as on other values.
See Values for Output Type and Format.
This property is read-write.
Example
&MYRQST.OutDestFormat = "RTF";
See Also
ProcessRequest class: ProcessType property, OutDestType property.
Description
This property specifies the type of output for the process or job to be scheduled as a string.
If the ProcessRequest object contains an invalid output type for a process, you won't be able to able to successfully schedule a process or job.
The value specified for this property is used only if the Output Destination Type for the defined process or job defined in PeopleSoft Process Scheduler is specified as Any. Otherwise any value specified for this property is ignored.
The values for OutDestType, OutDestFormat, and OutDest are dependent upon each other as well as on other values.
See Values for Output Type and Format.
This property is read-write.
Example
&MYRQST.OutDestType = "FILE";
See Also
ProcessRequest class: ProcessType property, RunControlID property.
Description
This property specifies the name of the report folder associated with a job item as a string. If you're specifying a folder, the folder that you specify must have already been created using Report Manager.
This property is read-write.
Description
This property is a system-generated identification number. PeopleSoft Process Scheduler assigns a ProcessInstance at runtime to each process or job it successfully schedules.
This property is read-write.
Example
&MYRQST.Schedule(); If &MYRQST.Status = 0 then /* process successfully scheduled */ &ProcInst = &MYRQST.ProcessInstance; Else /* do error processing */ End-If;
Description
This property specifies the name of a predefined process as a string.
To successfully schedule a process, you must assign values to ProcessName, ProcessType, and RunControlID (that is, for the Schedule method to succeed.)
This property is read-write.
Example
&MYRQST.ProcessName = "XRFWIN";
See Also
ProcessRequest class: ProcessType property, RunControlID property.
Description
This property specifies the name of a predefined process type as a string.
To successfully schedule a process, you must assign values to ProcessName, ProcessType, and RunControlID (that is, for the Schedule method to succeed.)
The values for ProcessType depend on the types of processes you have defined in your system. There are generic process types that are delivered with your installation of PeopleSoft. These process types may include the following:
Application Engine
COBOL
Crystal
Cube
nVision
SQR
WinWord
Other
If you define your own processes, you can use the name of that process with the ProcessType property. For example, suppose you create a custom process named "Custom CBL Programs." You could use this as follows:
&MyRqst.ProcessType = "Custom CBL Programs";
Note that spaces are included in the string for ProcessType.
This property is read-write.
Example
Note that spaces are included in the string for ProcessType.
&MYRQST.ProcessType = "Application Engine";
See Also
ProcessRequest class: ProcessName property, RunControlID property.
Description
This property returns a string that serves, along with the UserID, as a key that identifies a predefined group of parameters to be used by a process or a job at runtime.
To successfully schedule a process, you must provide values for RunControlID, ProcessName, and ProcessType.
To successfully schedule a job, you must provide values for RunControlID and JobName.
This property is read-write.
Example
&MYRQST.RunControlID = "MYRUNCONTROLID"; or &MYRQST.RunControlID = PRCSSAMPLEREC.RUN_CNTL_ID;
See Also
ProcessRequest class: JobName property, ProcessName property, ProcessType property.
Description
This property contains a DateTime value that specifies when the scheduled process or job will run.
If you don’t specify a value for this property, and there is no date time set for the pre-defined process or job, the process or job runs as soon as the Schedule method is executed.
This property is read-write.
Example
The following example schedules the process or job to run as soon as the Schedule method is executed:
&MYRQST.RunDateTime = %Datetime;
Description
This property specifies the Process Scheduler Server name the request should be scheduled on. This property takes a string value. Values for RunLocation is a specific server name, such as PSNT.
If no RunLocation is specified, the request is scheduled based on both the default operating system and load balancing options set in the System Settings page.
This property is read-write.
Example
&MYRQST.RunLocation = "SERVER"; or &MYRQST.RunLocation = "PSNT";
See Also
Viewing the Status of Processes.
Description
This property specifies the frequency with which a process or job is to be run as a string. The RunRecurrence value you use must be the name of a Recurrence Definition defined in Process Scheduler Manager to successfully schedule a job or process (that is, for the Schedule method to succeed.)
This property is read-write.
Example
&MYRQST.RunRecurrence = "M-F at 5pm";
Description
This property specifies the run status of a process request as a number. This property is used with the UpdateRunStatus method to change the status of a request. Values are:
RunStatus |
Description |
1 |
Cancel |
2 |
Delete |
3 |
Error |
4 |
Hold |
5 |
Queued |
6 |
Initiated |
7 |
Processing |
8 |
Cancelled |
9 |
Success |
10 |
Not Successful |
11 |
Posted |
12 |
Unable to post |
13 |
Resend |
14 |
Posting |
15 |
Generated |
16 |
Pending |
This property is read-write.
Example
&MYRQST.RunStatus = 1;
See Also
ProcessRequest class: UpdateRunStatus method.
Description
This property returns a number based on the result of the last execution of the Schedule method.
Valid returns are:
Zero if the method succeeded
Non-zero otherwise
This property is read-only.
Example
&MYRQST.Schedule(); If &MYRQST.Status = 0 then /* Schedule succeeded. */ Else /* Process (job) not scheduled, do error processing */ End-If;
Description
This property contains a timezone value that specifies when the scheduled process or job will run. If no value is used for this property, the server timezone is used. This property takes a string value.
This property is read-write.
Example
&MyRqst.TimeZone = "EST";
The following section contains the following examples:
Scheduling a single process
Scheduling a job where job item changes are not made
Scheduling a job where job item changes are made
The following example is when you're scheduling a single process:
Local ProcessRequest &RQST; /* Create the ProcessRequest Object */ &RQST = CreateProcessRequest(); /* Set all the Required Properties */ &RQST.RunControlID = &sRunCntlId; &RQST.ProcessType = &sProcessType; &RQST.ProcessName = &sProcessName; /* Set any Optional Properties for this Process */ &RQST.RunLocation = &sRunLocation; &RQST.RunDateTime = &dttmRunDateTime; &RQST.TimeZone = &sTimeZone; &RQST.PortalFolder = &sPortalFolder; &RQST.RunRecurrence = &sRecurrence; &RQST.OutDestType = &sOutDestType; &RQST.OutDestFormat = &sOutDestFormat; &RQST.OutDest = &sOutputDirectory; &RQST.EmailAttachLog = &bEmailAttachLog; &RQST.EmailWebReport = &bEmailWebReport; &RQST.EmailSubject = &sEmailSubject; &RQST.EmailText = &sEmailText; /* Schedule the Process */ &RQST.Schedule();
The following example is when job item changes aren't made.
Local ProcessRequest &RQST; /* Create the ProcessRequest Object */ &RQST = CreateProcessRequest(); /* Set all the Required Properties */ &RQST.RunControlID = &sRunCntlId; &RQST.JobName = &sJobName; /* Set any Optional Main Job Properties */ &RQST.RunLocation = &sRunLocation; &RQST.RunDateTime = &dttmRunDateTime; &RQST.TimeZone = &sTimeZone; &RQST.PortalFolder = &sPortalFolder; &RQST.RunRecurrence = &sRecurrence; &RQST.OutDestType = &sOutDestType; &RQST.OutDestFormat = &sOutDestFormat; &RQST.OutDest = &sOutputDirectory; &RQST.EmailAttachLog = &bEmailAttachLog; &RQST.EmailWebReport = &bEmailWebReport; &RQST.EmailSubject = &sEmailSubject; &RQST.EmailText = &sEmailText; /* Schedule the Job */ &RQST.Schedule();
The following example is when job item changes are made.
Local ProcessRequest &RQST; /* Create the ProcessRequest Object */ &RQST = CreateProcessRequest("PSJob", &sJobName); /* Set all the Required Properties */ /* Note: the JobName Property has already */ /* been set in the call above, so you don’t */ /* have to set it here */ &RQST.RunControlID = &sRunCntlId; /* Set any Optional Job Item Properties */ &RQST.SetOutputOption(&sOutputType, &sOutputFormat, &sOutputDest, &sJobName, &nPrcsItemLevel, &nJobSeqNo); &RQST.SetEmailOption(&sEmailSubject, &sEmailText, &sEmailAddress, &bEmailWebReport, &bEmailAttachLog, &sJobName, &nPrcsItemLevel, &nJobSeqNo); &RQST.SetItemFolder(&sPortalFolder, &sJobName, &nPrcsItemLevel, &nJobSeqNo); &RQST.AddDistributionOption(&sDistIdType, &sDistId, &sJobName, &nPrcsItemLevel, &nJobSeqNo); /* Set any additional Optional Main Job Properties */ &RQST.RunLocation = &sRunLocation; &RQST.RunDateTime = &dttmRunDateTime; &RQST.TimeZone = &sTimeZone; &RQST.PortalFolder = &sPortalFolder; &RQST.RunRecurrence = &sRecurrence; &RQST.OutDestType = &sOutDestType; &RQST.OutDestFormat = &sOutDestFormat; &RQST.OutDest = &sOutputDirectory; &RQST.EmailAttachLog = &bEmailAttachLog; &RQST.EmailWebReport = &bEmailWebReport; &RQST.EmailSubject = &sEmailSubject; &RQST.EmailText = &sEmailText; /* Schedule the Job */ &RQST.Schedule();
Use the PrcsApi class with file dependant processing. This section includes:
Scope of a PrcsApi object.
Data type of PrcsApi object.
How to import a PrcsApi object
How to create a PrcsApi object
PrcsApi reference
See File Dependant Processing.
A PrcsApi object can be instantiated only from PeopleCode.
A PrcsApi object can be called from a component, an internet script, or an Application Engine program.
PrcsApi class objects can be of Local, Global, or Component scope.
PrcsApi objects are of type PrcsApi.
Local PrcsApi &api = create PrcsApi();
The PrcsApi class is not a built-in class, like Rowset, Field, Record, and so on. It is an Application Class. Before you can use this class in your PeopleCode program, you must import it to your program.
An import statement names either all the classes in a package or one particular application class. For importing the PrcsApi class, PeopleSoft recommends that you import the API class.
The import statement you should use is as follows:
import PT_PRCS:API:*;
Using the asterisks after the package name makes all the application classes directly contained in the named package available.
See Also
After you've imported the PrcsApi class, you instantiate an object of that class using the constructor for the class and the Create function.
The following example creates a new instance of the PrcsApi class, as the variable &api, with local scope:
import PT_PRCS:API:*; Local PrcsApi &api = create PrcsApi();
You must use the constructor for the PrcsApi class to instantiate an instance of that class. The following is the constructor for the PrcsApi class.
Syntax
PrcsApi()
Description
Use the PrcsApi constructor to create an instance of the PrcsApi class.
Parameters
None.
Returns
A reference to a PrcsApi object.
In this section, we discuss the PrcsApi class methods. The methods are discussed in alphabetical order.
Syntax
getAllFileNames(PrcsInstance)
Description
Use the getAllFileNames method to return a list of all the files names detected by the scheduler to intiate this process. The names are returned in an array of string, as full path names.
Parameters
PrcsInstance |
Specify the process instance for which you want to get all the associated file names, as a number. |
Returns
An array of string containing all the files names associated with the specified process.
Example
The following example returns a list of file names.
/* QE_OPT_AET is the state record for the application engine program in this example */ import PT_PRCS:API:*; Local PrcsApi &api = create PrcsApi(); Local File &FileIO, &FileLog; Local array of string &strList = &api.getAllFileNames(QE_OPT_AET.PROCESS_INSTANCE); /* api call needs process instance as parameter */ /* the api returns list of file names matched by the scheduler for this instance */ For &i = 1 To &strList.Len &IOFilename = &strList [&i]; &FileIO = GetFile(&IOFilename, "r", "a", %FilePath_Absolute); &FileIO.Delete(); &FileIO.Close(); End-For;
Syntax
notifyToWindow(PrcsInstance, Message)
Description
Use the notifyToWindow method to display additional messages to the window.
If a process is not defined as going to Window, using this method has no effect. The purpose of this method is to display additional messages to the window when an Application Engine process (no other process type) is run to Window.
Parameters
PrcsInstance |
Specify the process instance for which you want to display messages, as a number. |
Message |
Specify the message you want displayed, as a string. |
Returns
A number: 0 if method failed.
Example
The following PeopleCode would be in a step in an application engine program.
import PT_PRCS:API:*; Local PrcsApi &api = create PrcsApi(); /* QE_AESTATUS_AET is the sate record for this Application Engine program */ &nret = &api.notifyToWindow(QE_AESTATUS_AET.PROCESS_INSTANCE, "Hi There! this is First step."); /* this displays the message on the window */