Component Interface


 

COMPONENT INTERFACE

What is Component Interface?

Component Interface is a peoplesoft object used to access PeopleSoft Component from external clients (Third Party Applications) including all business rules and data without going through the peoplesoft client.
We use component interface to expose peoplesoft component (methods and properties) to the external software (ex,VB, c, c++, java, com, dcom etc)

What are the major elements in the Component Interface Architecture?
There are three fundamental elements in the component interface architecture     
1.    components
2.    component interfaces
3.    Component interface API.

What are the attributes of the Component Interface?
1.    Component interface name.
2.    Keys (get keys, create keys, and find keys).
3.    Properties and collections (fields and records).
4.    Methods.

 

How many types of keys are there?

Keys are 3 types
1.    Get keys
2.    Create keys
3.    Find keys
Get keys are nothing but search key of the component search record, We cannot change the get keys.
Create keys are based on the add search record keys (add mode) and generated automatically for the component interface. We cannot change the create keys
Find keys are based on search key and alternate search keys of the search record. We can remove find keys if we don’t want to use.

What is component interface properties?

Properties: Properties are individual fields in component for component interface
Properties are 2 types
  1. Standard properties
  2. User defined properties
Standard properties exists for every component interfaces.

 

What is Collections?

Collections are referred as scrolls(level based controls will be having a primary record) in component for component interface.
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.

What is Component Interface Methods? How many Methods are there?

Methods are objects that perform a very specific function on a component interface at run-time.
The event of a component interface is methods (like on execute for app-engine.)
2 types of methods are there
1.    Standard methods

2.    User defined methods


What are standard methods?

Standard methods are those that are available for all component interfaces.
Cancel, Create, Find, Get, Save.
We can disable the standard methods, if we don’t want that functionality by going to the CI properties dialog box. These standard methods provide basic functionality for any CI.

User defined methods:
User-defined methods are created in PeopleSoft Application Designer to provide added functionality to the component interface. These methods are functions that are made accessible through the component interface. Each function maps to a user-defined method.

How can we create a new Component Interface?
1.    Select File, New from the PeopleSoft Application Designer menu.
2.    Select the Component Interface definition type from the new dialog box.
3.    Select the component, which is base for the component interface.
4.    Click Save to save the Component Interface.
5.    Save the component interface

Can we map more than one component at a time from the Component Interface?
No. A component interface maps to one, and only one, PeopleSoft component.

How can we access the component data?
By internal (PeopleCode) and external (Java, C/C++, or COM) applications.

Can we create the get keys and find keys manually?
No. When we create a new component interface, get and find keys are created based on the search record definition for the underlying component. 

How many types of properties can include the Component Interface?
Standard properties
User-Defined Properties

What are the standard properties?
      InteractiveMode
GetHistoryItems
EditHistoryItems                               

Can we create the user-defined methods?
Yes. We can create user-defined methods after creating a Component Interface.

Steps to Create Component Interface:
Create 3 fields
Nut_Id (Character, 5)
Name (Character, 15)
Salary (Number, 7.2)
Create new record and insert these 3 fields. Save the record with the name nut_source.
Save as the nut_source record to nut_target.
Create new page and insert all the fields of nut_source record. Save the page with the name nut_source.
Create new page and insert all the fields of nut_target record. Save the page with the name nut_target.
Create new component and insert nut_source page and go to the properties and specify the search record as nut_source in the use tab.
Create new component and insert nut_target page and go to the properties and specify the search record as nut_target in the use tab.
Register the two components.
File > New > Component Interface object. Then it asks the component, so give our target component name that is nut_target. (Means we are creating the Component Interface based on the target component).
Save the Component Interface with the name nut_compointerface.
Build, PeopleSoft API. Then press ok.
Go the source record that is nut_source. Drag and drop the Component Interface into nut_id (any field we can choose). Save Post Change event.
Remove the comments of (Execute Cancel, Execute Save, Execute Create) add the comments to Execute Get.
Add the comments to Execute Get.
Delete rem and <*> from rem &oCnuCOmpointercace.nut_ID = <*>; and drag the nut_ID field from nut_ SOURCE record.
Delete rem and <*> from rem &oCnuCOmpointercace.nut_NAME = <*>; and drag the nut_NAME field from nut_ SOURCE record.
Delete rem and <*> from rem &oCnuCOmpointercace.nut_SALARY = <*>; and drag the nut_SALARY field from NUT_SOURCE record.
Some Points in Component Interface:
Every component interface must be based on a component
If we want to expose a business process (logic) then we have to expose out component.
Through component Interface we can access internal (including peoplesoft) as well as external applications.
Multiple component interfaces can reference the same component. I.e. we can expose only one component to a component interface. We cannot expose 2 components to a single component interface.
Component interface API’s are used by the other applications to have real time access (synchronous) to peoplesoft component interfaces.
While creating a new component interface, we have to identify the name of the source component
After that we will be prompted for default properties (records and fileds)
If we want we can expose all the records and fields (properties) in the component to the calling program at run time or else we can drag and drop only those records and fields which we want third party to use.
Note: Only the objects in the component interface view will be exposed to the calling program at run-time.

 

Example for your understanding:

When ever we add a new employee row in personal data table(while recruiting, once we hire)
We want a student table should be populated with a new row by creating a new student id along with employee information.
Here two tables are involved (means two components)
One is personal data component.
Second is student information component. 
So now we will create a new component interface in application designer by giving name as student profile based on student information component
Then we will write save post change peoplecode in personal data component to instantiate, populate and  save the component interface object.
In the save post change event we will instantiate session object which is API object
To get the component interface.
(Refer account lock project description)
we will use session object whenever we will use integration tools.
We will enter new row in personal data table and see in the student information component whether new student id is created or not(testing)
Before testing we will give security to the new component interface.
Why should we write in save post change only, why not in other event?
Because component interface object data will not be in component buffer and student information component data will not be in component buffer so we are updating/inserting the data in the data base not in the component buffer tables.
Whenever we create a component interface ,we will give a name to CI to access.


CONFIGURATION MANAGER

 


6 comments:

  1. VERY USEFUL TO ALL OF US.THANKS

    ReplyDelete
  2. Hi Redappa,

    How to Populate Grid through Peoplecode ?

    ReplyDelete
    Replies
    1. Local Rowset &Robj1, &Robj;

      SQLExec("SELECT EMPLID FROM PSOPRDEFN WHERE OPRID=:1", %OperatorId,
      &OPR_EMPLID);
      &Robj = CreateRowset(Record.TST_VW);
      &Robj.Fill("WHERE SUPERVISOR_ID=:1", &OPR_EMPLID);
      &Robj1 = GetLevel0()(1).GetRowset(Scroll.TST_VW);
      &Robj1.Flush();

      WinMessage(&Robj.ActiveRowCount, 0);

      For &J = 1 To &Robj.ActiveRowCount
      &Robj1(&J).GetRecord(Record.TST_VW).GetField(Field.NAME1).Value =
      &Robj(&J).TST_VW.NAME1.Value;
      &Robj1(&J).GetRecord(Record.TST_VW).GetField(Field.EMPLID).Value =
      &Robj(&J).TST_VW.EMPLID.Value;

      &Robj1.InsertRow(&Robj1.ActiveRowCount);
      End-For;




      &Robj1.DeleteRow(&Robj1.ActiveRowCount);

      Delete
    2. Thank you for taking the time to reply to my email.

      Delete
  3. thank you so much sir ..its really awsom..

    ReplyDelete
  4. i have a req that when a new emp is hired through manage hire..then emp person profile will created automatically..via Component interface personal_profile_CI..please suggest me aur tell me how to write the code..

    ReplyDelete