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
- Create a New Maven Project
mvn archetype:generate -DgroupId=com.openiam.scripting -DartifactId=openiam-groovy-dev -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=falsecd openiam-groovy-dev
- 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.
- 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.
- 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 Type | Subfolder Path |
---|---|
Validation rules | conf/scripts/validation |
Transformation rules | conf/scripts/transform |
Reconciliation handlers | conf/scripts/recon |
Provisioning scripts | conf/scripts/provisioning |
Workflow scripts | conf/scripts/workflow |
Scheduled jobs | conf/scripts/scheduler |
Custom logic | conf/scripts/custom |
⸻