PeopleSoft - Component Interface

Prasad Raju. G

10/17/2010

© 2008 IBM Corporation

IBM Global Business Services

Component Interface 

A component interface is a PeopleTools object that you create in Application Designer. 

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.

2

| 10/17/2010

© Copyright IBM Corporation 2008

IBM Global Business Services

Component Interface 

A Component Interface maps to one, and only one, PeopleSoft component.  The Component Interface object, instantiated from a session object, is created at runtime as a way to access the data specified by the Component Interface.  When you instantiate a Component Interface object:
-

All the PeopleCode programs associated with the record fields, pages, component AND the runtime component processor still perform all of the work they do in the online environment.

3

| 10/17/2010

© Copyright IBM Corporation 2008

 In addition to keys. a Component Interface is composed of properties and methods. application message subscription programs.IBM Global Business Services Component Interface  Application Engine programs.  When you populate a Component Interface with data. These can be keys for getting an existing instance of the data or for creating a new instance of the data. the first thing you fill out are its keys. Component Interface methods are functions that can be called to perform operations on a Component Interface. - Component Interface properties provide access to the data in a component buffer. 4 | 10/17/2010 © Copyright IBM Corporation 2008 . as you would in a component. or any other PeopleCode programs will be able to use Component Interfaces.

 PeopleSoft components can be accessed from the following applications using Component Interface: - Microsoft¶s Component Object Model (COM) C/C++ shared libraries Java PeopleCode 5 | 10/17/2010 © Copyright IBM Corporation 2008 . and are the focal points for externalizing access to existing PeopleSoft components.IBM Global Business Services Component Interface  Component Interface Classes - - Component Interfaces are an evolution of the Message Agent. They provide real-time synchronous access to the PeopleSoft business rules and data associated with a component outside the PeopleSoft online system.

 This means that PeopleCode events typically fire in the same order as the online case. and so on. 6 | 10/17/2010 © Copyright IBM Corporation 2008 .  However. component interfaces behave exactly the same as their online counterparts (their associated components). there are several exceptions to this behavior that relate both to PeopleCode processing and search dialog processing.IBM Global Business Services Component Interface  In most cases.

IBM Global Business Services CI Elements 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 Component Interface Architecture 7 | 10/17/2010 © Copyright IBM Corporation 2008 .

 Component Interface .Exposed aspect of a component.Application programming interface for a Microsoft COM (Visual Basic) application and PeopleCode 8 | 10/17/2010 © Copyright IBM Corporation 2008 . component interfaces are readily accessible by internal and external applications and multiple component interfaces can reference the same component.IBM Global Business Services Elements of CI  There are three fundamental elements to the overall component interface architecture . component interfaces.One or more pages performing a business transaction that a component interface is associated with.  Component Interface API . and the component interface API. unlike components.  Components . However.Components.

Methods 9 | 10/17/2010 © Copyright IBM Corporation 2008 .Keys .Properties and Collections .Component Interface Name .IBM Global Business Services Attributes of CI  Attributes of a Component Interface  Every component interface has the following four main attributes: .

component interface keys are created automatically based on the associated component¶s search record  A component interface can have three types of keys: - Get Keys :  Required Keys for the component - Create Keys :  If the component has an Add action then Create keys are generated for the component interface automatically - Find keys  These map to fields marked as both Alt and Srch in the component search record. 10 | 10/17/2010 © Copyright IBM Corporation 2008 .IBM Global Business Services Keys for CI  Keys define the values that uniquely identify an instance of a component interface. You may remove Find Keys that you do not wish to make available for searching. - When you create a new component interface.

and must be added manually. Each property maps to a single field in the component interface¶s underlying component.  Standard Properties - - Standard properties are common across all component interfaces and are assigned automatically when a component interface is created. A collection is a type of property²which points to a scroll. 11 | 10/17/2010 © Copyright IBM Corporation 2008 . it points to a scroll.IBM Global Business Services CI : Properties & Collections  Properties and Collections - - Properties are the individual data items (fields) that describe a component interface.  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. Standard properties also exist for each collection within a component interface. instead of mapping to an individual field.

 FindKeyInfoCollection - Returns a set of items that describes the Find keys.  GetKeyInfoCollection - Returns a set of items that describes the Get keys.IBM Global Business Services CI : Standard Properties  CreateKeyInfoCollection - Returns a set of items that describes the Create keys. 12 | 10/17/2010 © Copyright IBM Corporation 2008 .  PropertyInfoCollection - Returns a set of items that describes properties.

IBM Global Business Services Collection & DataRow  Collection - Count  Returns the number of items in a collection  DataRow - ItemNum  Returns the position of the row within the collection of a DataRow. 13 | 10/17/2010 © Copyright IBM Corporation 2008 .

there are two main types of methods: user-defined methods and standard methods. Likewise. - For example. you can use methods to save or create a new purchase order. you may use a method to approve a specific purchase order. if you are working with a purchase order component interface.IBM Global Business Services Methods  A method is an object that performs a very specific function on a component interface at runtime.  For each component interface.  As with component interface properties. numerous methods are available. 14 | 10/17/2010 © Copyright IBM Corporation 2008 .

Each method maps to a single PeopleCode function. These methods are written as Functions using ComponentInterface PeopleCode. A method is simply a PeopleCode function that you wish to make accessible through the component interface. For example. 15 | 10/17/2010 © Copyright IBM Corporation 2008 . Application developer can write their own methods.IBM Global Business Services User Defined Methods  User-Defined Methods - - - User-defined methods are those that you can create to meet the requirements of an individual component interface. suppose you wanted to be able to copy an instance of Component Interface data.

and ³False´ on failure. Equivalent to opening a new record in Add mode online. - Cancel  Backs out of the current component interface. Equivalent to opening a record in Update/Display or Correction mode when online with a PeopleSoft application. - Find  Performs a partial key search for a particular instance of a component interface. Equivalent to clicking the Save button in the online system.Equivalent to clicking the Return to Search button online. - Save  Saves an instance of a component interface. Returns ³True´ on success. Returns ³True´ on success. and ³False´ on failure. canceling any changes made since the last save.IBM Global Business Services Standard Methods  Standard methods are those that are available on all component interfaces created as default with CI. - Get  Retrieves a particular instance of a component interface. Returns ³True´ on success. - Create  Creates a new instance of a component interface ( add data in the component). 16 | 10/17/2010 © Copyright IBM Corporation 2008 . and ³False´ on failure.

IBM Global Business Services CI : standard methods  CopyRowset (from PeopleCode only) - Enables you to copy rowsets created from the message data in your component interface.  CopyRowsetDelta (from PeopleCode only) - Enables you to copy only the changes created from the message data in your component interface. 17 | 10/17/2010 © Copyright IBM Corporation 2008 .

Equivalent to pressing F7 to insert a new row when online. It takes the item number as a parameter.  ItemByKeys(keys) - Identifies and finds a specific item based on keys. and follows the same conventions for executing business rules (PeopleCode) as the online system. The keys will vary according to the design of the collection.  Item(Index) - Takes an item number as a parameter. 18 | 10/17/2010 © Copyright IBM Corporation 2008 . and returns the specified row in the collection.IBM Global Business Services Data Collection Methods  InsertItem(Index) - Inserts a new item.

.

to the component interface by dragging objects from the component view into the component interface view.  However.IBM Global Business Services Component Interface  Add individual objects. 20 | 10/17/2010 © Copyright IBM Corporation 2008 . or groups of objects.  All objects in the component view are part of the underlying component interface. only the objects in the component interface view will be exposed to the calling program at runtime. and they are accessible through user-defined methods or through PeopleCode events on the component.

before you use the Get or Create method.IBM Global Business Services Accessing CI Properties  Properties that affect how the Component Interface is   GetHistoryItems InteractiveMode executed  These properties must be set before the Component Interface is populated with data (that is.  21 | 10/17/2010 © Copyright IBM Corporation 2008 . If you don¶t set this property as True.) GetHistoryItems lets you access the data in the Component Interface in a similar manner as if you were accessing a component in correction mode. it¶s as if you were accessing a component in update/display mode.

then any FieldChange PeopleCode programs associated with that field will fire as soon as you set that value. For example. if you set a value for a field in a Component Interface and you have set InteractiveMode to True.IBM Global Business Services Accessing CI Properties  InteractiveMode causes the Component Interface to emulate an online component.  Properties that return information about the structure of the Component Interface - CreateKeyInfoCollection FindKeyInfoCollection GetKeyInfoCollection PropertyInfoCollection 22 | 10/17/2010 © Copyright IBM Corporation 2008 .

or to access the value of that field. 23 | 10/17/2010 © Copyright IBM Corporation 2008 .RETURN_DT = "05/05/2000". At runtime. &MYCI.RETURN_DT.IBM Global Business Services Accessing CI: User Defined Props  Accessing User Defined Component Interface Properties - - 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. you can use PeopleCode to assign a value to that property (field). /* OR */ &DATE = &MYCI.

collections. Set the security. or methods to the component interface. Select the component on which this component interface will be based. New from the Application Designer menu. Select the Component Interface object type from the New dialog. Add properties. Save the component interface. 24 | 10/17/2010 © Copyright IBM Corporation 2008 . Test the component interface.IBM Global Business Services Creating a CI  To create a new component interface - Select File.

IBM Global Business Services Implementing CI  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 25 | 10/17/2010 © Copyright IBM Corporation 2008 .

© Copyright IBM Corporation 2008 . Set Keys Find() 3. Cancel() Pick a component from the collection 4. Read Properties Write Properties Invoke Methods Save() 26 | 10/17/2010 6. GetCompIntfc (name ) 2. 7. Get() or Create() 5.IBM Global Business Services Calling CI from peopleCode Session Object 1.

that is. This object can be used anywhere you have PeopleCode.IBM Global Business Services Code for calling CI  Declaring a Component Interface Object - Component Interfaces are declared as type ApiObject. For example. 27 | 10/17/2010 © Copyright IBM Corporation 2008 . Application Engine PeopleCode.  Scope of a Component Interface Object - - - A Component Interface can be instantiated from PeopleCode. record field PeopleCode. in message subscription PeopleCode. from a Visual Basic program. from COM and C/C++. Variables defined at Component and Global are only for Component Interface. and so on. Local ApiObject &MYCI.

IBM Global Business Services CI: Security 28 | 10/17/2010 © Copyright IBM Corporation 2008 .

Search Save & Rowinit Peoplecode events are not fired for CI  WinMessage cannot be used with CI  Peoplecode functions that relate to GUI and online processing cannot be used - Menu peoplecode & pop-up menu¶s are not supported Cursor position(set control value) cannot be used  Save in the middle of a transaction (do save) cannot be used 29 | 10/17/2010 © Copyright IBM Corporation 2008 .IBM Global Business Services Differences b/w Component & CI  Search Init.

IBM Global Business Services Thank You 30 | 10/17/2010 © Copyright IBM Corporation 2008 .

Sign up to vote on this title
UsefulNot useful