BeanShell Developer's Guide for IdentityIQ Bean Shell Developer's Guide for IdentityIQ IdentityIQ provides installations opportunities to configure site specific behavior of the software in several places through the use of the Bean Shell scripting language. Bean Shell is an interpreted language with syntax similar to the Java 1.4 and Java 1.5 programming languages. Scripts written in Bean Shell have access to all of the running Java APIs, classes, and objects available in the JVM running the Bean Shell script. More details about Bean Shell can be found at the maintainer's web site (BeanShell - Lightweight Scripting for Java). The purpose of this document is to illustrate the finer points of the art of creating Bean Shell code for IdentityIQ. The authors hope to communicate best practices, example patterns, and illustrate some example antipatterns for creating Bean Shell code for IdentityIQ. This document contains examples, illustrations and explanations for how to create excellent Bean Shell code. IdentityIQ interprets Bean Shell scripts in several parts of the product. Different places where Bean Shell is interpreted include Rules, Workflow Steps, and Scripts. Each of these objects is stored simply as a string of text that holds Bean Shell code that gets persisted in IdentityIQ's database. These strings get parsed and then executed by the Bean Shell interpreter at run-time. The interpreted code interacts with IdentityIQ objects to create custom, site-specific behaviors. This "interpreted at run-time" flexibility allows IdentityIQ to be extremely amenable to change to account for site-specific business needs. Like many things, with great power comes great responsibility; creating elegant, functional, and supportable Bean Shell code is critical to making a successful IdentityIQ installation. This guide presents information on specific topics separated into chapters. Each chapter is designed to be read in approximately one hour or less. Much like in an academic course, later chapters build on information presented in earlier chapters; chapters are generally best consumed the first time in numeric or sequential order. Chapters and their examples are also designed to be used for quick references on specific topics. Each chapter has a discussion section associated with it where questions and answers can be posted. Example code for topics discussed in each chapter is attached for easy downloading and modification. In some circumstances, especially for the later chapters, script examples will need editing and modification before they will work in site-specific environments. Contents 1 - Hello World - A Test Framework 2 - Using Apache Log4J in Bean Shell 3 - Listing Objects in Namespace at Runtime 4 - Bean Shell and the IdentityIQ Object Model 5 - Querying IdentityIQ Objects 6 - Committing 1 BeanShell Developer's Guide for IdentityIQ Changes to IdentityIQ Objects 7 - Executing Bean Shell on a Schedule 8 - Measuring the Performance of Bean Shell Code 9 - Performance Optimizations of Logging Code 10 - Connecting to JDBC Data Sources 11 - Checking for null Values in Bean Shell 12 - Integrating REST Clients and Bean Shell 13 - Aggregation Rule Best Practices 14 - E-Mail Based Reporting with Bean Shell 15 - Workflow Trigger Rule Best Practices 16 Workflow Step Best Practices 17 - Dynamic E-Mail content with Bean Shell 18 - LiveReport Construction and Bean Shell 19 - Understanding Link and ResourceObject APIs 20 - Locking Identity Objects for Modification Appendices: A1 - Bean Shell Related JVM Miscellany Related: Faster BeanShell Development | LinkedIn 2