Scheduling Requests from an Application Engine Program

A known limitation exists when you schedule requests from an Application Engine program in which the process that is associated with the request contains in-line bind variables in the parameter list. An in-line bind variable is a field that is characterized in a parameter field like this:

:<Record>.<Field>

For example:

-ORIENTP :PYCYCL_STAT_VW2.PAY_CYCLE :PYCYCL_RPT_VW.BANK_CD

The ProcessRequest PeopleCode class resolves in-line variables in a parameter list by searching the values for these fields in the component buffer of a PeopleSoft Pure Internet Architecture page. However, this becomes a problem when ProcessRequest class is used within an Application Engine program. In an Application Engine program, concept of component buffer doesn’t exist. As a repercussion, the ProcessRequest class cannot resolve any in-line bind variables that are found in a parameter list.

The instructions in this section describe how you can code a component interface in an Application Engine program to schedule a request using the ProcessRequest class.

Creating Definitions to Submit Requests That Contain In-line Bind Variables

To create the Component Interface to submit requests with in-line bind variables, you need to copy or reference the following Process Scheduler definitions:

Definition Name

Type

Description

PROCESSREQUEST

Component Interface

The Component Interface that is used to schedule a request using the ProcessRequest class.

PRCSRQSTBC

Page

The page that is associated with the component interface PROCESSREQUEST, including all the fields that are used for scheduling a request.

PRCSRQSTBC

Component

The component that is associated with the PRCSRQSTBC page.

PRCSMULTI

Component

The component that contains the sample PeopleCode that is used to schedule a request using the PROCESSREQUEST component interface.

The following steps use the definitions that are delivered with PeopleTools. Any definitions requiring modification are copied into a new definition to eliminate any problems with future PeopleTools upgrades.

  1. Create a new page based on the PRCSRQSTBC page.

    1. Copy the page PRCSRQSTBC into a new definition.

      When Application Designer prompts you to copy the associated PeopleCode, reply yes.

    2. Insert a new edit box for the field that is referenced in the Parameter List.

      Select Insert, Edit box. When the cursor icon changes, click the mouse where you want to position the new field in the page. Double-click the new field to open the box to select the field for this new box. Perform this step for each field that is found in the parameter list.

    3. Save the new definition.

  2. Create a new component based on the PRCSRQSTBC component.

    1. Make a copy of the component PRCSRQSTBC.

      When Application Designer prompts you to copy the associated PeopleCode, reply Yes.

    2. Insert the new page that you created from the previous step by selecting Insert, Page Into Component from the menu.

    3. Remove the page PRCSRQSTBC from the component so that the only page that is referenced in this component is the new page.

    4. Save the component.

  3. Create a new Component Interface from the Application Designer by selecting File, New.

    When prompted for the new component, provide the component that was created from the previous step. Save the new component interface.

    Do not close the definition of the new component interface because additional edits will be done in subsequent steps.

  4. Copy the existing PeopleCode that is found in the component interface PROCESSREQUEST.

    1. From the Application Designer, open the definition for the component interface PROCESSREQUEST.

    2. In the METHODS section of the component interface, move your mouse cursor to the Create method and right-click to select the View PeopleCode option.

    3. Highlight the PeopleCode, and then right-click to select the Copy option.

    4. In the new component interface, highlight the method Create and right-click your mouse to select the View PeopleCode.

    5. Paste the PeopleCode by right-clicking your mouse and select the Paste option.

    6. Save the component interface.

      After saving, you should see two additional methods, Schedule() and Update(), inserted in the METHODS section.

  5. In the new component interface, add the new fields that were added in the new page from step 1.

    1. Click the Scroll – Level 0 folder to display all the records.

    2. Expand the record folder for the field that was added in the new page.

      Highlight the field with your mouse and drag the field to the PROPERTIES section of the component interface.

    3. Perform this step for any additional fields that were added to the page.

    4. Save the component interface definition.

  6. Modify the Application Engine program to include the PeopleCode to schedule the request using the new component interface.

    The PeopleCode will be copied from the sample PRCSMULTI component.

    1. Open the Component PRCSMULTI from Application Designer.

    2. View the PeopleCode that is found in RUNCNTLCOMPINTF.FieldChange.

    3. Copy the entire PeopleCode that is found in FieldChange by highlighting the PeopleCode and right-clicking your mouse to select Copy.

    4. Open the Application Engine program where the request will be scheduled.

      In the step where the request will be copied, paste the PeopleCode that was copied from the PRCSMULTI component.

    5. In the pasted PeopleCode, perform the following edits:

      1. Remove the DoSave() function.

      This function is not allowed within an Application Engine program.

      2. In the function GetCompIntfc(), replace the component interface PROCESSREQUEST with the new component interface that was created in step 2.

      3. In all attributes of ProcessRequest class, modify these fields for the process request that you will schedule.

      For additional information pertaining to these attributes, please refer to the discussion of ProcessRequest class found in the PeopleCode manual.

      4. For the new fields that were added to the Properties of the component interface, modify the code to assign values to these fields.

      This is the value that will be assigned to the parameter list.

      5. Save your changes.