Implementing PeopleSoft Application Engine API Calls

This topic discusses what a developer has to do to use Group Build in the application that he or she is building, using PeopleSoft Application Engine. (We refer to this application as the client application.)

To implement PeopleSoft Application Engine API calls:

  1. In PeopleSoft Application Designer, create a Run Control page.

  2. Create a new Run Control record or use an existing one.

    In this record, add:

    • The parameters GB_GROUP_ID, GB_EFFDT, and GB_REFINE_DATE.

    • The field VERSIONGBQDM.

  3. In PeopleSoft Application Engine, create a new program.

    This program must contain:

    • A retrieval of parameters.

      Step01.SQL:
      %Select(AE_GBP002_AET.GB_GROUP_ID, AE_GBP002_AET.GB_EFFDT, AE_GBP002_AET.GB_⇒
      REFINE_DATE)  SELECT GB_GROUP_ID  , GB_EFFDT  , GB_REFINE_DATE  FROM PS_RUN_⇒
      CNTL_HR  WHERE OPRID = %Bind(OPRID)  AND RUN_CNTL_ID = %Bind(RUN_CNTL_ID)
    • A call to Group Build PeopleCode API.

      Step02.PeopleCode:
      Declare Function GB_DECLARE PeopleCode DERIVED_HR_GB.GB_API FieldFormula;
      Declare Function GB_BIND PeopleCode DERIVED_HR_GB.GB_API FieldFormula;
      Declare Function GB_RESET PeopleCode DERIVED_HR_GB.GB_API FieldFormula;
      Declare Function GB_BIND_DATE PeopleCode DERIVED_HR_GB.GB_API FieldFormula;
      Declare Function GB_SET_PANELGROUP PeopleCode DERIVED_HR_GB.GB_API FieldFormula;
      GB_SET_PANELGROUP("APPENGINE");   /* This is due to a tools issue and will⇒
       disappear as soon as the TPRD is closed */
      GB_RESET();
      &RET = GB_DECLARE(AE_GBP002_AET.GB_GROUP_ID, AE_GBP002_AET.GB_EFFDT, "", "");
      &RET = GB_BIND_DATE(AE_GBP002_AET.GB_REFINE_DATE);
      AE_GB_API_AET.REFRESH_SW.Value = "N";   /* You can see that the REFRESH_FLAG is⇒
       set to "N"  Equivalent to GB_EXEC("N"). As we can't call a section with direct⇒
       parameters, we must use the cache record of the AE API to perform this⇒
       operation */
    • A call to Group Build AE API GB_EXEC.

      Step02.Call Section:
      Call the section GB_API.GB_EXEC. You must not call GB_EXEC_LIB.GB_EXEC Directly.⇒
       You will always use the GB_API AppEngine Lib.
    • Version number of the group.

      Step01.SQL:
      UPDATE PS_RUN_CNTL_HR  SET VERSIONGBQDM = %Bind(AE_GB_API_AET.VERSIONGBQDM) ⇒
       WHERE OPRID = %Bind(OPRID)  AND RUN_CNTL_ID = %Bind(RUN_CNTL_ID)

      Note:

      Perform your own Application Engine processing using this group.

  4. Create reports, based on the group that you just created, by setting up a JOB.

    When the system launches the SQR, you get the GB_GROUP_ID VERSIONGBQDM (version of the group) from the Run Control record. This enables you to retrieve the group from the Group Results Table and print or perform processing on it.

Differences Between PeopleCode and Application Engine APIs

Question Answer

What are the differences between a PeopleCode API and a PeopleSoft Application Engine API?

For building a group, there are not many differences between the two APIs.

  • In both APIs, you use the PeopleCode function GB_DECLARE, GB_BIND, or GB_BIND_DATE.

  • In the PeopleCode API, you call GB_EXEC("Y") with a REFRESH_FLAG ("Y" or "N") as parameter, and the function returns the VERSION of the group.

  • In the PeopleSoft Application Engine API, you call a section GB_API.GB_EXEC. The refresh flag is set before this call by updating AE_GB_API_AET.REFRESH_SW, and you retrieve the version of the group in the cache record AE_GB_API_AET.VERSIONGBQDM.

Why can't we use the PeopleCode API directly in a PeopleSoft Application Engine PeopleCode step?

There is a PeopleTools limitation:

The CallAppEngine() function is not intended to be inserted into an Application Engine PeopleCode step. If you need to call an Application Engine program from another Application Engine program, you must use the Call Section Action.