Saturday 9 July 2011

PeopleTools I Rel 8.48 Topics



PeopleSoft Technical articles - Peoplecode
Course Topics:
Navigating PeopleSoft Applications 

Using Search Pages 
Identifying Definitions 
Entering and Modifying Data 
Finding Information Using PeopleBooks 

Explaining PeopleSoft Architecture 

Describing PeopleSoft Databases 
Explaining Data Transfer in PeopleSoft Pure Internet Architecture 
Identifying Requirements for the Development Environment 

Organizing Data 

Describing Relational Data Models 
Normalizing Data 
Reading Data Models 

Validating Data 

Describing Prompt Tables 
Using Effective Dating 
Comparing Validation Types 
Explaining Tableset Sharing 

Developing Applications by Using the Eight Steps 

Describing the PeopleSoft Application Development Process 
Describing the Application Designer Interface 
Organizing Definitions in a Project 

Designing the Application 

Planning the Application 
Determining Functional Specifications 
Determining Technical Specifications 
Describing the Training Application 

Defining Fields 

Discussing Fields in PeopleSoft Applications 
Identifying Field Definition Types and Properties 
Creating Field Definitions 
Assigning Translate Values 

Creating Record Definitions 

Discussing Fields in PeopleSoft Applications 
Identifying Field Definition Types and Properties 
Creating Field Definitions 
Assigning Translate Values 

Building SQL Tables 

Describing the Relationship Between Record Definitions and Application Data Tables 
Building Application Data Tables 
Viewing Table Indexes 

Creating Page Definitions 

Identifying Page Design Principles 
Identifying Page and Page Control Properties 
Adding Page Controls to a Page 
Creating Page Definitions 
Implementing Scroll Areas and Grids 

Defining Components 

Defining Component Properties 
Building New Components 

Registering Components 

Examining Menu Definitions 
Identifying PeopleSoft Security Basics 
Navigating the Portal Registry 
Registering a Component 

Testing an Application 

Creating and Analyzing Test Plans 
Troubleshooting Common Issues 

Editing the Registry Structure 

Discussing Content Organization in PeopleTools 8.4 Navigation 
Creating Folders 
Moving Folders or Content References to New Parent Folders 

Creating Menu Definitions 

Describing the Purpose of a Menu 
Locating a Component on a Menu 
Editing Menu Item Labels 

How to create dynamic prompts in PeopleSoft?


 

PeopleSoft Technical articles - Peoplecode
Here is a step by step tutorial to create dynamic prompts in PeopleSoft?
Requirement: If you  have a requirement to create a prompt table with values based on another prompt on the same page. For example prompt(1) for bank id and prompt(2) for bank Branchs.
Now if you want to be able to filter bank names on prompt(2) based on the value of prompt(1). So if a user picks some bank id in prompt(1), prompt(2) will only display Bank Branchs that are associated with bank.
Solution:
One way of doing this is to use %RECNAME_EDIT functionality.
1- CREATE  A RECORD
2- ADD A FEILD Bank ON WHICH YOU WANT TO CREATE DYNAMIC PROMPT
3- GO TO THE RECORD FEILD PROPERTY OF THAT FEILD
4- NAVIGATE TO EDITS TAB AND SET PROMPT TABLE  VALUE TO %RECNAME_EDIT
5-NOW WRITE THE PEOPLECODE ON THE ROWINIT OF THAT FEILD IN THE RECORD
6- MAKE SQL VIEWS ON YOUR CRITERIA

NOW ASSIGN THE REQUIRED SQL VIEW TO THE FEILD DEPENDING UPON THE CRITERIA

Global string &addBank;
Component string &addBank_compnt;

If %Component = Component.P1_ESS_BANK Then
If &addBank = "ADD" Then
DERIVED.RECNAME_EDIT.Value = "P1_BANK_EC_VW2";
Else
DERIVED.RECNAME_EDIT.Value = "P1_BANK_EC_VW1";
End-If;
Else
DERIVED.RECNAME_EDIT.Value = "P1_BANK_EC_VW1";
End-If;
&addBank_compnt = &addBank;
&addBank = "";

article in Data Buffer Classes

Data Buffer Classes
In PeopleCode there are four data buffer classes
  1. Rowset Class
  2. Row Class
  3. Record Class
  4. Field Class
