Interface TransformScript<T extends ProvisionObject>
-
- Type Parameters:
T- The type of provision object being transformed (e.g., ProvisionUser, ProvisionGroup)
- All Superinterfaces:
org.springframework.context.ApplicationContextAware,org.springframework.beans.factory.Aware
- All Known Implementing Classes:
AbstractGroupTransformScript,AbstractLogTransformScript,AbstractManSysTransformationScript,AbstractOrganizationTransformScript,AbstractResourceTransformationScript,AbstractRoleTransformScript,AbstractTransformScript,AbstractUserTransformScript
public interface TransformScript<T extends ProvisionObject> extends org.springframework.context.ApplicationContextAwareCore interface that defines the contract for all identity transformation scripts in the OpenIAM synchronization framework.Transformation scripts are responsible for mapping source data from external systems (represented as a
LineObject) to OpenIAM identity objects (extendingProvisionObject). These scripts provide the flexibility to implement custom business logic during the synchronization process, allowing organizations to tailor their identity workflows to specific requirements.Implementations of this interface can be written in Java or provided as Groovy scripts that are loaded dynamically at runtime. The framework provides abstract base classes that simplify the implementation of transformation scripts:
AbstractTransformScript- Base implementation with core utility methodsAbstractUserTransformScript- Specialized implementation for user transformationsAbstractGroupTransformScript- Specialized implementation for group transformationsAbstractRoleTransformScript- Specialized implementation for role transformations
The transformation process follows these steps:
- The
init()method is called to initialize the script - For each row of data from the source system, the
execute(LineObject, ProvisionObject)method is invoked to transform the data - The script returns a status code indicating how the synchronization process should proceed
This interface extends
ApplicationContextAwareto allow implementations to access Spring beans and services from the application context.- Since:
- 2.0
- See Also:
LineObject,ProvisionObject,ApplicationContextAware
-
-
Field Summary
Fields Modifier and Type Field Description static intDELETEStatus code indicating that the object should be deleted.static intDISABLEStatus code indicating that the object should be disabled rather than deleted.static intENABLEStatus code indicating that the object should be enabled.static intEXCEPTIONStatus code indicating that an exception occurred during transformation.static intINITIATE_ADD_USER_AND_INVITE_WORKFLOWStatus code indicating that an add user and invite workflow should be initiated.static intINITIATE_CHANGE_POSITION_WORKFLOWStatus code indicating that a change position workflow should be initiated.static intINITIATE_EDIT_USER_WORKFLOWStatus code indicating that an edit user workflow should be initiated.static intINITIATE_NEW_HIRE_WORKFLOWStatus code indicating that a new hire workflow should be initiated.static intINITIATE_REVOKE_ACCESS_WORKFLOWStatus code indicating that a revoke access workflow should be initiated.static intINITIATE_TERMINATE_USER_WORKFLOWStatus code indicating that a terminate user workflow should be initiated.static intNO_DELETEStatus code indicating that the object should not be deleted.static intSKIPStatus code indicating that the current record should be skipped and considered an error.static intSKIP_OKStatus code indicating that the current record should be skipped but not treated as an error.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intexecute(LineObject rowObj, T pUser)Executes the transformation logic for a single record from the source system.voidinit()Initializes the transformation script.booleanisNewUser()Determines if the current synchronization operation is for a new user creation.voidsetNewUser(boolean isNewUser)Sets the flag indicating whether the current synchronization operation is for a new user creation.
-
-
-
Field Detail
-
SKIP
static final int SKIP
Status code indicating that the current record should be skipped and considered an error. This will increment error counters in the synchronization process.- See Also:
- Constant Field Values
-
NO_DELETE
static final int NO_DELETE
Status code indicating that the object should not be deleted. Used when processing delete operations in the synchronization.- See Also:
- Constant Field Values
-
DELETE
static final int DELETE
Status code indicating that the object should be deleted. The synchronization process will initiate a delete operation for the object.- See Also:
- Constant Field Values
-
DISABLE
static final int DISABLE
Status code indicating that the object should be disabled rather than deleted. The synchronization process will initiate a disable operation for the object.- See Also:
- Constant Field Values
-
ENABLE
static final int ENABLE
Status code indicating that the object should be enabled. The synchronization process will initiate an enable operation for the object.- See Also:
- Constant Field Values
-
EXCEPTION
static final int EXCEPTION
Status code indicating that an exception occurred during transformation. The synchronization process will handle this as an error condition.- See Also:
- Constant Field Values
-
INITIATE_NEW_HIRE_WORKFLOW
static final int INITIATE_NEW_HIRE_WORKFLOW
Status code indicating that a new hire workflow should be initiated. The synchronization process will trigger the configured new hire workflow.- See Also:
- Constant Field Values
-
INITIATE_EDIT_USER_WORKFLOW
static final int INITIATE_EDIT_USER_WORKFLOW
Status code indicating that an edit user workflow should be initiated. The synchronization process will trigger the configured edit user workflow.- See Also:
- Constant Field Values
-
INITIATE_REVOKE_ACCESS_WORKFLOW
static final int INITIATE_REVOKE_ACCESS_WORKFLOW
Status code indicating that a revoke access workflow should be initiated. The synchronization process will trigger the configured revoke access workflow.- See Also:
- Constant Field Values
-
INITIATE_CHANGE_POSITION_WORKFLOW
static final int INITIATE_CHANGE_POSITION_WORKFLOW
Status code indicating that a change position workflow should be initiated. The synchronization process will trigger the configured change position workflow.- See Also:
- Constant Field Values
-
INITIATE_ADD_USER_AND_INVITE_WORKFLOW
static final int INITIATE_ADD_USER_AND_INVITE_WORKFLOW
Status code indicating that an add user and invite workflow should be initiated. The synchronization process will trigger the configured add user and invite workflow.- See Also:
- Constant Field Values
-
INITIATE_TERMINATE_USER_WORKFLOW
static final int INITIATE_TERMINATE_USER_WORKFLOW
Status code indicating that a terminate user workflow should be initiated. The synchronization process will trigger the configured terminate user workflow.- See Also:
- Constant Field Values
-
SKIP_OK
static final int SKIP_OK
Status code indicating that the current record should be skipped but not treated as an error. This will not increment error counters in the synchronization process.- See Also:
- Constant Field Values
-
-
Method Detail
-
execute
int execute(LineObject rowObj, T pUser)
Executes the transformation logic for a single record from the source system.This method is the core of the transformation script, where custom business logic is implemented to map data from the source system (represented by
rowObj) to the target OpenIAM identity object (represented bypUser). The implementation should:- Extract relevant data from the
rowObj - Transform the data according to business rules
- Update the
pUserobject with the transformed data - Return an appropriate status code to control the synchronization flow
The return value determines how the synchronization process handles the record:
- Parameters:
rowObj- The source data record to be transformedpUser- The target identity object to be populated- Returns:
- A status code indicating how to proceed with the synchronization
- Extract relevant data from the
-
init
void init()
Initializes the transformation script.This method is called once before processing begins, allowing the script to perform any necessary setup operations such as:
- Initializing internal data structures
- Loading reference data
- Establishing connections to required services
- Setting up caches for frequently accessed data
Implementations should use this method to prepare the script for efficient execution of multiple
execute(LineObject, ProvisionObject)calls.
-
isNewUser
boolean isNewUser()
Determines if the current synchronization operation is for a new user creation.This method is used to distinguish between new user creation and existing user updates, which may require different logic in the transformation script.
- Returns:
trueif the operation is creating a new user,falseif updating an existing user
-
setNewUser
void setNewUser(boolean isNewUser)
Sets the flag indicating whether the current synchronization operation is for a new user creation.This method is typically called by the synchronization framework to inform the transformation script about the nature of the current operation.
- Parameters:
isNewUser-trueif the operation is creating a new user,falseif updating an existing user
-
-