Issue Statement: If there are duplicate records(identified by key field) in a message, send only one record to target system.
Input & Output Message Structure:
MT_Vendor
row
SupplierNumber
Field1
Field2
....
....
Logic: Create 'row' node only once for duplicate records. Suppress the other duplicate records.
Solution: Create a simple UDF, to suppress the subsequent duplicate records. I got the UDF code from SDN, when I was implementing the logic for a project :smile:
Message mapping:
UDF Code:
for (int i = 0; i < input.length; i++) {
int found = 0;
for (int j = 0; j < i; j++) {
if (input[i].equals(input[j]))
{
found = 1;
break;
}
}
if (found > 0) result.addSuppress();
else result.addValue(input[i]);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
9 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |