Select Page

In this article we will discuss Debugging Application Engine with an example. This part of the Application Engine article is in continuation for Part-I in the series of Application Engine articles posted on my blog.

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.

To run an Application Engine program in debug mode, Start PeopleSoft Configuration Manager, Select Profile, Default, Edit and select the Process Scheduler tab.

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 of you do, that command line option takes precedence over Configuration Manager settings.

To start Application Engine in Debug mode, Open Application Engine AJ_AE_SAMPLE in Application Designer (AJ_COPY_JRNL was developed in Part 1).
Click on Edit, Run Program. Please make sure that both Run Minimized and Output Log to File are unchecked, as shown below.

Click on Ok. The following Window opens.

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 to observer 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.

We will type the new journal Id as DBGS000018 and press Enter.

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.

We will type the new journal Id as DBGS000019 and press Enter.

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

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.

Enjoy Debugging Application Engines.