Thursday, August 21, 2008

Adapter Patterns

Adapter Patterns wizard How to

Websphere Integration Developer v612

Contact us...

Contents

Introduction

Overview

Patterns enable the creation of integrated solutions based on pre-defined pieces. Websphere Integration Developer allows you to choose a pattern, provide relevant parameters exposed by a set of domain-specific wizards, which in turn create a deployable solution.

Patterns are useful time-savers in the creation of integrated solutions. They provide an already proven ready-to-use result. Patterns are basically parameterized Websphere Integration Developer artifacts that can generate single or multiple artifacts using existing or new modules or libraries.

Websphere Integration Developer facilitates the reuse of existing and new patterns using the Business Integration perspective.
Currently, the available patterns are:
  • Integration
    • Adapters
      • Email
        • Create an outbound Email service to send mail
      • FTP
        • Create an inbound FTP service to read from a remote file
        • Create an outbound FTP service to write to a remote file
      • Flat File
        • Create an inbound Flat File service to read from a local file
        • Create an outbound Flat File service to write to a local file
  • Business processes
    • Implementation
      • Human Task Client from Lotus Form
Related links

How to create an inbound Flat File service to read from a local file

Related links
Overview
The Flat File inbound pattern creates a service that retrieves a file from a directory on the local file system. 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.

The inbound service receives the file from the file system for processing.

Do the following steps to create the inbound service using the adapter pattern wizard.

Activate Adapter Pattern wizard
Right-click SeparateCustomers and select New > Project > From Patterns.
A New from Pattern window is displayed.
Select Pattern to create
In the New from Pattern window, select Flat File > Create an inbound Flat File.... and click Next.
A New Inbound Flat File Service window is displayed.
Note:
WID 6.1.2 currently supports only the patterns on the right.
Set Flat File service name
Change the Name to CustomersIn and click Next.
Set Business object and directory
  1. Click Browse besides the Business object: field and select Customer.
  2. Click Browse besides the Directory: field and select c:flatfilesinboundevents
  3. Click Next

Select Data Type

Select Customer and click OK.

Business object and directory setup
Business object and directory setup is complete.
Click Next.
Set Input file format and file content split option
  1. Input file format
    Select XML
  2. File content split option
    Select Split file content by delimiter.

    In the field, enter ####;rn. The delimiter is ####. The semi-colon (;) indicates there are more delimiters after the ####. The rn, in the Windows environment, indicates a new line.
  3. Click Next.
Specify the archive directory
  1. Click Browse to find the local directory to archive processed files.
  2. Click Finish.
The inbound Flat File service is created
Note the following additions:
  1. CWYFF_FlatFile
  2. CustomersIn export
  3. CustomersIn interface
  4. Binding Resources

There is also 1 warning:

The export does not specify a target component or import.

How to create an outbound Flat File service to write to a local file

Related links
Overview
The Flat File outbound pattern creates a service that stores data in a file in a directory on the local file system. 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.
The outbound service outputs a file that has been processed to the file system.

Do the following steps to create the outbound service using the adapter pattern wizard.

Activate Adapter Pattern wizard
Right-click SeparateCustomers and select New > Project > From Patterns.
A New from Pattern window is displayed.
Select Pattern to create
In the New from Pattern window, select Flat File > Create an outbound Flat File.... and click Next.
Set Flat File service name
Change the Name to SeparateCustomerOut and click Next.
Set Business object and directory
  1. Click Browse besides the Business object: field and select Customer.
  2. Click Browse besides the Directory: field and lookup c:flatfilesoutputdir
  3. Click Next

Select Data Type

Select Customer and click OK.

Business object and directory setup
Business object and directory setup is complete.
Click Next.
Set Output file name
The Output file name window opens.
A variety of ways can be used to create an output file name.
Accept the defaults, which will result in output files for each customer record in the format Customer.<number of customer record>.txt.
The Customer.seq file will contain the number of customer records processed.
Generating a random file name is useful if your application requires unique generated output file names. If, in creating the inbound service you had created a wrapper business object, then you would select the wrapper business object to specify the output file name. In that case, you can also select an append operation for writing all business objects to a single file rather than multiple files.
Accect the defaults and click Next.
Select Output file format
  1. Select XML.
  2. Click Finish.
The outbound Flat File service is created
Note the following additions:
  1. SeparateCustomersOut export (EIS binding)
  2. SeparateCustomersOut interface
  3. CommonSchemas under Data Types


No comments: