Top Banner
Agenda What is a CI ? How it works ? Why use CI ? CI Architecture How to create a CI ? Setting CI security Testing a CI Sample PeopleCode Building APIs Runtime considerations
26

Component Interface in peoplesoft

Apr 19, 2015

Download

Documents

Anbudan Chandru
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Component Interface in peoplesoft

Agenda• What is a CI ?• How it works ?• Why use CI ?• CI Architecture• How to create a CI ?• Setting CI security• Testing a CI• Sample PeopleCode • Building APIs• Runtime considerations

Page 2: Component Interface in peoplesoft

What is a Component Interface ?

Used to integrate PeopleSoft with another

PeopleSoft application or with external systems

Page 3: Component Interface in peoplesoft

How does a CI work ?

• Enables exposure of a PeopleSoft component for synchronous access from another application ( PeopleCode, Java, C/C++, COM, or XML)

• “Black boxes" that encapsulate PeopleSoft data and business processes, and hide the details of the underlying page and data

Page 4: Component Interface in peoplesoft

Why use CI ?

• Loading data using CI mimics online data entry

• The data entered confirms to all PeopleSoft online validations and edits

Page 5: Component Interface in peoplesoft

CI Architecture

• Component

• Component interfaces

• Component interface API

Page 6: Component Interface in peoplesoft

CI Architecture

Page 7: Component Interface in peoplesoft

How to create a CI ?

CI is a PeopleSoft definition that can be created in PeopleSoft Application Designer

Page 8: Component Interface in peoplesoft

Creating a new CI definition

• File -> New -> Component Interface Prompts for the component name on which this CI defn. will be based

• CI properties may/may not be based on the default properties of the underlying component

• Standard methods Cancel, Find, Get, and Save - automatically created.

• Create method - available only if the underlying component supports the ‘Add’ mode

Page 9: Component Interface in peoplesoft

Comparing CI & Component

CI

• Get keys• Find keys

• Create keys

Component (Search record)

• Search key fields • Search key fields & Alternate Search key

fields• Physical key (provided the component

has add-mode permissions)

Page 10: Component Interface in peoplesoft

CI Definitions and Views

Page 11: Component Interface in peoplesoft

Methods• Methods

A function that performs a specific task on a component interface at runtime

Standard methods - Find, Get, Save, and Cancel methods The Create method for components that have the “Add” action enabled

User-defined methods - Functions that are made accessible through the component interface. Each function maps to a user-defined method

Page 12: Component Interface in peoplesoft

Properties and Collections

• Properties - fields

• Collections - Scroll

Standard properties

InteractiveMode, GetHistoryItems, and EditHistoryItems

Page 13: Component Interface in peoplesoft

Enabling and Disabling Standard

Methods

Page 14: Component Interface in peoplesoft

Creating User-Defined Methods

Page 15: Component Interface in peoplesoft

Setting Component Interface

Security Open the Permission list – Component

Interface

Page 16: Component Interface in peoplesoft

Validating the Component Interface

Validation ensures that a component interface definition has not deviated from its source component

To validate a component interface • Open the component interface in Application

Designer• Select Tools, Validate for Consistency • Keys that no longer synchronize with their

associated components are marked with an X icon

Page 17: Component Interface in peoplesoft

Testing the Component

Interface Component Interface Tester

Test in interactive mode.

• Retrieve history items.• Test the standard, custom, and collection

methods.

Page 18: Component Interface in peoplesoft

Testing the Component

Interface

Page 19: Component Interface in peoplesoft

Programming CI in PeopleCode

Generating a PeopleCode Template

Page 20: Component Interface in peoplesoft

Generate PeopleCode template

for CI• Open the desired component interface definition

in Application Designer.• Insert the component interface into a project.• Save the project.• Open the PeopleCode editor.• You can associate component interface

PeopleCode with a record, a component, an application message, or Application Engine.

• Select the component interface from the project workspace.

• Drag and drop the object from the project into the PeopleCode editor.

• Make any necessary changes to the PeopleCode in the PeopleCode editor window.

Page 21: Component Interface in peoplesoft

Sample PeopleCode

template

• &oSession = %Session; • &oSession.PSMessagesMode = 1;

• &oHcompinterface = &oSession.GetCompIntfc(CompIntfc.HCOMPINTERFACE);• If &oHcompinterface = Null Then• errorHandler();• Exit;• End-If;• &oHcompinterface.InteractiveMode = False;• &oHcompinterface.GetHistoryItems = True;• &oHcompinterface.EditHistoryItems = False;• If Not &oHcompinterface.Get() Then• errorHandler();• Exit;• End-If;• rem <*> = &oHcompinterface.EMPLID;• rem &oHcompinterface.EMPLID = <*>;• rem <*> = &oHcompinterface.NAME;• rem &oHcompinterface.NAME = <*>;

Page 22: Component Interface in peoplesoft

Sample PeopleCode

template• rem &oHskillsetCollection = &oHcompinterface.HSKILLSET;• rem For &<*> = 1 To &oHskillsetCollection.Count• rem &oHskillset = &oHskillsetCollection.Item(&<*>);• rem <*> = &oHskillset.HSKILLSET;• rem &oHskillset.HSKILLSET = <*>;• rem <*> = &oHskillset.RATING_SCALE;• rem &oHskillset.RATING_SCALE = <*>;• rem End-For;

• /*If Not &oHcompinterface.Save() Then• errorHandler();• Exit;• End-If;*/

• /*If Not &oHcompinterface.Cancel() Then• errorHandler();• Exit;• End-If;*/

Page 23: Component Interface in peoplesoft

Building APIs for C++ ,Java, COM

To build the component interface bindings

• Open any component interface definition in Application Designer.• Select Build, PeopleSoft APIs.

Page 24: Component Interface in peoplesoft

Runtime Considerations

• Win Message() is unavailable -> Use MsgGet() function

• Email From a Component Interface • To use a component interface to send email,

use TriggerBusinessEvent PeopleCode event, not ‘Send Mail’.

Page 25: Component Interface in peoplesoft

Runtime Considerations• Infinite Processing Loops A component interface should not call itself in any of

the PeopleCode included within its component definition which may result in an infinite loop

A component interface also should not call itself from a user-defined method

• Multiple Instances of a Component Interface

Because of potential memory conflicts, COM or C++ applications shouldn’t create multiple, simultaneous instances of the same component interface, either within a single procedure, or in both a “parent” and a “child” procedure.

Page 26: Component Interface in peoplesoft

Summary

• CI is a powerful integration tool• Exposes a PS component for access from

other third party applications (Java, C++,COM)• Data load using CI mimics online data entry