Configuring WebSphere Adapters on WebSphere Transformation Extender

This article describes a business integration scenario involving WebSphere Adapters and WebSphere Transformation Extender. Business data is retrieved from a remote FTP server using WebSphere Adapter for FTP, and sent to the recipient via e-mail using WebSphere Adapter for E-mail. WebSphere Transformation Extender is used as the runtime.

Share:

Bharathi Manian (bharathi.manian@in.ibm.com), Software Developer, WebSphere Adapters team, IBM

Bharathi Manian is a Software Developer on the WebSphere Adapters team at the IBM India Software Lab in Bangalore, India. She has six years of experience and her areas of expertise include Java, J2EE, and Web technologies. She received a Bachelor's degree in Computer Engineering from Birla Institute of Technology and Science in Pilani, India. You can contact Bharathi at bharathi.manian@in.ibm.com.



Srikanth K Murali (skeralap@in.ibm.com), Software Developer, WebSphere Adapters team, IBM

Murali K. Srikanth is a Software Developer on the WebSphere Adapters team at the IBM Software Lab in Bangalore, India. He has over three years of experience working with Java and J2EE technologies. He received his Bachelor's degree in Computer Science from RVCE, Bangalore. You can contact Murali at skeralap@in.ibm.com.



22 December 2010

Introduction

Most enterprises must deal with diverse, complex data spread across multiple data sources and applications, and some of the biggest problems they face involve handling various input formats, processing them, and sending the output to multiple endpoints.

WebSphere Transformation Extender

IBM® WebSphere® Transformation Extender (hereafter called WebSphere TX) helps enterprises transform data in different formats, including XML, EDI, SWIFT, and HIPAA, and can greatly reduce development and maintenance costs involved in complex data conversion. WebSphere TX can be embedded, or can run as a standalone data transformation engine, and thereby provide its services to ESB's, application servers, messaging engines, and various applications.

WebSphere TX Enterprise Packs provide ready-to-use capabilities to accelerate WebSphere TX connectivity with key independent software vendor (ISV) business applications. Available WebSphere TX Enterprise Packs include WebSphere TX for PeopleSoft, WebSphere TX for SAP R/3, WebSphere TX for SAP XI, WebSphere TX for Siebel, and others.

WebSphere Adapters

