ProcessRequest Class Examples
The following section contains examples for scheduling processes and jobs using the ProcessRequest class.
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, &sEmailWebReport, &sEmailAttachLog, &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();