IT CanvassTalk to an advisor
Examples · LessonReviewed by Neelima, SailPoint Architect · Updated · Published · IdentityIQ 8.4 · all levels

SailPoint Rule examples

Copy-ready BeanShell rule examples for correlation, build-map and provisioning hooks.

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 this with a live instructor and a lab tenant?
SailPoint Developer training →
Already working on SailPoint and stuck on a live ticket?Get an expert SailPoint developer on screen-share to finish your daily tasks with you. Deliver on time, protect your reputation and your job. Monthly support only, no task-wise plans.Task assigned · no idea where to startStill stuck · your job on the lineExpert joins your screenDelivered on timeExplore On Job Support