I have tried to implement the sort by key described, the service compiles. I have the following code. My input is a document list called Transaction which has 3 variables (quantity, userstatus, and typename). I want to sort on the typename column. When I test the service my Transaction document list is the same no sort has occurred and the sort value is false. What am I missing?
IData sortedItemList = null;
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
// Get Transactions
IData Transactions = IDataUtil.getIDataArray( pipelineCursor, “Transactions” );
String keyField = IDataUtil.getString( pipelineCursor, “typename” );
boolean sortDescending = false;
pipelineCursor.destroy();
if ( Transactions != null)
{
sortedItemList = IDataUtil.sortIDataArrayByKey(Transactions, keyField, IDataUtil.COMPARE_TYPE_COLLATION, null, sortDescending);
}
// pipeline
pipelineCursor = pipeline.getCursor();
IDataUtil.put( pipelineCursor, “sorted”, sortedItemList==null ? “false” : “true”);
pipelineCursor.destroy();