Using the Inbound File Loader Utility

This chapter provides an overview of the Inbound File Loader utility processing and discusses how to:

Click to jump to parent topicUnderstanding the Inbound File Loader Utility

When external systems send inbound transactions consisting of flat files, you can use the Inbound File Loader utility to translate the incoming files into service operations and process them.

The Inbound File Loader utility provides two options for translating and processing files:

Note. You can only use one processing method at any given time. Application class processing always overrides PeopleSoft Integration Broker processing.

Click to jump to top of pageClick to jump to parent topicFile Processing

This section discusses the processing flow for the Inbound File Loader utility.

Inbound File Loader utility processing flow

The flow for inbound file processing using the Inbound File Loader utility is:

  1. The utility receives a flat file in the form of a file layout object from an external system.

    The flat file consists of either:

    These files contain the application data, which is in one of the following formats: fixed record, Comma Separated Values (CSV), or XML.

    Note. The wildcards “*” and “?” may only be used in the filename and not in the directory path.

  2. The utility reads the file that is submitted for processing:

  3. The utility loops through the list of data files to be processed and reads each data file.

  4. The utility uses either PeopleSoft Integration Broker or application class processing logic to read the file contents and process the data.

  5. To add file archiving, delete logic to prevent files from processing again, and so on, when defining processing rules, you can optionally specify an application engine program name and section. If specified, the utility calls the program and section as a final step to the inbound file process.

Click to jump to parent topicUnderstanding Development Activities

This section discusses development activities for using the Inbound File Loader utility and describes:

Click to jump to top of pageClick to jump to parent topicGeneral Development Activities

This section discusses general development activities for using the Inbound File Loader utility using either PeopleSoft Integration Broker processing or application class processing.

Determining the Format for Inbound Data

Determine the necessary format of the inbound data. If there is an industry standard, use it for your file definition. If there is no industry standard, create a file layout object.

Click to jump to top of pageClick to jump to parent topicDevelopment Activities for PeopleSoft Integration Broker Processing

This section discusses development activities for using the PeopleSoft Integration Broker processing in conjunction with the Inbound File Loader utility.

  1. Create a message definition in the PeopleSoft Pure Internet Architecture.

    The structure of the message definition must be similar to the structure of the file layout definition that you created.

  2. Create a service.

  3. Create an asynchronous one-way service operation for the service.

  4. Create a local-to-local routing definition for the service operation.

  5. Create an OnNotification handler and call the functional library IB_FILE_SUBCODE.

    PeopleTools delivers this functional library and it can be used for any generic notification.

    The following example shows code an OnNotification handler calling the functional library:

    import PS_PT:Integration:INotificationHandler; class QUSubscribe implements PS_PT:Integration:INotificationHandler method QUSubscribe(); method OnNotify(&_MSG As Message); end-class; Declare Function Subscribe PeopleCode FUNCLIB_IBFILE.IB_FILE_SUBCODE FieldFormula; /* constructor */ method QUSubscribe end-method; method OnNotify /+ &_MSG as Message +/ /+ Extends/implements PS_PT:Integration:INotificationHandler.OnNotify +/ /* Variable Declaration */ Local Message &MSG; Local Rowset &MSG_ROWSET; &MSG = &_MSG; Subscribe(&MSG); end-method;

  6. Define processing rules in the Inbound File Loader Rules page in the PeopleSoft Pure Internet Architecture.

  7. Initiate flat file processing using the Inbound File Processing page.

  8. Test the inbound flat file processing.

Click to jump to top of pageClick to jump to parent topicCreating File Layout Definitions

When you use the Inbound File Loader utility, you use file layout definitions to read and write data from flat files. Use the following guidelines when creating file layout definitions:

Click to jump to top of pageClick to jump to parent topicDevelopment Activities for Application Class Processing

This section discusses development activities for application class processing using the Inbound File Loader utility. This section discusses how to:

  1. Create an application class.

  2. Specify processing rules.

Creating Application Classes

This section discusses creating an application class for processing flat files in conjunction with the Inbound File Loader utility.

The application class you create must implement the IProcessFile interface. The signature of the interface is shown here:

interface IProcessFile /* Any initialization is done in this function*/ method Init (&fldDefName As string, &msgName As string) Returns boolean; /* Contains processing logic that stores the Rowset data into the respective⇒ tables */ method Process(&fldDefName As string, &msgName As string, &rs As Rowset) Returns⇒ boolean; /* This method shall contain logic for cleanup operations */ method Finish(&fldDefName As string, &msgName As string) Returns boolean; end-interface;