These four classes are used for accessing Component Buffer data.
Below is the Traversing Order of these classes:
Rowset -> Row -> Record -> Field
Now lets have a detail overview of these classes one by one.
  1. Rowset Class : A rowset object, instantiated from a Rowset class, is a collection of rows associated With buffer data. A component scroll is a rowset. You can also have a level 0 rowset.
If a rowset object is instantiated using the CreateRowset function, the rowset object that’s instantiated is a standalone rowset. Any records and field references created by this function are initialized to null values, that is, they do not contain any data. You can populate this rowset object using the CopyToFill, or FillAppend methods.
Built-in Functions for Rowset Class:
  1. CreateRowset
  2. GetLevel0
  3. GetRowset
The CreateRowset function creates an unpopulated, standalone rowset.
Syntax:
CreateRowset ({RECORD.recname | &Rowset} [, {FIELD.fieldnameRECORD.recname |&Rowset}] . . .)
Example : Local Rowset &RS;
&RS = CreateRowset (RECORD.QA_INVEST_DTL);
GetLevel0 creates a rowset object that corresponds to level 0 of the component buffer. This function returns a rowset object that references the base rowset. For a component, this is the level 0 of the page. For a PeopleSoft Application Engine program, this is the state record rowset. For a message, this is the base rowset.
Examle : The following code sample returns the level one rowset.
Local Rowset &ROWSET
&ROWSET = GetLevel0()(1).GetRowset(SCROLL.LEVEL1_REC);
The GetRowset function to get a rowset object based on the current context. That is, the rowset is determined from the row containing the program that is running.
Syntax :
GetRowset ([SCROLL.scrollname])
Example: In the following example, RS1 is a level 1 rowset, and RS2 is a child rowset of RS1.
Local Rowset &RS1, &RS2;
&RS1 = GetRowset();
&RS2 = GetRowset(SCROLL.EMPL_CHKLST_ITM);
With no parameters, GetRowset returns a rowset object for the rowset containing the currently running program. If a parameter is specified, it returns a rowset for that child scroll. scrollname must be the name of the primary record for the scroll.
2) Row Class: A row object, instantiated from the Row class, is a single row of data that consists of one to records of data. A single row in a component scroll is a row.
A row may have one to child rowsets. For example, a row in a level two scroll may have level three child rowsets.CopyTo and GetRecord are two commonly use methods for this class.
Visible and IsChanged are two commonly used properties for this class.
Built-in Functions :
i) GetRow
Methods :
i) CopyTo
ii) GetRecord
The GetRecord method creates a record object that references the specified record within the current row object.
Example:
&REC = &ROW.GetRecord(RECORD.QEPC_LEVEL1_REC);
Properties:
  1. Visible
  2. Ischanged
  3. Childcount
Ischabged property returns True if any field value on the primary database record of the row has been changed.
Example :
&tmp = &ROW.IsChanged;
if &tmp = True then
Warning("A Field on this row has been changed");
End-If;
ChildCount property returns the number of child rowsets of the row. It is defined by the "structure" of the scroll, so it is the same for all rows of the rowset.
It might be used, in conjunction with the GetRowset method, to write code that examines all child rowsets.
Example
For &I = 1 to &ROW.ChildCount
&ROWSET = &ROW.GetRowset(&I);
/* do processing */
End-For;
3)Record Class : record object, instantiated from the Record class, is a single instance of a data With in a row and is based on a record definition. A record object consists of one to n fields.
CopyFieldsTo is a commonly used method for the record class. NameIsChanged, and FieldCount are commonly used properties.
Built-in Functions :
  1. GetRecord
  2. CreateRecord
CreateRecord creates a standalone record definition and its component set of field objects. The specified record must have been defined previously, that is, it must have a record definition.
Example :
Local Record &REC2;
&REC2 = CreateRecord(RECORD.OPC_METH);
Methods :
  1. CopyFieldsTo
  2. CompareFields
