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 > FTP > 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 has already been created called RetrieveAFileModule and a business object called Customer has already been created. If you are using WebSphere Application Server environment variables to specify local files and directories, you have defined them using the IBM BPM administrative console.

The following adapter patterns are available for WebSphere Adapter for FTP:

Adapter pattern details
Adapter pattern Description
Inbound FTP pattern The FTP inbound pattern creates a service that retrieves a file in a specific directory on an FTP server. If the file is not in an XML format, you can specify a data handler that will transform 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 FTP pattern The FTP outbound pattern creates a service that stores data in a file in a specific directory on an FTP server. If the required output format is not an XML format, you can specify a data handler that will transform the business object to the file content format.

In this example, you create an FTP inbound service that receives a file from the file system for processing. The completed service in this example will read in a file and split the contents into separate files based on a delimiter.

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


Procedure

  1. Open the Assembly diagram of RetrieveAFileModule
  2. Expand Inbound Adapters, drag and drop FTP into the Assembly diagram.

  3. Select Simple:Create an inbound FTP service to read from a remote file.

  4. Click Next.

    Figure 1. Select the Service Type or Registry window

  5. In the FTP service name window, specify a meaningful name, such as FTPInboundInterface and click Next.

  6. In the Business object and location window, click Browse and navigate to the Customer business object.

  7. Specify the directory where you placed the input file, in this case the /home/user/event 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: ${FTPINBOUNDEVENTS}.

    Figure 2. Business object and location window

  8. In the FTP server security credential window, select either Using an existing JAAS alias or Using user name and password and click Next.

  9. 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.

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

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

  11. In the Archive directory and wrapper business object window, specify the Local archive directory, which is FTP\inboundarchive 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: ${FTPINBOUNDARCHIVE}. 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:

Artifact details
Artifact Name Description
Export FTPInboundInterface The export exposes the module externally, in this case, to WebSphere Adapter for FTP.
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 FTPInboundInterface This interface contains the operation that can be invoked.
Operation emitCustomerInput emitCustomerInput is the only operation in the interface.

Figure 4. The Business Integration section of the Integration Designer window with the new artifacts

Configure the module for deployment