Application Engine Basics
Application Engine Basics
Application Engine programs are PeopleSoft's batch processing technology. They are
developed in application designer and consist of blocks of PeopleCode and SQL.
Application engine programs can also use application classes, component interfaces,
XML publisher reports, and call SQRs and COBOLs through PeopleCode.
Program Structure
Program Properties
State Records
Logging to the Message Log
Call Sections
Migrating in a Project
Program Structure
Application engine programs are have very structured hierarchy (loosely based on
COBOL). They consist of a single application (application engine program) that can
consist of one or more sections. Each section can contain one or more steps, and each
step can contain one or more actions. The actions in a step can include:
● SQL actions
● Do actions
● PeopleCode actions
● Call Section actions
● Log Message actions
Program Properties
There are number of properties associated with an application engine program. These
include:
● General PeopleSoft object properties
● State records
● Temporary Tables
● Advanced program properties
There several different types of application engine programs:
● Standard, which is a normal entry-point program.
● Upgrade Only, which is used in PeopleSoft upgrade utilities.
● Import Only, which is used by PeopleSoft import utilities.
● Daemon Only, a type of program used as a daemon process.
● Transform Only, a program type used to support Extensible Stylesheet Language
Transformations (XSLT).
State Records
A state record is a PeopleSoft record object that contains one or more fields used by the
program to pass values between steps and actions. Essentially it is a work record for your
application to store common variables that can then be used throughout the program. A
state record can either be a database table or a PeopleSoft work record. If you make a
state record a database table it must be keyed by process instance. Otherwise the state
record will not work properly.
Because state records contain process instance, you can use the following SQL action to
ge tthe operator ID and run control ID of the person who triggerred the application engine
program.
%Select(OPRID,RUN_CNTL_ID)
SELECT OPRID ,RUN_CNTL_ID
FROM PS_AE_REQUEST
WHERE PROCESS_INSTANCE = %Bind(PROCESS_INSTANCE)
Note %Select and %Bind are special Meta-SQL elements for working with application
engine state records. %Select puts data in the state record and %Bind gets data from the
state record. Think Select-In and Bind-Out.
Call Sections
Call sections can be dynamic. To use a dynamic call section:
1. Add the fields AE_APPLID and AE_SECTION to your state record
2. In a PeopleCode step, set the value of AE_APPLID to the application engine
program name that you are calling. If it is a section in the same application engine
program, you can leave this blank and it will default to the current running
application engine program
3. In a PeopleCode step, set the value of AE_SECTION to the section of the
application engine program you are calling
4. Set the dynamic flag check box on the call section step
For a good delivered example, look at the Data Archive application engine program,
ARCH_PROCESS. The relevant parts are:
● ARCH_PROCESS.MAIN.Step001b
● ARCH_PROCESS.MAIN.Step003b
The data archive process application engine can dynamically call application engine
programs specified by the user in the data archive configuration template.
Migrating in a Project
One of the problems with application engines is getting all the relevant parts of the
application engine into a project.
I've found the following to be the best approach (repeat for each program):
● Develop away until you have the application design in place. Don't worry about
putting it all into a project at this point. The reason is that you will make mistakes
and remove/add/update sections, SQL, PeopleCode etc. Obviously you should
have a project that you are doing all this in, just don't worry about getting
everything related to the application engine(s) into this project at this point.
● When you're satisfied with the final design, do a validate project on your working
project. This will clear out all invalid definitions that may have been placed in the
project over the time you were working out the design. To do this in application
designer, select Tools -> Validate Project.
● In application designer select Insert -> Definitions into Project or press CTRL +
F7. Select the Application Engine Programs definition type, find your application
engine program and select all the related definitions. Press insert. Now check in
the upgrade tab to verify that the program, sections, PeopleCode, SQL, records
and XSLT are all shown in the upgrade tab.
● Make sure that the action flag is set to copy for all relevant definitions and that the
upgrade flags are checked.
● Migrate your app engine to another environment and confirm everything was
copied over and works.
Process Scheduler
This wiki page is dedicated to the PeopleSoft process scheduler - the server process(es)
that are responsible for running and managing batch processes including SQR,
Application Engine, Crystal Reports and Winword.
Processes stuck at Queued
Run status
Suppressing files from the Report Repository
Application Engine programs only stuck at queued
Active Processes
Summary of requested processes by process status
Distribution
Run status
In the PeopleTools 8.4x look at the translates on the field RUNSTATUS or use the query.
select FIELDVALUE, XLATLONGNAME
from PSXLATITEM
where FIELDNAME = 'RUNSTATUS'
Here's a summary of the run status translates (from PeopleTools 8.49). Note that not all
of these are active.
Value Status
1 Cancel
2 Delete
3 Error
4 Hold
5 Queued
6 Initiated
7 Processing
8 Cancelled
9 Success
10 Not Successful
11 Posted
12 Unable to Post
13 resend
14 Posting
15 Content Generated
16 Pending
17 Success with Warning
18 Blocked
19 Restart
The following query will give you a summary of the process run statuses in your process
request table:
select
RUNSTATUS,
(
select XLATSHORTNAME
from PSXLATITEM
where FIELDNAME = 'RUNSTATUS'
and FIELDVALUE = RUNSTATUS
) as RUNSTATUS_DESCR,
count(PRCSINSTANCE)
from
PSPRCSRQST
group by
RUNSTATUS
order by
RUNSTATUS;
Active Processes
Ever wondered where the active processes value on the server list tab comes from? Well
it actually uses a view - PS_PMN_PRCSACTV_VW. This view uses the underlying records
PS_SERVERMONITOR and PS_SERVERCLASS. It is the ITEMCOUNT field from
PS_SERVERMONITOR that gives you the active processes count by process type (SQR,
COBOL, Application engine etc).
Distribution
The following tables store information about the distribution of process scheduler output
to users or roles.
PS_PRCSDEFNCNTDIST
Distribution settings for process definitions.
PS_PRCSJOBCNTDIST
Distribution settings for jobs.
PS_PRCSRQSTDIST
Distribution settings by process instance. Join to PS_CDM_FILE_LIST on the process
instance to get the file names.
PS_PRCSRUNCNTLDIST
Distribution by operator ID and run control.