Application Engine Program Elements

An Application Engine program comprises the set of processes to carry out a given task. It is made up of these key elements:

  • Sections

  • Steps

  • Actions

  • State records

Sections include one or more steps and are equivalent to a COBOL paragraph or an SQR procedure. All Application Engine programs must contain at least one section entitled MAIN.

A section is a set of ordered steps that is 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. Running 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 is called, its steps execute sequentially. Every program begins by running the first step of the required section called MAIN and ends after the last step in the last section completes successfully.

You can specify multiple types of actions for inclusion within a step. Multiple actions are commonly 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 aSelect statement returns no rows, then subsequent actions may not need to execute. A Do action is equivalent to a COBOLPerform statement and has similar constructs.

The four types of Do actions are:

  • Do While

  • Do When

  • Do Select

  • Do Until

SQL

Most SQL actions contain a single SQL statement. These actions can perform the following types of SQL statements:

  • Update

  • Delete

  • Insert

  • Select

    A SQL action differs from a Do action, which also contain SQL, in that the SQL action does not control the flow of the program.

PeopleCode

You can include PeopleCode in a PeopleCode action. Application Engine PeopleCode provides an excellent way to build dynamic SQL, perform simple if/else edits, set defaults, and other operations that do not require a trip to the database. It also enables you to reference and change active Application Engine state records.

Most importantly, PeopleCode provides access to the PeopleSoft integration technologies, such as PeopleSoft Integration Broker, Component Interfaces, Business Interlinks, and file processing.

Log Message

You use a Log Message action to write a message to the message log based on a condition in your program. This functionality gives your program multi-language 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 capability enables you to chunk your program into more maintainable, reusable pieces. If a section already exists in one program, then rather than copying it into another program you can just call it.

Note: Application Engine supports up to 99 levels of nested Call Section actions. For example, the first called section can call a second, which can call a third, and so on up to 99 calls.

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 program.

An Application Engine state record can be either a physical record or a work record, and you can associate any number of state records with a program. You must key physical state records by process instance.