Saturday, February 14, 2015

Working with OIM Prepopulate Adapters

Version: Oracle Identity Manager 11g R2
Description: Prepopulate adapters are used to populate the fields on a resource form in Oracle Identity Manager. By having the resource form fields populated by prepopulate adapters, the provisioning process of a resource account to a user can be handled with ease rather than having someone manually enter values for the resource form fields. In Oracle Identity Manager, prepopoulate adapters are triggered on the initial assignment of the resource account to a user.  
References: http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/creadp.htm#OMDEV2693

Java Method for Prepopulate Adapter
In Oracle Identity Manager, you can wire a custom java method to a prepopulate adapter. Given below are several sample Java methods that can be used for OIM prepopulate adapters.



After writing Java methods for your prepopulate adapters, you have to create a JAR file of your Java code, and upload it to OIM as a JavaTasks JAR type (Place the JAR file in $MW_HOME/Oracle_IDM1/server/JavaTasks directory or upload to OIM database using UploadJars.sh script located in $MW_HOME/Oracle_IDM1/server/bin directory. The latter approach is recommended in a production environment).

The sample JAR file can be found here.

Creating Adapter
1. Log in to design console. Design console can be started by executing $MW_HOME/Oracle_IDM1/designconsole/xlclient.sh script.



2. On the left panel, expand Development Tools, and select Adapter Factory.



3.Specify Adapter Name, Adapter Type, Description. Then save.

Adapter Name = Prepopulate User Type Code
Adapter Type = Pre-populate Rule Generator
    

4. On the Variable List sub-tab, add the variables for your adapter. Typically, these variables are the input to your Java method.

Click Add.

Example for calculateUserTypeCode(String userType) method

5. On the Adapter Tasks sub-tab, create a task that calls your Java method.

Click Add.
Select "New Object Instance".
Select "Functional Task > Java".
Task Name = Prepopulate User Type Code
API Source = JavaTaskJar: OIMUtilities.jar
Application = com.blogspot.oraclestack.adapters.PrepopulateAdapters()
Methods = calculateUserTypeCode(java.lang.String)
Then click save.

Map Input using the adapter variable you created.
Order of the Input matters (First Input maps to first parameter in method etc.)
Output is the return value of the Java method.
Then click save.
Java Task attached to adapter

6. Click Build to compile the adapter. Then save.

Click Build.
Successful compilation with OK status.

Wiring Prepopulate Adapter to Form Field
Here you will attach the prepopulate adapter to a form field on a process form.

1. On the left panel of design console, expand Development Tools, and select Form Designer.


2. Select your process form that you will attach the prepopulate adapter to, and create a new version.

Click "Create New Version"
Specify new label version
Ensure "Latest Version" and "Current Version" are using the version you created.
3. On the Pre-Populate sub-tab, attach your prepopulate adapter to a form field.

On Pre-Populate tab, click Add.
Specify Field Name, Rule, and Adapter. Then save.
Example:
Field Name: User Type Code
Rule: Default
Adapter: Prepopulate User Type Code
Map adapter variables.
Maps user attribute "User Type" to the adapter variable.
Then save.
Save.

4. Make version active.

Click "Make Version Active"

Validate Prepopulate Adapter
Assign resource account to a user. After submitting the resource process form instance, the prepopulate adapters should kick in and populate the form fields.

8 comments:

  1. Thanks for your post!
    Is there any way you know of to configure this without using this (weird) Design Console?

    ReplyDelete
  2. Thanks for the information.
    Is there any way to prepopulate the field on Application Instance form at runtime i.e. consider use case as below
    1. For user a Application Instance is requested.
    2. On the Application Instance form, there is LOV Select State, the state will be manually selected.
    3. As per State, the City field should show respective Cities in the state.

    Thanks !

    ReplyDelete
  3. Nice blog and your all presenting information are very great and it's really good well done.
    CascadeMan

    ReplyDelete
  4. Hi

    Can any one help me how to pre-populate "boolean values"

    Thanks in advance.

    ReplyDelete
  5. can anyone help how to do " IT Resource as pre-populate adapter "?

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Hi Sai,

    If you need It resource value then their is attribute on PF as server in that the value of ITRes comes and in Form Designer properties need to set it true

    ReplyDelete
  8. Hello,
    can i use prepopulate adapter to provision a target attributes from two oim attributes (one of them always null)

    ReplyDelete