Chris Malek is a PeopleTools® Technical Consultant with two decades of experience working on PeopleSoft enterprise software projects. He is available for consulting engagements.
About Chris Work with ChrisIntroducing a small but powerful PeopleSoft bolt-on that makes web services very easy. If you have a SQL statement, you can turn that into a web service in PeopleSoft in a few minutes.
This section will discuss best practices in performing PeopleSoft updates.
99% of the time, all updates/inserts/deletes on PeopleSoft tables should be done through a Component Interface (CI)
.
INSERT INTO PS_....
or UPDATE PS_....
, you are probably doing something “wrong.”If your web service is just pulling data out of PeopleSoft (GET Operation), then doing SQL selects against the database table is fine. CI does not provide any real benefit to GET operations. In fact, CI gets in the way of GET operations.
First, let’s briefly review the high-level architecture of PeopleSoft.
PeopleSoft is a rapid application development platform if you are using it correctly. If you operate outside of the “rails” of PeopleTools, you can create a mess that is difficult to maintain and upgrade. Operating within the “rails” of PeopleTools means you let the PeopleTools framework do the heavy lifting for you. This is the key to a successful PeopleSoft implementation.
When an end user interacts with some user interface in PeopleSoft, they interact with a PeopleTools Component
.
Component
is responsible for maintaining parent-child relationships with tables it “governs”.Component
encapsulates all the business logic for those tables.Component
maintains data integrity by enforcing prompt table and other logic.Component
maintains effective dated logic.Component
triggers data syncs to other systems (PERSON_BASIC_SYNC, DEPT_SYNC, etc).Component
triggers inter-module updates.
A Component
- For example, if a person updates the state in which they live, their state payroll tax data may be updated.Component
triggers unknown lines of PeopleCode behind the scenes. This could be 2 lines or millions of lines of PeopleCode.Component
has underlying logic that changes via PUMs and customizations.Component
maps to a set of pages
that dictate the user interface in the web browser.The PeopleTools “component processor” in the application server handles all direct interaction with the database tables for the PeopleSoft user interfaces (aka Components).
The main point I want to make before we continue here is that all the business logic for a table is tied to some PeopleSoft Component. If you bypass the component, you bypass the business logic. CI is about reusing that business logic and not repeating and recreating logic.
I have seen many clients create a complete mess and have batch processes “ramming” data into PeopleSoft tables. This is a recipe for drastically increasing the total cost and complexity of operating. It makes upgrades difficult and patching extremely difficult and time-consuming. The testing process for bundles turns into a major affair. In contrast, I have integrations written against core components that have been running for ten years without a single change across many clients. Those clients have upgraded and applied quarterly patches to the underlying components, and there were no impacts on my integration code or any testing burden. This is because the basic structure of the component has not changed. There may have been underlying logic changes in the Component PeopleCode. However, users of the CI did not have to change their code.
Generally, using CI will make your integrations more robust and easier to maintain.
You are reading this book because you are interested in integrations with PeopleSoft. What should you do if you have an external system that needs to update a PeopleSoft table? The section above shows the importance of a PeopleSoft Component
. That component has all the business logic, and you do NOT want to recreate that or bypass it.
PeopleTools allows developers to create a Component Interface (CI)
that takes a Component
and creates an API based on it. The Component Interface
definition is tied to one Component
and changing the component can break or change the Component Interface
. The API created can be accessed using PeopleCode. Not all changes to the underlying component will break the CI, but some will. Only changes to the underlying search record or table structure will break the CI. If you change the underlying PeopleCode or add fields, the CI will not break.
If you have a piece of PeopleCode that needs to perform some table update, you should generally pushing that through a CI. DO NOT WRITE UPDATE/DELETE SQL STATEMENTS IN PEOPLESOFT!
Your Service Operation
PeopleCode handler should be performing all updates/deletes/inserts through a CI. Specifically, the CI will be doing all those updates for you. Your PeopleCode will interact with the CI API structure, which will closely resemble the underlying structure of the component.
Here is a high-level diagram of what that looks like.
If your web service is creating a custom “staging” table that the web service inserts data into and there is no PeopleSoft UI logic then that is a use case where CI does not make sense. CI’s are used for triggering business logic that is not within your control. If you are mirroring some data from an external system and PeopleSoft does not have internal logic on that data then CI does NOT make sense for that use case.
If you are writing a “GET” operation from PeopleSoft, it is OK to do SQL SELECT
s directly against the database most of the time. This depends on the nature of the web service. Oftentimes, your web service might pull system information for another service. If you try to use CI, the amount of code to generate that data would be at least an order of magnitude more if you used CI rather than SQL.
There are some edge-cases where using CI on a GET might make sense. I often see them around self-service components with complex business logic, calculations, and complex data aggregations. If the external system is passing some “user context” like “get me the Sally’s student balance at the university,” using a CI for that could make sense because: