Vous êtes sur la page 1sur 17

Application Engine

Exercise #1: The Basics - Increase Amt


In this exercise, you will create an AppEngine program that accesses an employee pay
rate table to increase the hourly pay rate for a specified department.

Table name: PS_GBUT_AETRN1_TBL


Field name: AMT
Web navigation: Tools Training > AE Training > AE Objects > Employees

You will need a project to “contain” the objects created in this exercise. This may be a
new project or you may open an existing project.

To create a new project:


1. Click on File, New… or Click on

Page 1 of 17
2. In the “New” pop-up window, click on Project, then click on OK

Your Application Designer workspace should appear as shown. Note the


messages in Results tab of the Output window indicating that a new project
containing 0 objects has been opened.

3. Save your new project. Click on File, Save Project As…, type a name for your
project (please follow established naming conventions explained in UNTSP
Standards document found in the Shared Documents section of the EIS
Developer Forum website), for this class please use GBUT_TRNTECHxx
(where xx is your computer number) then click OK. You will then see the project
name displayed in the Project workspace as well as on the Title bar for
AppDesigner.

Page 2 of 17
GBUT_TRNTECH00

GBTR_00
GBUT_TRNTECH00

Project Workspace

Alternately, to open a project:


1. Click on File, Open… or click on

2. In the “Open Object” window, either


a. Type the entire name of the project in the “Name” box and click on Open,
or
b. Type a partial name in the “Name” box and press ENTER to get a list to
choose from. Then either double-click the project you want to open or
click on it once to highlight and click on Open.

Page 3 of 17
GBUT_TRNTECH00

GBUT_TRNTECH00

Now that you have a project, you are ready to create an AppEngine program.

To create a new AppEngine program:


1. Click on File, New… or Click on
(see “Create New Project” for where this button appears on the toolbar)

2. Click on “App Engine Program” and then click OK

Page 4 of 17
3. You should now see a “skeleton” AppEngine program containing a “MAIN” section
and one step labeled “Step01” displayed in the Object workspace

Object Workspace

4. Open the AppEngine Program Properties window:


a. Click on or
b. Click on File, Object properties or
c. Press ALT-ENTER on your keyboard

5. Click on the “Advanced” tab and “check” the “Disable Restart” box. It is
important to disable restart of a program while testing to prevent problems with
rerunning the job. Once the program is tested, “Disable Restart” may be
“unchecked” to test restart processing. Click OK to close the Program Properties
window.

Page 5 of 17
6. Save your new AppEngine program. Click on File, Save As… or Click on .
Type a name for your program (please follow established naming conventions
explained in UNTSP Standards document found in the Shared Documents
section of the EIS Developer Forum website), then click on OK (or press
ENTER).

GBUT_00_EX1
Note: You must save your AppEngine
program before the SQL or PeopleCode
Editor windows are accessible.

7. Now you need to add some Actions to your program (so it will actually do
something!). To insert an Action (without inserting another Step along with the
Action), either
a. Right-click on the area to the left of “Step01” and click on “Insert Action”.
or
b. Click once on “Step01” to highlight it and click on

Right-click in this area


and click on Insert Action

The default action (“SQL”) will be inserted directly below “Step01”.

Page 6 of 17
8. Double-click in the area to the left of the SQL Action to open the SQL Editor.

Double-click in this area


to open the SQL Editor

9. Type the following SQL command into the SQL Editor window:

UPDATE PS_GBUT_AETRN1_TBL
SET AMT = AMT + (AMT * 10/100)
WHERE DEPARTMENT = 'TRNTECHxx'

Please substitute your computer number for the xx in “TRNTECHxx”. This


command will increase the hourly pay rate by 10% for all employees in your
department.

10. Click on to check the syntax of the SQL statement. Important note – this will
not validate that your SQL is correct (i.e., correct table name, correct field names,
etc). It will basically reformat your SQL the way it wants it to look. Misspelling
names or misplaced commas or parentheses will cause runtime errors.

11. Close the SQL editor window.

12. This program should also write a message to the Process Scheduler Message Log
to indicate the action completed successfully. Because this message should be
written out only if there were no errors encountered with the SQL executed in
“Step01”, the message should be in a step by itself. To insert a Step and Action in
one motion, either

Page 7 of 17
a. Right-click in the area to the left of “Step01” and click on “Insert
Step/Action” or
b. Click once on “Step01” to highlight it and click on

Your display should now look like this:

Click here for a drop-


down list of Actions

13. Since you don’t need a SQL action in the new “Step02”, change the action
performed to “Log Message” using the Action drop-down list.

14. The Log Message Action uses the PeopleSoft Message Catalog, which is accessed
via the web. Any message used in this Action must already exist. Navigation to
the Message Catalog is PeopleTools > Utilities > Use > Message Catalog.

15. Once you have selected “Log Message” and tabbed off that field, the parameters
available for the Action will change to appear as shown.

Page 8 of 17
16. Click on the box below “Message Set:” and type the Message Set number (see the
UNTSP Standards document found in the Shared Documents section of the EIS
Developer Forum website for the appropriate range of Message Set numbers for
your application). Then click on the box below “Number:” and type the number
for the message contained in the specified message set that you wish to use. For
this exercise, use Message Set 20101 and Message Number 1.

17. Save your program.

Now, you are almost ready to test your AppEngine program! In order to run an
AppEngine program, you must first create a Run Control Page and a Component to
contain the page, add the Component to a Menu, and set Security for the Component.

To create a Run Control Page:

If you do not need to accept input parameters from the user when this AppEngine
program is executed, you can use the generic Run Control Page delivered by PeopleSoft.
You can do that for this exercise because you are not accepting input from the user.
(Note: For an example of creating a Run Control Page that includes parameters, please
see Exercise #2.)

To create a Component for the Run Control Page:


1. Click on File, New… or click on

2. Click on Component, then click on OK

Page 9 of 17
3. On the toolbar, click on Insert, then Page into Component. Click on
“PRCSRUNCNTL” to highlight and click Insert.

4. Before the Component can be saved, a search record must be specified. Click on
to open the Properties window and click on the “Use” tab. Select
“PRCSRUNCNTL” as the search record, and then click on OK.

Page 10 of 17
5. Click on File, Save… or click on .

6. Type a name for the Component (please follow established naming conventions
explained in UNTSP Standards document found in the Shared Documents
section of the EIS Developer Forum website) and click on OK.

GBUT_00_EX1

You next need to add the Component to a Menu…however, since we can’t all update the menu at
once, the instructor will do this for you. Please let the instructor know when you are ready
to have your run control component added to the menu):

The instructor will also perform the necessary steps to add security to the
menu item for you during class.

The last step before you can run the AppEngine program you’ve created is to create a
Process Definition for the PeopleSoft Process Scheduler. This step must be completed
whether you are running the AppEngine program two-tier, three-tier, or n-tier.

To create a Process Definition:


1. On the web, navigate to PeopleTools > Process Scheduler Manager > Use >
Process Definitions
2. Click on the hyperlink “Add a New Value”
3. Click on the lookup icon and then click on Lookup
4. Click on the hyperlink “Application Engine”
5. Type in the Process Name – This must match your AppEngine program
name!

Page 11 of 17
Process name should be GBUT_xx_EX1
(where xx is your computer number).

6. Click on Add
7. Click on the “Process Definition Options” tab
8. In the Component section of the form, click on the Lookup icon and select your
Component (this will be the Component that contains your Run Control Page)
9. In the Process Groups section of the form, click on the Lookup icon and select the
permission list used with this AppEngine program (in this exercise use
ALLPANLS)
10. Click on Save

Believe it or not, you are finally ready to run your AppEngine program!

First, check the hourly pay rate on the employees in your department. This can be
accomplished either by accessing the records through the web navigation listed at the
top of this document.

To execute your AppEngine program via the web:

1. Navigate to the Menu Item you added (Tools Training > AE Training >
TRNTECHxx > Increase Pay Rate 10%” (where xx is your computer number)
menu. The Run Control Search Page will be displayed.

2. If you have an existing Run Control ID you want to use, you can type the name
(or partial name) and click on Find. If you want to add a new one, click on the

Page 12 of 17
hyperlink “Add a New Value” then type a value for the Run Control ID and click
on Add. This can be any value you wish…it does not need to match the
AppEngine program name and can be reused.

3. When the Run Control Page is displayed, click on Run.

Click here to run AE program

Page 13 of 17
4. A page containing a list of all Process Definitions linked to this Component (via
Security) is displayed. Since the Process Definition name must match your
AppEngine program name, this provides the link that PeopleSoft will need to
know which program to run. Click on OK to submit the Process Scheduler
Request.

Note: If this page


comes up and no
processes are
displayed, then you
forgot to create a
Process Definition
for your AppEngine
program.

Click here to complete submittal of request

Page 14 of 17
5. The display will return to the Run Control Page and display your Process
Instance. You can now click on the hyperlink “Process Monitor” to view the
progress of your program execution.

You should be able to locate your program in the list.

Page 15 of 17
The Process Monitor can also be found at PeopleTools > Process Monitor >
Inquire > Process Requests.

6. Click on the hyperlink “Details” next to your process instance. A page showing
information about your program’s execution is displayed.

Page 16 of 17
7. Click on the hyperlink “Message Log”. This will display anything written to the
Message Log (remember the “Log Message” action you added to your program?).
The first message was written by our program. The second message is a default
message that writes out for any AppEngine program to indicate the log file was
written to the report repository.

8. If your program had not completed successfully, the hyperlink “View Log/Trace”
could provide meaningful information for troubleshooting.

9. Lastly, you should verify that your program did what it was supposed to by
checking that your employees got a raise!

Page 17 of 17

Vous aimerez peut-être aussi