Rule examples
Quick answer
These rule examples show the most common IdentityIQ hooks, correlation, build map, and field value, as short BeanShell snippets you can adapt.
Key takeaways
- Correlation, build-map and provisioning rules
- Short, commented BeanShell snippets
- Adapt identifiers to your schema
- Keep rules small and tested
Rules are how you customise IdentityIQ in BeanShell at defined hook points. These examples show the patterns you will reach for most, correlation, build-map and provisioning, with the context each rule receives and how to keep them safe and fast.
Correlation rule
A correlation rule matches an incoming account to the correct identity, usually on a stable key. It receives the account and returns a correlation expression:
import sailpoint.object.*;
// Correlate an account to an identity by employeeId
String empId = (String) account.getAttribute("employeeId");
if (empId == null || empId.trim().length() == 0) {
return null; // fall through to default correlation
}
return "employeeId==" + empId;Build-map rule
A build-map rule shapes raw data read from a source before it is applied:
// Normalise department casing coming from HR
String dept = (String) map.get("Cost_Center_Name");
if (dept != null) { map.put("department", dept.trim().toUpperCase()); }
return map;Guidance
- Always null-check attributes, missing values are the norm.
- Keep rules small and single-purpose.
- Never query per-identity in a loop, it destroys refresh performance.
- Version-control and test every rule.
Common pitfalls
- Unguarded attribute access throwing null-pointer errors.
- Heavy database work inside hot-path rules.
- Copying a rule without checking its context.
Want to learn this properly?
Our live, instructor-led SailPoint Training covers this hands-on, with real projects and a certification path.
Check your understanding
What do rule examples cover?
- A. Common hooks like correlation, build-map and provisioning, as BeanShell snippets.
- B. Keep them small, commented and tested.
- C. BeanShell (Java-like scripting).
Show answer
A. Common hooks like correlation, build-map and provisioning, as BeanShell snippets.
Common hooks like correlation, build-map and provisioning, as BeanShell snippets.
What language are IdentityIQ rules?
- A. Keep them small, commented and tested.
- B. BeanShell (Java-like scripting).
- C. Common hooks like correlation, build-map and provisioning, as BeanShell snippets.
Show answer
B. BeanShell (Java-like scripting).
BeanShell (Java-like scripting).
Best practice for rules?
- A. Common hooks like correlation, build-map and provisioning, as BeanShell snippets.
- B. BeanShell (Java-like scripting).
- C. Keep them small, commented and tested.
Show answer
C. Keep them small, commented and tested.
Keep them small, commented and tested.