Using the Adapter for JText to process text files

The Adapter for JText connector can convert business object data into text files, and text files into business object data, which allows it to exchange business objects between InterChange Server Express and file-based applications, such as mainframes. Although many applications manage their business data through application-programming interfaces, some do not. Almost all applications, however, are capable of processing text files, which makes the Adapter for JText a popular and powerful integration component.

The SystemTestObject collaboration object exchanges data using an instance of the Adapter for JText. This instance is named SystemTestConnector in this SystemTest sample. This sample does not represent a typical integration interface since the exchange of enterprise data occurs between separate applications. It does, however, provide an application-independent means of validating most of the types of components that are typically involved in an IBM WebSphere Business Integration Server Express server exchange.

The SystemTestConnector polls the data folder within the /ProductDir/Samples/SystemTest folder of the IBM WebSphere Business Integration Server Express installation. This installation folder contains the Employee.in folder, which contains a number of records for an Employee business entity.

The following data represents a single record of this type:

This type of record is referred to as a name/value pair, delimited. Metadata names, such as EmployeeId, identify the data that they represent. Individual fields are identified by special characters such as paragraph returns. Individual records are identified by special characters such as semicolons.

The JText connector processes the Employee.in file, converting the records contained within it to business objects, and then sends these business objects to InterChange Server Express. The business objects are processed by a collaboration, which applies a small amount of business logic to the objects. The collaboration sends the objects back to SystemTestConnector, which converts each business object to a file in the data folder. SystemTestConnector uses the same data folder to poll for new events and to output the business objects it processes. SystemTestConnector recursively processes its own output, providing a consistent flow of data through the system.

The SystemTest collaboration template, upon which the collaboration objects are based, is designed to attempt an illegal Java number-formatting operation on a field in some of the business objects processed by the collaboration. This illegal operation generates failed flows so you can use Flow Manager to experiment with resolving failures in the system. For more information about Flow Manager, see the IBM WebSphere Business Integration Server Express and Express Plus System Administration Guide.

The following instructions use the Adapter for JText to process text files through a pair of interfaces in the system.

Note:
For the purpose of these instructions, it is assumed that you have started InterChange Server Express, System Manager, registered an InterChange Server Express instance, and verified that the test connectors and collaboration objects are active.
  1. Run the /ProductDir/Samples/SystemTest/start_SystemTest.sh shell file on the Linux InterChange server to start the JTextConnector and copy a file of sample data into the folder polled by the connector.

    The information displayed within the "SystemTest sample" console window scrolls rapidly as JTextConnector starts, and then polls and processes events. An example of the logged information is shown below.

  2. In the InterChange Server Component Management view in System Manager, right-click the SystemTestObject collaboration object, and then click Statistics in the menu bar to open the Statistics view.
    Note:
    The Statistics view shows information about the events being processed by a collaboration. The information in this view is very helpful when you are testing a business process interface.
  3. If the System Manager window is not maximized, right-click the title bar of the System Manager window, and then click Maximize in the context menu to fully expand it.
  4. The Statistics view, which you opened for the SystemTestObject collaboration object in System Manager in step 2, displays the counters for the total number of events processed, how many events were successful, and how many events failed. The interface is designed to occasionally fail an event so you can view failed flows as well as successful ones. The Statistics view is shown below.

  5. Navigate to and open the /ProductDir/Samples/SystemTest/data folder, which is the default installation path for IBM WebSphere Business Integration Server Express on your machine, to view the files created by the connector as it processes the data.
  6. After allowing the interface to run for several minutes, right-click SystemTestConnector in the InterChange Server Component Management view in System Manager, and then click Shut Down SystemTestConnector.

After you have completed these instructions, you have verified that InterChange Server Express starts and that the major components of the integration system can deploy, start, process business data, and be shut down. This indicates that the system is installed correctly and can support subsequent development, testing, and production

Copyright IBM Corp. 2004