Hi Shubham,
I think document you linked doesn’t apply to filtering via context url, its apply ISC side account exclusion.
To achieve your requirement if your api supports Payrollgroup based filter you can use that if not try to use webservice after operation rule
here is sample code modify according to your schema-
import java.util.*;
log.info(“After Aggregation Rule starting - payrollgroup only”);
if (processedResponseObject == null) {
Map emptyReturn = new HashMap();
emptyReturn.put(“data”, new ArrayList());
return emptyReturn;
}
String allowedPayrollGroup = “ABC”; // ← replace with the payroll group
List kept = new ArrayList();
int droppedPayroll = 0, droppedMissing = 0;
for (Iterator itRows = ((List) processedResponseObject).iterator(); itRows.hasNext()
{
Object obj = itRows.next();
if (!(obj instanceof Map)) { droppedMissing++; continue; }
Map m = (Map) obj;
Object pgObj = m.get(“payrollgroup”);
String pg = (pgObj == null) ? null : String.valueOf(pgObj).trim();
if (pg == null || pg.length() == 0 || !pg.equalsIgnoreCase(allowedPayrollGroup)) {
droppedPayroll++;
continue;
}
kept.add(m);
}
log.info(“After Aggregation payrollgroup-only: input=” + ((List) processedResponseObject).size()
-
“, kept=” + kept.size()
-
“, droppedMissing=” + droppedMissing
-
“, droppedPayroll=” + droppedPayroll);
Map returnMap = new HashMap();
returnMap.put(“data”, kept);
return returnMap;
Thanks
Mahesh