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
  • 1.  Wm6.5 Sort itemList

    Posted Tue June 16, 2009 10:55 PM

    Java code was posted regarding this …

    #4 09-21-2008, 23:11
    abrat13
    Member Join Date: Aug 2006

    Code Shown at the bottom<<<<<<<<


    Issue
    I need an entire document sorted and not knowing java I assume this code is sending a sorted document to sortedItemList

    Inputs for this service
    itemList = mapped the documentReferenceList I am trying to sort
    keyField = /itemList/invoiceDetail/customerCode… assuming it is looking for an itemList keyField
    sortDescending = ‘sortDescending’

    Outputs for this service
    sortedItemList = not showing on the results pane
    sorted = true

    I can see my itemList and the unsorted Values. It does not appear this is doing anything. Code I am using is below.

    IData sortedItemList = null;
    IDataCursor pipelineCursor = pipeline.getCursor();
    IData itemList = IDataUtil.getIDataArray( pipelineCursor, “itemList” );
    String keyField = IDataUtil.getString( pipelineCursor, “keyField” );
    boolean sortDescending = (Boolean.valueOf(IDataUtil.getString( pipelineCursor, “sortDescending” ))).booleanValue();
    pipelineCursor.destroy();
    if(itemList != null) {
    sortedItemList = IDataUtil.sortIDataArrayByKey(itemList, keyField, IDataUtil.COMPARE_TYPE_COLLATION, null, sortDescending);
    }
    // pipeline
    pipelineCursor = pipeline.getCursor();
    IDataUtil.put( pipelineCursor,“sorted”, sortedItemList==null ? “false” : “true”);
    pipelineCursor.destroy();


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Wm6.5 Sort itemList

    Posted Wed June 17, 2009 05:49 AM

    I’m not entirely sure, but I don’t think the key field can be nested within any structure. I think it may need to be a field at the root of each document in the list.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Wm6.5 Sort itemList

    Posted Wed June 17, 2009 03:32 PM

    For not being entirely sure you certainly hit this one head on.
    I created a new DocumentList with SortKey at the root level and I could not be happier with the results.

    As always thanks, thanks, thanks


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services