PeopleSoft Component Interface – A Complete Guide for the New CI Developer

Agenda
 Introduction to Component Interface  Component Interface Architecture  Elements of Component Interfaces  Developing and Implementing CI‘s

 Understanding the Component Interface API
 Validate and set the Component Interface Security  Using the CI Tester  Using the Excel to Component Interface Utility  Programming CI in JAVA, C/C++, COM

2

Component Interface What is Component Interface?
Component = Group of PeopleSoft Pages i.e.., Personal Data pages or Job Data pages  ―A means to access the PeopleSoft application without using the PeopleSoft pages‖  A component interface is a PeopleTools object that you create in Application Designer. A set of application programming interfaces (APIs) that you can use to access and modify PeopleSoft database information programmatically.  Real-time access to the PeopleSoft data and business rules.  It exposes a PeopleSoft component for synchronous access from another application.

 External applications need not be concerned with the details of page structures and component definitions in order to access the underlying data and business logic through component interfaces.  Evolution of the Message Agent from version 7.5

3

component interfaces behave exactly the same as their online counterparts (their associated components). 4 .  However.  This means that PeopleCode events typically fire in the same order as the online case.Component Interface What is Component Interface?  In most cases. and so on. there are several exceptions to this behavior that relate both to PeopleCode processing and search dialog processing.

Component Interface Open Integration Framework 5 .

Component Interface Benefits  Access to all business logic  Delivered PeopleSoft logic  Your customizations Insulated from complexities of application  Data relationships  Data Integrity  Upgradeable PeopleTools object  Result: Saves Time & Money 6 .

Component Interface Architecture PeopleSoft Application Component Component Interface PeopleCode Component Search Keys PeopleCode Functions Fields and Scrolls Keys API Methods External Application COM (VB) C/C++ Properties and Collections 7 .

and the component interface API.  Component Interface API  Application programming interface for a Microsoft COM (Visual Basic) application and PeopleCode 8 . component interfaces.) There are three fundamental elements to the overall component interface architecture. However. unlike components. Components.  Component Interface  Exposed aspect of a component.  Components  One or more pages performing a business transaction that a component interface is associated with. component interfaces are readily accessible by internal and external applications and multiple component interfaces can reference the same component.Component Interface Architecture (contd.

Component Interface Elements of CI Every component interface has the following four main attributes  Component Interface Name  One Component can have many Component Interfaces  Keys  Properties and collections (fields and records)  Methods 9 .

 Standard properties are assigned automatically when a component interface is created. you can add. 10 . GetHistoryItems.)  Name  Each component interface requires a unique name. and EditHistoryItems.  User-defined properties map to record fields on the PeopleSoft component and are displayed in the PeopleSoft Application Designer. or change keys in PeopleSoft Application Designer.  The calling programs use the name of the component interface to access properties and methods.  Two types of properties: Standard and User-defined.  Examples : InteractiveMode. remove.  Standard properties can be set to true or false.Component Interface Elements of CI (contd.  Properties  Provide access to both component data and component interface settings.  Keys  Keys are special properties containing values that retrieve an instance (get keys) or a list of instances (find keys) of the component interface.  A property can correspond to a field or a scroll (collection).

 There are two main types of methods: standard and user-defined.Component Interface Elements of CI (contd. Save and Cancel methods.  Methods  A method is a function that performs a specific task on a component interface at runtime. Get.)  Collections  A component interface collection is a special type of property that corresponds to a scroll. 11 .  User-defined methods are created in PeopleSoft Application Designer to provide added functionality to the component interface. Example : Find.  Standard methods are those that are available for all component interfaces.  It contains fields and subordinate scrolls as defined in its underlying component.

Component Interface Definition 12 .

Component Interface Keys  Used to define the values that uniquely identify an Instance of the Component Interface  Three Types of CI Keys  GetKeys Maps to fields marked as search keys in the Components Search record  CreateKeys Generated in CI when the Use tab on the Component Properties dialog allows the Add action  Findkeys Maps to fields marked as both Alternate Search keys and Search Key in the Component Search Record 13 .

 Each alternate search key field produces a Find key. if it isn‘t already the basis of an existing key of the same type.  You can add any type of key based on a qualifying search key field in the component.)  Keys are created automatically when you create a component interface.  It has been deleted from the component. Valid Conditions for Modifying Keys  You can add or delete a Find key if it‘s based on an alternate search key field.  Each search key field produces a Get key and a Find key.  It is no longer designated as a list box item. 14 .  Component interface keys are based only on the search key fields and alternate search key fields that are designated as list box items in the search record of the underlying component.Component Interface Keys (contd.  Each search key field also produces a Create key if the underlying component allows Add mode.  You can delete any type of key if its underlying search key field meets one of these criteria:  It is no longer defined as a search key field.

Component Interface Keys (contd.) 15 .

Component Interface Keys (contd.) 16 .

instead of mapping to an individual field.  All the fields in the scroll are mapped to a property. A collection is a type of property—which points to a scroll.  A collection groups multiple fields in a scroll. It provides access to component data and component interface settings and status. Each property maps to a single field in the component interface‘s underlying component.  These properties are part of the collection.  Two Types of Component Interface  Standard Properties  User-Defined properties Collections  It is a group of properties that corresponds to a scroll.Component Interface Properties & Collections Properties  Properties are the individual data items (fields) that describe a component interface. 17 . it points to a scroll. its fields and its subordinate scrolls in the underlying component.

)  User-Defined Properties  User-defined properties come from a component interface‘s associated component.  They are the specific record fields that you choose to expose to an external system with the component interface. 18 .  Standard properties also exist for each collection within a component interface.Component Interface Properties & Collections (contd.  Standard Properties  Standard properties are common across all component interfaces and are assigned automatically when a component interface is created. and must be added manually.

) 19 .Component Interface Properties & Collections (contd.

Component Interface Properties & Collections (contd.) 20 .

 Two Types Methods  Standard Methods  User-Defines methods  Available on all component interfaces as well as each collection within a CI  Automatically generated upon the creation of CI 21 .Component Interface Methods  A method is a function that performs a specific task on a component interface at runtime.

Retrieves a particular instance of a component interface.  Each method maps to a single PeopleCode function. Returns ―True‖ on success. Equivalent to opening a new record in Add mode online.Performs a partial key search for a particular instance of a component interface. For example.  User-Defines methods – User-defined methods are those that you can create to meet the requirements of an individual component interface. These methods are written as Functions using Component Interface PeopleCode.  Create .  Application developer can write their own methods. 22 . suppose you wanted to be able to copy an instance of Component Interface data. and ―False‖ on failure.)  Standard Methods – Standard methods are those that are available on all component interfaces created as default with CI. and ―False‖ on failure.  Get .Creates a new instance of a component interface ( add data in the component). Equivalent to opening a record in Update/Display or Correction mode when online with a PeopleSoft application. Returns ―True‖ on success. and ―False‖ on failure.Component Interface Methods (contd. Returns ―True‖ on success.  Find .  A method is simply a PeopleCode function that you wish to make accessible through the component interface.

Component Interface Standard Methods 23 .

Component Interface Standard Methods (contd.  Standard Methods available for use with any collection  InsertItem  DeleteItem  Item  ItemByKeys  CurrentItem  CurrentItemNum 24 .  CopyRowsetDelta (from PeopleCode only) Enables you to copy only the changes created from the message data in your component interface.)  Standard Methods that can be called only from PeopleCode  CopyRowSet (from PeopleCode only) Enables you to copy rowsets created from the message data in your component interface.

 In addition to keys. a Component Interface is composed of properties and methods.  When you populate a Component Interface with data. as you would in a component. is created at runtime as a way to access the data specified by the Component Interface. or any other PeopleCode programs will be able to use Component Interfaces. application message subscription programs. These can be keys for getting an existing instance of the data or for creating a new instance of the data.Component Interface User Defined Methods  Those that you can create to meet the requirements of an individual component interface.  Application Engine programs.  Component Interface methods are functions that can be called to perform operations on a Component Interface. the first thing you fill out are its keys.  A method is simply a PeopleCode function that you wish to make accessible through the component interface  Each method maps to a single PeopleCode function  The Component Interface object. instantiated from a session object.  Component Interface properties provide access to the data in a component buffer. 25 .

Component Interface Developing & Implementing CI – Nine Steps
 Design  Define Fields  Record Definition  Build Record  Defines Pages  Define Components  Define the Component Interface  Link the Component to the Menu  Authorize User Access (Security)  Test your Component Interface Add individual objects, or groups of objects, to the component interface by dragging objects from the component view into the component interface view. All objects in the component view are part of the underlying component interface, and they are accessible through user-defined methods or through PeopleCode events on the component. However, only the objects in the component interface view will be exposed to the calling program at runtime.

26

Component Interface Working with CI Properties
 Properties that affect how the Component Interface is executed GetHistoryItems InteractiveMode  These properties must be set before the Component Interface is populated with data (that is, before you use the Get or Create method.)  GetHistoryItems lets you access the data in the Component Interface in a similar manner as if you were accessing a component in correction mode. If you don‘t set this property as True, it‘s as if you were accessing a component in update/display mode.  InteractiveMode causes the Component Interface to emulate an online component. For example, if you set a value for a field in a Component Interface and you have set InteractiveMode to True, then any FieldChange PeopleCode programs associated with that field will fire as soon as you set that value. It is suggested that, this mode be used only in testing and debugging the CI.
27

Component Interface Working with CI Properties (contd.)
 Properties that return information about the structure of the Component Interface  FindKeyInfoCollectioCreateKeyInfoCollection  FindKeyInfoCollection  GetKeyInfoCollection  PropertyInfoCollection  Every user defined property in a Component Interface definition can be used like a property on the object instantiated from that Component Interface at runtime. At runtime, you can use PeopleCode to assign a value to that property (field), or to access the value of that field.
&TESTCI.START_DT = "01/08/2008"; /* OR */ &STARTDATE = &TESTCI.START_DT;

28

 Add properties. or methods to the component interface.  Select the component on which this component interface will be based.Component Interface Creating & Working with a CI  To create a new component interface  Select File. collections.  The following are the usual actions that you perform with a Component Interface:  Create a new instance of data  Get an existing instance of data  Retrieve a list of instances of data 29 .  Set the security.  Select the Component Interface object type from the New dialog.  Test the component interface. New from the Application Designer menu.  Save the component interface.

Get() or Create() 5. Cancel() Pick a component from the collection 4.) Session Object 1. GetCompIntfc (name ) 2. Read Properties Write Properties Invoke Methods Save() 6. Set Keys Find() 3. 30 .Component Interface Creating & Working with a CI (contd. 7.

from a Visual Basic program.  Variables defined at Component and Global are only for Component Interface. that is. and so on.  Local ApiObject &TESTCI.  This object can be used anywhere you have PeopleCode. from COM and C/C++. For example. Application Engine PeopleCode. record field PeopleCode.  Scope of a Component Interface Object  A Component Interface can be instantiated from PeopleCode.Component Interface Working with a CI – Understanding the Delivered Code  Declaring a Component Interface Object  Component Interfaces are declared as type ApiObject. in message subscription PeopleCode. 31 .

BUSINESS_UNIT = "H01B". we are creating a new instance of data for the ORDER Component Interface. &TESTCI = &TESTSESSION.)  In this example.Create(). /* Key 3 */ &TESTCI. &TESTCI. This is having an Add mode with three keys. /* Key 2 */ &TESTCI. &TESTSESSION. &TESTSESSION = GetSession().LOCATION = "H10B6987". &TESTCI. Local ApiObject &TESTCI./* Other Properties*/ &TESTCI.GetCompIntfc(COMPINTFC. /* other Properties */ 32 .Component Interface Working with a CI – Understanding the Delivered Code (contd. "EXISTING". "".CUSTOMER = "John‘s Chicken Shack".INTERNAL_FLG = "Y".ORDER). Local ApiObject &TESTSESSION./* Key 1 */ &TESTCI.Connect(1. "". which is based on the ORDER_ISSUE_INV component. 0").ORDER_NO = "NEXT‘.

&COLL.BEGIN_DT} (90).Text. /* do error processing */ End-For. you will want to delete it from the PSMessages collection.Component Interface Working with a CI – Understanding the Delivered Code (contd.Item(&I). (1) 33 . As you correct each error.) If NOT(&TESTCI.PSMessages. if you specified the incorrect format for a date field of the Component Interface named ABS_HIST.DeleteAll().Save()) Then /* save didn‘t complete */ &COLL = &TESTSESSION. all errors will be logged to the PSMessages collection. For &I = 1 to &COLL.  For example. not just the first occurrence of an error. End-if.  If there are multiple errors. &TEXT = &ERROR. the Text property would contain the following string: Invalid Date {ABS_HIST.Count &ERROR = &COLL.

34 .Connect(1. "". &TESTCI. &TESTCI = &TESTSESSION. for the Update/Display mode.EMPLID= "8001". which is based on the EMPL_CHECKLIST component. 0). &TESTCI.Get(). Local ApiObject &TESTSESSION. you are getting an existing instance of data for the EMPL_CHECK_CI Component Interface.CHECKLIST_CD. &TESTSESSION. /* Get checklist Code */ &CHECKLIST_CD = &TESTCI.)  In this example.EFFDT = "01-01-1990". &TESTSESSION = GetSession().Component Interface Working with a CI – Understanding the Delivered Code (contd. "EXISTING". Local ApiObject &TESTCI. /* Set Effective date */ &TESTCI.EMPL_CHECK_CI). "".GetCompIntfc(COMPINTFC.

/* do error processing */ End-For.PSMessages.DeleteAll().  For example. For &I = 1 to &COLL. all errors will be logged to the PSMessages collection.) If NOT(&TESTCI.Component Interface Working with a CI – Understanding the Delivered Code (contd. &COLL.Save()) Then /* save didn‘t complete */ &COLL = &TESTSESSION.  If there are multiple errors. if you specified the incorrect format for a date field of the Component Interface named ABS_HIST. As you correct each error. (1) 35 .Text.Item(&I). End-if. not just the first occurrence of an error.BEGIN_DT} (90).Count &ERROR = &COLL. the Text property would contain the following string: Invalid Date {ABS_HIST. &TEXT = &ERROR. you will want to delete it from the PSMessages collection.

36 . you should validate a component interface that is already open in PeopleSoft Application Designer.  Select Tools.  As you change components or other related definitions.Component Interface Validating a CI  Open the component interface in PeopleSoft Application Designer.  Validation occurs automatically whenever you open a component interface in PeopleSoft Application Designer. Validate for Consistency from the PeopleSoft Application Designer menu to validate an open component interface.

Component Interface Working with a CI – Setting Security  Two ways to Secure Component Interfaces  Maintain Security • Can be used to restrict access to individual methods or entire Component Interface  Application Designer • To make individual property ‗Read Only‘ • To delete property from CI 37 .

Security for the component interface is provided through the PeopleSoft Internet Architecture pages.Component Interface Working with a CI – Setting Security (contd. Each individual method also needs to be provided security.)  After creating a component interface. you must set security for it. 38 .

 Click OK when you're done.  Set the access permission for each method.  To add another component interface to the list.  The Component Interface Permissions page appears. Security.  The Permission List component appears. click the Add button.  Select the permission list for which you want to set security. Permission Lists. 39 .  Access the Component Interfaces page.  Click Edit. You must grant full access to at least one method to make the component interface available for testing and other online use. Permissions & Roles.)  Through the browser login to PIA.  Select Full Access or No Access.Component Interface Working with a CI – Setting Security (contd. showing all of the methods (both standard and user-defined) in the component interface and their method access.  Press the Save button to save these settings. Select PeopleTools.  Select the component interface for which you want to set security.

or finding an instance of the component interface. This dialog box displays the keys (in the left-hand columns) for getting.  Enter the value in the right-hand column. creating.  Double-click the column to the right of any displayed keys. The data that is used for the test corresponds to the key values that you enter here. 40 .Component Interface Working with a CI – Using the CI Tester  Open the component interface in PeopleSoft Application Designer.  The Component Interface Tester search dialog box appears. The right-hand columns provide a place for you to enter sample key values for testing. Test Component Interface from the PeopleSoft Application Designer menu.  Select Tools.  Enter key values.

such as FieldChange PeopleCode) occurs for each set property. This differs from non-interactive mode.  Whether you select this option depends on how you expect a particular component interface to be used and what you are currently testing. By default. errors and properties are not updated until a method is run. Each property being set causes an immediate trip to the application server (or database server in two-tier mode). However.Component Interface Working with a CI – Using the CI Tester (contd.)  Specify whether to run in Interactive mode.  When in Interactive Mode. This means that edit processing (and other processing. in interactive mode the property is validated immediately. the property is not validated until you perform the save. In a real production system. Interactive Mode is selected in the component interface tester. For example. any action request occurs immediately. this parameter can significantly affect performance. if you set a property. but it makes little difference in the test component. in noninteractive mode. in which actions are often held and later sent in batches. In non-interactive mode. 41 .

After you click the Get Existing button. It retrieves one row from the database.Component Interface Working with a CI – Using the CI Tester (contd.  Clicking Get Existing is equivalent to opening a record in Update/Display or Correction mode online. Selecting Edit History Items enables editing and saving of history data.  Getting existing records for the test. These options are initially cleared.  Selecting Get History Items retrieves history data.)  Specify whether to get or edit history items. the Component Interface Tester dialog box appears. These options apply to effective-dated fields only and are equivalent to running in either Update/Display or Correction mode online. 42 .

this button is disabled. and calling the Get method. This is the same as calling the Find method through the Component Interface API. the Component Interface Tester dialog box appears. If your component does not support the Create method. You then can choose the specific instance by selecting and clicking the Get Selected button. followed by selecting a value from the Find results. If you do not enter a partial key before clicking Find.  Clicking Create New is equivalent to creating a new row in Add mode online. 43 . all key values in the database are returned (subject to the maximum count of 300.)  Getting existing records using partial keys. click the Find button.  Creating new records for the test.Component Interface Working with a CI – Using the CI Tester (contd. After you click the Create New button. the Component Interface Tester dialog box appears.  If you want to retrieve a partial key. setting the Get key. After you click the Get Selected button. just as when online). The Find Results dialog box appears.

 Retrieve history items. and collection methods.  With the component interface tester. custom. you first search for the component interface to test.  Test the standard.  To test the component interface. then you test it. you can:  Test the component interface in interactive mode. 44 .Component Interface Testing the CI  Tester can be used to test CI.

) 45 .Component Interface Testing the CI (contd.

warnings. Based upon results from saving the component interface. another DOM is created in the PeopleCode that returns success.Component Interface Excel the CI How to upload data from Excel into PeopleSoft using the Component Interface to execute business logic for each transaction ?  Use the Excel to Component Interface utility to upload data from Microsoft Excel into your PeopleSoft database. validating the data submitted against the business logic built into the PeopleSoft component.  Next a PeopleCode program parses the DOM structure and uses the component interface to create entries in the PeopleSoft database.  Microsoft Excel workbooks can be used as a template to create worksheets that are specific to the business logic that you need to use when you are uploading data to your PeopleSoft system. and/or errors to the Microsoft Excel document. and submits it to the PeopleSoft database. using component interfaces.  The code formats spreadsheet data into a PeopleSoft readable Document Object Model (DOM) structure.  The component interface executes all the necessary PeopleCode events and the field-level edits. 46 .

 Prompt and translate table values are validated when data is saved and submitted to the database through the Excel to Component Interface utility. but rely on logic at level 0 to load the level 1 collection. This different from the behavior on the page when prompts and translates are validated interactively.  Reduces processing time when loading data  Saves time when building the template  Components that have no keys at level 0. cannot be loaded by using the Excel to Component Interface utility.Component Interface Building a CI from the “Excel to CI” Utility  Fields that are not relevant for data input should not be exposed on the component interface. 47 .  Component interfaces that rely on CommitWork to save the data cannot be used in the Excel to Component Interface utility.

 ActiveX controls.Component Interface Building a CI from the “Excel to CI” Utility (contd.  Dynamic tree controls.  Functions that are ignored in a component interface call.  Performance Expectations  If the component has a complex user interface with many pages and scrolls.)  Testing the Component Interface  First Test the component interface using the tester as it enables you to troubleshoot any problems before running the component interface through the utility. the component interface generally will have a slower processing time.  Search dialog processing.  Transfers between components. including modal transfers.  PeopleCode Behavior and Limitations  PeopleCode events and functions that relate exclusively to the page interface and online processing cannot be used by component interfaces.  Menu PeopleCode and pop-up menus.  DoSave and DoSaveNow. 48 .

To launch the Excel to Component Interface utility. 8. Template page is a graphical representation of the component interface structure that you would be using to upload the data. Connect to the Database to Create a Template and Submit Data 7. Create a Template. The coversheet of the Excel to Component Interface utility workbook gives a brief overview of the process flow and functionality of the tool. Access the Staging and Submission tab to submit data.xls executable file in the PS_HOME\excel folder. Enter Connection Information 6. Grant Access to WEBLIB_SOAPTOCI 3. Enable Macros in Excel 4.Component Interface Getting Started with the “Excel to CI” Utility 1. 2. 5. 49 . Access the Data Input tab to enter data 9. you will need to locate the ExcelToCI.

) 50 .Component Interface Getting Started with the “Excel to CI” Utility (contd.

Component Interface Getting Started with the “Excel to CI” Utility (contd.) 51 .

) 52 .Component Interface Getting Started with the “Excel to CI” Utility (contd.

)  Data Input sheet enables you to enter data into the Excel to Component Interface utility so that it can be loaded to the database by using the component interface that you've selected.Component Interface Getting Started with the “Excel to CI” Utility (contd. 53 .  Field labels that appear on the Data Input sheet are those properties that you selected as input cells on the template  Data Input sheet is also used to correct data that failed to submit to the database.

) 54 .Component Interface Getting Started with the “Excel to CI” Utility (contd.

 The PeopleSoft application server and database.  APIs are in the form of *.  When deploying component interfaces on a local client machine or web server with Java bindings. create a component interface API. you must have:  The third party Java application.  The Java Virtual Machine (JVM) supplied with Sun Microsystems‘ Java Development Kit (JDK) found in the %PS_HOME%\JRE directory.Component Interface Programming Component Interfaces in Java  To access your component interface from a Java external application. which should be compiled into Java classes.java source code files. PeopleSoft Application Designer generates a template in the form of boilerplate Java code that you can adapt to your purposes.  To access a component interface through PeopleSoft APIs using Java. 55 .

)  Generating Java Template 56 .Component Interface Programming Component Interfaces in Java (contd.

Any PeopleCode associated with push buttons used on the page to add rows will not be invoked by the component interface when an insert is done.  Row Inserts If RowInserts have been disabled for a page. there are some important differences between component interfaces and components.  Email from a Component Interface To use a component interface to send email. However. you must take care when calling inserts against the corresponding component interface. use TriggerBusinessEvent PeopleCode event. Use MsgGet() instead. accessing a component interface is functionally equivalent to working with an online component.  WinMessage Unavailable You cannot use WinMessage in a component that will be used to build a component interface.  Related Display Related display fields are not available for use in a component interface as they are not held in the buffer context that the component interface uses. 57 .Component Interface Runtime Considerations  In many ways. not SendMail.

The error is logged in the PSMessages collection. COM or C++ applications should not create multiple. A component interface also should not call itself from a user-defined method. simultaneous instances of the same component interface. Check the value of both Save method and collection ErrorPending property to discover all errors.Component Interface Runtime Considerations (contd. the edit field value is reset back to its original value. either within a single procedure. running in interactive mode may reduce performance enough on some UNIX servers to produce a connection failure. 58 .)  Infinite Processing Loops A component interface should not call itself in any of the PeopleCode included within its component definition. and if a transaction sets a property to a value that isn't allowed in a prompt edit field.  UNIX Server Performance If you‘re using a component interface as part of a batch process in which thousands of rows are being inserted.  Hidden Edit Validation Errors If the InteractiveMode property is set to True. Prevent this by setting the InteractiveMode property to False. however. or in both a ―parent‖ and a ―child‖ procedure. the Save method runs without errors.  Multiple Instances of a Component Interface Because of potential memory conflicts. as this may result in an infinite loop of the CI.

They are:  WinMessage  CheckMenuItem/ UncheckMenuItem  EnableMenuItem/ DisableMenuItem  HideMenuItem  SetCursorPos  TransferPage  IsModalComponent  DoModalComponent  GetSelectedTreeNode  GetTreeNodeParent  RefreshTree  TreeDetailInNode  GetControl  DoSave  DoSaveNow  Gray/ Ungray 59 .Component Interface Runtime Considerations (contd.)  Some PeopleCode functions are ignored if they are called through a CI.

 Solution : Create a CI for jobcode table . 60 .  CI will take care all the validation while inserting rows for newly created jobcodes in jobcode table.Component Interface Examples  User need to upload multiple jobcode into jobcode_tbl which are newly created and it will take lot of time to manually insert each and every job code. Create a process which will read file where all the newly jobcode data will be present and load the data using CI which is newly created.

) Steps to follow:  Create a CI for Jobcode table  Name:CI_JOB_CODE_TBL  Open the application designer.  Click on the File->New>Component Interface. Following Screen is shown on clicking the OK button. Click on the Select 61 .Component Interface Examples (contd.  Enter Job_Code_TBL Component.

Component Interface Examples (contd. Following message box is shown after clicking "Select" which essentially asks whether all the default properties of component should ported to the interface or not  Click on Yes or No per your discretion. though 'Yes' will be better moving ahead.)  Choose a Component of whose interface you want to develop and click on "Select". 62 .

Component Interface Examples (contd. 63 .)  New Component Definition will be created with all the keys.

 Create a application Engine to read the file and load the data into Jobcode table using CI.)  Create a file layout to read the file. 64 .Component Interface Examples (contd.

&RSP).Name | ". REM &REC. &RECP. Else Return True. &MSGSET = &MYFIELD.EditError Then &MSGNUM = &MYFIELD.FieldCount &MYFIELD = &REC.GetRow(1). Function ImportSegment(&RS2 As Rowset. If &MYFIELD.MessageNumber. &REC. &RECP = &RSParent(1).GetRecord(@(&RecordName)). Local Record &REC2.DBRecordName.ExecuteEdits(%Edit_Required + %Edit_DateRange + %Edit_YesNo + %Edit_TranslateTable + %Edit_PromptTable + %Edit_OneZero). End-If. End-If. &LOGFILE. For &I = 1 To &RS2. If (EditRecord(&REC2)) Then &SQL1. End-If. If &REC. &RecordName = "RECORD. Local string &RecordName. &SQL1 = CreateSQL("%Insert(:1)").WriteLine("****Record:" | &REC. &REC2 = CreateRecord(@(&RecordName)).GetRecord(1). End-For. &L. For &L = 1 To &RS2. &MSGNUM. 65 .CopyFieldsTo(&REC2).IsEditError Then For &E = 1 To &REC.ChildCount &RS1 = &RS2. Field:" | &MYFIELD.ActiveRowCount &RS2(&I).MessageSetNumber.GetRow(&I). &RSP.GetRowset(&L). "")).Execute(&REC2)." | &RS2.GetRowset(&L). &LOGFILE. Local SQL &SQL1. &RSParent As Rowset) Local Rowset &RS1. &RS2(&I). End-Function. Local integer &E.ExecuteEdits(%Edit_Required + %Edit_DateRange + %Edit_YesNo + %Edit_OneZero). ImportSegment(&RS1.WriteLine("****" | MsgGet(&MSGSET. Return False.CopyFieldsTo(&RECP). Local integer &I.GetRow(&I).GetRecord(1). If (&RS1 <> Null) Then &RSP = &RSParent.GetField(&E).Name).Component Interface Code to read the file through file layout Function EditRecord(&REC As Record) Returns boolean. End-For.

ImportSegment(&RS1. &RS1 = &FILE1.SetFileLayout(FileLayout.ActiveRowCount > 0 Then &RSParent.Component Interface Code to read the file through file layout (contd. &RS).CI_TEST). End-If. &RS = CreateRowset(Record.txt". "a". Local integer &M. rem * PeopleCode to Import Data *. Local File &FILE1.GetRow(&I).ReadRowset(). &LOGFILE. %FilePath_Absolute). Local Rowset &RS1. For &L = 1 To &RS2. &RS1 = &FILE1. &SQL1 = CreateSQL("%Insert(:1)"). "r". rem *****************************************************************. "W". &FILE1.WriteRecord(&REC2). Local SQL &SQL1. While &RS1 <> Null.TEST). &FILE1.GetRowset(&L).GetRow(&I). End-Function. &RS1 = &FILE1. &LOGFILE. %FilePath_Absolute).ReadRowset(). End-If.WriteRowset(&RS). End-If. &LOGFILE = GetFile("C:\Documents and Settings\user1\Desktop\jobcode_err. If (&RS1 <> Null) Then &LOGFILE. &RS2. 66 . Else &LOGFILE.SetFileLayout(FileLayout. End-For.Close().CI_TEST). Local Record &REC1. End-For. rem *****************************************************************.) If &RSParent. &LOGFILE. &LOGFILE.csv".Close(). End-While.WriteLine("****Correct error in this record and delete all error messages").DeleteRow(1).WriteRowset(&RS1).ChildCount &RS1 = &RS2. &FILE1 = GetFile("C:\Documents and Settings\user1\Desktop\jobcode.CreateRowset().

67 . &sErrMsgSetNum = &oPSMessage. Local ApiObject &oJobcdTrnProgCollection. End-Function.Fields." | &sErrMsgNum | ") .DeleteAll(). &oJbcdCmpRt2Vw. rem ***** Delete the Messages from the collection *****. &oJbcdCmpRt3Vw.PSMessages. Local ApiObject &oJbcdCmpRt2VwCollection. Function errorHandler() Local ApiObject &oPSMessageCollection. &sErrType. You need to replace all references to '[*]' OR default values with references to PeopleCode variables and/or a Rec." | &sErrMsgText).Text. &oPSMessage. &oSetJobBuVw. &oPSMessageCollection = &oSession. Local string &sErrMsgSetNum. Local ApiObject &oCollJobcodeTblCollection. &sErrMsgNum = &oPSMessage. For &i = 1 To &oPSMessageCollection. &fileLog. &sErrMsgText. Local ApiObject &oSession. &oPSMessageCollection. End-For.WriteLine(&sErrType | " (" | &sErrMsgSetNum | ".Component Interface Code To load data through CI /* ===> This is a dynamically generated PeopleCode template to be used only as a helper to the application developer. &oJobcodeTblBra. &sErrMsgNum. &oCiJobCodeTbl. Local ApiObject &oJbcdCmpRt3VwCollection. Local ApiObject &oJobcodeTblBraCollection. Local ApiObject &oSetJobBuVwCollection. &sErrMsgText = &oPSMessage.Count &oPSMessage = &oPSMessageCollection.Item(&i). &oCollJobcodeTbl. Local number &i.MessageNumber. &oJobcdTrnProg.MessageSetNumber. */ Local File &fileLog.

activerowcount &REC1 = &RS. &fileLog = GetFile("C:\Temp\CI_JOB_CODE_TBL.GetField(Field.JOBCODE).Value. &oSession.Value.GetField(Field. rem ***** Set the PeopleSoft Session Error Message Mode *****.Value.getrecord(Record.Component Interface Code To load data through CI (contd.STD_HOURS).log". rem ***** Get the Component Interface *****.GetField(Field. rem ***** 0 . 0. &RS = CreateRowset(Record.DESCR).Message Box only *****. For &i = 1 To &RS. &status = &REC1. rem ***** 3 .WriteLine("Begin").Value.Value.Value.PSMessage Collection only (default) *****.) try rem ***** Set the Log File *****.CI_JOB_CODE_TBL).GetField(Field.fill(""). If &oCiJobCodeTbl = Null Then errorHandler().EFF_STATUS). rem ***** Get current PeopleSoft Session *****. "a". &effdt = &REC1. %FilePath_Absolute). &oCiJobCodeTbl = &oSession. rem ***** 1 .COMP_FREQUENCY). throw CreateException(0. &descrshort = &REC1. &manager_level = &REC1. &comp_frequency = &REC1. 68 .Value.PSMessagesMode = 1.Value.GetField(Field.None *****. &fileLog. &setid = &REC1.GetField(Field. "w". "GetCompIntfc failed").Value. &std_hrs = &REC1.Both collection and message box *****.MANAGER_LEVEL).GetField(Field. rem ***** 2 . &jobcode = &REC1.EFFDT).GetCompIntfc(CompIntfc. End-If.DESCRSHORT).TEST).GetRow(&i). &oSession = %Session. &RS. &descr = &REC1.GetField(Field.GetField(Field.SETID).TEST).

*****.EditHistoryItems = False. End-If.Create() Then rem ***** Unable to Create Component Interface for the Add keys provided. rem ***** Execute Create ******. End-If.InteractiveMode = False. &oSetJobBuVwCollection = &oCiJobCodeTbl. rem ***** Set Component Interface Get/Create Keys *****.KEYPROP_EFFDT = " | &oCollJobcodeTbl. Local integer &i113. &fileLog. 0. rem errorHandler(). If Not &oCiJobCodeTbl.Get() Then rem ***** No rows exist for the specified keys. &oCiJobCodeTbl. Local integer &i111.WriteLine("&oCiJobCodeTbl.Item(&i111). &oCollJobcodeTblCollection = &oCiJobCodeTbl. &oCiJobCodeTbl. rem ***** Execute Get *****. &oCollJobcodeTbl. For &i111 = 1 To &oSetJobBuVwCollection.KEYPROP_EFFDT).Parent: PS_ROOT Collection *****. 69 . End-For.Count.KEYPROP_SETID = &setid" | &setid). &fileLog.Parent: PS_ROOT Collection *****.KEYPROP_JOBCODE" | &jobcode). If Not &oCiJobCodeTbl.KEYPROP_JOBCODE = &jobcode.KEYPROP_SETID = &setid. throw CreateException(0. &fileLog. &oCiJobCodeTbl.SET_JOB_BU_VW.) rem ***** Set the Component Interface Mode *****. "Create failed").WriteLine("&oCiJobCodeTbl.WriteLine("&oCollJobcodeTbl. &fileLog. &oCiJobCodeTbl. &oSetJobBuVw = &oSetJobBuVwCollection.GetHistoryItems = True. rem ***** Begin: Get/Set Component Interface Properties *****.WriteLine("&oCiJobCodeTbl. rem ***** Set/Get COLL_JOBCODE_TBL Collection Field Properties -. *****. "Get failed").KEYPROP_JOBCODE" | &jobcode). rem throw CreateException(0.COLL_JOBCODE_TBL.KEYPROP_SETID = &setid" | &setid). &oCollJobcodeTbl = &oCollJobcodeTblCollection.Count. &fileLog.Item(&i113). 0.WriteLine("&oCiJobCodeTbl. &oCiJobCodeTbl. For &i113 = 1 To &oCollJobcodeTblCollection. rem ***** Set/Get SET_JOB_BU_VW Collection Field Properties -.Component Interface Code To load data through CI (contd. errorHandler().KEYPROP_EFFDT = &effdt.

End-For. catch Exception &ex rem Handle the exception. End-If. errorHandler(). &fileLog.WriteLine("&oCollJobcodeTbl. &fileLog. &fileLog.PROP_DESCR = " | &oCollJobcodeTbl.PROP_EFF_STATUS = &status. rem ***** Execute Cancel *****.PROP_MANAGER_LEVEL).ToString()). 70 .Cancel() Then.Save() Then. 0.PROP_MANAGER_LEVEL = " | &oCollJobcodeTbl.WriteLine("&oCollJobcodeTbl. &fileLog.Close().) &fileLog. end-try. throw CreateException(0. &oCollJobcodeTbl.PROP_COMP_FREQUENCY = &comp_frequency. &fileLog.Component Interface Code To load data through CI (contd. &oCollJobcodeTbl.WriteLine("&oCollJobcodeTbl. &oCollJobcodeTbl. "Cancel failed"). "Save failed"). &oCollJobcodeTbl. If Not &oCiJobCodeTbl. &fileLog.PROP_EFF_STATUS). &fileLog.PROP_DESCR).PROP_MANAGER_LEVEL = &manager_level.PROP_DESCRSHORT).PROP_DESCRSHORT = &descrshort. &fileLog. &oCollJobcodeTbl.WriteLine("&oCollJobcodeTbl. 0.WriteLine("&oCollJobcodeTbl.WriteLine("&oCollJobcodeTbl. throw CreateException(0.PROP_COMP_FREQUENCY = " | &oCollJobcodeTbl. rem ***** End: Get/Set Component Interface Properties *****. errorHandler().PROP_STD_HOURS).WriteLine("End"). End-For.WriteLine(&ex. If Not &oCiJobCodeTbl.PROP_STD_HOURS = &std_hrs.PROP_COMP_FREQUENCY). End-If. &oCollJobcodeTbl.PROP_DESCRSHORT = " | &oCollJobcodeTbl. rem ***** Execute Save *****.PROP_STD_HOURS = " | &oCollJobcodeTbl.PROP_DESCR = &descr.PROP_EFF_STATUS = " | &oCollJobcodeTbl.

Component Interface Execution Steps (for the example)  Create a data file csv.  Run the application engine. The application engine willl load the jobcodes created. 71 .

Create a process which will read the data from file and upload data through CI. Create a CI for job data component to upload the data. 72 . Create a file layout to read the data.Component Interface Assignment  Load the job data for the existing employees through component interface .  Test file : Emplid Effdt Empl_rcd Action Action Reason 49588 49588 07/01/2011 07/01/2011 0 0 DTA PAY SUP APR Hints : Create a csv file using the format mentioned in the test file to upload the data.

We have experience in managing ERP applications as well as in providing high value services around packaged enterprise applications such as PeopleSoft and Oracle. Our experience in the business process outsourcing area fully extends our services footprint to provide end to end enterprise wide solutions. See www.com About SOAIS SOAIS is a provider of Enterprise IT and Process outsourcing solutions. 73 .com click on “Ask the Expert” link or send an email to solutions@soais.soais.You can send queries or provide feedback on this solution at http://www.soais.com for information. Since its inception SOAIS has expanded at a tremendous pace and has garnered customers from both midmarket segment and Fortune 100 companies.

Sign up to vote on this title
UsefulNot useful