Hello,
Did try to add the Cloning, but ended with null pointer exception when running the service. The java code is getting compiled without errors. I am working on Version 4.6.
Here is the changed code
IData sortedItemList = null;
IData itemListClone = sortedItemList;
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
IDataCursor pipelineCursor1 = pipeline.getCursor();
IData itemList = IDataUtil.getIDataArray( pipelineCursor, “itemList” );
try {
if (itemList != null)
{
for (int i=0;i<itemList.length;i++)
if (itemList[i] != null)
itemListClone[i] = IDataUtil.deepClone(itemList[i]);
}
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);
}
}catch (IOException e) {}
// pipeline
pipelineCursor1 = pipeline.getCursor();
IDataUtil.put( pipelineCursor1,“sortedList”,sortedItemList);
pipelineCursor1.destroy();
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB