Professional Documents
Culture Documents
APPLICATION ENGINE
DESIGNER
Overview
In this chapter you will be introduced to developing Application Engine programs using
the Application Engine Designer. You will be introduced to the basic structure of an
Application Engine program, and examine the structure of the program you executed in
the last chapter. Lastly, you will write a small Application Engine program to become
familiar working with this new tool.
Objectives
By the end of this chapter, you will be able to:
Read an Application Engine program by navigating through its structural parts in the
Application Designer.
2-1
APPLICATION ENGINE
JUNE 2002
File
Open
Definition Type =
Project
PSU_AECLASS
Open
2-2
JUNE 2002
APPLICATION ENGINE
Ability to work on the entire Application Engine program at once. Users of previous
versions will know that this is a change from only being allowed to work on a
Section at a time.
2-3
APPLICATION ENGINE
JUNE 2002
Application Components
Program
An Application Engine program identifies the set of processes to execute a given task. A
program must contain at least one Section. The execution of the program always starts
with the Section defined as MAIN.
Sections
An Application Engine Section is comprised of one or more Steps and is 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 Steps that get executed as part of a program. You can call Sections
(and other programs) from Steps within other Sections.
Steps
A Step is 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, youll
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.
Actions
There are multiple types of Actions that you can specify to include within a Step. Keep
in mind, that it is common to have multiple actions associated within a single step. The
following sections briefly describe each type of action. These actions will be explained
in more detail when we approach more advanced topics related to building Application
Engine programs.
2-4
JUNE 2002
APPLICATION ENGINE
Program Flow
Application
Section
Steps
Actions
Application program
Logical groupings of
actions
Line of Code
Composed of 1 or
more sections
Composed of one or
more steps
Composed of one or
more actions
Can execute:
Do When
Do While
Do Select
PeopleCode
Effective Date
Call Section
Effective Status
SQL
Platform generic
or specific
Log Message
Do Until
XSLT
By double clicking on the gray area of the SQL action, the SQL editor will be displayed
containing the SQL statement to be executed.
2-5
APPLICATION ENGINE
JUNE 2002
If there are no errors the program proceeds to Step02. Step02 is used to log a message.
Throughout your Application Engine programs, you may want to display messages. The
message catalog is where you will store your messages. For the Application Engine
course, you will store your messages in Message Set 30000.
Navigation
PeopleTools
Utilities
Administration
Message Catalog
2-6
JUNE 2002
APPLICATION ENGINE
Before we start building Application Engine programs and related definitions, we want to
make sure that our new definitions are automatically added to the PSU_AECLASS
project.
Navigation
Tools
Options
Change the Insert Definition into Project group box to use When definition is
modified and saved.
You create an Application Engine program using File, New, App Engine Program.
Initially you get the MAIN section and Step01 (with no Actions yet).
2-7
APPLICATION ENGINE
JUNE 2002
R u n Pr o gr a m
Inser t Section
R e fre s h V ie w
Expand all Nodes
You can also add sections, steps and actions using the Insert menu option or by using the
right mouse to invoke the popup menu.
Notice that the Insert is dependent on where the cursor is placed. If you have your cursor
on a section, the Insert Action will be grayed.
2-8
JUNE 2002
APPLICATION ENGINE
As you added sections, and steps, you probably noticed that the names were
automatically generated using the current name and appending the next consecutive
number (i.e. Section1, Section2). When you create your own programs, you will want to
use names for your sections and steps that provide a more descriptive name.
Y o u m u s t s av e y o ur pr o gr a m be f or e y ou c a n c h an g e t h e n am e o f a s e c t io n . T h e on l y
s e c t i o n y o u ca n n ot r e na me i s MAIN .
2-9
APPLICATION ENGINE
JUNE 2002
Sections
For each section, you can set parameters for the section.
Control
Description
Section Name
Be as descriptive as you can, keeping in mind that you only have an 8character limit. Develop a naming convention and be consistent throughout
your projects.
Description
Market
Select the Market for which the Section is intended. If a particular Market is
irrelevant to your batch program, you can leave the Market value as GBL.
Platform
Effective Date
Effective Status
Section Type
Auto Commit
Here you specify the Commit level for the Section. You can opt to have no
Commit or you can have Application Engine Commit after each Step
successfully completes.
Access
This property controls the Call Section Action. You can specify that a Section
can or cant be called from another program.
Comments
To view comments, you can select View, Show all Comments (F2) from the menu or right
mouse on the section and select Show Comment.
2-10
JUNE 2002
APPLICATION ENGINE
Walk Thru
One of the advantages of Application Engine is that you can code a program to execute
differently based on the market code. In this walkthru we will look at how you can insert
sections that are market code specific (the same logic is used for effective-dated or
platform-specific sections).
Copy the section (CTRL C or Edit, Copy). Paste the section (CNTL V or Edit,
Paste).
2-11
APPLICATION ENGINE
JUNE 2002
You now have two Section1s. When you execute the program, you will select the Market
on the run control. Based on the market selected, the program will execute the
appropriate Section1.
2-12
JUNE 2002
APPLICATION ENGINE
Hiding Details
When you view your program, you have a choice of what is displayed.
Section Filter
Typically, youll want the Section Filter settings to only allow unique Sections to appear
in the view at a given time.
2-13
APPLICATION ENGINE
JUNE 2002
When the Section Filter is set, you will only see the sections that will execute when the
Market is set to FRA.
Execution Precedence
A Section is unique based on the program, section names, RDBMS platform, effective
date and market. When you execute an Application Engine program, it executes Sections
based on the following order of precedence:
If a unique Section does not exist, Application Engine just executes the default
Section.
For example, suppose you have two versions of a particular Section: SECT01 for Public
Sector and SECT01 for Global use. If you request to run the Public Sector version of the
program, Application Engine executes the Public Sector version of SECT01. If the
program is running on Oracle, Application Engine then looks for an Oracle version of the
SECT01 for Public Sector.
The default Market value is GBL for Global, which is similar to the Platform value of
default.
2-14
JUNE 2002
APPLICATION ENGINE
Steps
Each section contains one or more steps. The steps are executed in the order that they are
displayed in the application designer. The steps contain the logical groupings of actions
to be performed.
Control
Description
Step Name
Step Description
Commit After
Frequency
On Error
Active
Comment
Actions
Actions are the reason for your program. They contain the code you wish to execute.
The primary type is a SQL statement. But you also have the ability to log messages,
execute PeopleCode, call other Sections and perform transformations. The following
action types are available:
Do When
Do While
Do Select
PeopleCode
SQL
Call Section
Log Message
Do Until
XSLT
2-15
APPLICATION ENGINE
JUNE 2002
Click OK.
2-16
JUNE 2002
APPLICATION ENGINE
You will also notice that there are 8 actions out of the available 9.
Which action is missing? ____________________
When you refresh, the actions will be reordered into the order of execution.
To refresh, either select the Refresh Icon
S Q L a nd C a l l S e c t i on are m u t ua l l y e x c lu s i v e .
2-17
APPLICATION ENGINE
JUNE 2002
Program Properties
When you create a new program, you will want give your program a name. If you
modify existing programs, you will want to document your changes. Descriptions and
documentation are updated via the general tab in program properties.
2-18
JUNE 2002
APPLICATION ENGINE
Item
Description
Disable Restart
Application Library
Batch Only
Select this check box for batch only programs. Batch only programs are
not executed from the CallAppEngine() PeopleCode function. Any
dedicated temporary table used for Batch Only programs do not have
online instances created.
Message Set
Specify the message set value that you want assigned as the default
message set number for this Application Engine program. The system
uses this Message Set value for all Log Message actions where the
message set isnt specified.
Program Type
Select the appropriate program type from the list: Standard, Upgrade
Only, Import Only, Daemon Only or Transform Only. During the course
of this class we will only be dealing with Standard or Daemon Programs.
2-19
APPLICATION ENGINE
JUNE 2002
Price Increase
Activity
You are notified that all stock items will have a price increase of 10 percent. Write an
Application Engine program that will accomplish this task.
In Query Analyzer examine the current values in PS_PSU_STOCK_TBL.
The stock table is PS_PSU_STOCK_TBL. What is the SQL statement to accomplish this
task?
______________________________________________________________________
______________________________________________________________________
2-20
JUNE 2002
APPLICATION ENGINE
Your completed program will look like the screen shot below.
2-21
APPLICATION ENGINE
JUNE 2002
Developers Shortcut (Generic Application Engine Test Type) through the Process
Scheduler.
Command Line
We will look at the first two methods in this chapter; the command line is covered in
depth in Chapter 10 Application Engine Execution.
Execute directly from Application Designer
In the application designer, you can select Edit, Run Program or the Run Program push
Walk Thru
Run minimized
OK
2-22
. This method is fast and simple, but does not allow you to add any run
button
control parameters at execution time. For the program that you just created, there are no
run control parameters.
Run Control ID
Enter the run control ID of the program that you are testing.
If your program requires run control parameters, you will
need to populate the fields on the run control and specify the
run control when executing from Application Designer.
Run Minimized
Process Instance
JUNE 2002
APPLICATION ENGINE
If you had an error in the program, the log will indicate the problem.
2-23
APPLICATION ENGINE
JUNE 2002
Walk Thru
Your system will come delivered with a page called Request AE. This page is designed
for developers to test Application Engine programs. The Request AE page allows you to
enter parameters associated with the Application Engine program. In your production
system, you should not be using this page to execute your AE programs. In Chapter 11
Application Engine Process Definition, you will learn how to create process definitions
and run control pages.
An Application Engine Generic Test Process Type has been created that allows you to
run a program from the Request AE page as long as the run control ID is the same as the
Application Engine program name. We will refer to this as the developer's shortcut.
The process FASTTEST uses the Application Engine Generic Test Process Type.
In Chapter 11 Application Engine Process Definition, you will learn how to set up an
application generic test type, as well as process definitions
Navigation
PeopleTools
Application Engine
Request AE
2-24
JUNE 2002
APPLICATION ENGINE
Use the Add a New Value tab to create a run control for your new program.
Navigation
PeopleTools
Application Engine
Request AE
Program Name:
PSU_STK_INC
Add
Click on the
push button.
2-25
APPLICATION ENGINE
JUNE 2002
Navigation
New Window
PeopleTools
Process Scheduler
Process Monitor
2-26
JUNE 2002
APPLICATION ENGINE
Chapter Review
1. What are the layers into which an Application Engine program is structured?
5. Where does the SQL come from that the Application Engine executes?
2-27
APPLICATION ENGINE
JUNE 2002
2-28
You must determine the data sources and structures for your Application Engine
program.
You must generate the SQL required for your program. You can use the PeopleSoft
Query tool or your relational database SQL tool.
You will use the Application Designer Application Engine designer to build
individual Application Engine programs.
FASTTEST can be used from the Application Engine Request page to test your
Application Engine programs.