Script development using an IDE

OpenIAM supports the use of Groovy scripts to extend and customize various workflows and behaviors, such as lifecycle events, provisioning logic, and validation rules. This guide walks you through setting up a local development project for Groovy scripting, importing the required dependencies, and deploying your script to the correct location within OpenIAM.

Prerequisites

Ensure you have the following installed:

  • JDK 17+
  • Apache Maven
  • A code editor or IDE that supports Groovy (e.g., IntelliJ IDEA, VS Code)
  • Git (optional, for version control)

Create a New Project

  1. Create a New Maven Project
mvn archetype:generate -DgroupId=com.openiam.scripting -DartifactId=openiam-groovy-dev -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
cd openiam-groovy-dev
  1. Update pom.xml to Add Required Dependency
<dependencies>
<dependency>
<groupId>com.openiam</groupId>
<artifactId>openiam-mq-services</artifactId>
<version>REPLACE_WITH_VERSION</version>
</dependency>
</dependencies>

Note: Replace REPLACE_WITH_VERSION with the version of OpenIAM you’re using (e.g., 4.2.1.13). Check the OpenIAM documentation or internal Maven repository for version availability.

  1. Script Development Guidelines
  • Scripts must use Groovy and follow the OpenIAM script interface requirements for the corresponding context (e.g., validation, transformation, reconciliation, provisioning)
  • Test logic locally with mock data where applicable.
  • Ensure proper error handling and logging using logger.
  1. Deploying the Script to OpenIAM

Once your Groovy script is tested and finalized, copy it into the appropriate subfolder under the OpenIAM conf/scripts directory on the server or connector VM.

Script TypeSubfolder Path
Validation rulesconf/scripts/validation
Transformation rulesconf/scripts/transform
Reconciliation handlersconf/scripts/recon
Provisioning scriptsconf/scripts/provisioning
Workflow scriptsconf/scripts/workflow
Scheduled jobsconf/scripts/scheduler
Custom logicconf/scripts/custom