OIM 11g R2 -Updating UDF through code

Hi,
I am using the below code to update the UDF and getting "oracle.iam.identity.exception.ValidationFailedException: IAM-3056160:Modify User Profile request cannot set or change attribute USR_UDF_TEMPUSERNAME, since it is not defined in the corresponding data set.:Modify User Profile:USR_UDF_TEMPUSERNAME"
UserManager usrMgr = Platform.getService(UserManager.class);
System.out.println("User Key :: "+usrKey);
HashMap<String, Object> attrMap = new HashMap<String, Object>();
attrMap.put("USR_UDF_TEMPUSERNAME",attrValue);
User user = new User(String.valueOf(usrKey), attrMap);
UserManagerResult result = usrMgr.modify("User Login", usrLogin, user);
Can some one please help me out on this.
Thanks

Hi Rajiv,
I quite did not get your question. Here is the code:
Long usrKey = getUserKey(usrLogin); //usrLogin is of the user whose attribute is to be updated
UserManager usrMgr = Platform.getService(UserManager.class);
HashMap<String, Object> attrMap = new HashMap<String, Object>();
String attrName = "TempUserName";
String attrValue = "TestUser1";
attrMap.put(attrName,attrValue);
User user = new User(String.valueOf(usrKey), attrMap);
UserManagerResult result = usrMgr.modify("User Login", usrLogin, user);
Thanks

Similar Messages

  • Oim 11g R2 request submisson through code

    Hi All,
    I have written a custom code for submitting the request from client using the following program.
    private RequestData buildappinstance(Catalog item,String userLogin)
      UserManager userService = oimClient.getService(UserManager.class);
      User user=null;
      try{
      user=userService.getDetails(userLogin, null, true);
      }catch(Exception e){
      e.printStackTrace();
      throw new RuntimeException(e.getMessage(),e);
      RequestData reqData=new RequestData();
      Beneficiary ben= new Beneficiary();
      String userkey=user.getId();
      System.out.println("userkey");
      ben.setBeneficiaryKey(userkey);
      ben.setBeneficiaryType(Beneficiary.USER_BENEFICIARY);
      RequestBeneficiaryEntity reqent=new RequestBeneficiaryEntity();
      /*reqent.setRequestEntityType(OIMType.ApplicationInstance);*/
      reqent.setEntitySubType(item.getEntityName());
      reqent.setEntityKey(item.getEntityKey());
      reqent.setOperation(RequestConstants.MODEL_PROVISION_APPLICATION_INSTANCE_OPERATION);
      List<RequestBeneficiaryEntity> entities=new ArrayList<RequestBeneficiaryEntity>();
      entities.add(reqent);
      ben.setTargetEntities(entities);
      List<Beneficiary> benfs=new ArrayList<Beneficiary>();
      benfs.add(ben);
      reqData.setBeneficiaries(benfs);
      return reqData;
    public static void main(String args[]) {
    List moList = null;
    try {
    Sample oimSample = new Sample();
    // initialize resources
    oimSample.init();
    // retrieve User logins with first name 'Joe'
    moList=oimSample.getUserLogin("joe");
    Catalog item = new Catalog();
    item.getEntityName();
    ApplicationInstance appInst= new ApplicationInstance();
    RequestService reqsrvc = oimClient.getService(RequestService.class);
    RequestData reqData=new RequestData();
    ApplicationInstanceService appInstAPI = (ApplicationInstanceService)oimClient.getService(ApplicationInstanceService.class);
    SearchCriteria appInstSearchCriteria = new SearchCriteria(AccountSearchAttribute.APPINST_NAME.getId(),"app2",SearchCriteria.Operator.EQUAL);
    List<ApplicationInstance> appInstList = appInstAPI.findApplicationInstance(appInstSearchCriteria, null);
    appInst = appInstList.get(0);
    System.out.println("appinstancekey"+appInst.getApplicationInstanceKey());
    System.out.println("appinstance name"+appInst.getApplicationInstanceName());
    System.out.println(appInst.getItResourceKey());
    item.setEntityKey("2");
    item.setEntityName("app2");
    System.out.println("entity key"+item.getEntityKey());
    System.out.println("userlogin......"+userLogin);
    reqData=oimSample.buildappinstance(item,userLogin);
    reqsrvc.submitRequest(reqData);
    System.out.println("request has been submitted");
    System.out.println("appinastance has been created");
    But getting the following error.
    oracle.iam.request.exception.RequestServiceException: Request submission failed with Error getCacheEntry called with an empty or null key.
    Caused by: oracle.iam.request.exception.RequestServiceException: Request submission failed with Error getCacheEntry called with an empty or null key.
    when Iam writing the following statement
    /*reqent.setRequestEntityType(OIMType.ApplicationInstance);*/ which is bold in the above code
    getting the error
    The method setRequestEntityType(OIMType) in the type RequestBeneficiaryEntity is not applicable for the arguments (OIMType)
    Please help me out.
    This is urgent.
    Thanks.

    Can you please confirm your OIMType class belongs to "oracle.iam.platform.utils.vo.OIMType" and not oracle.iam.catalog.vo.OIMType.

  • OIM 11g r2  User  UDF fields  Updation based on AD ID

    Hi,
    We have to update the UDF fields created for the users in OIM using the data from a table.
    This table contains the AD ID, and other fields.
    OIM User (already available) will be updated based on AD ID ….i;e AD ID column will be used to find the user in OIM and then his UDF will be updated based on the respective data from other columns in the table .
    Please can you help me on this task?
    Thanks,

    Your requirement doesn't tell much like when you want to update your user. If it would be on daily basis then go for Schedule Task, if you want to at the time of provisioning then you can have one task and attach your code to bring AD ID in OIM..
    You may leverage Event Handlers as well if your use case requires that.

  • OIM 11g - Renaming an UDF attribute

    Hi,
    May I know how i can rename a custom defined user attribute in OIM 11g?.Thanks.

    878153 wrote:
    Thanks BB.My requirement is to renamed a UDF which I have created.For example,I created a UDF with labee "Mobile" and want to change it to "Telephone" .May I know how I can achieve this?.If you want to define the label for your attribute in GUI, then use resource bundles to define the label for your label:
    $OIM_ORACLE_HOME//server/customResources/customResources_<your language>.properties
    Add the global.udf. prefix to the name of the attribute.
    Otherwise, you will have to create a new attribute and delete the old one.

  • OIM 11g R2 Exporting UDF without sandbox!

    Hi, I'm trying to export the UDFs att from a User Form, but I lost the sandbox whit i make the customizations.
    Is there any way to recover the Sandbox or export this att to another OIM 11g r2 Server??
    Regards!!

    If you create new sandbox and modify any UDF and export that sandbox before publishing.
    Once you publish sandbox of UDF and then you try to export sandbox in that case you will lost your UDF changes.
    For UDF's always export sandbox before publishing sandbox. so that you have exported sandbox which you can import into another environment.

  • OIM 11g R2: Organization UDFs problem

    Hi all,
    I tried to create an UDF NOT for User entity but for Organization entity.
    In my environment OIM is installed in 11g R2 version (11.1.2.0.0).
    I'm not completely new about this activity with this OIM version because I created some UDFs for User entity also and all of them work fine.
    To customize the Organization entity, I followed Oracle documentation fitting it for Organization entity instead User one, but I get an error.
    Here high-level steps that I've done:
    1. created and activated a sandbox
    2. looked for Organization form
    3. modified it adding MyCustomField
    4. opened Create Organization Form
    5. customized it adding MyCustomFild
    6. created a new organization MyTestOrg
    Note: for steps 1, 2, 3 I followed this document http://docs.oracle.com/cd/E27559_01/admin.1112/e27149/customattr.htm#CHDDIGCI, while for steps 4 and 5 this one http://docs.oracle.com/cd/E27559_01/admin.1112/e27149/customattr.htm#BABGDEIC
    Once I created the new Organization I checked the result, but closing and opening again MyTestOrg details, my custom field is empty.
    I also checked at database side and I noticed that the value specified for MyCustmField of MyTestOrg was saved to Xellerate Users default organization.
    I executed this test for four times with the same result.
    To verifiy this behaviour, I've done the following test:
    1. at database side, I manually updated MyCustomField for MyTestOrg
    2. at database side, I manually updated MyCustomField for Xellerate Users default org
    Once executed the first test, I verified that using OIM web interface the value specified does not appear in any organizations.
    While once executed the second test, I verified that the value specified appear in all of the organizations. It's seams that Xellerate Users organization modification is spawned for all organizations.
    It sounds like a bug.....
    Do you have any suggestions?
    Thanks
    Daniele

    Hi,
    for anybody who's interested, I have some news about this problem.
    Here the answer that support provides to me:
    check if the following doc addition helps you with the issue?
    http://docs.oracle.com/cd/E27559_01/admin.1112/e27149/customattr.htm#CHDDIGCI,
    Section "7.5 Adding a Custom Attribute" in OIM Administration Guide needs to be updated as follows:
    Step 12, add the following:
    For Organizations (includes create and modify organization), select Data Component - Organization
    Step 13 - we need to mention all the VOs that they're supposed to select based on selection they made in Step 12. We need to add the following: For View User Details, select UserVO1
    For Create User, select userVO
    For Modify User, select userVO
    For Manage Roles (create / modify role), select RoleDetailsVO
    For Organizations (create / modify organization), select EditOrgVO
    Step 18b - the EL provided only works for user page. On other pages they're
    basically supposed to copy the EL of valueChangeListener property from any
    other existing field on the form.With this suggestions, the initial problem was resolved, but a strange behaviour still occurs.
    Infact, after the new organization creation (with UDF field valorized), if I try to modify the value for custom field MyCustomFiled (for example from "MyCustomValue_2" to "MyCustomValue_1"), the button Apply remain inactive (so I can't save the modification - see screenshot "inactive-apply-button.png"). It become active only if I modify a standard field also (for example Organization Name or Type).
    About this last problem, the support needs to check it.
    I'm waiting an answer.
    I'll give you news as soon as possible.
    Bye
    Daniele

  • OIM 11g R2 Custom UDF Creation

    We have created custom UDFS, but when I try to create a new user with the new field, the data for the new field is not getting saved in the USR table.
    We have checked the 'Auto Submit' for that field (on the Create User page) and for the Value Change Listener, I tried to add #{pageFlowScope.cartDetailStateBean.attributeValueChangedListener}, it is throwing an error.
    M

    set Auto submit true. you can't set the value for ValueChangedListener property in current release of R2. This is bug and you can raise SR for same. But, this won't cause saving data into USR table. ValueChandedListener property for Modify User page only.
    As you said, data is not being saved in the USR table then verify your steps again:
    create sandbox->users->create user/edit user/view user details page->click customize->leftTopcorner->View->Source->select area->edit->Click Add Content (on left top)->Data Component catalog->scroll down and select User VO->Refresh dialogue box->select the field and click 'Add'->on dropdown select 'ADF Input test w/label/for view user page it should be output test w/label->close that window->Check if it added to create user form->save and close customization
    for user detail page select "Managed User->UserVo1 " as datacomponent
    Re: UDF creation on User form in 11gR2
    for valuechangedlistener the fixes all ready available. you have to do some workaround as other poster has given in above link:
    1.Create a sandbox and activate it. Open the page that contains the UDF, and click Customize.
    2.Select View, Source.
    3.Note the value of the valueChangeListener property of a predefined field. To do so:
    a.Click the predefined field, and then click Edit to open the Component Properties dialog box.
    b.Copy the value of the valueChangeListener property.
    4.Export the sandbox as a ZIP file.
    5.Extract the ZIP file and edit the jsff.xml file for the specific screen.
    6.Add the following attributes to the ADF tag, for example af:inputText, for the UDF:
    ◦valueChangeListener=VALUE_COPIED_IN_STEP3
    ◦autoSubmit="true"
    7.Create the ZIP file for the sandbox.
    8.Import the sandbox.
    9.Publish the sandbox.
    Edited by: Nishith Nayan on Sep 21, 2012 1:04 PM

  • OIM 11g R2 Group Membership

    Hi All,
    In OIM 11g R2, when i try to manually add a user to a group (custom or OOTB), i do not see the "Assign" button active and with the absence of the assign button, i could not assign a new user to the group. But, I can see that the Create Rule option is active.
    Does this mean that the group membership in OIM 11g can only happen through Group membership rule satisfaction?
    Please help.
    Thanks,
    Srini

    You can manually add an user to a role in OIM 11gR2. Open identity console --> Click on Roles--> Search
    You will get all the roles listed. Select the role to which you want to add a member. Assign tab will be visible under the Members panel layout in the bottom frame.
    When you click on assign the request catalog opens with the selected target user and the role. You can change the target user or add another target user.
    Then click on submit.
    If this process is done through sysadmin login then directly the member is assigned to the role
    Else it will create a request and after approval is completed the member will be assigned to the role.

  • OIM 11g: Custom Scheduler code

    Hi
    I need to develop custom scheduler in OIM 11g. But I am struck at how to use execute() method.
    public class CustomScheduler extends oracle.iam.scheduler.vo.TaskSupport {
    *//How to use execute(HashMap argMap) -- What hashmap data I need to pass to this method*
    Please help me out with a code snippet.

    Hi
    I created a scheduler job in OIM with parameters as IT Resource and Resource Object.
    Now through my custom scheduler I need to get the value of Parameter IT Resource.
    I don't want to extend SchedulerBaseTask class to get task attributes. Instead I am trying to get values of those attributes using oracle.iam.scheduler.vo.TaskSupport class.
    I tried with the below code. But it throws compile time error.
    public class HRReconciliationTask extends oracle.iam.scheduler.vo.TaskSupport {
         public void init()
              String itResource = getAttribute("IT Resource");//Error: getAttribute() is undefined for type HRReconciliationTask
         public void execute()
              //code here
    Pls help with code snippet.

  • Changing the Updatable property of a View Object Attribute through code

    Hi,
    Is there a way to set the "Updatable" property of an attribute in a view object through code ?
    I checked the API docs for the AttributeDef class but there is no method to set this. there is a constant (UPDATEABLE_WHILE_NEW) which gives the current value.
    My requirements in short - I have a ADF editable Table. Based on a flag whether it is SET or NOT, i need to make a particular column such that the inputTextBox on this column must appear for only the new rows inserted into the table. For all the existing rows users should not be allowed to edit values on this column.
    I know this can be controlled with the UPDATABLE property on the attribute in the view object by setting the value as "WHILE  NEW".
    Now i need to control this through code at runtime.
    Please let me know on ow to do this.
    JDev version: 11.1.2.3
    Thanks.

    the method you are looking for is available in the AttributeDefImpl class which you can get from the EntityImpl like
    this.mDefinitionObject.getAttributeDefImpl("YOUR_ATTRIBUTE_NAME").setUpdateableFlag(AttributeDef.UPDATEABLE_WHILE_NEW);
    Timo

  • How to give query in lookup type udf in OIM 11g

    Hi,
    In OIM 9.x, we were able to provide query in lookup type field in users UDF to fetch data from DB and display it in lookup table.
    Where as in OIM 11g, I cant find that option. We need to provide user id in lookuptype field based on some query. Please let me know where we can do the same in OIM 11g.
    Thanks,
    Kalpana.

    In OIM 9.x, we had below query in one of the lookup type attribute:
    select usr.usr_udf_empid,usr.usr_first_name,usr.usr_last_name from usr where usr.usr_emp_type='Full-Time' and usr.usr_status='Active' and usr.USR_UDF_EMPID is not null
    The lookup used to show firstname, lastname & employee id of active employees in the lookup.
    Where we can achieve the same in OIM 11g?
    Thanks,
    Kalpana.

  • Direct provisioning through API - OIM 11g

    Hi,
    OIM 11g here. I am trying to use the APIs to make direct provisioning. What i have done till now:
    tcUserOperationsIntf userIntf = (tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
    ResourceData rd = userIntf.provisionResource(userkey, objectkey);
    now, in the ResourceData object i have two ids, obiKey and ouiKey. Now i need to extract the process instance key with those numbers. How can i do this?
    Using the userIntf getObjects method i can get the list of objects provisioned, iterate over it and retrieve the process instance key of the object which matches obiKey and ouiKey. Is there an easier method to do this?
    Another question, which one is the process instance key, ORC_KEY or ORC_TOS_INSTANCE_KEY ?
    Last, how do i trigger the task responsible for provisioning given the filled process form?
    thx in advance

    Ok, i guess the process instance key is ORC_KEY.
    Now i am trying to provision through APIs a resource object (say AD User) to an OIM user. I have used the provisionResource(userkey, objectkey) method, but the Create User task is not put in the Resource History (there is only the System Validation Task), and i don't know how to look for it's task id to add it manually.

  • OIM 11g R2: Delete User UDF fields

    Hi all,
    I installed and configured OIM 11g R2. In this environment I created an UDF for User entity.
    Here the steps that I followed:
    - created a sanbox
    - opened User Form
    - added a custom field named "MyCustomField". The type field is Text.
    Now, due to a mistake during UDF creation, I have to delete it.
    I found this post (OIM 11gR2 - Unable to remove UDF which describe how to delete an UDF field.
    The post gives these instructions:
    - export the sandbox
    - remove UDF occurences in xml files
    - import the sanbox
    I followed the instructions and at the and I checked the result: the UDF field does not exist in the User form, but the associated database field still exits in database.
    My question is: how I can delete the database filed without create database inconsistency?
    Thanks in advance,
    Daniele

    Hi Nayan,
    I tried to export Users.xml using Depolyment Manager Export, but I the export failed whit this error.
    [2012-10-09T10:03:37.366+02:00] [oim_server1] [ERROR] [] [XELLERATE.WEBAPP] [tid: [ACTIVE].ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: fc578f2854422d44:67bee673:13a2720c2c5:-8000-0000000000015853,0] [APP: oim#11.1.2.0.0] Class/Method: LoadDeploymentUtility/handleExportData encounter some problems: invalid character in name[[
    Thor.API.Exceptions.tcAPIException: invalid character in name
    at com.thortech.xl.ejb.beansimpl.tcExportOperationsBean.getExportXML(tcExportOperationsBean.java:245)
    at Thor.API.Operations.tcExportOperationsIntfEJB.getExportXMLx(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.xml.parser.v2.XMLDOMException: invalid character in name
    at oracle.xml.util.XMLUtil.validateName(XMLUtil.java:464)
    at oracle.xml.parser.v2.XMLDocument.createElement(XMLDocument.java:877)
    at com.thortech.xl.ddm.repositories.api.impl.APIRepository.getElementforHashMapAttribute(APIRepository.java:552)
    at com.thortech.xl.ddm.engine.visitor.ExportVisitor.visitStarted(ExportVisitor.java:126)
    at com.thortech.xl.ddm.engine.data.datatypes.SchemaInstance.traverse(SchemaInstance.java:252)
    at com.thortech.xl.ejb.beansimpl.tcExportOperationsBean.export(tcExportOperationsBean.java:281)
    at com.thortech.xl.ejb.beansimpl.tcExportOperationsBean.getExportXML(tcExportOperationsBean.java:235)
    ... 120 more
    ]]Do you have any other suggestions?
    Thanks,
    Daniele

  • OIM 11g Upgrade from OIM 9.1.1

    Hi All,
    We are planing to upgrade OIM 9.1.1 to OIM 11g, I have seen the impact analysis in the link "http://www.oracle.com/technetwork/middleware/id-mgmt/learnmore/upgrading-oim9x-to-oim11g-wp-365479.pdf". I am bothering about OIM Objects (Forms,Adapters,Lookups), How the impact will be?
    In that document, they said, There is no Prepopulated adapters and changes in Enitity adapters and APIs are also changed.
    1. So de we need to implement all adapters in OIM 11g again, or can we directly import them?
    2. For API changes, Do we need to update all APIs in my custom adapters? or will old APIs work on OIM 11g?
    3. Can we directly load all Lookups directly?
    We dont have any Approval workflows, We have simple direct provisioning using custom adapters, we dont have policies also. Through Groups, we have assigned the AD and Exchange resources to the users
    Please suggest me.
    Thanks

    The document details which pieces of OIM exist in 9.x and 11g. Table 2.2.1 identifies all the request related objects in 9.1 and 11gR1 and which can be migrated. It lists pre-populate adapters, but this could only be on the object side, they will still exist as is in the process side for provisioning. As part of your upgrade plan, you will need to identify how to recreate the non-upgradable items and how they are integrated into the parts of OIM once it is migrated to 11gR1.
    In section 2.7 Entity Adapters and Event Handlers behave differently. So in 9.x if you have any of these for custom code, you will need to identify how to recreate these in 11gR1 and attach them into the existing processes so your existing functionality will be intact.
    As for APIs, none of the old APIs go away. A portionof them listed in section 2.8.2 have been identified as legacy APIs and how they map to the new service. You can continue usage of old ones, but the suggestion is to make any new ones with the latest API set. I woudl assume the only exception for APIs that wont work would be the tcRequestOperationsIntf since this will not exist in 11g. You'll need to use the APIs to access the BPEL and SOA data in the database instead.
    The overall process is an evaluation of every connector you have implemented and all your functionality. Identify which pieces can and can't be migrated, and then either recreate the functionality in 11g or create new functionality within the 11g product instead. It will be a very lengthy process, which is essentially reviewing your whole implementation.
    I hope this gives you some idea of the changes to be expected. The utility will migrate the pieces it can, but then it's up to you and your client to implement the pieces that could not be converted. Then you get to evaluate the new features of the product and which ones you want to use.
    -Kevin

  • Bulk load in OIM 11g enabled with LDAP sync

    Have anyone performed bulk load of more than 100,000 users using bulk load utility in OIM 11g ?
    The challenge here is we have OIM 11.1.1.5.0 environment enabled with LDAP sync.
    We are trying to figure out some performance factors and best way to achieve our requirement
    1.Have you performed any timings around use of Bulk Load tool. Any idea how long will it take to LDAP sync more than 100,000 users into OID. What are the problems that we could encounter during this flow ?
    2.Is it possible we could migrate users into another environment and then swap this database for the OIM database? Also is there any effective way to load into OID directly ?
    3.We also have some custom Scheduled Task to modify couple of user attributes (using update API) from the flat file. Have you guys tried such scenario after the bulk load ? And did you face any problem while doing so ?
    Thanks
    DK

    to Update a UDF you must assign a copy value adpter in Lookup.USR_PROCESS_TRIGGERS(design console / lookup definition)
    eg.
    CODE --------------------------DECODE
    USR_UDF_MYATTR1----- Change MYATTR1
    USR_UDF_MYATTR2----- Change MYATTR2
    Edited by: Lighting Cui on 2011-8-3 上午12:25

Maybe you are looking for

  • Oracle Linux Calendar 9.0.4.2/10 and Fedora Core 5

    Hi folks -- I recently migrated from FC4 to FC5 (did a fresh install), and to my chagrin, the Oracle Calendar linux client install is now broken. This was running fine under both FC4 and RHEL 4. Here is the error I receive on any of the installs (sil

  • Problem with drawImage

    I've got a JLabel that i've extended in order to stretch an image to the full size of the JLabel. public class ImageLabel extends JLabel { public ImageLabel() { super(); public ImageLabel(ImageIcon imageIcon) { super(); super.setIcon(imageIcon); priv

  • New HDD getting restart message after carbon copy cloner

    Hey folks, Been a while since I asked for help, but always glad you are here. My 160GB HDD was getting close to its limit and slowing down quite a bit, so I figured I'd upgrade to a 500GB Seagate 7200rpm HDD. Used CCC to do a complete clone. Did the

  • Multiple Conditional Processes on Submit - Confused!

    I have a Form Page based on a table where the user can update the data. I want to capture changes in a history table. Simplified, the tables are: Table PKey Varchar Columns UPDATEABLETABLE ID1 TEXT1 TEXT2 HISTORYTABLE ID1 DESCRIPTION In addition to t

  • CNR 6.1.2 request bufffers incrementing until it reaches 500

    Hi, We are running Cisco CNR 6.1.2  build #6.1.2.0501131448 and this has been very reliable for over 5 years, just recently in the last 4 weeks have began experiencing a problem where the DHCP server will stop issuing leases in response to discovers.