IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Complex Record Mapping using Java of Carl Ozkaynak

  • 1.  Complex Record Mapping using Java of Carl Ozkaynak

    Posted Wed June 11, 2003 10:51 AM

    Hi Carl ,
    I realy impresed with the code in archive but i have problem in implementing the same. as i saw there is some code missing.

    Not able get that please can clarify me urgently

    Next, using a standard Java for-loop, get the value of orderItemsList key “Stock”. Remember that a cursor is required to navigate the IData object.

    for (int i=0; i ???
    IDataCursor idcItem = orderItemsList[i].getCursor();

    idcItem.first(“Stock”);
    String stock = (String)idcItem.getValue();

    i saw in two place same thing missing .

    Please need it urgently.

    with regards
    satya


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Complex Record Mapping using Java of Carl Ozkaynak

    Posted Thu July 10, 2003 05:46 AM

    Hi Satya,

    Wow. Thank you for pointing this out. It looks like there must have been an error of some sort when converting to the new look & feel of wmusers site. The full code was here before.

    Here is the code you were looking for:

    IData orderList = (IData)ValuesEmulator.get(pipeline, “Order”);

    IData newOrderList = (IData)ValuesEmulator.get(orderList, “NewOrder”);

    IData bulkOrderList = (IData)ValuesEmulator.get(newOrderList, “BulkOrder”);

    IData orderInformationList = (IData)ValuesEmulator.get(bulkOrderList, “OrderInformation”);

    // Retrieve the necessary elements the OrderInformation structure
    IDataCursor idc = orderInformationList.getCursor();

    idc.first(“CustomerName”);

    String custName = (String)idc.getValue();

    idc.first(“OrganizationType”);

    String organizationType = (String)idc.getValue();

    idc.destroy();

    // Retrieve the elements from the line
    IData orderItemsList = (IData)ValuesEmulator.get(orderInformationList, “OrderItem”);

    for (int i=0; i<orderItemsList.length; i++) {

       IDataCursor idcItem = orderItemsList[i].getCursor(); 
    idcItem.first("Stock"); 
    String stock = (String)idcItem.getValue(); 
    
    idcItem.first("Price"); 
    String price = (String)idcItem.getValue(); 
    
    idcItem.first("Side"); 
    String side = (String)idcItem.getValue(); 
    
    if (stock.equals("IBM") && organizationType.equals("XYZ")) { 
    // Set the value if the transformation rule is true. 
    // copy the new valuen into the specified field 
    idcItem.first("CUSIP"); 
    idcItem.setValue("12345"); 
    } 
    
    
    if (stock.equals("NRWR") && organizationType.equals("ABC")) { 
    
    // Set the value if the transformation rule is true. 
    // copy the new valuen into the specified field 
    idcItem.first("SEDOL"); 
    idcItem.setValue("67891"); 
    } 
    

    }

    idcItem.destroy();

    Hope this helps!

    Thanks!

    Best Regards,
    Carl


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB