Mapping (ICS Integration Broker only)

This section discusses the following:

Mapping problems

If the business objects are not being mapped or mapping is not being invoked, check to make sure the maps have been installed in the correct directory.

Date conversion

Note:
This date conversion procedure applies only to versions of the connector prior to version 1.5.0.

Use WebSphere Business Integration Adapter maps to convert data stored in Date format in the database to the String format used by a WebSphere Business Integration Adapter business object.

For example, assume that you want to convert the following date, which is stored in an Oracle database:

Sun Jan 01 00:00:00 CEST 1999
 

to the following string, which is processed in a WebSphere Business Integration Adapter i2ADW business object:

Jan 01 1999 00:00:00
 

To perform this conversion, use the DtpDate() and DtpSplitString() constructors defined for data transformation in WebSphere Business Integration Adapter mapping. For the syntax and a description of these constructors and the classes whose objects they construct, see the Map Development Guide.

To use a WebSphere Business Integration Adapter map to convert the Date value to a String, follow these steps:

  1. Use DtpSplitString() with a space delimiter to split the string into its six pieces and rearrange it into an order that DtpDate can use. To convert the example date, use:
       DtpSplitString OurSplitString = new DtpSplitString
           ("Sun Jan 01 00:00:00 CEST 1999"," ");
     
    

    In the above statement, OurSplitString is a user-defined variable of type DtpSplitString, and a space is specified as the delimiter.

  2. Use the nextElement() method of the DtpSplitString class to loop through the newly created OurSplitString variable, putting each of the variable's six elements into an array whose elements are of type String. The following example specifies OurStringPieces as the output array:
       String[] OurStringPieces = new String[6];
        for (i=0;i<=5;i=i+1){
           OurStringPieces[i]=OurSplitString.nextElement();
        }
     
    

    This looping produces the following array elements:

       OurStringPieces[0] = Sun
        OurStringPieces[1] = Jan
        OurStringPieces[2] = 01
        OurStringPieces[3] = 00:00:00
        OurStringPieces[4] = CEST
        OurStringPieces[5] = 1999
     
    
  3. Concatenate the pieces of the string needed for DtpDate input. The example conversion uses "M D Y h:m:s" as the input format for DtpDate, which requires the converted string to look like "Jan 01 1999 00:00:00". This example String uses elements 1, 2, 5, and 3 of the OurStringPieces array:
    OurConcatenatedString =
     OurStringPieces[1]+OurStringPieces[2]+OurStringPieces[5]+OurStringPieces[3];
     
    
  4. Use your new concatenated string as input into DtpDate:
    DtpDate OurDtpDate = new DtpDate(OurConcatenatedString,"M D Y h:m:s");
     
    

After you have put the Date value into DtpDate format, you are ready to work with the date in your map.

Copyright IBM Corp. 1997, 2003