Skip to Content
0
Jan 16, 2018 at 11:11 AM

UDF Function not processing Second record in the extracted list

59 Views

we have JDBC to SOAP Scenario where We have successfully extracted Data from an SQL Table using JDBC Adapater , we are using a SOAP Receiver Channel to send the data in a below format

<Data>COL1;COL2;.......;COL18

DATA1[1];DATA2[1];......;DATA18[1]

DATA1[2];DATA2[2];......;DATA18[2]

</Data>

For this i had created a UDF function however the function only seems to process a single row of data not multiple.

public void FN_UDFConCat(String[] rowCount, String[] COL1, String[] COL2, String[] COL3, String[] COL4,.. STRING COL18, ResultList result, Container container) throws StreamTransformationException{

String delimiter = " ; ";

String columnHeader = "COL1;COL2;COL3;.......COL18";

String newLineCharacter = "\n";

String finalOutput = " ";

String value;

int i = 0;

finalOutput = columnHeader + newLineCharacter ;

//value = "IN";

//MappingTrace mt = container.getTrace();

for ( i = 0; i < rowCount.length; i ++)

{

//mt.addInfo(value);

finalOutput = finalOutput +

COL1[i] + delimiter +

COL2[i] + delimiter +

COL3[i] + delimiter +

COL4[i] + delimiter +

COL4[i] + delimiter +

COL5[i] + delimiter +

COL6[i] + delimiter +

COL7[i] + delimiter +

COL8[i] + delimiter +

COL9[i] + delimiter +

COl10[i] + delimiter +

COl11[i] + delimiter +

COl12[i] + delimiter +

COl13[i] + delimiter +

COL14[i] + delimiter +

COl15[i] + delimiter +

COl16[i] + delimiter +

COl17[i] + delimiter +

COL18[i] + delimiter +newLineCharacter;

}

result.addValue(finalOutput);

}