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
What is a Component Interface ?
Used to integrate PeopleSoft with another
PeopleSoft application or with external systems
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
Why use CI ?
• Loading data using CI mimics online data entry
• The data entered confirms to all PeopleSoft online validations and edits
CI Architecture
• Component
• Component interfaces
• Component interface API
CI Architecture
How to create a CI ?
CI is a PeopleSoft definition that can be created in PeopleSoft Application Designer
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
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)
CI Definitions and Views
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
Properties and Collections
• Properties - fields
• Collections - Scroll
Standard properties
InteractiveMode, GetHistoryItems, and EditHistoryItems
Enabling and Disabling Standard
Methods
Creating User-Defined Methods
Setting Component Interface
Security Open the Permission list – Component
Interface
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
Testing the Component
Interface Component Interface Tester
Test in interactive mode.
• Retrieve history items.• Test the standard, custom, and collection
methods.
Testing the Component
Interface
Programming CI in PeopleCode
Generating a PeopleCode Template
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.
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 = <*>;
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;*/
Building APIs for C++ ,Java, COM
To build the component interface bindings
• Open any component interface definition in Application Designer.• Select Build, PeopleSoft APIs.
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’.
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.
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
Top Related