You are on page 1of 8

Application Engine Faq's

1) What is Application Engine ? ans) It is a development peopletool that we use to develop batch or online programs and create applications,the applications are useful to perform the background SQL process, means we can develop,test and run background SQL processing programs. Advantages: i) Using AE we can run parallel and set processing ii) There is restart facility iii) Meta SQL support is there 2) What are AE program elements ? i) sections ii) steps iii) Actions 3) What are the Do Actions in AE? Do When, Do While,Do Select,Do Until 4) Order of Events in Application Engine? Do When,Do While,Do Select, PeopleCode,SQL/Fetch,Call Section,Log Message,Do Until,(XSLT) Note: Whenever Application Engine Program type as Transform Only theb XSLT event will come into the picture 5) What are the types of AE programs i) Standard --- Which is normal entry-point program ii) Upgrade Only ---- Which is used in PS Upgrade utilities iii) Import Only-----Which is used by PS Import only iv) Daemon Only----- A special type of program used as Daemon v) Transform Only----Special program type used to support XSLT. 6) Where we set the Application Engine program types? ans) In AE properties Advanced tab-->programtype 7) How many ways we can run AE ? i) Application Designer-------Using RUN button in Menu bar (or) select edti>run program from the psad ii) Command Line---------psae.exe: c:\pt8.4x\bin\client\winx86\psae.exe iii) Process Scheduler iv) PeopleCode using CallAppEngine() 8) How to view or modify the properties of Application Engine? whar are those properties tabs? ans) By clicking the properties button (or) select File-->Definition Properties (ALT+ENTER) General,State Records,Temp tables,Advanced General Tab Includes Descriptions,Comments,Owner ID,Last Updated (date-time,user) State Records Tab includes Default Staterecord Temp Tables Tab Includes Instance Count,Runtime(continue,Abort) Advanced Tab Includes Disable Restart,Application Library,Message Set,Batch Only and Program Type 9) Uses of State Record(Cache Record) ? ans) State Records are used to assign variables for Application Engine programs and state record

used as worktable. Key field is PROCESS_INSTANCE. It can be a derived record or SQLTable. No people code fires on state record. To Restart facility we put the process_instance field. 10) How many rows we can have in state record? ans) We will have one row in state record. But in case if multiple AE programs are use same state record as default state record there will be multiple rows in state record. i.e one row for each record. 11) What is prerequisite for the state record? ans) i) It should be a Derived Record or SQL Table. ii) Name of the record must be end with _AET. This is how the system identifies the record as state rec. iii) PROCESS_INSTANCE must be a key iv) Any Data types except character or numeric must not be required fields 12) difference between Default state record and state record?

13) Uses of Temporary Tables? ans) Temporary tables are used to store intermediate results and set processing and parallel processing. It improves the performance of the program.It used to insert the data without interrupting the main record. 14) What is instance count? ans) The Instance Count value controls the number of physical tables to be created for each dedicated tables for this program during the SQL Build procedure in People Soft Application Designer. Typically, You would set this number to equal maximum number of parallel program runs that you anticipate. For instance if you expect up to 5 instance of the same program to run simultaneously ,Then you would set the instance count to 5. 15) How can we divide the data to be processed by different instance of the program to perform parallel program? ans) Run Control Parameters passed to each instance of the AE program enable it to identify which input rows belong to it, and each program instance inserts the row from the source table into its assigned temporary table instance using %table . 16) What happens when all the INSTANCE of the temporary tables are in use?

17) How can you assign the temp tables to AE program? ans) Open AE Program properties then click on the temp tables tab select the table you want click ok save the program Open App Designer open the record build the record and save it. 18) What is restart facility? ans) The restart facility is used to restart the AE program where it was stopped.

19) How to read the RUN CONTROL PARAMETERS in AE? ans) 1)SQL : %select(emplid) select emplid from ps_aeruncontrol where process_instance=%process_instance and oprid=%oprid 2)People Code: &SQL="select EMPLID from PS_AERUNCNTROL Where PROCESS_INSTANCE="|PS_TEST_AET.PROCESS_INSTANCE|" and OPRID="|%OPRID 20) What is set processing? ans) Set processing is nothing but processing of set of rows at one time rather than processing each row individually.Set processing enables you to apply your business rule directly on the data(preferably while it resides in temporary tables) in the database using an update or inser/select staements. Ex: Increase the salary for all employees from any department whose department profitability is more than 5 million dollars. 21) What is parallel processing? ans) The ability for multiple instances of the same program to run simultaneously is called parallel processing. Ex: Increase the salary for the managers from any department whose department profitability more than 5 million dollars. 22) What are the importance steps for implementing the parallel processing ? ans) i) Define Temporary Tables. ii) Set the Temporary Tables Online Pool iii) Assign Temporary Tables to AE Program iv) Set temporary Tables Batch Pool-Instance count in the AE V) Build/Rebuild the Temporary Table Record. 24) How do you debug an AE program? ans) We can set the Debug option in the following locations. i) Start PS Configuration Manager and select the Process Scheduler tab. In the application Engine group,enable Debug by selecting the Debug check box. ii) Use the Command Line option to invoke the AE program, Then you can just include the DEBUG Y parameter in the command line you submit to psae.exe if you already have the Debug check box selected in PS Configuration Manager, then you do not need to include the -DEBUG parameter in command line. iii) If you have peoplecode in your AE program, you should also enable the PeopleCode Debugger. When you launch your program and the peoplecode action executes,you will enter the peoplecode debugger at that point. 25) Application Engine supports what type of Debugging Tools? ans) I) Process Monitor II) Application Engine Trace File(In the Configuration Manager) III) Application Engine Interactive Debugger IV) PeopleCode Debugger 26) When we use Interactive Debugger? ans) It can be used while running on the cline or when running running directly on the server-out side of the process scheduler.

