IT CanvassTalk to an advisor
Examples · LessonBy , 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?
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