Component Interface...
PeopleSoft Component Interface (CI) exposes a PeopleSoft Component for synchronous access to other applications written in PeopleCode, Java or C++. We can consider CI as the means by which PeopleSoft enforces encapsulation by limiting external access to just what is made available through the CI and nothing more.
A CI also executes the business logic included in the Component. As such, it provides a higher level of data validation to the data that is being loaded into the Component when compared to direct SQL inserts.
PeopleSoft also provides a Component Interface Tester to validate the CI and Excel To CI to manage loading data.
You can have as many CIs pointing to a Component as you want. But a Component Interface can point to only one Component.
Attributes of a Component Interface
A Component Interface has the following five attributes.
The Name of the Component Interface is the unique name by which we can identify the CI. Calling the CI is also done with the help of this name.
Keys
These are special properties that can retrieve the values from a CI. The three types of keys that a Component Interface has are the following:
Get Keys: These keys return one instance of the Component Interface. These keys are created based on the search record and map to the Search Keys in the search record.
Find Keys: These keys return a list of instances of the CI. These too are created based on the search record and map to the combination of Search Keys and Alternate Search Keys of the Search record.
Create Keys: Create keys are created only when the associated Component has the Add action enabled.
Properties
Properties of a CI provide access to the Component Interface’s settings and the data from the underlying Component. We can broadly classify properties into two:
Standard Properties: There are some properties that get assigned automatically when a CI gets created. These standard properties cannot be viewed through the Application Designer. Some examples for such properties are InteractiveMode, GetHistoryItems etc.
User Defined Properties: These properties map to the record fields on the Component. These are displayed in Application Designer and you can choose the properties that need to be included in the Component Interface.
Collections
This is a special property that corresponds to a scroll area. It can contain fields or subordinate scrolls, as is the case in the Component. The default name of a collection would be same as that of the primary record for the underlying scroll.
Methods
Methods are functions that perform a specific task on a CI at runtime. Runtime access to each method is governed by the security level that you have for the specific method. Like Properties, Methods too can be classified into two:
Standard Methods: These are the methods that are available for all CIs. Certain standard methods like Find, Get, Save and Cancel get created automatically when CI is created. The Create method is created only if the underlying Component has the Add action enabled.
User Defined Methods: In addition to the standard methods, we can create our own functions and expose them through the CI as methods for added functionality. Such methods are called user-defined methods. Each user defined method maps to a function. Such methods are highlighted in blue in the Component Interface Designer.
PeopleSoft Component Interface (CI) exposes a PeopleSoft Component for synchronous access to other applications written in PeopleCode, Java or C++. We can consider CI as the means by which PeopleSoft enforces encapsulation by limiting external access to just what is made available through the CI and nothing more.
A CI also executes the business logic included in the Component. As such, it provides a higher level of data validation to the data that is being loaded into the Component when compared to direct SQL inserts.
PeopleSoft also provides a Component Interface Tester to validate the CI and Excel To CI to manage loading data.
You can have as many CIs pointing to a Component as you want. But a Component Interface can point to only one Component.
Attributes of a Component Interface
A Component Interface has the following five attributes.
- Name
- Keys
- Properties
- Collections
- Methods
The Name of the Component Interface is the unique name by which we can identify the CI. Calling the CI is also done with the help of this name.
Keys
These are special properties that can retrieve the values from a CI. The three types of keys that a Component Interface has are the following:
Get Keys: These keys return one instance of the Component Interface. These keys are created based on the search record and map to the Search Keys in the search record.
Find Keys: These keys return a list of instances of the CI. These too are created based on the search record and map to the combination of Search Keys and Alternate Search Keys of the Search record.
Create Keys: Create keys are created only when the associated Component has the Add action enabled.
Properties
Properties of a CI provide access to the Component Interface’s settings and the data from the underlying Component. We can broadly classify properties into two:
Standard Properties: There are some properties that get assigned automatically when a CI gets created. These standard properties cannot be viewed through the Application Designer. Some examples for such properties are InteractiveMode, GetHistoryItems etc.
User Defined Properties: These properties map to the record fields on the Component. These are displayed in Application Designer and you can choose the properties that need to be included in the Component Interface.
Collections
This is a special property that corresponds to a scroll area. It can contain fields or subordinate scrolls, as is the case in the Component. The default name of a collection would be same as that of the primary record for the underlying scroll.
Methods
Methods are functions that perform a specific task on a CI at runtime. Runtime access to each method is governed by the security level that you have for the specific method. Like Properties, Methods too can be classified into two:
Standard Methods: These are the methods that are available for all CIs. Certain standard methods like Find, Get, Save and Cancel get created automatically when CI is created. The Create method is created only if the underlying Component has the Add action enabled.
User Defined Methods: In addition to the standard methods, we can create our own functions and expose them through the CI as methods for added functionality. Such methods are called user-defined methods. Each user defined method maps to a function. Such methods are highlighted in blue in the Component Interface Designer.
1. Define component interface?
PeopleSoft Component Interface
(CI) exposes a PeopleSoft Component
for synchronous access to other applications written in PeopleCode, Java or
C++. We can consider CI as the means by which PeopleSoft enforces encapsulation
by limiting external access to just what is made available through the CI and
nothing more. A CI also executes the business logic included in the Component.
As such, it provides a higher level of data validation to the data that is
being loaded into the Component when compared to direct SQL inserts. PeopleSoft
also provides a Component Interface Tester to validate the CI and Excel to CI
to manage loading data. You can have as many CIs pointing to a Component as you
want. But a Component Interface can point to only one Component.
2. Architecture of CI? Or what are the main elements in the component Interface?
Main elements of component Interface
• Component interface name
• Keys
• Properties and collections
• Methods
Main elements of component Interface
• Component interface name
• Keys
• Properties and collections
• Methods
3. Difference between get, create
and find keys? Get
keys: - These are mapped to the fields marked as search in the component’s
search record. Automatically “Search key” fields in search record become Get
keys.
We cannot change it.
Find keys: - These are mapped to fields marked as Alt or Search in the component search record. You may remove Find keys that you do not wish to make available for searching.
Create Keys: - It is generated from the key fields for the search record. If Add search record is present then its key fields are taken. We cannot change it.
We cannot change it.
Find keys: - These are mapped to fields marked as Alt or Search in the component search record. You may remove Find keys that you do not wish to make available for searching.
Create Keys: - It is generated from the key fields for the search record. If Add search record is present then its key fields are taken. We cannot change it.
4. What are the properties of CI? The Fields in the
level 0 in the component are the properties of the component.
Properties of a CI provide access to the Component Interface’s settings and the data from the underlying Component. We can broadly classify properties into two:
Standard Properties: There are some properties that get assigned automatically when a CI gets created. These standard properties cannot be viewed through the Application Designer. Some examples for such properties are Createkeyinfocollection Developer can further control the exposed Getkeyinfocollection field properties.
Findkeyinfocollection
Property Info collection
GetHistoryItems (Update/Display mode or Correction mode)
EditHistory Items
InteractiveMode..
User Defined Properties: These properties map to the record fields on the Component. These are displayed in Application Designer and you can choose the properties that need to be included in the Component Interface.
Properties of a CI provide access to the Component Interface’s settings and the data from the underlying Component. We can broadly classify properties into two:
Standard Properties: There are some properties that get assigned automatically when a CI gets created. These standard properties cannot be viewed through the Application Designer. Some examples for such properties are Createkeyinfocollection Developer can further control the exposed Getkeyinfocollection field properties.
Findkeyinfocollection
Property Info collection
GetHistoryItems (Update/Display mode or Correction mode)
EditHistory Items
InteractiveMode..
User Defined Properties: These properties map to the record fields on the Component. These are displayed in Application Designer and you can choose the properties that need to be included in the Component Interface.
5. How to provide security to the
CI? • Open the Permission
list (PeopleTools – Security – Permissions lists – Permissions)
• On the Component Interface tab
• Add row and select the newly created Component Interface
• Edit the permissions to give permission for the standard methods by click on FullAcess(All) button
• Get, Create, Save, cancel, find.
• On the Component Interface tab
• Add row and select the newly created Component Interface
• Edit the permissions to give permission for the standard methods by click on FullAcess(All) button
• Get, Create, Save, cancel, find.
6. How to invoke CI using the PC?
• Establish a user section
• Get the component interface definition
• Populate the create keys
• Create an instance of the component interface
• Populate the required fields
• Save the component Interface.
&Session = GetSession();
&CI = &Session.GetcompIntfc(CompIntfc.INTERFACE_NAME)
&CI.KEY_FILED_NAME = ‘NEW’
If not &CI.Create () Then
Populate required fields
Else
Populate other fields
End-if;
Populate the other fields
If not &CI.Save () Then
Else
End-if;
• Get the component interface definition
• Populate the create keys
• Create an instance of the component interface
• Populate the required fields
• Save the component Interface.
&Session = GetSession();
&CI = &Session.GetcompIntfc(CompIntfc.INTERFACE_NAME)
&CI.KEY_FILED_NAME = ‘NEW’
If not &CI.Create () Then
Populate required fields
Else
Populate other fields
End-if;
Populate the other fields
If not &CI.Save () Then
Else
End-if;
7. Steps to test CI? • Using the
Component Interface tester (Tools – Test Component Interface)
• Give values in the tester for options
• Get Existing, Create new, Find and perform the operation from the CI Tester
• Give values in the tester for options
• Get Existing, Create new, Find and perform the operation from the CI Tester
8. What are the collections in CI? This is a special
property that corresponds to a scroll area. It can contain fields or
subordinate scrolls, as is the case in the Component. The default name of a
collection would be same as that of the primary record for the underlying
scroll.
9. Can you write user defined
methods in CI? How? Yes, Right
Click on CI – View PeopleCode – on method Event
10. What is the PC event which is
available in CI? Method Event
11. How to catch error messages in
CI? This function needs to be
called when ever methods like Find, Save, Create methods return false.
Error text and Error type can be printed in the log message for any other action in to the log message.
Function CheckErrorCodes()
&PSMessages = &Session.PSMessages;
&ErrorCount = &PSMessages.Count;
For &i = 1 To &ErrorCount
&ErrorText = &PSMessages.Item(&i).Text;
&ErrorType = &PSMessages.Item(&i).Type;
End-For;
End-Function
Error text and Error type can be printed in the log message for any other action in to the log message.
Function CheckErrorCodes()
&PSMessages = &Session.PSMessages;
&ErrorCount = &PSMessages.Count;
For &i = 1 To &ErrorCount
&ErrorText = &PSMessages.Item(&i).Text;
&ErrorType = &PSMessages.Item(&i).Type;
End-For;
End-Function
12. When should I be using a component interface?
If you need to
insert/update/delete data through PeopleCode, and your PeopleCode will require
replicating a lot of existing business logic that already exists in a component
then a component interface is the best approach. Once you learn how to use
them, they will be the fastest and most robust solution for such cases. If you
are performing simple changes, then using a CI becomes overkill as there is an
overhead to using a CI on both the system and on development time. Similarly,
large amounts of batch processing may be too much for a CI to handle or may be
considerably slower using a CI.
13. When I create my component interface, why can't I see any Getkeys?
The search
record for your component does not have any search keys defined. Go back and
define search keys as these are used as Getkeys.
14. Why are my Findkeys missing certain fields?
Findkeys are
derived from search and alternate search keys on the component search record.
If you have a key but it is neither a search key nor alternate search key, then
it will not be available as a Findkey.
15. When I test my component interface, why do I get a "Not
Authorized" error?
Check that your
component interface is included in a permission list that you have access to.
Also check that you have access to all possible methods (Get, Save, Create,
Cancel, Find). If you delete a component interface through application
designer, it is also removed from any associated permission lists so this may
be another reason why your new component interface (with the same name) is not
authorized any more.
Also, make sure
you are not trying to do something in your code that the CI can't do. For
example, if your CI doesn't have a create method, you can't set security for it,
so you will get a not authorized error if you have code that attempts to
perform a create. This is because the authorization error is usually the first
error to be displayed.
16. When automatically building a component interface, why are some fields
missing?
Sometimes
application designer gets it wrong. For instance, if the same field exists in
scroll 1 and scroll 2, it may put the field in just one scroll level. It may
also have problems with certain key/search key/alternate search key fields
between the search record and the scroll level records. Normally you just need
to check your CI and add any missing fields.
17. Why does my component interface not have a Create method?
Create is only
available if the underlying component allows Add mode. If it doesn't then you
can't create anything in the component, and thus you can't create anything
using the component interface. The create method will be disabled in the
component interface properties.
18. Can I override my Component Interface methods?
Yes, you can
write additional PeopleCode for your component interface methods. Simply go to
the method (Cancel, Find, Get, Save, Create), right-click and select view
PeopleCode.
19. My PeopleCode didn't copy any data to a collection. Why not?
Make sure that
all the fields that you are copying to in a collection actually exist in the
component interface! If any are missing you can get unexpected results or none
at all.
20. My PeopleCode didn't update the value of a field. Why not?
Check that the
field is actually in your component interface. Also make sure that the field
properties are not set to Read Only Access. (Double click on the field
in the component interface).
21. The same field is in different scrolls but they do not have the same
value
For example, at
scroll 0 you might have the field EFFDT set to 01/01/2009. You want the EFFDT
field to get the same value in scroll 1, so you write code to set it from the
value in level 0 but it isn't working. If this is the case, check the field
name in the component interface, you may find that PeopleSoft has automatically
renamed it. For example, it might be EFFDT at level 0 but something like
EFFDT_1 in level 1 of the component interface.
22. What underlying tables define security access to Component Interfaces?
The association
between a permission list (CLASSID) and a component interface (BCNAME) is
stored in the PeopleTools table PSAUTHBUSCOMP.
23. What delivered role / permission give access to all the delivered CIs?
The role is
Standard Non-Page Permissions. The permission list is HCSPCMPINT.
24. I get the error No Rows Exist for Specified Keys
But I have
double checked that the key values being passed are correct and exist in the
database. What's going on? This could be row level security at work. Don't
forget that a CI uses the security implemented by the underlying component. Are
you sure that the user running the CI has the appropriate row level security to
view the data? Confirm by querying against the search record of the underlying
component. Row level security may also be at work if you are getting errors
entering valid values into a field where the prompt table relies on row level
security.
25) What is method?
What are the different types of method?
Methods: - A method is an object that performs a very specific function on a component interface at run-time.
Standard methods and user-defined methods.
Standard methods: - Automatically generated upon the creation of a new component Interface in Application.
Apart from the Standard methods there are Standard methods available for the use with any collection.
User-Defined methods: - User-defined methods are those that you can create to meet the requirements of an individual component interface.
26) Traversing the Collections in the Component Interface?
COLL_JOB – Collection
Coll_JOBItm – Row in the collection.
&COLL_JOBCol = &CI_JOB_DATA.COLL_JOB;
For &i = 1 to &COLL_JOBCol.Count
&COLL_JOBItm = &COLL_JOBCol.Item (&i);
&COLL_JOB_JRCol = &COLL_JOBItm.COLL_JOB_JR;
For &J = 1 to &COLL_JOB_JRCol.Count
&COLL_JOB_JRItm = &COLL_JOB_JRCol.Item (&j);
&COLL_JOB_JRItm.KEYPROP_EFFDT =;
27) How do you login in correction mode in the Component Interface?
Get History Items and Edit History items property should be set to true.
Get History Items alone: - Update display all - modes will be used.
Methods: - A method is an object that performs a very specific function on a component interface at run-time.
Standard methods and user-defined methods.
Standard methods: - Automatically generated upon the creation of a new component Interface in Application.
Apart from the Standard methods there are Standard methods available for the use with any collection.
User-Defined methods: - User-defined methods are those that you can create to meet the requirements of an individual component interface.
26) Traversing the Collections in the Component Interface?
COLL_JOB – Collection
Coll_JOBItm – Row in the collection.
&COLL_JOBCol = &CI_JOB_DATA.COLL_JOB;
For &i = 1 to &COLL_JOBCol.Count
&COLL_JOBItm = &COLL_JOBCol.Item (&i);
&COLL_JOB_JRCol = &COLL_JOBItm.COLL_JOB_JR;
For &J = 1 to &COLL_JOB_JRCol.Count
&COLL_JOB_JRItm = &COLL_JOB_JRCol.Item (&j);
&COLL_JOB_JRItm.KEYPROP_EFFDT =;
27) How do you login in correction mode in the Component Interface?
Get History Items and Edit History items property should be set to true.
Get History Items alone: - Update display all - modes will be used.
I am not able to insert rows in ci in case:
ReplyDeleteWe have two rows.
US emp1 IND
US emp2 US
only key field is Country.
I sucessfully upload first row and not able to insert second row.I use item and insert item logic for first row in scroll one.I need insert zero level and first level from only one staging table.
Thanks in advance
sudhir IBM
Thank You Ismail. Could you add interview questions on Integration Broker?
ReplyDeleteI am trying to insert the data from Mulesoft standard connector into CI to insert the data into Invoice CI. It does not accept the data in first call. My PS team tells me I need to make calls for create and then call Save. The catch is when we are using integration tool, we cannot perform 2 step process unless we know a response or reference. Can someone throw some light?
ReplyDeleteIn a nutshell, is keys, properties and methods to be entered in a sequence or can we make a direct call to CI?
DeleteThank you for sharing your blog, seems to be useful information can’t wait to dig deep!
ReplyDeleteGreat read! Thank you for such useful insights. Visit here for advanced technical courses on PEOPLESOFT ADMIN ONLINE TRAINING
ReplyDelete