The application class you create must implement the following three methods:

If the Replace Data check box is selected in the Inbound File Loader Rule page, the Init method will be called. The Finish method is the last method to be invoked by the utility. Any post-processing clean up code can be implemented with this function.

The logic in the Process method stores the file contents in staging tables. You can add logic in the Finish method to move the data from staging tables to the actual transaction tables as a final process.

The Init, Process and Finish methods must return a boolean value of True for successful completion of the file processing. If methods Init and Finish are not used, return a default value of True.

The following example shows an application class implementing the IProcessFile interface:

import PTIB:Interfaces:IProcessFile; class InboundFileProcess implements PTIB:Interfaces:IProcessFile method Init(&fldDefName As string, &msgName As string) Returns boolean; method Process(&fldDefName As string, &msgName As string, &rs As Rowset) Returns⇒ boolean; method Finish(&fldDefName As string, &msgName As string) Returns boolean; end-class; method Init /+ &fldDefName as String, +/ /+ &msgName as String +/ /+ Returns Boolean +/ /+ Extends/implements PTIB:Interfaces:IProcessFile.Init +/ //This function will be called when the Replace Data flag is //enabled //add initialization code, such as cleaning up the table before //reading in the data from the file Return True; end-method; method Process /+ &fldDefName as String, +/ /+ &msgName as String, +/ /+ &rs as Rowset +/ /+ Returns Boolean +/ /+ Extends/implements PTIB:Interfaces:IProcessFile.Process +/ //Add the code that inserts/updates/delete data in the table Return True; end-method; method Finish /+ &fldDefName as String, +/ /+ &msgName as String +/ /+ Returns Boolean +/ /+ Extends/implements PTIB:Interfaces:IProcessFile.Finish +/ //This function will be called when the Replace Data flag is //enabled // Clean up logic goes here (if any) Return True; end-method;

Specifying Processing Rules

After you create an application class, you must access the Inbound File Loader Rules page and specify the following information:

Click to jump to parent topicPrerequisites for Using the Inbound File Loader Utility

The prerequisites for using the Inbound File Loader utility are:

Click to jump to parent topicSetting Up Inbound File Loader Processing Rules

This section discusses how to set up inbound flat file processing rules.

Click to jump to top of pageClick to jump to parent topicUnderstanding Setting Up Inbound File Loader Processing Rules

The Inbound File Loader utility uses information you define in the Inbound File Loader Rules page to determine the file layout and message combination, as well as other file attributes necessary for processing files.

Click to jump to top of pageClick to jump to parent topicSetting Up Inbound File Loader Processing Rules

Use the Inbound File Loader Rules page (PSIBINFILERULE) to specify the file layout and message to process, as well as define the parameters for processing. To access the page, select PeopleTools, Integration Broker, File Utilities, Inbound File Loader Rules. The following examples shows the page:

Note. You can process multiple inbound flat files at one time. By specifying an inbound index file as part of the Inbound File Loader utility parameters. The system reads all input files within the index file and uses the associated file layout object and message to convert the data. Similarly, specify a wildcard in the filename in the inbound file rule component, but make sure that all files that meet the wildcard criteria correspond to the file layout and message mapping that are defined.

File Identifier

Displays the inbound file that you are associating with the rule.

Inbound File

Enter the index file name or the data file name of the inbound file to process. Specify the full path information. The PeopleCode program uses the %filepath_absolute variable when opening the file.

File Type

In the File Type section, select the type of inbound file. The options are:

  • Data File

  • Index File

File Layout ID

(Optional.) Enter a file layout ID to associate with the file. The file layout ID is used in a multiple file layout processing. This identifier indicates that the data that follows belongs in a new file layout.

Status

From the Status drop-down list, select whether this inbound file rule is active. The valid options are:

  • Active.

  • Inactive. (Default.)

Replace Data

Check the box to indicate that the inbound file processing is a destructive load process.

A destructive load process involves replacing the contents of the tables with new data from the file being processed. In a destructive load process, the service operations must be subscribed in the same order as they are published to ensure transactional integrity.

If this check box is selected, the utility publishes a header message. The header message is a trigger in the subscription process to initialize tables before receiving the data messages. The subscription PeopleCode logic must check for the header message and perform any cleanup operation .

The utility then publishes data messages containing the data followed by a Trailer Message. The trailer message is used as a trigger in the subscription process to indicate that all the data messages have been received.

If the Replace Data check box is not selected, only data messages are published.

When used in the context of application class processing, if the Replace Data flag is selected, the Init() and Finish() methods of the specified application class are invoked.

