Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Peoplesoft - Component Interface: Prasad Raju. G

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 30

PeopleSoft - Component Interface

Prasad Raju. G

12/07/21 © 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 | 12/07/21 © 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 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Component Interface

 Application Engine programs, application message subscription programs, or


any other PeopleCode programs will be able to use Component Interfaces.

 When you populate a Component Interface with data, the first thing you fill
out are its keys, as you would in a component. These can be keys for getting
an existing instance of the data or for creating a new instance of the data.

 In addition to keys, a Component Interface is composed of properties and


methods.
- Component Interface properties provide access to the data in a component buffer.
- Component Interface methods are functions that can be called to perform
operations on a Component Interface.

4 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Component Interface

 Component Interface Classes


- Component Interfaces are an evolution of the Message Agent, and are the focal
points for externalizing access to existing PeopleSoft components.
- They provide real-time synchronous access to the PeopleSoft business rules and
data associated with a component outside the PeopleSoft online system.

 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 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Component Interface

 In most cases, component interfaces behave exactly the same as their online
counterparts (their associated components).

 This means that PeopleCode events typically fire in the same order as the
online case, and so on.

 However, there are several exceptions to this behavior that relate both to
PeopleCode processing and search dialog processing.

6 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

CI Elements

PeopleSoft Application
Component Component Interface
PeopleCode

Component
Keys
Search Keys External Application
API
PeopleCode
Methods COM (VB)
Functions

C/C++
Fields and Scrolls Properties and
Collections

Component Interface Architecture

7 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Elements of CI

 There are three fundamental elements to the overall component interface


architecture
- Components, component interfaces, and the component interface API.

 Components
- One or more pages performing a business transaction that a component
interface is associated with.

 Component Interface
- Exposed aspect of a component. However, unlike components, component
interfaces are readily accessible by internal and external applications and
multiple component interfaces can reference the same component.

 Component Interface API


- Application programming interface for a Microsoft COM (Visual Basic)
application and PeopleCode

8 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Attributes of CI

 Attributes of a Component Interface

 Every component interface has the following four main attributes:


- Component Interface Name

- Keys

- Properties and Collections

- Methods

9 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Keys for CI

 Keys define the values that uniquely identify an instance of a component


interface.
- When you create a new component interface, 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. You may
remove Find Keys that you do not wish to make available for searching.

10 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

CI : Properties & Collections

 Properties and Collections


- Properties are the individual data items (fields) that describe a component interface.
Each property maps to a single field in the component interface’s underlying
component.
- A collection is a type of property—which points to a scroll, instead of mapping to an
individual field, it points to a scroll.

 User-Defined Properties
- User-defined properties come from a component interface’s associated component,
and must be added manually.
- They are the specific record fields that you choose to expose to an external system
with the component interface.

 Standard Properties
- Standard properties are common across all component interfaces and are assigned
automatically when a component interface is created.
- Standard properties also exist for each collection within a component interface.

11 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

CI : Standard Properties

 CreateKeyInfoCollection
- Returns a set of items that describes the Create keys. 

 GetKeyInfoCollection
- Returns a set of items that describes the Get keys.

 FindKeyInfoCollection
- Returns a set of items that describes the Find keys.

 PropertyInfoCollection
- Returns a set of items that describes properties.

12 | 12/07/21 © Copyright IBM Corporation 2008


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 | 12/07/21 © Copyright IBM Corporation 2008


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, numerous methods are available.
- For example, if you are working with a purchase order component interface, you may
use a method to approve a specific purchase order. Likewise, you can use methods
to save or create a new purchase order.

 As with component interface properties, there are two main types of methods:
user-defined methods and standard methods.

14 | 12/07/21 © Copyright IBM Corporation 2008


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.
- 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.
- Application developer can write their own methods. These methods are written as
Functions using ComponentInterface PeopleCode. For example, suppose you
wanted to be able to copy an instance of Component Interface data.

15 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Standard Methods

 Standard methods are those that are available on all component interfaces
created as default with CI.

- Create
 Creates a new instance of a component interface ( add data in the component). Equivalent to
opening a new record in Add mode online. Returns “True” on success, and “False” on failure.
- Find
 Performs a partial key search for a particular instance of a component interface. Returns “True”
on success, and “False” on failure.
- Get
 Retrieves a particular instance of a component interface. 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.
- Save
 Saves an instance of a component interface. Equivalent to clicking the Save button in the online
system.
- Cancel
 Backs out of the current component interface, canceling any changes made since the last
save.Equivalent to clicking the Return to Search button online.

16 | 12/07/21 © Copyright IBM Corporation 2008


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 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Data Collection Methods

 InsertItem(Index)
- Inserts a new item. Equivalent to pressing F7 to insert a new row when online. It
takes the item number as a parameter, and follows the same conventions for
executing business rules (PeopleCode) as the online system.

 Item(Index)
- Takes an item number as a parameter, and returns the specified row in the collection.

 ItemByKeys(keys)
- Identifies and finds a specific item based on keys. The keys will vary according to
the design of the collection.

18 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

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.

20 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Accessing 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.

21 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Accessing CI Properties

 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.

 Properties that return information about the structure of the Component


Interface
- CreateKeyInfoCollection
- FindKeyInfoCollection
- GetKeyInfoCollection
- PropertyInfoCollection

22 | 12/07/21 © Copyright IBM Corporation 2008


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.
- At runtime, you can use PeopleCode to assign a value to that property (field), or to
access the value of that field.
&MYCI.RETURN_DT = "05/05/2000";
/* OR */
&DATE = &MYCI.RETURN_DT;

23 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Creating a CI

 To create a new component interface


- Select File, New from the Application Designer menu.
- Select the Component Interface object type from the New dialog.
- Select the component on which this component interface will be based.
- Save the component interface.
- Add properties, collections, or methods to the component interface.
- Set the security.
- Test the component interface.

24 | 12/07/21 © Copyright IBM Corporation 2008


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 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Calling CI from peopleCode

Session Object

1. GetCompIntfc (name )

2. Set Keys

Find() 3.

7. Cancel() Pick a
component from
the collection

4. Get() or Create()

Read Properties
5. Write Properties
Invoke Methods

Save() 6.
26 | 12/07/21 © Copyright IBM Corporation 2008
IBM Global Business Services

Code for calling CI

 Declaring a Component Interface Object


- Component Interfaces are declared as type ApiObject. For example,
- Local ApiObject &MYCI;

 Scope of a Component Interface Object


- A Component Interface can be instantiated from PeopleCode, from a Visual Basic
program, from COM and C/C++.
- This object can be used anywhere you have PeopleCode, that is, in message
subscription PeopleCode, Application Engine PeopleCode, record field PeopleCode,
and so on.
- Variables defined at Component and Global are only for Component Interface.

27 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

CI: Security

28 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Differences b/w Component & CI

 Search Init, 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 | 12/07/21 © Copyright IBM Corporation 2008


IBM Global Business Services

Thank You

30 | 12/07/21 © Copyright IBM Corporation 2008

You might also like