The CopyFieldsTo method copies all like-named field values from the record object executing the method to the specified record object recordobject. This copies all field values. To copy only changed field values, use the CopyChangedFieldsTo method.
Example :
Local Record &REC, &REC2;
&REC = GetRecord(RECORD.OPC_METH);
&REC2 = CreateRecord(RECORD.OPC_METH_WORK);
&REC.CopyFieldsTo(&REC2);
The CompareFields method compares all like-named fields of the record object executing the method with the specified record object recordobject.
Example:
&REC = GetRecord(RECORD.OP_METH_VW);
&REC2 = GetRecord(RECORD.OPC_METH);
If &REC2.CompareFields(&REC) Then
WinMessage("All liked named fields have the same value");
End-If;
4)Field Class : field object, instantiated from the Field class, is a single instance of data with in a record object, and is based on a field definition.
SetDefault is a frequently used method. Name, Enabled, and Type are several commonly used field properties.
Built-in Functions :
i) GetField
GetField creates a reference to a field object for the current context; that is, from the row containing the currently executing program.
Example :
&FIELD = GetRow().recname.fieldname;
Methods :
i) SetDefault
SetDefault sets the value of the field to a null value, or to a default, depending on the type of field.
Example :
&CHARACTER.SetDefault();
Properties :
  1. Name
  2. Enabled
  3. Type
Data Buffer Classes
In PeopleCode there are four data buffer classes
  1. Rowset Class
  2. Row Class
  3. Record Class
  4. Field Class
These four classes are used for accessing Component Buffer data.
Below is the Traversing Order of these classes:
Rowset -> Row -> Record -> Field
Now lets have a detail overview of these classes one by one.
  1. Rowset Class : A rowset object, instantiated from a Rowset class, is a collection of rows associated With buffer data. A component scroll is a rowset. You can also have a level 0 rowset.
If a rowset object is instantiated using the CreateRowset function, the rowset object that’s instantiated is a standalone rowset. Any records and field references created by this function are initialized to null values, that is, they do not contain any data. You can populate this rowset object using the CopyToFill, or FillAppend methods.
Built-in Functions for Rowset Class:
  1. CreateRowset
  2. GetLevel0
  3. GetRowset
The CreateRowset function creates an unpopulated, standalone rowset.
Syntax:
CreateRowset ({RECORD.recname | &Rowset} [, {FIELD.fieldnameRECORD.recname |&Rowset}] . . .)
Example : Local Rowset &RS;
&RS = CreateRowset (RECORD.QA_INVEST_DTL);
GetLevel0 creates a rowset object that corresponds to level 0 of the component buffer. This function returns a rowset object that references the base rowset. For a component, this is the level 0 of the page. For a PeopleSoft Application Engine program, this is the state record rowset. For a message, this is the base rowset.
Examle : The following code sample returns the level one rowset.
Local Rowset &ROWSET
&ROWSET = GetLevel0()(1).GetRowset(SCROLL.LEVEL1_REC);
The GetRowset function to get a rowset object based on the current context. That is, the rowset is determined from the row containing the program that is running.
Syntax :
GetRowset ([SCROLL.scrollname])
Example: In the following example, RS1 is a level 1 rowset, and RS2 is a child rowset of RS1.
Local Rowset &RS1, &RS2;
&RS1 = GetRowset();
&RS2 = GetRowset(SCROLL.EMPL_CHKLST_ITM);
With no parameters, GetRowset returns a rowset object for the rowset containing the currently running program. If a parameter is specified, it returns a rowset for that child scroll. scrollname must be the name of the primary record for the scroll.
2) Row Class: A row object, instantiated from the Row class, is a single row of data that consists of one to records of data. A single row in a component scroll is a row.
A row may have one to child rowsets. For example, a row in a level two scroll may have level three child rowsets.CopyTo and GetRecord are two commonly use methods for this class.
Visible and IsChanged are two commonly used properties for this class.
Built-in Functions :
i) GetRow
Methods :
i) CopyTo
ii) GetRecord
The GetRecord method creates a record object that references the specified record within the current row object.
Example:
&REC = &ROW.GetRecord(RECORD.QEPC_LEVEL1_REC);
Properties:
  1. Visible
  2. Ischanged
  3. Childcount
Ischabged property returns True if any field value on the primary database record of the row has been changed.
Example :
&tmp = &ROW.IsChanged;
if &tmp = True then
Warning("A Field on this row has been changed");
End-If;
ChildCount property returns the number of child rowsets of the row. It is defined by the "structure" of the scroll, so it is the same for all rows of the rowset.
It might be used, in conjunction with the GetRowset method, to write code that examines all child rowsets.
Example
For &I = 1 to &ROW.ChildCount
&ROWSET = &ROW.GetRowset(&I);
/* do processing */
End-For;
3)Record Class : record object, instantiated from the Record class, is a single instance of a data With in a row and is based on a record definition. A record object consists of one to n fields.
CopyFieldsTo is a commonly used method for the record class. NameIsChanged, and FieldCount are commonly used properties.
Built-in Functions :
  1. GetRecord
  2. CreateRecord
CreateRecord creates a standalone record definition and its component set of field objects. The specified record must have been defined previously, that is, it must have a record definition.
Example :
Local Record &REC2;
&REC2 = CreateRecord(RECORD.OPC_METH);
Methods :
  1. CopyFieldsTo
  2. CompareFields
The CopyFieldsTo method copies all like-named field values from the record object executing the method to the specified record object recordobject. This copies all field values. To copy only changed field values, use the CopyChangedFieldsTo method.
Example :
Local Record &REC, &REC2;
&REC = GetRecord(RECORD.OPC_METH);
&REC2 = CreateRecord(RECORD.OPC_METH_WORK);
&REC.CopyFieldsTo(&REC2);
The CompareFields method compares all like-named fields of the record object executing the method with the specified record object recordobject.
Example:
&REC = GetRecord(RECORD.OP_METH_VW);
&REC2 = GetRecord(RECORD.OPC_METH);
If &REC2.CompareFields(&REC) Then
WinMessage("All liked named fields have the same value");
End-If;
4)Field Class : field object, instantiated from the Field class, is a single instance of data with in a record object, and is based on a field definition.
SetDefault is a frequently used method. Name, Enabled, and Type are several commonly used field properties.
Built-in Functions :
i) GetField
GetField creates a reference to a field object for the current context; that is, from the row containing the currently executing program.
Example :
&FIELD = GetRow().recname.fieldname;
Methods :
i) SetDefault
SetDefault sets the value of the field to a null value, or to a default, depending on the type of field.
Example :
&CHARACTER.SetDefault();
Properties :
  1. Name
  2. Enabled
  3. Type

application engine interview question and answers-2

1) Order and flow of action types
1) Do When
2) Do While
3) Do Select
4) Peoplecode
5) SQL
6) Call Section
7) Message Log
8) XSLT
9) Do until

2) What is Prerequisite for the Temporary record?
1) Should have process Instance as key
2) Name should end with _TAO

3) Different types of Temporary tables
- Dedicated
- Un Dedicated (Shared)

4) Why Parallel Processing required?
Potential performance improvements by splitting the data to be processed into groups and simultaneously running multiple instance of your program to deal with different groups of data.
If you have a one program that uses a temporary table and is invoked multiple times, that single temporary table could be used concurrently in multiple executions of the code. This could create unpredictable results since the different instances of the code would be issuing delete, Inserts and/or updates unsynchronized with each other.
You could solve the problem by creating multiple temporary tables as a pool of tables. Each invocation of your program would have to allocate an unused temporary table,
mark it as ‘in use’ , use it and release it back to the pool when you through with it (for each Application Engine program you write).

5) How running AE program as Batch differs from running it online?
Application Engine programs are designed for two types of execution and each has its own pool of Temporary Tables
Online: 
Invoked by CallAppEngine from People code
Run quickly, synchronously, and at random times.
Potential for simultaneous executions
Uses the online Temporary Table pool.
Not restart able.
Psae.exe randomly assigns an instance number from the number range on your online temp tables.
If the instance number is in use psae.exe puts the program in Queue until the assigned instance becomes free.
Unlock on completion, on Crash free from Manage Abends.
Batch:
Invoked through the Process Scheduler.
Run for longer amounts of time, asynchronously, and at scheduled times.
Can be designed for parallel execution for performance.
Uses the Batch/Dedicated Temporary table.
Restart able.
It allocates instance number based on the availability on a record by record basis and psae.exe begins with the lowest instance numbers.If the properties are set continue - Base table is used with Process instance as key.
If Re-starable – Locked across Restarts until completes successfully.
If not Re-startable on Program completion.

6) What are the important steps for implementing the parallel processing?
Define you Temporary Tables.
Set the Temporary Tables Online pool.
Assign Temporary Tables to your Application Engine program in it program.
Set Temporary Table Batch Pool – Instance count in the AE.
Build / Rebuild your Temporary Table record.
Code %Table Meta – SQL as reference to Temporary Tables in your Application Engine program, so that Application Engine can table references to the assigned Temporary Table instance dynamically at runtime.

7) What happens when all the instance of the temporary table are in use?
It behavior can control by AE developer. If the runtime options are set to continue “People Tools will insert rows into the base table using the PROCESS_INSTANCE as a key”. If temp table doesn’t contain PROCESS_INSTANCE as a key field in a Temporary table, you should change the Temp table runtime options to “Abort” in the appropriate Application Engine programs.

8) How can you divide the data to be processed by different instance of the program to perform parallel program?
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 rows from the source table into its assigned temporary table instance using %Table.

9) What are the 3 common ways to pass a trace parameter and value to your program psae.exe?
Configuration manager, Process Definition, Command prompt.

10) What is the main purpose of the Access property in the Section?
Basically they have two option, public and private if section declared as public then it be access from other program.Private we cannot call from other program.

11) Which actions are mutually exclusive and why they are mutually exclusive?
Sql and callsection.

12) Error handling or Exception handling in Application Engine ?
Step properties:-
On Error:-
Abort – Write message to message log and terminate.
Ignore - Write message to message log and continue.
uppress – No message will be written, but program will continue.
People code Action: - On return options can used to handle run time errors.
Abort: - Exits immediately – Not recommended.
Break:- 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.
SQL Action properties:-
No Rows:- When the Sql doesn’t return any rows, you can tell what application engine program should do.
Abort: - Program terminates
Section Break: - Application Engine exits the current section immediately, and control returns to the calling step.
Continue: - The program continues processing
Skip Step: - Application Engine exits the current step immediately and moves on to the next step. When using skip step keep the following in mind:
1) Application Engine ignores the commit for the current step at runtime
2) If the current step contains only one Action, only use skip step at by-pass the commit.
13) What are different types Do Select? 
1) Select/Fetch
2) Reselect
3) Restart able

Select/Fetch: -
Opens the cursor only at the first time and retrieve rows one at loop.
Commits inside the step (commits in the Called Section) are ignored if AE is Restart enabled.
Reselect: -
It opens the cursor and closes the cursor on each iteration of the loop.
It will reselect the same row of data.
Logic in Actions of the step should be such that it will be changing the status of the rows in the table the do select is selecting.
Commits are not ignored and will be committed in a reselect loop when the restart is enabled.
Restart able: - similar to select/Fetch but it WILL COMMIT inside the loop thus allowing the checkpoint to the PS_AERUNCONTROL table.

14)What is the maximum limitation on temporary tabel instances in AE.
99

15) what is the difference between the %SELECT and %SELECTINIT meta sql functions.
Ans %select : if any values have not selected then previous value will be there
%selectinit : if any values have not selected then previous value will reinitilate to null

16) what is the difference between exit(0),exit(1) when we are using this functions in AE
Exit (1) causes immediate termination of a PeopleCode program. Use this parameter to rollback database changes.
Exit (0) caused immediate termination of a Peoplecode Program but don’t make rollback in the database.

application engine interview question and answers

PeopleSoft Interview Questions and Answers– Application Engine

1) There are different types of variables in the Application Engine people code?
Local variable – these are available for the duration of the program in which they are declared.
Global / Component – These variables are available while the Application Engine program is running. They are saved at commits and checkpoints,
So they can be used for restarts. Component variables are same as Global incase of the AE.

2) What are the Different ways pass data between the steps?
1) State records – One row can be passed and can have many state records.
2) Component/Global People code variables
3) Temporary records – Multiple rows of data can be passed.

3) What is Prerequisite for the State record?
1) Should be either Derived work record Or SQL Table.
2) Name of the record must end in AET; this is how the system identifies the record as a state record.
3) PROCESS_INSTANCE must be a key.
4) Any data types except character or numeric must not be required fields.
Note: - No People code fires on an Application Engine state record.
No Validation of translate values or Prompt tables are done.

