103211674 Understanding the Component Buffer

download 103211674 Understanding the Component Buffer

of 30

Transcript of 103211674 Understanding the Component Buffer

  • 7/28/2019 103211674 Understanding the Component Buffer

    1/30

    Understanding the Component Processor

    and the Component BufferWhat every PeopleSoft Developer and Analyst Must Know

    By Derek Tomei

    DMT Solutions, Inc.

    www.DMTSolutions.com

    DMT Solutions, Inc. All Rights Reserved

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    2/30

    DMT Solutions, Inc.www.dmtsolutions.com

    Copyright 2008 by DMT Solutions, Inc.

    Printed in the United States of America.

    All rights reserved. Except as permitted under the UnitedStates Copyright Act of 1976, no part of this publication maybe reproduced or distributed in any form or by any means, orstored in a database or retrieval system, without the priorwritten permission of the publisher. The views expressed inthis book are solely those of the author and do not representthe views of any other party or parties.

    PeopleSoft, PeopleTools, PeopleCode, PeopleBooks and nVisionare registered trademarks of PeopleSoft Inc. This book is anindependent creation of the author and has been publishedwithout license, authorization or participation of Oracle /PeopleSoft Inc. or

    Information contained in this work had been obtained by DMTSolutions, Inc. from sources believed to be reliable.However, neither DMT SOLUTIONS, INC. nor its authorsguarantee the accuracy or completeness of any informationpublished herein and shall not be responsible for any errors,omissions, or damage arising from the use of this

    publication. This work is published with the understandingthat DMT Solutions, Inc. and its authors are supplyinginformation but are not attempting to render engineering orother professional services. If such services are required,the assistance of an appropriate professional should besought.

    You are permitted to print one copy of this eBook foryourself. You are not allowed to distribute or copy thisbook in any part.

    Any errors found, should be sent to [email protected]

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    2

    http://www.dmtsolutions.com/mailto:[email protected]://www.dmtsolutions.com/http://www.dmtsolutions.com/mailto:[email protected]://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    3/30

    ABOUT THE AUTHOR

    Derek Tomei is a Senior PeopleSoft Consultant, the CEO of DMT

    Solutions, Inc. and the founder of PeopleSoftCareer.com.

    Derek has been involved with PeopleSoft software for over 12

    years since version 5 through the most recent versions of HCM

    and Financial. He has seen and worked through the progression

    from PeopleSoft client-server 2-tier, 3-tier, and the

    PeopleSoft Internet Architecture. He has worked with small

    private companies to large fortune 500 corporations

    implementing, upgrading, installing, enhancing, and

    maintaining PeopleSoft Financial and HCM applications.

    Derek is considered one of the PeopleSoft industrys top

    technical consultants with the ability to perform in all

    areas of technical expertise including but not limited to

    development, architecture, database administration, system

    administration, web development, employee and manager self-

    service, and project management.

    Derek has presented at many PeopleSoft events and conferences

    and has written several articles that have helped many

    PeopleSoft professionals.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    3

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    4/30

    Table of Contents

    Who is This Book For? ..........................................................................................................5

    Introduction ............................................................................................................................6

    A Review of the PeopleSoft Architecture ............................................................................. 7Meta-Data and Application Data .......................................................................................8

    Accessing PeopleSoft Applications .....................................................................................10

    The Component Processor ..................................................................................................12PeopleCode and the Component Processor .........................................................................14

    PeopleCode Events .............................................................................................................. 15

    The Component and Triggering PeopleCode ..................................................................16The Component Buffer .......................................................................................................21

    Understanding Occurs Levels ..........................................................................................22

    Rules for Buffer Allocation .............................................................................................23PeopleCode Programs and the Component Buffer ..........................................................25

    Buffer Allocation Order ...................................................................................................25Application Performance and the Buffer .............................................................................28

    Summary.............................................................................................................................................. 30

    PeopleSoft Resources ...........................................................................................................30

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    4

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    5/30

    Who is This Book For?

    This book is a practical guide for technical users,

    developers, programmers, and analysts who work with

    applications for your PeopleSoft system. In addition, this

    guide can be used as an aide for ensuring the proper design

    of applications and for performance tuning your online

    PeopleSoft applications.

    If you are a developer or technical analyst, then this book

    is for you. This book is intended to be used as a guide that

    will educate you on how the component processor works and how

    the component buffer utilizes data in memory.

    These two concepts are extremely important. If you

    completely understand how the component processor and the

    component buffer work, you will be able to write efficient

    code and ensure that your PeopleSoft applications are built

    for optimal performance.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    5

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    6/30

    Introduction

    If I had to tell someone what the most important concept they

    need to understand as a PeopleSoft developer, I would quickly

    answer. It is the Component Processor and how it allocates

    Buffer space, how it places information in the buffer, and

    how to ensure that you maximize its use.

    The PeopleSoft application is an extremely powerful and

    highly configurable product that runs many different

    applications. Every application that is accessed online

    through the PeopleSoft Internet Architecture is part of a

    component. When you navigate to a particular content

    reference or menu item to access a particular page, the

    Component Processor is what performs all of the activity

    including executing SQL, PeopleCode, loading the

    component/page, and filling the buffer with the necessary

    data that was requested. More importantly, all of these

    activities happen in a specific order.

    It is this overall process that every PeopleSoft developer

    and analyst needs to understand thoroughly. If you

    understand how the component processor works and how it

    allocates buffer space, than debugging, performance tuning,

    designing, and developing your PeopleSoft applications will

    be simple for you. However, if you miss this concept or

    dont fully understand it, your design and development

    process and your online performance will be inadequate. In

    addition, it will become more difficult for you to debug your

    applications without understanding the component processor.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    6

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    7/30

    Before we begin to discuss and dissect the component

    processor and buffer, it is important to understand the

    PeopleSoft Internet Architecture (PIA); especially the

    separation or partitioning of the data elements within a

    PeopleSoft application.

    A Review of the PeopleSoft Architecture

    When PeopleSoft was first designed, it was originally

    introduced as client server architecture. With the inception

    of version 6, PeopleSoft introduced the application server for

    the three tier architecture. Now, in recent versions of

    PeopleSoft starting with version 8 PeopleSoft introduced the

    PeopleSoft Internet architecture (PIA). In this new

    architecture, a web server was added and there is now no code

    on the client. This means that PeopleSoft is a 100% Internet

    based application.

    A typical installation will look like the following.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    Browser Web Server App Server

    RDBMS

    Batch

    Server

    7

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    8/30

    As you can see from this diagram a user using a browser will

    access a web server. The browser and the web server talk to

    each other via the HTTP Protocol. From here, the web server

    talks to the application server via the JOLT protocol. The

    application server communicates with the database via SQL.

    It is not important at this point to go into great detail on

    the components of the web server or the application server. I

    just want you to understand the overall architecture and the

    servers that are involved. For now, we are going to focus inon the database server where all of the data for PeopleSoft

    applications reside. This includes system data, application

    data, and the data components that are used to build record

    definitions, fields, pages, components.

    Meta-Data and Application Data

    PeopleSoft uses database tables to store information andattributes for all of the objects that make up a basic

    PeopleSoft application. This includes fields, record

    definitions, pages, components, menus, and many other types of

    objects. This is known as meta-data.

    The PeopleSoft architecture has always been driven by meta-

    data. For this reason, it is important to understand the make

    up of the different types or categories of database tables

    that are used within a PeopleSoft database.

    The three categories of tables are:

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    8

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    9/30

    1. System Catalog

    The system catalog is analogous to a table of contents for a

    book. The structure and names of the tables will vary

    depending on which RDBMS is used. However, the system catalog

    serves the same purpose in each RDBMS. It contains metadata

    that tracks objects that reside in the database. This is not

    the same as the metadata for PeopleSoft objects.

    2. PeopleTools tables

    These tables hold data about PeopleSoft application installed

    on the database. This includes tables that contain the

    definitions that make up an application, such as, Fields,Records, pages, components, SQL, and more. When you create a

    field in application designer, it will have many attributes

    that are associated with it. For example, the field will have

    a label, a type, etc. All of this information is stored as

    metadata in database tables. The main parent table for fields

    is named PSFIELDDEFN.

    The naming convention for PeopleTools tables is PS****. For

    example, PSFIELDDEFN, PSRECDEFN, and PSOPRDEFN.

    3. Application data tables

    These database tables contain the data that is entered into

    the system for use by your organization. The tables are

    specific to a given application and the structure will depend

    on the applications that are installed or by the definitionsyou create in customizations.

    For example supply chain management applications use tables

    to store inventory information. These tables might contain

    items for parts. These are usually stored in tables such as

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    9

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    10/30

    PS_ITEM_MASTER. The Human Resource applications have tables

    to hold information about employees. An example of an HR

    application data table is PS_JOB or PS_PERSONAL_DATA.

    The naming convention for application data tables is PS_****.

    For example, PS_JOB, PS_EMPLOYEES, PS_PERSONAL_DATA, etc.

    Accessing PeopleSoft Applications

    Now that we have reviewed the PIA and dissected the database

    tables into three different categories, it will be easier to

    understand how the component processor builds a page and

    places data into the buffer.

    Lets take the example of a user accessing a PeopleSoft

    application. When a user navigates using a browser, a number

    of things happen behind the scenes.

    The first set of actions has to do with the PeopleTools

    tables. All of the raw data that is required to assemble the

    page is contained in the PeopleTools tables. This includes

    definitions of the component, page, fields, record

    definitions, navigation, and possibly other elements. The

    component processor will need to gather all of the metadata

    regarding the application and pass it to the application

    server.

    Because we are dealing with a 100% internet based application,

    there is no code on the client desktop. So when a user clicks

    on a content reference that point to a component where the

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    10

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    11/30

    page resides, the web server will make the call to the

    application server from a java servlet. This call is made to

    the application server over the JOLT protocol. The application

    server, through a set of services, will issue SQL commands to

    the database that will retrieve the metadata. Basically, this

    data is returned to the application server, where it will be

    loaded into memory (or the component buffer) and used to

    assemble the necessary HTML to display to the user via the

    browser. Once the HTML is assembled, it is sent to the web

    server.

    The application server will also issue SQL statements to thedatabase to retrieve the specific application data that is

    based on the high level key value that the user keyed into the

    search page. This data is retrieved by the component

    processor and loaded into the component buffer on the

    application server. There is a precise manner in which all of

    this data is loaded into the buffer, and we will discuss this

    in detail in another chapter.

    Application Server Processes

    There are dozens of processes or services that run on the

    application server and perform all of this work. PSAPPSRV is

    just one of these services that takes the PeopleTools data and

    application data and assembles it into a HTML for display.

    Tuxedo manages the multiple connections from the applicationserver to the database. JOLT is a java based communication

    protocol. The HTML is then sent to the web server.

    Individual programs manage the state of each user session

    including a buffer that allows the use of the browser back

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    11

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    12/30

    button. It is these servlets that actually pass HTML to web

    services for display. It is at this point that the user will

    see the page they requested with the data filled in. However,

    the data is actually stored in component buffer and not on the

    web server or browser.

    This is just a high level view of what happens when a user

    requests to access a page/component. There are many specific

    steps that occur in specific order. This order is important

    to understand, especially as it pertains to programming

    PeopleCode.

    In the next several sections, we are going to review the

    sequence of events and the order of those events in detail.

    In addition we will review the exact order of how the

    Component Processor executes the PeopleCode programs in each

    PeopleCode event. And finally we will discuss what gets

    loaded into the component buffer and how the component

    processor allocates buffers and parses through occurs levels.

    The Component Processor

    The Component Processor is the PeopleTools runtime engine that

    controls processing of an application from the time that a

    user requests a component from an application menu until the

    database is updated and processing of the component is

    complete.

    We had a brief example in the previous section that discussed

    what happens when a user navigates to a content reference and

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    12

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    13/30

    accesses a PeopleSoft application. This example was discussed

    at a very high level. We will now discuss this in more detail

    Before a user selects a component by clicking a content

    reference, the system is in reset state. This means that

    there is currently no component being displayed. The Component

    Processor does not begin its flow of execution until a user

    selects a component from a PeopleSoft menu.

    Once the user selects a component, the Component Processor

    does the following:

    Builds and displays the search page so the user can

    select a high level key to retrieve the data.

    Performs search processing, where it will retrieve and

    save the search key values that were selected for the

    component.

    Makes calls to the database to retrieve the metadata that

    is needed to build the component.

    Builds the component, including all of its pages, fields,

    PeopleCode programs, and data, creating buffers for the

    component data.

    Performs any additional processing for the component or

    the page. (We will discuss this in more detail in the

    section on the Component Buffer)

    Displays the component and waits for user action.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    13

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    14/30

    This can be illustrated in detail the following flowchart

    PeopleCode and the Component Processor

    Almost every application contains PeopleCode programs. These

    programs are executed or triggered at specific times by the

    component processor. In the last section, we discussed what

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    14

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    15/30

    the Component Processor does when a user selects a component.

    We mentioned search dialogue, search processing, building the

    page, etc. All of these have underlying record definitions

    behind them. This is usually where the PeopleCode programming

    logic for the application is stored. PeopleCode can be

    associated with a PeopleCode record field, a component record,

    and many other items. However, PeopleCode is mostly associated

    with a Record field.

    PeopleCode events are initiated at particular times, in

    particular sequences, during the course of the Component

    Processors flow of execution. When an event is initiated, ittriggers PeopleCode programs on specific objects. There are a

    set of specific events where PeopleCode can be placed. The

    PeopleCode within these events are triggered by the component

    processor in a specific order. There are certain events that

    are triggered before the component/page is displayed to the

    user. And, there are events that are triggered after the

    component is displayed and when a user performs a specific

    action.

    PeopleCode Events

    Every PeopleCode program is associated with a PeopleCode

    event, and is often referred to by that name, such as RowInit

    PeopleCode or FieldChange PeopleCode. These programs are

    accessible from, and associated with, different items. The

    following events can contain PeopleCode programs.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    15

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    16/30

    Record Field Events Component Record

    Field Events

    Component Record

    Events

    Component Events Page

    Events

    Menu Events

    FieldChange FieldDefault

    FieldEdit

    FieldFormula

    PrePopup

    RowDelete

    RowInit

    RowInsert

    RowSelect

    SaveEdit

    SavePostChg

    SavePreChg

    SearchInit

    SearchSave

    Workflow

    FieldChange FieldDefault

    FieldEdit

    PrePopup

    RowDelete RowInit

    RowInsert

    RowSelect

    SaveEdit

    SavePostChg

    SavePreChg

    SearchInit

    SearchSave

    PostBuild PreBuild

    SavePostChg

    SavePreChg

    Workflow

    Activate ItemSelected

    The Component and Triggering PeopleCodeIn PeopleSoft, the component is the representation of a

    transaction. Everything revolves around or is contained within

    the component. Therefore, any PeopleCode that is associated

    with a transaction or an application should reside in events

    associated with the component at one level or another. If you

    have a specific PeopleCode program that you want to be

    executed every time a field is changed, then the code should

    be at the record field level. If you have a specific

    PeopleCode program that you want to have executed every time a

    person presses the save button, then the code should be on the

    SaveEdit event of the primary record field.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    16

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    17/30

    Lets consider the process of accessing a component to see

    when all the types of events are going to get triggered.

    1. The user selects a content reference / component from the

    menu to run a specific component in a certain action. A

    component can have different actions associated with them.

    They are:

    Add

    Update/Display

    Update/Display All

    Correction

    2. The component that is selected by the user will contain the

    search record for the action in which the user has asked the

    system to run.

    3. The search page is created online with the keys and

    alternate keys displayed for entry, but before the user can

    enter any data, the first event of PeopleCode activates.

    SearchInit:The SearchInit event is generated just

    before a search, add, or data-entry dialog box is

    displayed. It triggers the PeopleCode in the search

    key fields of the search record so that you can

    control the processing before a user enters a value

    into the search key field.

    4. After SearchInit, the user is able to interact with the

    search page to search for records and select the high level

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    17

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    18/30

    key that they wish to process. Upon clicking OK in this search

    page, the next event becomes active.

    SearchSave: The PeopleCode in SearchSave is executed

    for all search key fields on a search, add, or data-

    entry dialog box after a user clicks Search.

    Note. This event, and all its associated PeopleCode,

    is not initiated if run from a component interface

    5. Now, the main page of the component, as requested from the

    menu, is now being accessed. However, before the page is

    visible to the user, each row of data that is to be loaded

    onto the page is validated by the code contained in the

    RowSelect event.

    RowSelect: The PeopleCode in this eventis initiated

    at the beginning of the component build process in any

    of the update action modes.

    6. The page is now filled with data from the high level key

    that was chosen on the search page. However, the processor is

    not yet ready for user input. A series of events must launch

    for each row of data already loaded into the page. For each

    row of data loaded into the page, the following events get

    triggered.

    FieldDefault: This event enables you to

    programmatically set fields to default values when

    they are initially displayed. It only gets triggered

    if

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    18

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    19/30

    o The page field is still blank after applying any

    default value specified in the record field

    properties.

    o This is true if there is no default specified, ifa null value is specified, or if a 0 is specified

    for a numeric field.

    o The field has a FieldDefault PeopleCode program

    Field Formula: This event is used to store functions.

    It is highly recommended not to place any code in this

    event for a record that is used within a component.

    Rather, use it on FUNCLIB records.

    RowInit: The PeopleCode in this event is initiated the

    first time that the Component Processor encounters a

    row of data. IUse it to set the initial state of

    component controls.

    Each one of these events runs, in order, on all rows of data

    within the page. Therefore, it is extremely important that

    you ensure that the code you place in these events are

    absolutely necessary. Placing the wrong kind of PeopleCode in

    these events can cause serious performance problems.

    7. At this point the page is displayed to the user and is

    ready and waiting for the user to take a specific action.

    If the user inserts a new row of data on a page (only for

    occurs levels 1 through 3), then the following PeopleCode

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    19

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    20/30

    events run for all the fields on the record that is within the

    level where the ADD was performed. If the insert was done on

    level 2, then only the PeopleCode events on the record

    definitions contained within level 2 are activated. The

    PeopleCode events within the record definition on levels 0 or

    1 are not activated.

    RowInsertFieldDefaultFieldFormula

    If the user deletes a row of data on a level 1 through 3

    scroll area, then the following PeopleCode events run for the

    row deleted and then for all the rows that are left within the

    level where the delete occurred.

    RowDeleteFieldDefaultFieldFormula

    The last step the user can take is to save the page. The save

    process runs another set of PeopleCode events, as listedbelow.

    SaveEdit: The PeopleCode in this event is triggered

    whenever a user attempts to save the component. It is

    usually used to validate the consistency of data in

    component fields.

    SavePreChg: The PeopleCode in this eventis initiated

    after SaveEdit completes without errors. SavePreChange

    PeopleCode provides one final opportunity to manipulate

    data before the system updates the database.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    20

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    21/30

    Workflow: Only PeopleCode related to workflow (such as

    TriggerBusinessEvent) should be in workflow programs.

    SavePostChg: The code in this event gets triggered after

    the Component Processor saves the data to the database.

    This event is usually used to update data that is not in

    the component. This can be accomplished with a SQLEXEC.

    So, now you know the PeopleCode events and the exact order of

    how the component processor triggers these events. It is very

    important to understand the order when placing your PeopleCode

    programs in specific events. Placing your code in the wrong

    place could be detrimental to performance and could possibly

    corrupt data integrity.

    The Component Buffer

    As you saw in the last section, many different PeopleCode

    programs work together and it is very important to understand

    the exact order in which they will be executed. It isnecessary to identify within the component which PeopleCode

    program will be performed and which PeopleCode will not be

    performed.

    Every time you access a component, the component processor

    queries the database and moves relevant data from the database

    to the application server. The Component processor manages

    this data according to special rules. Therefore, your

    Component design has a crucial impact and it is extremely

    important to understand how the buffers are allocated and

    maintained by the component processor.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    21

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    22/30

    We learned in the last section that before a page can be

    displayed, all of the associated data for the entire component

    has to be brought into the memory buffer of the application

    server. Once the data is retrieved and brought into the

    component buffer, it can be manipulated by PeopleCode programs

    or directly by the user. Once the user saves the component

    all of the information in buffer will get saved to the

    database tables.

    Understanding Occurs Levels

    Before we get into the discussion on the Buffer Allocation

    process, I would like to first, talk briefly about the various

    occurs levels of a component. Occurs level is similar to the

    scroll areas or grids on a page and the level where they

    reside.

    Scroll occurs levels in the page definition allow PeopleSoft

    to maintain common key information for child record

    definitions. If the value of the common key is updated on the

    parent table, PeopleSoft automatically updates it on the child

    table.

    Every component has at least one level 0 record definition.

    There can only be one row of data for each level 0 record

    definition because scrolls begin at occurs level 1.

    The keys of the occurs level 1 record definition must include

    the same search keys as level 0, with at least one additional

    key. PeopleSoft allows only one primary record definition per

    scroll. The purpose of a scroll is to control input into a

    single SQL table. There can be more then one scroll on level

    1. Each scroll has it own primary record definition. The rows

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    22

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    23/30

    of data within one scroll are completely independent from the

    rows of data within another scroll at level 1.

    Additional occurs levels can be added to a component.

    The maximum possible value of an occurs level for a component

    is 3. Each Occurs Level is subordinate to the one above it.

    The Occurs Levels are managed by common keys between the

    tables using a parent/child relationship

    The Component Processor allocates temporary buffers on the

    application server to hold the application data for a

    component and retrieves all the data needed for the entirecomponent up front.

    Its important to understand the fields that the component

    processor retrieves and how they are arranged in the buffer.

    For PeopleCode to refer successfully to a page field online,

    the Component Processor must retrieve that field from the

    database.

    As a developer it is your job to ensure that the Component

    Processor retrieves all the data required. The component

    processor follows a simple set of rules for determining how

    data is retrieved and stored in memory. The performance of

    your online application will depend on how you create the

    component buffers, so it is extremely important that you

    understand this section.

    Rules for Buffer Allocation

    When a user chooses a search key from the search page, the

    component processor will build a set of SQL statements to

    retrieve data from the database and store it into the buffer.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    23

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    24/30

    The component processor uses a specific set of rules to do

    this.

    If a field from a record is referenced on a page, then all

    fields/columns from that record definition and all rows that

    are subordinate to the search key are retrieved into the

    component buffer.

    There are, however, a few exceptions to this rule. The first

    exception has to do with the data at level 0. If the only

    fields at level 0 are the search key and alternate search key,

    then the component processor will only retrieve those fieldsand not the entire row. However, if there is at least one

    field that is not a search field on the page at level 0, the

    component processor will retrieve the entire row and load it

    into the buffer.

    The second exception deals with related fields. If you have a

    related field on the page, the component processor will only

    retrieve that field from the database and place it in the

    buffer. It will not bring in any other columns or rows from

    the record definition associated with the related display.

    Other fields may also be retrieved. These fields consist of

    the following types of fields:

    Derived/Work Field

    Translate Table Field

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    24

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    25/30

    PeopleCode Programs and the Component Buffer

    It is crucial to know what fields get loaded into the

    component buffer; especially, when you are writing PeopleCode

    programs. Many times, PeopleCode programs will make reference

    to other fields and potentially other PeopleCode programs.

    However, if you attempt to access the field and/or PeopleCode

    program and it is not in the buffer, you will get an error.

    If an entire row of data was brought into the buffer, any

    PeopleCode program on any field event within that record

    definition may be accessed and executed. Here are a few other

    rules for PeopleCode and the buffer allocation.

    If derived/work fields are brought into the buffers, any

    PeopleCode on that specific field maybe performed.

    PeopleCode on the related/display record definition is

    not performed.

    Buffer Allocation Order

    The component processor is responsible for loading data into

    the buffer. This includes not only the application data, but

    it also includes the meta-data and more importantly the

    PeopleCode that is associated the record/fields on the page.

    The component buffer is located on the application server and

    is allocated and filled in a very precise approach.

    The component processor loads the buffer and the PeopleCode

    programs are executed in the following manner. Buffers are

    allocated and filled for the first row from the level 0

    record. Level 0 always has one row of data and it loads the

    fields according to the tab order on the page. If there is

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    25

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    26/30

    PeopleCode associated with any of the fields at level 0 they

    will get loaded and executed in the order that was discussed

    in the previous section.

    Depending on the design of your application, the component may

    have one or more scroll areas or levels. This means there

    could be a level 1 on the page. The level 1 record is

    subordinate to level 0, meaning that it is a child record of

    the level 0 record. Furthermore, there could be 1 or more

    level 1 record on the component. Remember, a component can

    contain multiple pages and each page could have a different

    level one record definition.The component processor will first fill only the first row of

    data for each level 1 record definition.

    Even if your level one record has over 100 rows associated

    with it, the component processor will only load the first row.

    If there is a related display field associated with your level

    1 record, it will also be loaded. Again, each field is loaded

    in the tab order on the page and any associated PeopleCode in

    an event on these fields will get executed in the proper

    order.

    If you remember, when you design / develop a page, you have

    the ability to have up to 4 occurs levels or scroll areas.

    These are:

    Level 0

    Level 1

    Level 2

    Level 3

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    26

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    27/30

    At this point, the component processor will work its way down

    through each occurs level. Once it loads the data from the

    first row of level one, it looks to see if there is a level 2.

    If there is it will load the first row of the level 2 record.

    If there is not a level 2 it will then load the remaining

    field rows at level one.

    Once it loads the first row of level 2, it looks to see if

    there is a level 3 row that is subordinate to itself. If

    there is it will load the rows. So basically, if the

    component processor retrieves all of the data that issubordinate to an occurs-level or when it cant find any more

    child record definitions, it will retrieve the next row of

    data at the current occurs-level. It will continue to work

    its way down through the occurs levels.

    Picture a page that has 3 scroll areas associated with it.

    There is a level 0, level 1, level 2 and a level 3.

    In the following diagram, I have illustrated how the component

    processor allocated the data that is stored in several

    different tables. In this example there are 4 rows in the

    child table, 3 rows in the grand-child table, and 1 row in the

    great grand-child record.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    27

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    28/30

    Notice, that I also labeled each row with a letter. I did

    this so that I can list out the exact order that the component

    processor will allocate and load the buffer. The order is as

    follows: A,B,F,I,G,C,D,H,E

    Application Performance and the Buffer

    Now that you understand how the component processor works and

    how it allocates and loads data into the buffer, you can see

    how the design of your application can have a tremendous

    effect on performance. Sometimes its advantageous to have a

    component with multiple pages, however, there are also

    situations that can cause your online performance of the

    overall component to slow down.

    When it comes to buffer allocation and processing of the

    component, there are two specific features that have a very

    high cost associated to them. For this reason, you should be

    judicious then using them. They are

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    28

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    29/30

    Nested Scroll Areas

    Table References

    Obviously, the more record definitions that you add to a

    component, the more work the component processor has to

    perform. Therefore, think through whether or not you really

    need the additional references, before you add them. Each

    time you add a record definition to a component, whether its

    in the form of a related display, or a field with PeopleCode,

    the component processor must follow all of its rules and

    allocate buffers for them. If it is at all possible, I highly

    advise you to use views as the primary record of scroll areas.

    Using views eliminates the need for related displays and can

    enhance PeopleCode efficiency.

    Writing extensive PeopleCode can sometimes cause performance

    issues, if not correctly written and placed in the proper

    location. For the best performance of your PeopleCode, you

    should try to place the code at the lowest level possible.Sometimes you are forced to place the code up a level due to

    operator actions. However, the lower the level, the easier and

    more straightforward the code can be written.

    Additionally, when you design your pages you should use as few

    nested scrolls as possible. Every time you access a component

    the component processor has to allocate buffers for every row

    of each subordinate table and scroll area. This requires more

    overhead and processing time than is necessary.

    Copyright DMT Solutions, Inc.www.DMTSolutions.com

    29

    http://www.dmtsolutions.com/http://www.dmtsolutions.com/
  • 7/28/2019 103211674 Understanding the Component Buffer

    30/30

    Summary

    This eBook provides you with the basic guidelines, methods,

    and information necessary for understanding the componentprocessor and how it utilizes the component buffer. There are

    many facets to designing and developing PeopleSoft

    applications. However, I believe that every developer should

    fully understand the component processor and the component

    buffer allocation methods. Whether you are just learning how

    to develop PeopleSoft applications, or have been developing

    for years, this information and guidelines will help you to

    design better performing PeopleSoft applications.

    PeopleSoft Resources

    The following is a list of websites and other resources for

    PeopleSoft information, and products to assist you in

    maximizing performance in your PeopleSoft environment.

    PeopleSoft Career - www.PeopleSoftCareer.com

    http://www.peoplesoftcareer.com/http://www.peoplesoftcareer.com/