Thursday Nov 26, 2015

OIM11gR2: Side-effects of using EntityManager API on update Event Handlers

The main purpose of using EntityManager API to update a user-profile on a post-update event handler is that the event handler shouldn't get into an infinite loop. This is very clear.

Consider a scenario where there is a UDF 'Company Name' which is populated based on user's Organization. Assume, it is just a simple 1-1 mapping between user's Company Name and Organization.  The 'Company Name' attribute is read-only on the user profile and its value needs to be propagated to downstream applications and LDAP Synced. The 'Company Name' attribute is populated using a user-post-update event handler. When user's Organization changes, the event handler is held responsible for updating the 'Company Name value' and it works awesome. 

Sample code on event handler at this point:

HashMap<String, Object> mapAttrs = new HashMap<String, Object>();                   mapAttrs.put(COMPANY_ATTR_NAME, companyCode);  

         //Use profile is updated here with non-null company code.

 EntityManager entMgr = Platform.getService(EntityManager.class);                 entMgr.modifyEntity(targetType,usrKey, mapAttrs);  

 After changing the user's organization from UI, the user profile is updated with new Company Name value, however, either the downstream applications or LDAP Sync directory is not updated with new value. This is because, the EntityManager API does not initiate new orchestration when an update happens. This is as good as database insert/update.

 It is now clear EntityManger API is not suitable in the above mentioned scenarios. Thinking of which API to use? The obvious answer is UserManager API. Yes, use UserManager API.

Instantiate and use this API as shown:

HashMap<String, Object> mapAttrs = new HashMap<String, Object>();              mapAttrs.put(COMPANY_ATTR_NAME, companyCode); 

UserManager usrManagerAPI = Platform.getServiceForEventHandlers(UserManager.class, null, null, null, null);

User userToModify = new User(usrKey,mapAttrs);             

usrManagerAPI.modify(userToModify);

 This way a new orchestration is started and rest of the operations like LDAP Sync, User process triggers etc..are placed accordingly. 

Wednesday Mar 26, 2014

OIM11gR2 : Fetch Human Task comments using SOA API

From OIM11gR2, in order to get the human task comments one should use SOA API instead of OIM Request API.

The Task Id or Task Number can be obtained from OIM request tables which can be used to uniquely identify the human task.

Refer the link to know human task operations using SOA API: http://docs.oracle.com/cd/E25178_01/fusionapps.1111/e15524/uc_manage_tasks.htm

About

OIM11gR2 Blog by NA-TAG Offshore IDAM team

Search

Categories
Archives
« February 2016
SunMonTueWedThuFriSat
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
     
       
Today