Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Component Interfaces
A way for external applications, internal message handling, and other application
environments to access PeopleSoft logic and data.
Provide access to PeopleSoft data in a ways that is completely independent of specific pages.
Properties
Data items that describe a Component Interface and map to the data in the page buffer
associated with the component.
Can be either fields or collections – these correspond to component record fields and
scrolls, respectively.
Methods
Perform functions on a Component Interface such as creating a new purchase order,
approving a purchase order, saving a purchase order, etc.
Standard methods and user-defined methods
Component View shows exactly the same hierarchical record structure that you would see
if you had the component open in AppDesigner.
Add individual objects or groups of objects to the Component Interface View by dragging
and dropping objects from the Component View into the Component Interface View.
All objects in the Component View are part of the underlying Component Interface and
they are accessible through user-defined methods or through PeopleCode events on the
Component. However, only the objects in the Component Interface View will be exposed
to the calling program at run-time.
Component Interface View displays a tree in which each object type is represented by a
unique icon.
Sample PeopleCode:
&SESSION = GetSession();
If &SESSION.Connect(1, “EXISTING”, “”, “”, 0) <> True Then
/* Error Handling Routine */
End-If;
Get a Component Interface – Use the GetComponent method with a session object to
get the Component Interface. You must specify a Component Interface definition that
has already been created or you will receive a run-time error.
&CI = &SESSION.GetCompIntfc(CompIntfc.PSU_STUDENT_PROFILE);
If None(&CI) Then
Error (“Component Interface does not exist!”);
End-If;
&CI.STUDENT_ID = “NEW”;
Get the Instance of the Component Interface – After you set the key values, you have
to use the Create Method to populate the Component Interface with the key values
you set.
&CI.Create();
Populate the rest of the fields – Assign values to the other fields.
&CI.STUDENT_NAME = PERSONAL_DATA.NAME;
&CI.CUSTOMER_ID = “PSFT”;
&CI.SAME_ADDR_CUSTOMER = “Y”;
&CI.PROJECT_ROLE = “BSA”;
Save the component – when the Save method is executed, a new row of data will be
saved to the database.
&Save = &CI.Save();
If &Save = False Then
Error (“Component Interface update has failed.”)
End-If;
Note: The Save method returns a True if the save was successful or False if it failed.
COM Bindings – when deploying Component Interfaces on a local client machine or web
server with COM bindings, you must have:
The third party COM application
The PeopleSoft application server and database
The Java Virtual Machine (JVM) supplied with Sun Microsystems’ JDK 1.3.1
A copy of the type library called Peoplesoft_Peoplesoft.tlb that you generated during the
Build PeopleSoft API Bindings process. This type library is not specific to a single
database instance – it is specific to those database objects.
A copy of the registry file called Peoplesoft_Peoplesoft.reg that you generated during the
Build PeopleSoft API Bindings process. This registry file is not specific to a single
database instance – it is specific to those database objects.
Client Setup:
1. Install the PeopleSoft Server.
2. Install Sun’s JDK 1.3.1 to enable the JVM (if it is not already installed).
3. Set the environment variable PATH to include the following:
a. The directory containing jvm.dll (typically c:\bea\jdk131\jre\bin\classic)
b. PeopleTools client installation directory (typically
<PS_HOME>\bin\client\winx86)
4. Set the environment variable CLASSPATH to include the file psjoa.jar (typically
<PS_HOME\class\psjoa.jar).
5. For Microsoft Visual Basic:
a. Open the Visual Project File pscitester.vbp or sdk_bus_exp.vbp in Microsoft
Visual Basic
b. Select Project, References and add the type library
Third Party Applications
Copy the type library and registry files to the directory containing the external API on
each client machine from which you want to use the COM API.
Apply the API registry settings by double-clicking Peoplesoft_Peoplesoft.reg
Java Bindings – when deploying Component Interfaces on a local client machine or web
server with Java bindings, you must have:
The third party Java application
The PeopleSoft application sever and database
The Java Virtual Machine (JVM) supplied with Sun Microsystems’ JDK 1.3.1
Client Setup:
1. Install Sun’s JDK 1.3.1 to enable the JVM (if it is not already installed).
2. Set the environment variable PATH to the directory containing jvm.dll (typically
c:\bea\jdk131\jre\bin\classic)
3. Set the environment variable CLASSPATH to include:
a. the file psjoa.jar (typically <PS_HOME\class\psjoa.jar).
b. the target directory selected during the Build API process
(<PS_HOME>\class)
A file layout is a definition that represents the data structure of a flat (text) file to be
processed.
When reading from or writing to a flat file, your PeopleCode can use a file layout as a
template to identify and correctly process the file’s records and fields.
File layouts work with hierarchical and non-hierarchical data and can handle files that
combine data records with non-data (audit or control) records.
You can employ file layouts to move data between a PeopleSoft database and external
systems (data interchange), using flat files as the transmission medium.
Once a file layout has been created and mapped to a flat file, you can have the system
automatically generate an AppEngine program to perform the data import (rel 8.4).
Sequence Positional or Comma Separated Values (CSV): Fields are located in the file by
their sequence and separated from each other by either a separator, a delimiter or both.
XML Tagged (XML): A field is located not by its position or sequence within a record,
but by the named XML tags surrounding it.
Record Hierarchy
In theory, you can ignore rowset hierarchy when importing file data because the
PeopleSoft database stores each record independently for the others and rowsets aren’t
used in the import process. However, many records are designed with hierarchical
dependencies in mind. The input file might omit inherited field values or order the data
records in a way that reflects such dependencies.
If your input file omits inherited field values, make sure the inheriting fields’ records in
the file layout are children of the ones from which they inherit their values and make the
appropriate Field Inheritance settings.
If the records to be imported contain key fields that reflect a rowset hierarchy, they might
be in an order in the file that also reflects the hierarchy. Make sure your File Layout
reflects that hierarchy as well.
Your completed File Layout must have exactly one file record at the root level; all other
file records must be below that level.
You can use the GetFile built-in function to access an external file, but each execution of
GetFile instantiates a new file object. If you plan to access only one file at a time, you only
need one file object. Use GetFile to instantiate a file object for the first external file you
access, then use Open to associate the same file object with as many different external files
as you want. You’ll need to instantiate multiple file objects with GetFile only if you expect
to have multiple files open at the same time.
filespec Specify the name, and optionally, the path, of the file you want to open.
mode A string indicating the manner in which you want to access the file. The
mode can be one of the following:
Mode Description
R Read mode: opens the file for reading, starting at the beginning
W Write mode: opens the file for writing. When you specify Write mode, any
existing content in the file is discarded and will be overwritten.
charset A string indicating the character set you expect when you read the file, or
the character set you want to use when you write to the file. You can
abbreviate ANSI to “A” and Unicode to “U”.
pathtype If you have prepended a path to the filename, use this parameter to specify
whether the path is an absolute or relative path. The valid values for this
parameter are:
• %FilePath_Relative (default)
• %FilePath_Absolute
&REC.ExecuteEdits();
If &REC.IsEditError Then
For &I = 1 to &REC.FieldCount
If &REC.GetField(&I).EditError Then
LOG_ERROR(): /* application specific pgm */
End-If;
End-For;
End-If;
Writing to a File
WriteRecord(record)
File Layout method that writes the contents of the record object record, to the output
file. (Remember, a record object contains only one row of data from an SQL table).
Use this method to build a transaction in the output file, one file record at a time,
without having to instantiate and populate a rowset object. You can apply this method
to any record whose structure and name matches that of a record defined in the
current file layout.
WriteRowset(rowset)
File Layout method that writes the contents of a rowset object, rowset, to the output
file associated with the file object executing this method. Regardless of whether the
rowset contains just one or more than one transaction (level 0 row), executing this
method once will write the entire contents of the rowset to the output file.
SQL Class
CreateSQL(sqlstring [, paramlist])
Instantiates a SQL object from the SQL class and opens it on the given sqlstring and
input values. sqlstring is a PeopleCode string value giving the SQL statement.
Any errors in the SQL processing cause the PeopleCode program to be terminated
with an error message.
&ABS_HIST = CreateRecord(Record.ABSENCE_HIST);
&ABS_STG = CreateRecord(Record.ABSENCE_STG);
&SQL2 = CreateSQL(“%INSERT(:1)”);
While &SQL1.Fetch(&ABS_HIST);
&SQL2.Execute(&ABS_STG);
End-While;
Application Messaging
Completely server-based allowing PeopleSoft applications to interact with web services in
response to the invocation of business events within the Component Processor.
Messages are published in XML format and delivered to subscribing systems over a secure
HTTP connection.
Synchronous message can be used for invoking web services in other systems and returning
the results into a PeopleSoft page before continuing with a process, or for exposing
PeopleSoft business logic as a web services to calling systems.
Asynchronous messaging is used to guarantee delivery of data between PeopleSoft and other
applications without having to halt a business process because of a subscribing system being
unavailable.
Component Interfaces
Component Interfaces make the business logic and data of a Component available as an
object that is accessible externally from the application or within a PeopleCode environment.
An external system can invoke PeopleSoft Components over HTTP(S)/XML or it can invoke
the Component Client using Java, COM, or C/C++ bindings.
File Interfaces
PeopleSoft delivers the File Layout designer for graphically defining where data should be
located in the file. The File Layout definition becomes a metadata object that is accessible
from AppEngine for batch processing of file data and invoking PeopleSoft business logic.
Business Interlinks
Deprecated feature in PeopleTools rel 8.4…meaning that new development is not encouraged
(replaced by more robust Application Messaging). However, Business Interlinks are still
used within the PeopleSoft system for synchronous integration with 3rd part systems.
Seamlessly connects the two systems or applications, enabling one- or two-way data transfer
in order to accomplish a specific business purpose.
Note: For any transaction type, your application must invoke PeopleCode to generate and
send a message, or to receive and process a message.
When Integration Broker sends a message, the receiving system sends a low-level reply message
back to the sender. This differs from the response message which is the second half of a
synchronous transaction. A reply message serves only a “handshaking” purpose, to notify the
sending system of the transmission status of the request or response message. It’s processed
automatically by the application server, which uses that status information to update the
Integration Broker Monitor.
Message Status
Regardless of what Queue Type you are monitoring, the columns in the Message
Name/Channel Name list remain the same. Possible status messages that you may encounter
are:
Status Description
Error An error occurred during processing. Manual intervention is required.
New Either the item has been written to the database but has not been dispatched
yet or the item has just been resubmitted.
Started The dispatcher is in the process of passing the item to a handler, but the
handler has not received it yet.
Working The handler has accepted the item and is currently processing it.
Done The handler successfully processed the item. Depending on the type of
process you are monitoring, this status indicates different outcomes.
Message Instance: All contracts have been created.
AppEngine transform programs are used to apply transformation, data translation and
filtering on either inbound or outbound messages.
Transformation
Preferred method is an AppEngine program with Extensible Stylesheet Language
Transformation (XSLT) steps. XSLT is a well-recognized standard language perfectly
suited to manipulation XML structures so it’s highly recommended for implementing
transformations.
Each transform program step operates on the message content that results from the
previous step, so you can break your transform program into a sequence of discrete steps.
Multiple transform actions within a step can produce unwanted effects, so be sure to
insert each XSLT or PeopleCode action in its own step.
XSLT works only on XML DOM compliant data, so Integration Broker assures that both
outbound and inbound messages are in XML DOM compliant form when transform
programs are applied to them.
Each XSLT program must be enclosed in the following wrapper:
<?xml version=”1.0”?>
<xsl:stylesheet
xmlns:xsl=http://www.w3.org/1999/XSL/Transform version=”1.0”>
…
</xsl:stylesheet>
Note: Third-party XSLT development tools may generate a wrapper that specifies a
different URL. Make sure the URL in your program is exactly as above or your program
may not work as expected.
Data Translation
Best suited for modifying message content rather than structure
Most appropriate when the sending and receiving systems use different field values or
different combinations of fields and their values to represent the same information
Example:
Application A transmits customer names in four fields – Title, First, Middle, Last.
Application B uses two fields – Last, First. It doesn’t use a title and includes the middle
name as part of the First field.
Application C uses only one field – Accounted.
One Integration Broker node can store in its codeset repository the equivalent fields and
values used by another node. When it receives a message from the other node containing
a customer name, it can use its codeset repository to translate the information into the
form it prefers. It can likewise reverse the process for messages it sends to the other
node.
Elements of a Data Translation
Codeset Group – contains a list of significant data fields and their values that a
particular node might send in an initial message
Codeset – contains a specific set of match/name value pairs selected from the existing
codeset group
Codeset Values – contains the named value you predefine as the Return value
Development Sequence
The codeset group must exist before you can define a codeset based on it.
A codeset and two groups must exist so you can define values associated with them.
A codeset and associated codeset values must exist before you can invoke them in
your translation program.
To invoke a codeset, add the following code to your XSLT step in the AppEngine
Transform program:
<TYPE>
<psft_function name=”codeset” codesetname=”TYPES”>
<parm name=”TYPE”><xsl:value-of select=”COURSE_TYPE”/></parm>
<value name=”RET_TYPE” select=”.”/>
</psft_function?
</TYPE>