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();