Unfortunately this is a bug in the unique value renderer when you create it programatically. If the render is read from JSON i.e. from a service then multiple fields will work.When creating one in code a work around is to turn the unique values into JSON and then read back into a unique value e.g.
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
private UniqueValueInfo getUniqueValueInfo(Object[] values, Symbol symbol) throws Exception {
UniqueValueInfo uv = new UniqueValueInfo(values, symbol);
ObjectMapper mapper = new ObjectMapper();
JsonNode node = mapper.readTree(uv.toJson(","));
return new UniqueValueInfo(node);
}
So create your renderer like this
UniqueValueRenderer uvr = new UniqueValueRenderer(null, "TYPE", "SEVERITY", "ATTACHMENTTYPE");
uvr.addValue(getUniqueValueInfo(new Object[] {0, 1, 0}, getPMS("resources/traffic_cone.png", 20)));
uvr.addValue(getUniqueValueInfo(new Object[] {0, 2, 0}, getPMS("resources/traffic_cone.png", 30)));
uvr.addValue(getUniqueValueInfo(new Object[] {0, 3, 0}, getPMS("resources/traffic_cone.png", 40)));
This should hopefully resolve your problem.