Application Engines. 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.
PeopleSoft Application Engine comprises two distinct components—a designer where you define your batch program and the runtime environment where you run and monitor your program.
In PeopleSoft Application Engine, a program is a set of SQL statements, PeopleCode, and program control actions that enable looping and conditional logic. A program is defined in PeopleSoft Application Designer and performs a business process. You can use PeopleSoft Application Engine for straight, row-by-row processing, but the most efficient Application Engine programs are written to perform set-based processing.
A state record is a PeopleSoft record that must be created and maintained by the Application Engine developer. This record defines the fields a program uses to pass values from one action to another. Think of the fields of the Application Engine state record as the working storage for your Application Engine. If I have to provide a training on Application Engine to my co-workers who have never developed any Application Engine in Peoplesoft, I would use this blog. Here I am going to describe how to develop a simple Application Engine program covering Sections, Steps, Actions, State records, Meta-SQLs, etc. In their simple forms using a simple example. A Application Engine state record must have a process instance defined as the first field and the only key field, and the state record name must end with AET. If I have to provide a training on Application Engine to my co-workers who have never developed any Application Engine in Peoplesoft, I would use this blog. Here I am going to describe how to develop a simple Application Engine program covering Sections, Steps, Actions, State records, Meta-SQLs, etc. In their simple forms using a simple example.
PeopleSoft Application Engine does not generate SQLor PeopleCode. It executes the SQL and PeopleCode that you include in an Application Engine action as part of your program.
PeopleSoft Application Engine is designed for batch processing where you have data that must be processed without user intervention—for example, calculating salaries in payroll processing (although not printing the checks). Another example might be converting money from one currency to another.
App Engine Program Elements-
A PeopleSoft Application Engine program comprises the set of processes to execute a given task, and is made up of several key elements:
Sections comprise one or more steps and are equivalent to a COBOL paragraph or a Structured Query Report (SQR) procedure. All Application Engine programs must contain at least one section entitled MAIN.
A section is a set of ordered steps that gets executed as part of a program. You can call sections (and other programs) from steps within other sections.
A program must contain at least one section. The execution of the program always starts with the section defined as MAIN.
Steps are the smallest unit of work that can be committed within a program. Although you can use a step to execute a PeopleCode command or log a message, typically you use a step to execute a SQL statement or to call another section. The SQL or PeopleCode that a step executes are the actions within the step.
When a section gets called, its steps execute sequentially. Every program begins by executing the first step of the required section called MAIN and ends after the last step in the last section completes successfully.
There are multiple types of actions that you can specify to include within a step. It is common to have multiple actions associated with a single step.
Do Actions–
Do actions contain a SQL Select statement designed to return results on which subsequent actions depend. For instance, if a Select statement returns no rows, subsequent actions may not need to execute. A Do action is equivalent to a COBOL Perform statementand has similar constructs.
The four types of Do actions are:
SQL–
Most SQL actions contain a single SQL statement. These actions can perform the following types of SQL statements:
The SQL action differs from the Do actions, which also contain SQL, in that the SQL action does not control the flow of the program.
PeopleCode–
You can include PeopleCode in the PeopleCode action. PeopleSoft Application Engine PeopleCode provides an excellent way to build dynamic SQL, perform simple if/else edits, set defaults, and other operations that don’t require a trip to the database. It also enables you to reference and change active Application Engine state records.
Log Message–
You use a Log Message action to write a message to the message log based on a condition in your program. This gives your program multilanguage capability. The system stores the message generically as a message set, message number, and parameter values. When a user views the messages using the Application Engine Message Log page, the system retrieves the appropriate message string from the message catalog based on the user’s language preference.
Call Section–
You can also insert an action that calls another section. The called section can be in the same program as the calling section, or it can be in an external program. This enables you to chunk your program into more maintainable, reusable pieces. If a section already exists in one program, rather than copying it into another program, just call it.
Introducing Application Engine Designer
Using State Records
Testing and Debugging
Using the Do Select Action
Incorporating Conditional Processing
Using PeopleCode with Application Engine
Using Set Processing
Using Temporary Tables
Executing Application Engine Programs
Creating Process Definitions for Application Engine
Measuring Application Engine Performance
Tuning Application Engine Programs