Application Engine - Development, Execution & Debugging
Application Engine - Development, Execution & Debugging
Documentation related to Peoplesoft 9.2+ and PeopleTools 8.53+ for training, knowledge sharing and quick reference
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. We will discuss four ways to execute an Application Engine as well. Once
you have the basic idea, you will be able to grasp the detailed topics in an efficient
manner.
The example has been created and tested on the following software environment.
Peoplesoft Application: FSCM 9.2.005
Peoplesoft Peopletools: 8.53.09
Peoplesoft Virtual Machine Image id: FSCMDB-8309-PI005
Database: Oracle 11.2.0.3
In this example, we will copy two GL journals i.e. create copies of two journals with new
journal ids and dates. The major steps involved will be
1) Start the Application Engine Program.
2) Log a message.
3) Check if there is any journal specified in the in the detail run control record.
4) If there is no more journal to be copied, Go to Step # 9.
5) Read the next row from Run Control detail record for Business Unit, Journal Id, Journal
Date to be copied from and the Journal Id, Journal Date to be copied to.
6) Save the above Business Unit, Journal Id, Journal Date fields from the current run
control row to a temp/working table. (This table is going to be STATE record for the
Application Engine).
7) Copy the journal.
8) Go to Step # 3 for next journal to be copied.
9) This marks the completion of the Application Engine Completion.
Let us create a run control record with the following structure. The first 3 fields
OPRID, RUN_CNTL_ID and REQUEST_NBR are keys. Please go ahead and build the record as well.
Let us start building Application Engine program. In Application Designer select File and
New and select Application Engine. The following new Application Engine will be shown.
Under the Step ReadReq1, change the default action from SQL to Do Select and the
description to "Get new Journal to copy". Save the Application Engine.
Right click on the action Do Select and select View SQL option. Paste the following SQL
there.
%SelectInit(OPRID, RUN_CNTL_ID, REQUEST_NBR, BUSINESS_UNIT, JOURNAL_ID, JOURNAL_DATE,
NEW_JOURNAL_ID, NEW_JOURNAL_DATE, PROCESS_FREQUENCY )
SELECT OPRID , RUN_CNTL_ID , REQUEST_NBR , BUSINESS_UNIT , JOURNAL_ID ,
%DateOut(JOURNAL_DATE) , NEW_JOURNAL_ID , %DateOut(NEW_JOURNAL_DATE) , PROCESS_STATUS
FROM PS_AJ_JRNL_COPY_RC
WHERE OPRID = %Bind(OPRID) AND RUN_CNTL_ID = %Bind(RUN_CNTL_ID)
AND PROCESS_STATUS IN ( 'N' )
ORDER BY REQUEST_NBR
The %SelectInit is a special function for Application Engine. It will update (or insert if
not exists) the STATE record with the values selected from the run control. The STATE
record is used as working storage to save the values to be passed between various
steps/actions of the Application Engine.
Right Click on MAIN section and select Insert Section. A new section is created under MAIN
section. Change section name to COPYJRNL and its description to Copy Journal.
On the Do Select action in step ReadReq1 of MAIN section, Right click and select Insert
Action option.
Under the Step ReadReq1, for the new action just inserted, change the default action from
SQL to Call Section and the description to "Copy Journal". In the drop down for Section
name, select COPYJRNL.
So far the Application Engine program looks like the following.
Go to the section COPYJRNL. Right click and select Insert Step/Action.
Repeat the above 3 times.
In the section COPYJRNL, update the step names and descriptions as follows.
001 - step name = CPJRNLHD, Description = Copy Journal Header
002 - step name = UPDJRNLH, Description = Update Journal Header
003 - step name = CPJRNLLN, Description = Copy Journal Lines
004 - step name = UPDJRNLL, Description = Update Journal Lines
Go to the section COPYJRNL,
step CPJRNLHD, Right click and select Insert Action.
step UPDJRNLH, Right click and select Insert Action.
step CPJRNLLN, Right click and select Insert Action.
step UPDJRNLL, Right click and select Insert Action.
Now the section COPYJRNL should look the following.
Right click on SQL action of the step CPJRNLHD and select View SQL to open the SQL editor
for the action. Paste the following SQL there.
%InsertSelect(JRNL_HEADER, JRNL_HEADER, JOURNAL_ID = %Bind(NEW_JOURNAL_ID), JOURNAL_DATE =
%Bind(NEW_JOURNAL_DATE))
FROM %Table(JRNL_HEADER)
WHERE business_unit = %Bind(BUSINESS_UNIT) and journal_id = %Bind(JOURNAL_ID) and
journal_DATE = %Bind(JOURNAL_DATE);
This will insert the header using all fields from the journal_id specified but the three
fields business_unit, journal_id and journal_DATE will be picked up from the bind
variables we populated earlier.
Right click on SQL action of the step UPDJRNLH and select View SQL to open the SQL editor
for the action. Paste the following SQL there.
UPDATE ps_jrnl_header
SET UNPOST_SEQ = 0, JRNL_HDR_STATUS = 'N', JRNL_CREATE_DTTM = SYSDATE,
(FISCAL_YEAR,ACCOUNTING_PERIOD) = (
SELECT FISCAL_YEAR,ACCOUNTING_PERIOD
FROM ps_cal_detp_tbl
WHERE setid = 'SHARE' AND calendar_id = '01'
AND %Bind(NEW_JOURNAL_DATE) BETWEEN begin_dt AND end_dt)
WHERE business_unit = %Bind(BUSINESS_UNIT)
AND journal_id = %Bind(NEW_JOURNAL_ID)
AND journal_DATE = %Bind(NEW_JOURNAL_DATE);
Selection from PS_CAL_DETP_TBL is made to update the appropriate Fiscal_Year and
Accounting_Period for the Journal_date.
Right click on SQL action of the step CPJRNLLN and select View SQL to open the SQL editor
for the action. Paste the following SQL there.
%InsertSelect(JRNL_LN, JRNL_LN, JOURNAL_ID = %Bind(NEW_JOURNAL_ID), JOURNAL_DATE =
%Bind(NEW_JOURNAL_DATE))
FROM %Table(JRNL_LN)
WHERE business_unit = %Bind(BUSINESS_UNIT)
AND journal_id = %Bind(JOURNAL_ID)
AND journal_DATE = %Bind(JOURNAL_DATE);
Right click on SQL action of the step UPDJRNLL and select View SQL to open the SQL editor
for the action. Paste the following SQL there.
UPDATE ps_jrnl_ln
SET UNPOST_SEQ = 0
WHERE business_unit = %Bind(BUSINESS_UNIT)
AND journal_id = %Bind(NEW_JOURNAL_ID)
AND journal_DATE = %Bind(NEW_JOURNAL_DATE);
As of now, the Application Engine is complete and ready. If you are up to this stage,
you know the basic Application Engine development. Let us discuss Application
Engine execution. There are four ways to execute an Application Engine.
1) Executing through Process Scheduler.
2) Executing from Application Designer.
3) Executing from Command Prompt.
4) Calling from Peoplecode.
Let us discuss the Application Engine Execution in each of the four ways.
When the process completes successfully, let us run following SQL to see if journals are
copied.
select * from ps_jrnl_header where business_unit = 'FED01'
and journal_id in ('GTAS000018','GTAS000019','TSTS000018','TSTS000019');
Let us verify that the new journals are viewable online. Navigate as shown below. Enter
Business unit as FED01 and Journal Id begins with TST. Blank out all other criteria.
Select the journal id TST000018. The Journal opens up.
If you want to rerun the Application Engine, please make sure to either update the
journal_id and journal_date combination in the run control or delete the newly created
journal using the following SQLs.
delete from ps_jrnl_header where business_unit = 'FED01'
and journal_id in ('TSTS000018','TSTS000019');
delete from ps_jrnl_ln where business_unit = 'FED01'
and journal_id in ('TSTS000018','TSTS000019');
Executing from Application Designer
Let us delete the journals that we had just created using our Application Engine running
in Process Scheduler. Open the Application Engine in Application Designer. Click on Edit.
Select Run Program. Specify the Run Control Name as shown.
The Application Engine will run on the client, a window will appear showing Application
Engine execution.
The window will close automatically when Application Engine completes.
If you try to open the Journal online, you will see the journals are copied.
If you try to open the Journal online, you will see the journals are copied.
CallAppEngine(AJ_COPY_JRNL , GL_JRCPSJE_AET);
That is it in this article. Now it is a good time to read about advanced topics in
Application Engine like Application Engine types, Multiple State records, Temporary table
instances, COMMIT handling, etc.
There is delivered Application Engine GL_JRNL_COPY. You may compare that one with the one
simple one you just developed and start enhancing yours by incorporating more complex
things like ADB_DATE, LEDGER_GROUP, LEDGER, REVERSAL, Document Sequencing, etc.
The example has been created and tested on the following software environment.
Peoplesoft Application: FSCM 9.2.005
Peoplesoft Peopletools: 8.53.09
Peoplesoft Virtual Machine Image id: FSCMDB-8309-PI005
Database: Oracle 11.2.0.3
In this example, we will use the Application Engine AJ_AE_SAMPLE that we developed in
Part-I. There are two iterations as there are 2 journals to be copied. The major steps
involved will be
1) Make configuration setup for Application Engine Debugging.
2) Start Application Engine in Debug mode.
3) STEP INTO until we reach a specified action.
4) View the value in a column of STATE record at that stage.
5) Modify the value of a column in the STATE record.
6) If it is not the last iteration of the loop, go to step 3.
7) STEP OVER until Application Engine completes.
In the Application Engine group, enable debug by selecting the Debug check box.
This is the method that applies to all methods of invocation.
Another method is to specify DEBUG Y option if you are executing the Application Engine
in Command Line.
If you already have the Debug check box selected in PeopleSoft Configuration Manager, then
you do
not need to include the DEBUG parameter in your command line. But if you do, that command
line option takes precedence over Configuration Manager settings.
Type I and press Enter to Step Into. Continue typing I and pressing Enter until you see
the step AJ_COPY_JRNL.COPYJRNL.CPJRNLHD to Step Into.
Type L to observe the value of a column in the state record associated with the
Application Engine program. By default, the default state record GL_JRCPSJE_AET appears
with the brackets. Press Enter to select the default state record. Type NEW_JOURNAL_ID for
the FIELD_NAME prompt and press Enter. The current content of NEW_JOURNAL_ID is shown
which is TSTS000018.
We want to change the new journal Id from TSTS000018 to DBGS000018. So type M at the
prompt. It will display the current value and prompt you to specify the new value.
Type I and press Enter to Step Into. Continue typing I and pressing Enter until you see
the step AJ_COPY_JRNL.COPYJRNL.CPJRNLHD again to Step Into.
We want to change the new journal Id from TSTS000019 to DBGS000019. So type M at the
prompt. It will display the current value and prompt you to specify the new value.
Type S and press Enter to Step Over. Continue typing S and pressing Enter until the
Application Engine completes to success.
When the application Engine is done, we expect to have two journals created as copies of
GTAS000018 and GTAS000019. Let us execute the following SQLs to see that the two new
journals 'DBGS000018' and 'DBGS000019' are created and that looks like copies of
GTAS000018 and GTAS000019.
select * from ps_jrnl_header where business_unit = 'FED01'
and journal_id in ('GTAS000018','GTAS000019','DBGS000018','DBGS000019');
select * from ps_jrnl_ln where business_unit = 'FED01'
and journal_id in ('GTAS000018','GTAS000019''DBGS000018','DBGS000019');
So we just debugged an Application Engine. Now you should be ready to try more options in
the debug mode like
Q=Quit
C=Commit
B=Break
W=Watch
O=Step-Out
G=Go
R=Run-to-next-Commit
Exit=Exit
Debug Commands:
(Q)uit Rollback work and end program
E(X)it Commit work and end program (valid between steps)
(C)ommit Commit work (valid between steps)
(B)reak Set or remove a break point
(L)ook Examine state record fields
(M)odify Change a state record field
(W)atch Set or remove a watch field
(S)tep over Execute current step or action and stop
Step (I)nto Go inside current step or called section and stop
Step (O)ut of Execute rest of step or called section and stop
(G)o Resume execution
(R)un to commit Resume execution and stop after next commit
If your Application Engine had Peoplecode as well, you might want to enable the PeopleCode
debugger for Application Engine. To enable the PeopleCode debugger
select Debug, Peoplecode Debugger Mode
select Debug, Break at Start
The Application Engine program will break before executing any Peoplecode programs which
are part of the Application Engine.
This part of the Application Engine article is in continuation for Part-I in the series of
Application Engine articles posted on my blog.
The example has been created and tested on the following software environment.
Peoplesoft Application: FSCM 9.2.005
Peoplesoft Peopletools: 8.53.09
Peoplesoft Virtual Machine Image id: FSCMDB-8309-PI005
Database: Oracle 11.2.0.3
In this example, we will use the Application Engine AJ_AE_SAMPLE that we developed in
Part-I. The major steps involved will be
1) Make configuration setup for Application Engine Tracing.
2) Start Application Engine on Windows workstation.
3) Open trace file in text editor.
4) Open trace file using TraceMagic utility.
To run an Application Engine program with Tracing ON, Start PeopleSoft Configuration
Manager, Select Trace tab.
Please check the boxes and specify the trace file. I have specified trace file as
c:\temp\TRACE.TRC as shown below.
Open the Application Engine program AJ_COPY_JRNL in Application Designer (AJ_COPY_JRNL was
developed in Part 1).
Click Edit, Run Request to execute the Application Engine program. Please specify run
control as TEST1 and leave the two check boxes unchecked.
TraceMagic utility
There is one utility called TraceMagic which can read the above trace file and present
those trace results in much efficient form. This TraceMagic utility is available from
Oracle support site. Please logon on to Oracle Support site and search for Doc ID
1470578.1 for the latest version and documentation on TraceMagic.
Download the TraceMagic zip file and install on your Windows workstation. Please note that
it requires Microsoft .Net Framework 4 or later.
Start TraceMagic program. Open the trace file c:\temp\TRACE.TRC we just created. Once the
files is read by TraceMagic, the trace results will be presented in three main tabs (1)
Statistics (2) Execution Path (3) SQL Statements. The three main tabs have further sub-
tabs. The following screen shots show the various tabs and sub-tabs showing the trace
results for the Application Engine we executed.
If you are comfortable at this stage with Application Engine tracing, it is time now to
trace when Application Engine runs at Command Line or through Process Scheduler.
When you want to trace Application Engine while executing at Command Line, you need to
specify -TRACE nnnnn option. That nnnnn is determined using the summation of the values
related to what you want to trace, from the following table.
Value Description
0 Disables tracing.
1 Initiates the Application Engine step trace.
2 Initiates the Application Engine SQL trace.
4 Initiates the trace for dedicated temporary table allocation to an Application Engine trace (AET) file. You
can trace how the system allocates, locks, and releases temporary tables during program runs.
128 Initiates the statement timings trace to a file, which is similar to the COBOL timings trace to a file.
256 Initiates the PeopleCode detail to the file for the timings trace.
1024 Initiates the statement timings trace and stores the results in the following tables: PS_BAT_TIMINGS_LOG
and PS_BAT_TIMINGS_DTL.
2048 Requests a database optimizer trace file.
4096 Requests a database optimizer to be inserted in the Explain Plan table of the current database.
8192 Sets a trace for PeopleSoft Integration Broker transform programs.
1638 Initiates a SQL timings trace and stores the results in the following tables: PS_AE_TIMINGS_LG and
4 PS_AE_TIMINGS_DT.
In this article we will discuss Temporary tables, their instances, parallel processing,
COMMIT usage and Restarting Application Engine.
This part of the Application Engine article is in continuation for Part-I in the series of
Application Engine articles posted on the blog. We will be using the Application Engine
AJ_AE_SAMPLE, that we developed in Part-I.
We will create four different run controls to cover scenarios of Re-Startable APPLICATION
ENGINE and non-ReStartable Application Engine with and without COMMIT usage. We will use
an invalid Meta-SQL in one of the step after COMMIT to cause abends for all four run
controls. We will then analyze the abends and resolutions.
This article is going to be long as we will be covering multiple inter-connected topics.
So please follow each step closely as any change could cause different results than
discussed.
The examples have been created and tested on the following software environment.
Peoplesoft Application: FSCM 9.2.005
Peoplesoft Peopletools: 8.53.09
Peoplesoft Virtual Machine Image id: FSCMDB-8309-PI005
Database: Oracle 11.2.0.3
We will not build the records as we have not configured the number of instances required
yet.
Change the Application Engine properties for using 2 instances of temporary tables by
Application Engine
Open the Application Engine program AJ_COPY_JRNL in Application Designer (AJ_COPY_JRNL was
developed in Part 1).
Select File, Definition Properties and then select the Temp Tables tab.
Assign two records AJ_JRN_HD_TMP and AJ_JRN_LN_TMP and set the instance count dedicated to
this Application Engine as 2.
The following four SQL are copying the data from base tables to temporary tables. These
are examples of Row-by-Row Processing.
Modify the SQL of Step=CPJRNLHD and Action=SQL To the following.
%InsertSelect(%table(AJ_JRN_HD_TMP), JRNL_HEADER, PROCESS_INSTANCE =
%Bind(PROCESS_INSTANCE), JOURNAL_ID = %Bind(NEW_JOURNAL_ID), JOURNAL_DATE =
%Bind(NEW_JOURNAL_DATE)) FROM PS_JRNL_HEADER WHERE BUSINESS_UNIT = %Bind(BUSINESS_UNIT)
AND JOURNAL_ID = %Bind(JOURNAL_ID) AND JOURNAL_DATE = %Bind(JOURNAL_DATE);
When we try to resolve the above Met-SQL, it fails. Looks like %InsertSelect is not going
well with %table. So we will use the following SQL instead.
Insert Into %Table
(Aj_Jrn_Hd_Tmp)
(Process_Instance, Business_Unit, Journal_Id, Journal_Date, Unpost_Seq,
Business_Unit_Iu, Adjusting_Entry, Fiscal_Year, Accounting_Period,
Adb_Date, Ledger_Group, Ledger, Auto_Gen_Lines, Reversal_Cd,
Reversal_Date, Reversal_Adj_Per, Reversal_Cd_Adb, Reversal_Date_Adb,
Unpost_Jrnl_Date, Jrnl_Total_Lines, Jrnl_Total_Debits, Jrnl_Tot_Credits,
Jrnl_Net_Units, Source, Trans_Ref_Num, Jrnl_Balance_Stat,
Control_Total_Stat, Jrnl_Edit_Err_Stat, Jrnl_Hdr_Status,
Susp_Recon_Status, Jrnl_Process_Reqst, Jrnl_Sumled_Reqst, Sje_Type,
Schedule, Event_Occurrence, Posted_Date, Source_Instance,
Transaction_Date, Last_Ln_Committed, Oprid, Dttm_Stamp_Sec, Descr,
Currency_Cd, Foreign_Currency, Rt_Type, Cur_Effdt, Rate_Div, Rate_Mult,
System_Source, Doc_Type, Doc_Seq_Nbr, Doc_Seq_Date, Doc_Seq_Status,
Acctg_Def_Name, Budget_Hdr_Status, Kk_Amount_Type, Kk_Tran_Over_Flag,
Kk_Tran_Over_Oprid, Kk_Tran_Over_Dttm, Kk_Skip, Journal_Locked,
Proc_Part_Id, Gl_Adjust_Type, Date_Code_Jrnl, Journal_Date_Orig,
Journal_Class, Kk_Tran_Bypas_Flag, Ee_Hdr_Status, Iu_Sys_Tran_Cd,
Iu_Tran_Cd, Jrnl_Create_Dttm, Alc, Fed_Distrib_Status, Descr254,
Attachment_Exist, Sce_Id, Source_Data)
Select %Bind(Process_Instance),
Business_Unit,
%Bind(New_Journal_Id),
%Bind(New_Journal_Date),
Unpost_Seq,
Business_Unit_Iu,
Adjusting_Entry,
Fiscal_Year,
Accounting_Period,
Adb_Date,
Ledger_Group,
Ledger,
Auto_Gen_Lines,
Reversal_Cd,
Reversal_Date,
Reversal_Adj_Per,
Reversal_Cd_Adb,
Reversal_Date_Adb,
Unpost_Jrnl_Date,
Jrnl_Total_Lines,
Jrnl_Total_Debits,
Jrnl_Tot_Credits,
Jrnl_Net_Units,
Source,
Trans_Ref_Num,
Jrnl_Balance_Stat,
Control_Total_Stat,
Jrnl_Edit_Err_Stat,
Jrnl_Hdr_Status,
Susp_Recon_Status,
Jrnl_Process_Reqst,
Jrnl_Sumled_Reqst,
Sje_Type,
Schedule,
Event_Occurrence,
Posted_Date,
Source_Instance,
Transaction_Date,
Last_Ln_Committed,
Oprid,
Dttm_Stamp_Sec,
Descr,
Currency_Cd,
Foreign_Currency,
Rt_Type,
Cur_Effdt,
Rate_Div,
Rate_Mult,
System_Source,
Doc_Type,
Doc_Seq_Nbr,
Doc_Seq_Date,
Doc_Seq_Status,
Acctg_Def_Name,
Budget_Hdr_Status,
Kk_Amount_Type,
Kk_Tran_Over_Flag,
Kk_Tran_Over_Oprid,
Kk_Tran_Over_Dttm,
Kk_Skip,
Journal_Locked,
Proc_Part_Id,
Gl_Adjust_Type,
Date_Code_Jrnl,
Journal_Date_Orig,
Journal_Class,
Kk_Tran_Bypas_Flag,
Ee_Hdr_Status,
Iu_Sys_Tran_Cd,
Iu_Tran_Cd,
Jrnl_Create_Dttm,
Alc,
Fed_Distrib_Status,
Descr254,
Attachment_Exist,
Sce_Id,
Source_Data
From Ps_Jrnl_Header
Where Business_Unit = %Bind(Business_Unit)
And Journal_Id = %Bind(Journal_Id)
And Journal_Date = %Bind(Journal_Date);
Let us add SQLs for copying data from temporary tables to base tables. Since the two steps
CPHD2BSE and CPLN2BSE are executed when the journal copy iterations in step ReadReq1 are
completed, all the selected journals will be copied from temporary tables to base tables
by one SQL. These are examples of Set Processing.
Add following SQL to Step=CPHD2BSE and Action=SQL for copying journal headers from
temporary table to base table.
%InsertSelect(JRNL_HEADER, %table(AJ_JRN_HD_TMP) T)
FROM %Table(AJ_JRN_HD_TMP) T
WHERE T.PROCESS_INSTANCE = %Bind(PROCESS_INSTANCE);
Add following SQL to Step=CPLN2BSE and Action=SQL for copying journal lines from temporary
table to base table.
%InsertSelectWithLongs(JRNL_LN, %table(AJ_JRN_LN_TMP) T)
FROM %Table(AJ_JRN_LN_TMP) T
WHERE T.PROCESS_INSTANCE = %Bind(PROCESS_INSTANCE);
RESTART feature and COMMIT usage in Application EnginesAn Application Engine has built-in
checkpoint and ReStart capabilities. If a program step terminates abnormally or fails, you
can restart the request from the last successful checkpoint. Application Engine programs,
by default, perform a COMMIT only when an entire program successfully completes. We must
set individual COMMITs where appropriate. The COMMIT level that we select affects how
ReStart works in a program. Each time Application Engine issues a COMMIT with ReStart
enabled, it records the current state (check point) of the program. Using the ReStart
feature enables to perform commits more often in a program and it reduces the number of
rows that are locked by the program.
Since we want to use RESTART option, we will change the state record from Derived/Work
record to a regular table. Open the record GL_JRCPSJE_AET in Application Designer and save
as AJ_JRCPSJE_AET. Change the record Type from Derived/Work to SQL Table and build the
table. GO to Application Engine properties and on the State Records tab, add the record
AJ_JRCPSJE_AET, make it default and delete the GL_JRCPSJE_AET record from that list.
Create 4 different run controls to be used for 4 executions of the Application Engine
The run control TEST1 that we used in Part 1 of Application Engine series, will be reused
here. We will copy the Run control TEST1 to TEST2, TEST3 and TEST4 using the following
SQLs.
insert into PS_AJ_JRNL_COPY_RC
(OPRID, RUN_CNTL_ID, REQUEST_NBR, PROCESS_FREQUENCY, BUSINESS_UNIT,
JOURNAL_ID, JOURNAL_DATE, NEW_JOURNAL_ID, NEW_JOURNAL_DATE, PROCESS_STATUS)
select OPRID, 'TEST2', REQUEST_NBR, PROCESS_FREQUENCY, BUSINESS_UNIT,
JOURNAL_ID, JOURNAL_DATE, 'TST2000018', NEW_JOURNAL_DATE, PROCESS_STATUS
from PS_AJ_JRNL_COPY_RC where OPRID = 'VP1' and RUN_CNTL_ID = 'TEST1' and NEW_JOURNAL_ID
= 'TSTS000018';
Since the temporary tables are unlocked and cleared when the Application Engine runs
successfully, we may not be able to view the locking and dedicated temporary tables
assignments with small examples. For this reason we will use our small example and cause
the Application Engine to abend in all four scenarios to demonstrate the dedicated
temporary tables handling and parallel processing.
All the four run controls TEST1, TEST2, TEST3 and TEST4 are setup to copy the journals
from 'GTAS000018' and 'GTAS000019'. But will have left an invalid Meta-SQL to cause abends
for our purpose.
We have enabled trace also.
We will change COMMIT at step level from Default to Later for step GoPrgMsg
We will keep COMMIT settings at step level step ReadReq1 to After Step.
We will change COMMIT at step level from Default to Later for steps CPHD2BSE and CPLN2BSE
as well.
Go to Application Engine properties, Advanced tab and uncheck 'Disable ReStart' checkbox.
Execute the Application Engine using the run control TEST1. The run control page looks
like
Click on AE_AJ_COPY_JRNL_18823.AET link. The Log file opens in a new window. Scroll down
till you see insert into PS_AJ_JRN_HD_TMP4.
Application Engine dedicated instance number 4 to this run. Since we had COMMIT after
inserting into temp tables, and Application Engine abended, we should have data in TMP4
table.
select PROCESS_INSTANCE , JOURNAL_ID from PS_AJ_JRN_HD_TMP4;
Let us review some other Application Engine tables.
select * from PS_AERUNCONTROL where PROCESS_INSTANCE = 18823;
Let us leave this scenario here for now, we will review these soon.
Let us leave this scenario here for now, we will review these soon.
Scenario 3: Execute with run control TEST3 with no COMMIT and ReStart=Enabled
Go to Application Engine properties, Advanced tab and check 'Disable ReStart' checkbox.
Let us go to the section MAIN, step ReadReq1 and change the COMMIT After option from
'After Step' to 'default'.
Execute the Application Engine using the run control TEST3. The run control page looks
like
Select PeopleTools, then select Application Engine, then select Review Temporary Table
Usage, then select Temp Table Settings by Program to access the Temp Table Settings by
Program page.
Let us make the Application Engine ReStartable and place the COMMIT(s) back.
Let us fix the Meta-SQLs which caused the abends.
The following SQL for Step=CPHD2BSE and Action=SQL caused abends.
%InsertSelect(JRNL_HEADER, %table(AJ_JRN_HD_TMP) T)
FROM %Table(AJ_JRN_HD_TMP) T
WHERE T.PROCESS_INSTANCE = %Bind(PROCESS_INSTANCE);
We will replace %table(AJ_JRN_HD_TMP) with AJ_JRN_HD_TMP in the first place only. So the
SQL will look like
%InsertSelect(JRNL_HEADER, AJ_JRN_HD_TMP T)
FROM %Table(AJ_JRN_HD_TMP) T
WHERE T.PROCESS_INSTANCE = %Bind(PROCESS_INSTANCE);
Here the Alias from AJ_JRN_HD_TMP T will help in resolving the SQL correctly.
Similarly the SQL for Step=CPLN2BSE and Action=SQL will be changed from
%InsertSelectWithLongs(JRNL_LN, %table(AJ_JRN_LN_TMP) T)
FROM %Table(AJ_JRN_LN_TMP) T
WHERE T.PROCESS_INSTANCE = %Bind(PROCESS_INSTANCE);
to
%InsertSelectWithLongs(JRNL_LN, AJ_JRN_LN_TMP T)
FROM %Table(AJ_JRN_LN_TMP) T
WHERE T.PROCESS_INSTANCE = %Bind(PROCESS_INSTANCE);
That is it in this article for now. It was a long one. Relax for now and revisit if
needed. After that you may read peoplesoft documentation for deeper understanding of
temporary tables and achieve better performance with Application Engine Parallel
Processing.