for (String resVal : policyRes.getValues()) {
XXServiceResourceElementValue resourceElementValue = new XXServiceResourceElementValue();
resourceElementValue.setResElementId(resourceElement.getId());
resourceElementValue.setValue(resVal);
resourceElementValue.setSortOrder(sortOrder);
<BUG>resourceElementValue = (XXServiceResourceElementValue) rangerAuditFields.populateAuditFieldsForCreate(resourceElementValue);
resourceElementValue = daoManager.getXXServiceResourceElementValue().create(resourceElementValue);</BUG>
sortOrder++;
}
}

for (String resVal : policyRes.getValues()) {
XXServiceResourceElementValue resourceElementValue = new XXServiceResourceElementValue();
resourceElementValue.setResElementId(resourceElement.getId());
resourceElementValue.setValue(resVal);
resourceElementValue.setSortOrder(sortOrder);
resourceElementValue = rangerAuditFields.populateAuditFieldsForCreate(resourceElementValue);
resourceElementValue = daoManager.getXXServiceResourceElementValue().create(resourceElementValue);
sortOrder++;