WebSphere Adapters implement Java Connector Architecture (JCA) 1.5 and enable bi-directional connectivity between different enterprise information systems (EIS's) and client applications. The WebSphere Adapters suite consists of application and technology adapters that help to connect to systems such as FTP, PeopleSoft, SAP, Siebel, and e-mail servers.

Figure 1. WebSphere Adapters offerings
WebSphere Adapters offerings

By using WebSphere Adapters, applications can send requests to the EIS to invoke functions such as create, retrieve business data (outbound), or receive notification for events that occur in the EIS (inbound).

Prerequisites

This article is for intermediate users of WebSphere Adapters working with WebSphere TX. In order to perform the steps in this article, you need to have WebSphere TX V8.3.0.3 installed. WebSphere Adapter for FTP V7 and WebSphere Adapter for E-mail V7 are packaged with WebSphere TX and used in this article.

Scenario

In this scenario, business data is retrieved from a remote FTP server using WebSphere Adapter for FTP, and the data is sent to the recipient via e-mail using WebSphere Adapter for E-mail. WebSphere TX is used to build a map that uses WebSphere Adapters as part of the input and output cards. The External Service wizard is used to configure the Adapters and generate the artifacts. These artifacts are later used in the map to create an integration solution. Finally, the compiled map is deployed using the Launcher tool.

Creating a new WebSphere TX project

The first step is to create a new extender project called FTPtoEmail in the WebSphere TX Design Studio:

Figure 2. Create extender project
Create extender project in WebSphere TX
Figure 3. Configure the extender project
Configure the extender project in WebSphere TX

Configuring WebSphere Adapter for FTP using the Adapter wizard

  1. Select File=>Import. Expand WebSphere TX, select IBM WebSphere Adapter for FTP, and click Next:
    Figure 4. Import WebSphere Adapter for FTP into Extender project
    Import FTP Adapter into Extender project
  2. Click Next in the Resource Adapter Selection window.
  3. In the Connector Import window, make sure that Runtime is set to WTX Runtime 8.3.0.0 and then click Next.
  4. In the Processing Direction window, select Inbound and click Next. The Adapter will be configured to perform inbound operation, in which it polls for files from a specified event folder on the remote FTP server.
  5. Enter the connection information for the FTP server and the local directory path where the file will be temporarily stored:.
    Figure 5. Configure WebSphere Adapter for FTP
    Configure connection properties for FTP Adapter
  6. In the Operation window, click Add to add an operation. Select the default Generic FTP business object and click Finish:
    Figure 6. Selecting the data type
    Select the data type
  7. The default operation name is emitFTPFile. Click Next.
  8. In the Generate Command Configuration Parameters window, enter the value FTPInbound for the File Name field and click Finish.

Creating a type tree

A type tree defines the structure and semantics of the data. It is analogous to the business object definitions used in SCA. A type tree in this scenario is used to define the structure of the data that will be used by adapters to perform their inbound or outbound operations.

  1. Right-click on the Extender project FTPtoEmail and select New=>Type tree:
    Figure 7. Create a type tree
    Create a type tree
  2. Enter the name as blob.mtt:
    Figure 8. Enter the name of the type tree: blob.mtt
    Name the type tree
  3. Right-click on the root element and select Add to create a new subtype. Name it as blob.
  4. On the Properties tab for the blob type, select the option Item for the Class field . Save the type tree.
  5. Right-click on the type tree in the Navigator window and select Analyze Type Tree to analyze the type tree for any errors:
    Figure 9. Set class of the type as Item
    Set Class of the type as Item

Creating a map

A map defines the transformation rules between the input and output data. Each map can contain multiple input and output cards that transform data from the source data format to the destination data format. A map source contains one or more map files.

  1. Select Map files from the Extender project, right-click, and select New => Map Source:
    Figure 10. Create a new map source
    Create a map source
  2. Select FTPtoEmail as the parent folder, enter the file name as Ftp_Email, and click Finish. A map source file named Ftp_Email is created in the project.
  3. To create a new map under this map source, right click on Ftp_Email in the Outline window and select New:
    Figure 11. Creating a new Map
    Create a Map
  4. Enter the name of the new map as ftpemail.

The next steps configure the input and output cards for the map. The input card corresponds to an inbound adapter component, which enables the EIS to invoke the message flow when an event occurs. Similarly, the output card corresponds to an outbound adapter component, which is used by the map to invoke a service in the EIS.

Configuring the input card

  1. Expand ftpemail and create a new input card:
    Figure 12. Create a new input card
    Create a input card
  2. Enter the card name as ftp.
  3. Click Browse in the Type Tree property item and select blob.mtt:
    Figure 13. Select a type tree definition for the input card
    Select a type tree defeinition for the input card
  4. Click Browse in the Type property item. The type tree selected in the previous step will be displayed in the popup window. Select the blob item type.
  5. To configure the source rule, select Browse beside the Source property, and from the dropdown list, select WebSphere FTP:
    Figure 14. Select WebSphere Adapter for FTP as source for the input card
    Select WebSphere Adapter for FTP as source for Input card
  6. For the Command property, click Browse to open a Command Configuration window. Since the adapter is already configured, select Browse under the Service Definition file checkbox to select the generated artifact.
  7. Expand FTPtoEmail and select FTPInbound.export. Click OK.
  8. Click Next on the Adapters Operation window.
  9. Enter the username and password of the FTP server in the Connection properties window and click Next.
  10. In the Resource Adapter properties window, enable the checkbox for Specify tracing options. Enter a path for the trace file and select the tracing mode:
    Figure 15. Configure tracing options for WebSphere Adapter
    Select tracing options
  11. Click Finish. The input card is now configured:
    Figure 16. Snapshot of input card after configuration
    Input card configuration

Configuring the output card

  1. Expand ftpemail and create a new output card:
    Figure 17. Create an output card for the map
    Create an output card for the map
  2. Enter the card name as email.
  3. The Target Rule must be configured before the Type Tree is configured. To configure the Target, select WebSphere Email from the dropdown list:
    Figure 18. Select WebSphere e-mail as target of the output card
    Select WebSphere e-mail as target in output card
  4. For the Command property, click Browse to open the Command Configuration window.
  5. Select the Adapter wizard option in the Command Configuration window and click OK to start the import wizard to configure the adapter.
  6. In the next steps, the adapter RAR will be imported into the project. Click Next.
  7. Select Outbound and click Next again.
  8. In the Connection Properties window, enter the connection information for the Email server:
    Figure 19. Configure WebSphere Adapter for E-mail
    Configure WebSphere Adapter for E-mail
  9. Click Add in the Operations window. Select Simple e-mail for the data type for the input operation and click Finish.
  10. Click Next in the Operations window.
  11. In the Generate Command Configuration Parameters window, enter the filename as EmailOutbound and the function Name as CREATE.
  12. Specify the location for the trace file and tracing options and then click Finish:
    Figure 20. Configure tracing options for the Adapter
    Set tracing options
  13. The Command property is automatically populated, but you have to manually enter certain properties. Ensure that Command has the following properties :
    Listing 1. Command value for WebSphere Adapter for E-mail
    -TV C:\emailj2ca.mtr -wtx:schemadir C:\wid-build\WTX_Email\FTPtoEmail\CommonSchemas 
    -is:functionName Create -wtx:typename EmailOutboundResponse 
    -wtx:uri http://www.ibm.com/xmlns/prod/websphere/j2ca/email/emailoutboundresponse 
    -wtx:ispec com.ibm.j2ca.email.EmailInteractionSpec 
    -wtx:record com.ibm.j2ca.email.EmailStructuredRecord 
    -mcf:adapterID 001 -mcf:host 9.121.220.45 
    -mcf:userName "emailjca" -mcf:password "addcuser"
  14. To configure the Type Tree, click Browse corresponding to TypeTree and select SimpleAlertEmailTX.xsd from the CommonSchemas folder listed under the FTPtoEmail project:
    Figure 21. Select the Type Tree for the output card
    Select the Type Tree for output card
  15. Click Browse to configure the Type property, select under XSD=>global, and then click SimpleAlertEmail:
    Figure 22. Select data type for the output card
    Select data type for the output card
  16. The output card email is configured. Click OK:
    Figure 23. Output card after configuration
    Output card after configuration

Configuring rules

  1. The input and output cards are now configured. In the output card, email, enter the values for the To, From, and Subject fields. For fields that are not required to be populated, select NONE. The content of the mail sent to the recipient is obtained from the file retrieved from the remote FTP server. This mapping between the input and output cards has to be performed.
  2. For the mailContent of the output card, populate its value as =ftp, indicating the content of the blob item type in the input card:
    Figure 24. Map configured with the rules
    Map configured with the rules
  3. Save the Map, then build it: right-click on the map and select Build all maps. A map executable file is created. In this example, it is named Ftp_Email.mmc.

Creating the system target file for deployment

In this scenario, the business event is being triggered by an external business process in the remote file system. The map needs to be loaded into the runtime environment so that the map execution is triggered when an event occurs in the remote file system:

  1. Start the Integration Flow Designer:
    Figure 25. Start Integration Flow Designer
    Start Integration Flow Designer
  2. Select File=> New from the main menu to create a new definition file.
  3. Select System => Add component => compiled map from the main menu to import the compiled map:
    Figure 26. Import compiled map into Integration Flow Designer
    Import compiled map into Integration Flow Designer
  4. Select the executable file from the Design Studio workspace created in the previous section.
  5. Right-click on the Map component and select Edit Launcher.
  6. Expand the Input(s) option and set SourceEvent to ON, which ensures that the map is loaded to listen to the business events and trigger the execution of the map:
    Figure 27. Set SourceEvent to ON to listen to business events
    Set SourceEvent to ON
  7. Save the system definition file as FtpToEmail.msd. Select System =>Generate and enter the filename as FtpToEmail.msl to generate a system target file that will be deployed in the runtime environment.

Deploying and running the system file

Before continuing, ensure that the runtime environment is configured using the Launcher administration tool. Ensure that a user is created and proper permissions are provided. Also, set the value for deployment directory, which specifies the location for the system target file. The default value for deployment directory is <WTX_INSTALL_DIR>/systems.

  1. Copy the FtpToEmail.msl file created in the previous section to the deployment directory. Start the IBM WebSphere TX 8.3 Launcher Windows service.
  2. To monitor the operation of the runtime environment, start the Management Console from the Start menu.
  3. Select Launcher => New to configure a new Launcher and enter the relevant information for hostname and port number. Click OK to complete the configuration.
  4. Right-click on the new launcher you created and select Connect:
    Figure 28. Set the SourceEvent to ON to listen to business events
    Connect to the Launcher
  5. In the right-hand window, information regarding the runtime is displayed. The value for the property Active Listeners up will be 1, indicating that the Inbound FTP Adapter is deployed and is listening for any events in the remote file system.
  6. To test the integration scenario, create a file with suitable content in the configured event directory on the remote file system. The inbound FTP adapter will be triggered. The file content will be encapsulated in a business object and will be sent to the map for conversion. The map will then trigger the Email outbound adapter, and it will send the contents of the file to the configured recipient in the form of an e-mail, completing the integration scenario:
    Figure 29. Management console window showing status of map execution
    Management console window showing status of map execution

The value of the field History Successes will be updated to 1, indicating that the map was executed successfully.

Conclusion

This article described a business integration scenario involving WebSphere Adapters and WebSphere TX.

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into WebSphere on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=604661
ArticleTitle=Configuring WebSphere Adapters on WebSphere Transformation Extender
publish-date=12222010