Examples · LessonBy Imran Q, SailPoint Trainer, 7 yrs · Published · IdentityIQ 8.4 · all levels
BeanShell examples
Standalone BeanShell snippets used across IdentityIQ.
Quick answer
These BeanShell examples show common scripting patterns, logging, attribute access and helper calls, used inside rules and workflows.
Key takeaways
- Logging and debugging
- Attribute access
- Calling helper methods
- Keep snippets side-effect-light
BeanShell is the scripting language used throughout IdentityIQ rules and workflows. These snippets show everyday patterns that keep custom logic debuggable and robust.
Logging for debugging
import org.apache.log4j.Logger;
Logger log = Logger.getLogger("custom.myrule");
log.debug("Processing: " + (identity != null ? identity.getName() : "null"));Safe attribute access
String dept = identity != null ? identity.getStringAttribute("department") : null;
if (dept == null) { dept = "UNKNOWN"; }Guidance
- Log at debug with a named logger to trace values without production noise.
- Guard every dereference, BeanShell throws at runtime otherwise.
- Keep snippets side-effect-light, they often run per identity.
Common pitfalls
- No logging, leaving failures opaque.
- Null-pointer errors from unguarded access.
- Expensive work in per-identity snippets.
Practice challenge
+0 XPStreak ×0
Question 1 of 3
What is BeanShell used for?
Frequently asked questions
What does the term BeanShell examples refer to in SailPoint?
BeanShell is the scripting language used throughout IdentityIQ rules and workflows. These snippets show everyday patterns that keep custom logic debuggable and robust.
What is another point to note about BeanShell examples?
Log at debug with a named logger to trace values without production noise. Guard every dereference, BeanShell throws at runtime otherwise. Keep snippets side-effect-light, they often run per identity.
What tends to go wrong with BeanShell examples?
No logging, leaving failures opaque. Null-pointer errors from unguarded access. Expensive work in per-identity snippets.
Want this with a live instructor and a lab tenant?