IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > Flat Files > Configure the module for deployment

Create a simple service with the adapter pattern wizard

Adapter patterns provide a quick and easy way of creating a simple service with an adapter.

A module called RetrieveAFileModule and a business object called Customer is already created. If you are using WebSphere Application Server environment variables to specify local files and directories, you defined them using the IBM BPM Process Administrative Console.

The following adapter patterns are available for the WebSphere Adapter for Flat Files:

Adapter patterns
Adapter pattern Description
Inbound Flat File pattern The Flat File inbound pattern creates a service that retrieves a file in a specific directory on the local file system.

If the file is not in an XML format, you can specify a data handler that transforms from the file content format to business objects. The file content can be split if the content contains multiple copies of the data structure for processing.

Outbound Flat File pattern The Flat File outbound pattern creates a service that stores data in a file in a specific directory on the local file system.

If the required output format is not an XML format, you can specify a data handler that transforms the business object to the file content format.

In this example, we create a Flat File inbound service that receives a file from the file system for processing. The completed service in this example reads in a file and splits the contents into separate files based on a delimiter.

Complete the following steps to create a service with the adapter pattern wizard:


Procedure

  1. Right-click RetrieveAFileModule within the Business Integration section of the IBM Integration Designer window and select New > External Service. The Select the Service Type or Registry window opens.

  2. Select Simple: Create an inbound Flat File service to read from a local file and click Next.

    Figure 1. Select the Service Type or Registry window

  3. In the Flat File Service window, change the Name to something meaningful such as FlatFileInboundInterface and click Next.

  4. In the Business object and directory window, click Browse and navigate to the Customer business object.

  5. Specify the directory where you placed the input file, in this case the FFInboundEvents directory, and click Next. To use a WebSphere Application Server environment variable for this value, specify the name of the variable in braces, preceded by a $ symbol.

    For example: ${FFINBOUNDEVENTS}.

    Figure 2. Business object and directory window

  6. In the Input file format and file content split option window, accept the default XML input file format or select Other and specify a data handler to transform the data from your native format to the business object format.

  7. Select Split file content by delimiter and enter your delimiter, which is ####;\r\n in this example. Click Next.

    Figure 3. Input file format and file content split option window

  8. In the Archive directory and wrapper business object window, specify the Local archive directory, which is FFInboundArchive in this example. To use a WebSphere Application Server environment variable for this value, specify the name of the variable in braces, preceded by a $ symbol.

    For example: ${FFINBOUNDARCHIVE}. Select Use a wrapper business object to contain additional input file information check box, if you want to include the adapter-specific information. Click Finish.


Results

The inbound service is created, which includes the following artifacts:

Artifacts and their descriptions
Artifact Name Description
Export FlatFileInboundInterface The export exposes the module externally, in this case, to the WebSphere Adapter for Flat Files.
Business objects Customer, CustomerWrapper The Customer business object contains the fields for customer data such as name, address, city, and state. The CustomerWrapper business object contains additional fields for adapter-specific information.
Interface FlatFileInboundInterface This interface contains the operation that can be invoked.
Operation emitCustomerInput emitCustomerInput is the only operation in the interface.

Configure the module for deployment


Previous topic: Converting COBOL copybook files to business objects during inbound processing


Next topic: Starting the external service wizard