The Filter.eq("compositeDefinition.primaryTier", targetAppName) syntax assumes compositeDefinition is a navigable property of the Application class, but it’s actually an embedded value within the Attributes map. The QueryOptions and Filter mechanisms in IIQ can’t directly traverse into map-based attributes like this. You’ll need to fetch the Application objects and then manually inspect the compositeDefinition within the Attributes map in your rule.
import sailpoint.object.*;
import sailpoint.tools.*;
String targetAppName = "LDAP";
QueryOptions qo = new QueryOptions();
qo.addFilter(Filter.eq("type", "Logical")); // Filter for Logical Applications only
// Get all Logical Applications
Iterator logicalIter = context.getObjects(Application.class, qo);
List matchingApps = new ArrayList<>();
while (logicalIter.hasNext()) {
Application app = logicalIter.next();
Attributes attrs = app.getAttributes(); // Get the Attributes map
if (attrs != null && attrs.containsKey("compositeDefinition")) {
CompositeDefinition compDef = (CompositeDefinition) attrs.get("compositeDefinition");
if (compDef != null && targetAppName.equals(compDef.getPrimaryTier())) {
matchingApps.add(app); // Add to list if primaryTier matches "LDAP"
}
}
}
// Clean up iterator
Util.flushIterator(logicalIter);
// Now 'matchingApps' contains all Logical Applications where primaryTier is "LDAP"
// You can process matchingApps as needed, e.g., log or return them
for (Application app : matchingApps) {
log.debug("Found matching app: " + app.getName());
}
return matchingApps; // Or handle as required by your rule
For more insights, you might want to check these community blogs: