BeanShell basics
Quick answer
BeanShell essentials for SailPoint rules: syntax, the IdentityIQ API objects, logging and safe scripting patterns.
Key takeaways
- BeanShell is uncompiled Java with the full IIQ API
- context is your handle to read and save objects
- Use QueryOptions and projection for efficient reads
- Null-check, avoid heavy per-identity queries, log at debug
BeanShell in a nutshell
BeanShell runs Java without compilation. You can declare loosely typed variables, call Java classes, and use the full IdentityIQ API from inside a rule.
Key objects
context (SailPointContext) is your gateway to query and save objects; log writes to the server log; and rule-specific inputs like identity, account or link give you the data to work on.
Querying with context
Use context.getObjectByName, context.search and QueryOptions to read objects efficiently. Always project only the columns you need for performance.
Safe patterns
Null-check inputs, avoid heavy queries in per-identity rules, never commit unless required, and log at debug rather than printing to stdout.
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
Which object lets a rule query IdentityIQ data?
- A. log
- B. context
- C. identity
- D. plan
Show answer
B. context
context (SailPointContext) is the gateway for reading and saving objects.