Application Engine | Specifying the Section Name dynamically
Peoplesoft App Engine Error
An Application Engine program running on the application server uses a file object to read the file sent from the legacy system and to translate it so that the file can update affected PeopleSoft application. PeopleSoft Application Engine for PeopleTools 8.54 has been updated with new features especially with more options for AE Trace settings. This post will help you understand new AE features with 8.54 and how to use those. Application Engine trace file split You can set the file size of the Application Engine Trace file. PSAEAPPLDEFN: Table that stores Application Engine program definitions. PSAEAPPLSTATE: Stores application engine STATE records and a flag to indicate if the record is the default STATE record. PSAESECTDEFN: Application engine section information and also stores last user id to update a specific section.
<< Previous | Next >>
A. CallSection
An App Engine program is divided into ‘Sections’, which are blocks of statements consisting of any number of ‘Steps’ and ‘Actions’. Unless you’re dealing with a ‘library’ App Engine, the program will contain one section called ‘MAIN’, with any number of remaining sections named by the developer. At any point throughout the App Engine code, you can transfer control from one section to another via the use of the ‘Call Section’ command:
The name of the target section is usually specified in the AE definition. However, in some cases, you may want to use ‘CallSection’ in a more dynamic way. You’d rather not specify the name of the section in advance, but would instead prefer to set the Section name at run-time. Fortunately, this is relatively easy to do.
B. Creating a Dynamic Call
Firstly, insert the field ‘AE_SECTION’ into your AE state record. Then prior to the ‘Call Section’ step, add the following code to a PeopleCode Step, setting the AE_SECTION field to the actual section that needs to be called.
Peoplesoft App Engine Message Log
The ‘Call Section’ command itself should then be defined with no value entered in the section name, but with the ‘Dynamic’ flag ticked. The system will know that dynamic naming is in operation and will check for the AE_SECTION field on the state record. The program will error if the AE_SECTION field does not exist, or it points to an invalid section name.
Dynamic sections could be used, for instance, when the App Engine is intended to run as both a batch process and as an online process. In this case, you may want to call different sections as the data requirements will differ depending on whether a run control record has been created in advance. Refer to Tip 015 for more details of the ‘CallAppEngine’ function.
See Also:
Tip 015: Calling an App Engine from within PeopleCode
Tip 039: Using Population Selection
Tip 039: Using Population Selection
Peoplesoft App Engine Insert
<< Previous | Next >>