27) How can we access the AE Interactive debugger? ans) Set the Debug check box checked, in the process scheduler folder tab in the configuration manager. Open Configuration Manager,Click on the Trace tab,Click on the profile tab,Click on Edit ,Open process Scheduler page,We will find the Application Engine options.Select the Debug checkbox.click the ok to save. 28) How can we access the Debug Commands,in command line? ans) After specifying the Debug option in the configuration manager,Run any program then we will see the DOS communication window,Then type a (?),and press Enter.Then displays all the debug commands. 29) How can we set the Trace file? ans) For process running on a windows workstation, we can set trace option in Configuration Manager. In CM-->Trace tab>AE trace 30) What are the 3 trace parameters you can pass to your psae.exe? ans) TRACE<Trace Value> TOOLSTRACESQL<TraceValue> TOOLSTRACEPC<Trace Value> 31) What is the difference between a Trace Value and Trace Parameter? ans) A Trace Value Determines which type of trace is turned on. A Trace Parameter Determines what type of data is recorded in your trace files. 32) What are the 3 common ways to pass a trace parameter and value to your program psae.exe? ans) Configuration Manager, Process Definition, Command Prompt. 33) How do you execute Application Engine through Push Button? ans) CreateProcessRequest(),Schedule(),CallAppEngine() 34) What is the Syntax of CallAppEngine? Ans) CallAppEngine(applid,[state record]); 35)What are the Section Properties (or) Section Parameters? ans) Section Name, Description Market, Platform, Effective Date, Effective Status, Section Type, Auto Commit, Access ----Section Types includes Critical Updates and Preparation Only(by Default) 36) What are the Step Properties? ans) Step Name, Step Description, Commit After, Frequency, On Error, Status --Commit After Includes Default, Later, After Step Default: The step inherits what ever commit level you have specified for the section in which the step resides.

Later: Select to postpone the commit until a subsequent commit occurs, as specified by developers. Again, here you can override the section-level commit, if it happened to be set to After Step. After step. Select if you have a commit level of None specified at the section level. This way you can override the section-level commit, and commit a specific step within a section with no other commits. Frequency:This becomes enabled only when a step contains one of the following actions: Do While, Do Select, or Do Until. This control accepts only numeric values. The value indicates the frequency with which Application Engine should commit. If non-zero, PeopleSoft Application Engine commits every N iterations, and then again after the last iteration. On Error: Specify how PeopleSoft Application Engine should respond to an error at the step level. The On Error routine behaves the same for both SQL and PeopleCode actions. The program only aborts on errors, not warnings. Abort: The application terminates with an error message. Ignore: The program continues but logs an error message. Suppress: The program continues and presents no error message.

Status: Specify whether to activate a step or make it inactive. If the step is currently applicable to your program (and working) youll probably want to keep it Active. However, if youre still developing or testing the step you may want to make it Inactive. The check box toggles the status of a step. 37) What are The Action Properties ? ans) Do When------ReUse Statement(bulk insert,no,yes) Do While------ReUse Statement Do Select------Reuse Statement, Do Select Type(select/fetch,reselect,restartable), PeopleCode----On Return(Abort,Break,Skip Step) SQL------------ReUse Statement, No Rows(Abort,Section Break, Continue,Skip Step) Call Section-----Section Name, Program Id, Dynamic Logmessage----Message Set, Number, Parameters Do Until---------ReUse Statement XSlt--------------GraphicalMapper ReUSe Statement: It includes Bulk Insert, No ,YES ReUSe Statement: ReUse is an option you can enable to optimize the SQL components of your batch program. ReUse converts any %BIND references to state record fields into real bind variables (:1, :2,and so on), enabling the Application Engine runtime process to compile the statement once, dedicate a cursor, and then re-execute it with new data as often as your program requires.When you are using SQL to process a large volume of rows, one at a time, inside a fetch loop,compiling each statement you issue can be a considerable performance issue. ReUse is a way to combat potential performance decreases.

Bulk Insert: When used in conjunction with statements like INSERT INTO tablename (field1, field2) VALUES(%BIND(ref1), %BIND(ref2), Bulk Insert offers the most powerful degree of performance enhancements related to ReUse. This option turns on ReUse, and, in addition, it holds all the data in a buffer and performs an insert only after a large volume of rows has gathered in the buffer.The number of rows allowed to gather in the buffer depends on your database platform. Keep in mind that storing data in the buffers is applicable only if youve selected Bulk Insert and the SQL is an INSERT statement.For statements other than INSERT/VALUES, the Bulk Insert option is ignored. No: Select this option to disable ReUse. With ReUse off, the Application Engine runtime process recompiles the SQL statement every time the loop executes. By default, ReUse is disabled. Yes: Select this option to enable basic ReUse functionality. NoRows: If the SQL (INSERT, UPDATE, and DELETE) associated with the SQL action does not return any rows, you must specify what the Application Engine program should do. For example, you could use this in a case where you INSERT into a temporary table, and then you intend to perform further operations on the inserted rows (provided that some rows meet the criteria). If the initial INSERTSELECT provides no rows, you could save the program from having to re-SELECT on the temporary table prior to executing another operation, or you could also prevent the program from performing set operations on the table when there won't be any qualifying rows. Abort: The program terminates. Section Break: PeopleSoft Application Engine exit the current section immediately, and control returns to the calling step. Continue: The program continues processing. Skip Step: PeopleSoft Application Engine exits the current step immediately and moves on to the next step. Application Engine ignores the commit for the current step at runtime. If the current step contains only one action, use Skip Step only to bypass the commit. Do Select Type: When you add a Do Select action, you can specify the ReUse Statement option available for all SQL-based actions, but you also need to specify the Do Select Type. Select/Fetch: With this option, PeopleSoft Application Engine opens a cursor for the Do Select, then, within that cursor, Application Engine performs a Fetch for each iteration of the loop to get each row from the SELECT. When a FETCH results in an end of table, the looping is

complete. You cant restart this type of SELECT statement because PeopleSoft Application Engine does not perform a checkpoint or a commit within the step containing this action while Select/Fetch is running. Ultimately, your program ignores the commit settings at runtime until the outermost Select/Fetch completes. Re-Select: For each iteration of the loop, PeopleSoft Application Engine opens a cursor and fetches the first row. This means that, with Re-Select, your program processes the first row returned from the Select statement. It also means that the cursor gets re-opened for each iteration of the loop. With this type of Fetch, you will typically want some aspect of the loop to eventually cause the Select to return no rows. Otherwise, there is no mechanism in place by which to exit the loop. This type of Do Select is restartable. Restartable: This option is similar to the Select/Fetch in that PeopleSoft Application Engine opens the cursor associated with the Do Select once, and then it performs a Fetch on each iteration of the loop to get each row from the SELECT. However, unlike the Select/Fetch option, you can restart this type of Select and Fetch because PeopleSoft Application Engine performs a checkpoint in the middle of the step. Keep in mind that Application Engine will only treat this loop as if it is restartable. Developers need to make sure that the SQL they include within this action is such that, upon restart, it recognizes where the previous run failed and where to restart processing. There are various techniques you can use to achieve this, such as employing a processed switch, or to base the next Select on the key. On Return: This option is used to handle run time errors. Abort :The program issues an error and exits immediately. Break :The program exits the current step and section, and control returns to the calling step. Skip Step: The program exits the current step, and continues processing at the next step in the section.If this is the last step in the section, the calling step resumes control of the processing. 37) In which events of people code we can write CallAppEngine function? ans) SavePrecChange, SavePostChange, Workflow and FieldChange 38) What are the different ways pass data between the Steps ? ans) i) StateRecords----One row can be passed and can have many state records

ii) Component/Global PeopleCode variables iii) Temporary Records---Multiple rows of data can be passed 38) What are the mutually exclusive action and why they are mutually exclusive? ans) Call Section and SQL are mutually Exclusive. Both are used for DML operations thats why there are mutually exclusive. 39) What is the difference between exit(0), exit(1) when we are using this function in AE? ans) exit(1) causes immediate termination of PC program.Use this parameter to rollback DB changes exit(o) causes immediate termination if PC program but don't make to rollback in the DB

Getting Current and Feature Effected Rows


We Always use this query to getting the Current and Feature Effected rows

SELECT A.EMPLID , A.EFFDT CURR_EFFDT, B.EFFDT PREV_EFFDT FROM PS_JOB A, PS_JOB B WHERE B.EFFDT = (SELECT MAX(A_ED1.EFFDT) FROM PS_JOB A_ED1 WHERE B.EMPLID = A_ED1.EMPLID AND B.EMPL_RCD = A_ED1.EMPL_RCD AND A_ED1.EFFDT < A.EFFDT) AND B.EFFSEQ = (SELECT MAX(A_ES1.EFFSEQ) FROM PS_JOB A_ES1 WHERE B.EMPLID = A_ES1.EMPLID AND B.EMPL_RCD = A_ES1.EMPLID AND B.EFFDT = A_ES1.EFFDT) AND A.EMPLID=B.EMPLID

You might also like