Publish From

Select the name of the publishing node.

Use this option to simulate an inbound asynchronous transaction from an external node.

While using this feature, you must create an inbound asynchronous transaction on the node from where the message is published.

Root Package ID

Select the root package ID of the application class.

Path

Select the qualifying path of the application class.

Class Name

Select the application class name that contains the file processing logic.

Program Name andSection

Select a PeopleSoft Application Engine program and section to invoke when the utility finishes processing data.

Definition Name

Specify the file layout definition for the file(s) being processed.

If the File Layout ID field is blank, this field should contain only one entry.

If the File Layout ID field is not blank, this scroll area must contain an entry for each file layout definition name that is specified in the inbound file.

Service Operation

For every row in this scroll area, specify a service operation. The utility uses the message(s) defined within the service operation to copy the file rowsets into message rowsets

Note. Use the wildcards “*” and “?” for the file name but not for the directory path. The file layout and service operation must be valid for all files that meet the wildcard criteria.

Click to jump to parent topicInitiating File Processing

This section discusses how to initiate inbound flat file processing.

Click to jump to top of pageClick to jump to parent topicUnderstanding Initiating File Processing

The Inbound File Processing page runs the Application Engine process PTIB_INFILE that initiates the file-to-message processing. The file-to-message processing function reads the file rowset and publishes it as a message.

If an index file exists when the inbound conversion process runs, the application engine program loads the list of files to be converted into a parameter table and completes a commit. The application engine program uses the list of files within the parameter table to restart the processing if a particular flat file fails. If a single data file is provided, then the rowset processing immediately begins.

The file publish process goes through each of the rowsets of the file layout and copies them into the message row sets.

If the audit action (AUDIT_ACTN) exists in the file, it is copied to the PSCAMA record. If the audit action does not exist in the file, the publishing process uses the default value that is specified in the file layout field property.

The Inbound File Loader utility publishes a new message when one of the following exists:

The application engine program completes a commit every time a message is published from a file. After conversion, the flat file remains in the parameter table with a status of Processed.

Note. The file layout should exactly match the message layout (excluding the PSCAMA record) and should use the same character set as that used by the file: either American National Standards Institute or Unicode.

Click to jump to top of pageClick to jump to parent topicInitiating Inbound Flat File Processing

Use the Inbound File Processing page (PSIBFILERUNCNTL) to initiate flat file processing. Select PeopleTools, Integration Broker, File Utilities, Inbound File Processing. The Inbound File Processing page, shown in the following example, appears:

Request ID

Enter a unique identifier to track the request.

Process Frequency

Select the frequency for processing the file. The options are:

  • Process Once.

  • Always.

  • Don't Run.

File Identifier

Select or enter the name of the file identifier that you set up in the Inbound File Loader Rules. page. The file identifier is tied to the publish rules.

Index Flag

A read-only field that indicates if the file being processed is an index file or a data file. When checked, the Inbound File Loader utility is processing an index file.

File Layout ID

A read-only field that displays the file layout ID associated with the file in the Inbound File Loader Rules page.

Inbound File

A read-only field that displays the name of the file being processed.

Click to jump to parent topicTesting Inbound Flat File Processing

To test inbound files:

  1. Create a sample flat file, or ask the third-party vendor for a sample flat file.

  2. Set up processing rules for the test.

    Select PeopleTools, Integration Broker, File Utilities, Inbound File Loader Rules to access the Inbound File Loader Rules page.

    See Setting Up Inbound File Loader Processing Rules.

  3. Initiate file processing.

    Select PeopleTools, Integration Broker, File Utilities, Inbound File Processing to access the Inbound File Processing page.

    See Initiating Inbound Flat File Processing.

  4. Verify the inbound processing created a message that contains the sample flat file data.

    1. If you used application class processing, verify if the production or staging tables are loaded with the correct field values. For production tables, look in the PeopleSoft application pages. For staging tables, use either the PeopleSoft application pages or run a query by using PeopleSoft Query.

    2. If you used PeopleSoft Integration Broker for file processing, use the Service Operations Monitor to ensure the inbound file processing created a service operation that contains the sample flat file data.

      Verify that the standard inbound notification process received the message and processed it into the application tables.

      Determine whether the values become the inherited values (if you used the inherited value feature in file layout).

      Validate that the production or staging tables loaded with the correct field values. For production tables, look in the PeopleSoft application pages. For staging tables, use either the PeopleSoft application pages or run a query by using PeopleSoft Query.

      Ensure that the date formats conform.