Top Banner
PeopleSoft Development: Overview of Application Engine and the Query Tool Presented by: Judi Doolittle (Judi Hotsinpller) and Barbara Sandoval
56

Peoplesoft Development Overview Application Engine

Oct 29, 2014

Download

Documents

Dhar Bab
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Peoplesoft Development Overview Application Engine

PeopleSoft Development: Overview of Application Engine and the Query Tool

Presented by: Judi Doolittle (Judi Hotsinpller) and Barbara Sandoval

Page 2: Peoplesoft Development Overview Application Engine

Agenda• Introductions• Logistics• Application Engine (Morning Session)

– History– Program Structure– Properties– Action Types – Break 10 mins– MetaSQL and MetaVariables– Running an AE Program– Printing Options – Break 10 mins– Sample– Review of Take Home Exercise

Page 3: Peoplesoft Development Overview Application Engine

Agenda Continued

• Query Tool

Page 4: Peoplesoft Development Overview Application Engine

Introductions

• Instructor Introductions• Student Introductions

Page 5: Peoplesoft Development Overview Application Engine

Logistics

• Class Format• Restroom Location• Breaks

Page 6: Peoplesoft Development Overview Application Engine

Application Engine History

• Released with Version 8.0• Developed by PeopleSoft Coder

– Prior Tool – COBOL– Used for Batch Processing

• Application Engine Vs. SQR• Future

– Fusion– XML

Page 7: Peoplesoft Development Overview Application Engine

Application Engine Program Structure• Application Designer

Page 8: Peoplesoft Development Overview Application Engine

Application Engine Program Structure• Structure

– Section

– Steps

– Actions

Page 9: Peoplesoft Development Overview Application Engine

Application Engine Properties• General Tab

– Track changes– Document

• State Tab– State Record– Attributes

• Temp Tables Tab– Define– Set– Assign– For Batch Processing– Build/Rebuild– Meta SQL

• Advanced Tab

Page 10: Peoplesoft Development Overview Application Engine

General Tab

Page 11: Peoplesoft Development Overview Application Engine

State Tab

Page 12: Peoplesoft Development Overview Application Engine

Temp Tables Tab

Page 13: Peoplesoft Development Overview Application Engine

Advanced Tab

Page 14: Peoplesoft Development Overview Application Engine

Action Types• Do When• Do While• Do Select• PeopleCode• SQL• Call Section• Log Message• Do Until• XSLT—Only shows if it is specified as a

Transformation Program

Page 15: Peoplesoft Development Overview Application Engine

Do When

• It is comparable to an IF statement in other Languages

• When true returns one or more rows and continue with actions

• When false exits step

Page 16: Peoplesoft Development Overview Application Engine

Sample

Page 17: Peoplesoft Development Overview Application Engine

Do While• Executing step while SQL is true• To prevent an endless loop:

– Requires code in another action– The data must change to make the SQL false

• Example—Process sample to countSELECT ‘X’FROM PS_TEST_RECWHERE count < = %bind(totemp);– Other actions– Action that triggers the falseUPDATE PS_TEST_RECSET count = count + 1;

Page 18: Peoplesoft Development Overview Application Engine

Do While Example

Page 19: Peoplesoft Development Overview Application Engine

Do Select

• Loops through records one at a time• Used to populate State Record• Three Looping Rules

– Select/Fetch (Default)– ReSelect– ReStartable

• Example of Populating State Record%SELECT(year)SELECT yearFROM PS_RUN_CONTROL

Page 20: Peoplesoft Development Overview Application Engine

Do Select Example

Page 21: Peoplesoft Development Overview Application Engine

PeopleCode

• Reasons why PeopleCode Used:– Manipulate and Manipulation– Functions– Application Packages– Component Interface– Reuse Developed Code

• Refer to PeopleBooks for PeopleCode instruction

Page 22: Peoplesoft Development Overview Application Engine

PeopleCode Continued

• Unique to Application Engine– How to use State Record in PeopleCode– Example

PS_TEST_AET.YEAR

– Return Parameters• Exit(1) – causes set parameter to executed (Execution

can be ABORT, BREAK, or SKIP STEP)• Exit(0) –default will continue

Page 23: Peoplesoft Development Overview Application Engine

PeopleCode Continued

Page 24: Peoplesoft Development Overview Application Engine

SQL• SQL actions used for

– INSERT– UPDATE– DELETE

• Can be used with any of the Conditional Actions• Or by themselves• ExampleUPDATE PS_TEST_REC SET bonus = %bind(bonus)WHERE year = %bind(year)

Page 25: Peoplesoft Development Overview Application Engine

SQL Continued

Page 26: Peoplesoft Development Overview Application Engine

Call Section

• Allows you to Call another Section• Reason is for readability

Page 27: Peoplesoft Development Overview Application Engine

Call Section Continued• Example 1

Page 28: Peoplesoft Development Overview Application Engine

Call Section Continued• Example 2

Page 29: Peoplesoft Development Overview Application Engine

Call Section Continued• Example 2 Continued

Page 30: Peoplesoft Development Overview Application Engine

Log Message

• Writes Messages to the Log File• Messages stored in Message Catalog• Parameters can be provided as part of the

Message• To create a custom message use Message

Set > 20000

Page 31: Peoplesoft Development Overview Application Engine

Do Until

• Another Conditional Action• Processes Until Condition is False• Needs Another Action to make Condition

False• Difference between Do While and Do Until