4) How to read the runctrl parameters in AE
1) SQL: - %Select (EMPLID) Select EMPLID from PS_AERUNCONTROL where PROCESS_INSTANCE = %PROCESS_INSTANCE and ORPID = %oprid
2) People code: - &SQL = “Select EMPLID from PS_AERUNCONTROL Where PROCESS_INSTACNE =” PS_TEST_AET.PROCESS_INSTANCE “and OPRID =” %oprid.
%PROCESS_INSTANCE or %Bind (PROCESS_INSTANCE) can be used.
%PROCESS_INSTANCE is more efficient and faster.

5) How do you execute Application Engine through Push Button?
1) CreateProcessRequest () , Schedule ()
2) CallAppEngine.
6) What is the syntax for CallAppEngine?
CallAppEngine (applid [, state record]);

7) What are the 3 trace parameters you can pass to your psae.exe?
- TRACE 
- TOOLSTRACESQL 
- TOOLSTRACEPC 
8) Which Trace option is the best place to start for general performance information?
- TRACE 384 – mostly used trace value.

9) What is the difference between a Trace value and Trace parameters?A Trace parameter determines which type of trace is turned on.
A Trace parameter determines what type of data is recorded in your trace files (s).

10) What are the 3 common ways to pass a trace parameter and value to your program psae.exe?
Configuration manager, Process Definition, Command prompt.

11) What are the Different types of Application Engine?Standard: Standard entry-point program.
Upgrade Only: Used by PeopleSoft Upgrade utilities only.
Import Only: Used by PeopleSoft Import utilities only
Daemon Only: Use for daemon type programs.
Transform Only: Support for XSLT Transform programs.

12) How do you program AE program for the restarts?
Program Level State RecordOne of the state record needs to SQL Table, Since All Derived work record will be re-initializing on commit.
Program PropertiesOn the Advanced tab in the program properties dialog box, make sure that disable restart is not checked.
Configuration managerIn the configuration manager, sure that Disable restart is not selected on the process scheduler tab.
Section Level
Section type
The option for section type are prepare only and critical updates
If the section is preparing data i,e select data, Populating temporary tables, or updating temporary tables then the section should be prepare only.
If the section is updating the permanent application tables in the database, you should select critical update.
Step LevelAdd an order by clause
%Select Field Select Field1 from PS_SOME_RECORD Where FIELD1 > %Bind (FIELD1) Order by FIELD1.

Add a switch to the selected table
Delete processed rows.

The only restriction for batch runs occurs when you have restart enabled, and you are inside a Do Select that is of the Select/Fetch type (instead of "Re-select" or "Restartable"). with select/Fetch, all commits inside the loop are ignored, including the commit frequency if it's set.

13) What is Set Processing? 
Set Processing uses SQL to process groups, or sets, of rows at one time rather than processing each row individually. With row by row processing you following a repetitive loop that selects a row, determines if it meets a given criteria, if so, apply rule x to row Update row, commit. With set processing, you only select those rows that meet the filtering criteria and then run the rule once again all the affected rows.

14) Advantages of Set Processing?
Improved Performance: - Our internal testing has revealed that, in an overwhelming majority of cases, set processing performs significantly better than it is -by-row counterpart for “reasonable” batch processing volumes.

Minimized SQL Overhead: - It tends to use fewer Application Engine SQL statements that each processed more data than the statements executed in row-by-row processing.
Easy Maintenance: - if need to make a fix or add an enhancement to SQL, it’s just a matter of modifying the SQL or inserting the new “Chunk”.
Leveraging the RDBMS: - With Set – based processing, you take advantage of the SQL processing engine on the database rather than placing the processing burden and overhead on the application executable.

15) Testing and debugging application engine?
Application Engine Trace file-You can track the step execution of your application execution.
Application Engine Interactive Debugger – First click on the trace tab and turn off the statement timings. Select Profile -> Edit Profile-> Process Scheduler Tab -> Application section Select Debug check box.

(You can dynamically modify the state record run application engine step by step
People Code Debugger for the Application Engine.)
AE Trace files: - AE__.AET
Without the process instance: - AE__.AET