– Do While pre-processes and checks condition prior to other actions

– Do Until post-processes and checks condition after other actions

Page 32: Peoplesoft Development Overview Application Engine

Do Until Continued

Page 33: Peoplesoft Development Overview Application Engine

How to Run

• Process Definition• .Bat File

Page 34: Peoplesoft Development Overview Application Engine

Process Definitions

Page 35: Peoplesoft Development Overview Application Engine

Process Definitions Continued

Page 36: Peoplesoft Development Overview Application Engine

.Bat File

\\ServerName\bin\client\winx86\PSAE.exe -CD database -CO USERID –CP PASSWORD –R RS_TEST_RUN_CONTROL –AI PS_TEST_AE

• Note your PSAE.exe location is unique to your enviroment

• Description of parameter is immediately following

• See PeopleBooks for a comprehensive list of Parameter values

Page 37: Peoplesoft Development Overview Application Engine

MetaSQL and MetaVariable

• Quick Definition– SQL Functions– Reserved Words– Some are Unique to Application Engine– Has to be in a SQL Statement– Within PeopleCode it can be used in the SQLExec

statement—not the most efficient– Can use in CREATESQL in PeopleCode

Page 38: Peoplesoft Development Overview Application Engine

%BIND

• This is only used in AE Programs• Retrieve fields from State Record• Example

INSERT INTO PS_TEST_REC(emplid, bonus)VALUES (%bind(emplid), %bind(bonus))

Page 39: Peoplesoft Development Overview Application Engine

%CURRENTDATEIN

• Returns current system date• Example

SELECT emplid, effdtFROM PS_JOBWHERE effdt < %CURRENTDATEIN

Page 40: Peoplesoft Development Overview Application Engine

%DATEIN

• Date variable is used as an input variable• Formats Date to Database Date

Specifications• Example

SELECT emplid, effdtFROM PS_JOBWHERE effdt < %DATEIN(‘2007-12-01’)

Page 41: Peoplesoft Development Overview Application Engine

%DATEOUT

• When selecting a date from the Database to ensure proper format

• Example%SELECT(emplid, effdt)SELECT emplid, %dateout(effdt)FROM PS_JOBWHERE effdt < %CURRENTDATEIN

Page 42: Peoplesoft Development Overview Application Engine

%OPERATORID

• Returns USERID of person running the Application Engine Program

• Helps you get the correct row from the RUNCNTL

• Example%SELECT(effdt, erncd, amount)SELECT %dateout(effdt), erncd, amountFROM PS_TEST_RUN_CONTROLWHERE oprid = %OPERATORID

Page 43: Peoplesoft Development Overview Application Engine

%RUNCONTROL

• Returns RUNCONTROLID that is being used to run the Application Engine Program

• Example%SELECT(effdt, erncd, amount)SELECT %dateout(effdt), erncd, amountFROM PS_TEST_RUN_CONTROLWHERE oprid = %OPERATORIDAND run_cntl_id = %RUNCONTROL

Page 44: Peoplesoft Development Overview Application Engine

%SELECT

• Used with a DoSelect• Stores you data in the AET record• Field Names must be valid Fields on the

State Record• Example

%SELECT(emplid, name)SELECT emplid, nameFROM PS_TEST_REC

Page 45: Peoplesoft Development Overview Application Engine

%SELECTALL

• %SELECTALL will select all the fields from the record

• If the field is a date it automatically uses the %DATEOUT

• ExampleLocal Record &testrec;&testrec = CreateRecord(PS_TEST_REC)CreateSQL(“%SELECTALL(:1)”, &testrec);

Page 46: Peoplesoft Development Overview Application Engine

Printing

• PeopleTools Delivers an Option to Print your AE Program

• Print in Flow Layout or• Print in Definition Mode

Page 47: Peoplesoft Development Overview Application Engine

Print Options

Page 48: Peoplesoft Development Overview Application Engine

Sample Report

Page 49: Peoplesoft Development Overview Application Engine

Advanced Topics

• Using Email• Input and Output Files

Page 50: Peoplesoft Development Overview Application Engine

Using Email

• Application Engine programs can send Emails– Used to notify when processes complete– Or fail– Also to send Notifications to Employees

• Send Mail Function– Used within PeopleCode– ExampleSENDMAIL(0, &EMAIL, “”, “”, &SUBJECT, &TEXT);– For more Options refer to PeopleBooks

Page 51: Peoplesoft Development Overview Application Engine

Input and Output Files

• For interfacing with other Applications• Excel, Access, and Text Files• Process

– Declare a Global Variable– Path and Filename need to be Explicitly Defined

Page 52: Peoplesoft Development Overview Application Engine

Delivered Functions

• GetFile– This will open a file for read, write or update– Example

GetFile(&path|&filename, “W”, %FilePath_Absolute)

• FileName.Open– This will check to see if the file is open– Example

If &InFile.Open Then …

Page 53: Peoplesoft Development Overview Application Engine

Delivered Functions Continued

• Filename.Writeline– This will write to the file.– Example

&Outfile.WriteLine(&string);

• Filename.Readline– This will read from the file.– Example

While &Infile.Readline ….End-While

Page 54: Peoplesoft Development Overview Application Engine

Sample Program

• Walk through Handout

Page 55: Peoplesoft Development Overview Application Engine

Discussion Time

• Questions and Answers• Workshop

Page 56: Peoplesoft Development Overview Application Engine

Query Tool