Disabling resources via OIM API. Which appKey?

Hi gurus!
I'm developing my own scheduler tasks that use the OIM API to manage users and their resources. I'm working with OIM version 9.0.3
One of these tasks has to disable a provisioned resource for an user, by using the tcUserOperationsIntf.enableAppForUser() method. This method has two parameters: the user key and the app key. So, before the invokation, I have to find them.
I know how to get the user key, but I don't know which object key must I choose between the OBI_KEY, ORC_KEY and OIU_KEY.
I've tried to do it with obi_key and oiu_key, and sometimes works with obi_key and sometimes with oiu_key. What is the difference between these two keys?
This is my code:
     tcResultSet users = findUser(userLogin); //this method uses the tcUserOperationsIntf.findUsers() api method
     if (users != null) {
tcResultSet resources = findResource("resource_name"); // this method uses the tcObjectOperationsIntf.findProvisionableObjects() api method
long userKey = users.getLongValue("Users.Key");
long resourceKey = resources.getLongValue("Objects.Key");
     tcResultSet resource = findResourceByUser(userKey, resourceKey, "Objects.Key"); //this method uses the tcUserOperationsIntf.getObjects() api method
if (resource != null) {
long obiKey = resource .getLongValue("Object Instance.Key");
String status = resource .getStringValue("Objects.Object Status.Status");
long oiuKey = recurso.getLongValue("Users-Object Instance For User.Key");
if ("Disabled".equals(status)) {
userUtil.enableAppForUser(userKey, oiuKey); //userUtil is an instance of tcUserOperationsIntf
Edited by: bucle on 25-nov-2008 4:49

What these are is roughly explained in the API Usage Guide for Meta Data mapping.
OBI = Object Instance : There are lots of object instances including users.
OIU = Object Instance for User : These are the object instances that actually belong to a user, for example a provisioned resource.
You want the OIU which is returned by the getObjects method as the first value.
Edited by: user809225 on 25-Nov-2008 14:09

Similar Messages

  • Getting users disabled/deleted with disabled resources in OIM

    Hi,
    Consider following use case related to OIM:
    To get the Users deleted or disabled on a particular date with their 'AD User' resources which are in disabled state.
    By means of built in reports i can get the users disabled or deleted for particular date.... how do i get the disabled AD User resource for each user....
    i can go for scheduler task but how to proceed on that?

    the exact requirement here is to get the users/deleted a day before along with their 'AD User' resources which are disabled
    getObjectsByTypeStatus(long plUserKey, java.lang.String psObjectType, java.lang.String psStatus)
    Gets a list of all the objects of the specified type that have been provisioned for a user and are in the specified status.
    What i can make out here is that:
    i need to write some logic that would give users disabled/deleted say yesterday... after this i would loop in these user keys into getObjectsByTypeStatus that would give resources disabled for each user.
    Am i correct?
    Now how do i get the users disabled/deleted yesterday. This is realised by default Users Disabled/Users deleted report.
    But how do i use it in my scheduler
    Edited by: Chhavi Saluja on Jun 30, 2010 1:20 AM

  • Provision Resource through OIM APIS

    I am using the OIMClient and the new APIs to provision a resource
    I am using the Provisioning Service provision() method. For the Account details how should the AccountData be initialized. It says int he APIs that the AccountData constructor is only for already provisioned accounts.
    Please suggest if there is any other way this can be done.

    Try this:
    //Account profile data - need not be set if all data is coming from prepop adapters
      HashMap parentData = new HashMap();
      parentData.put("UD_ADUSER_UID","Larry.Jones");
      parentData.put("UD_ADUSER_FNAME","Larry");
      parentData.put("UD_ADUSER_LNAME","Jones");
    //Construct account data VO with process form key sdk_key=15
      AccountData objAccountData = new AccountData("15", null, parentData);
    //Construct account VO with app instance and account data VO
      Account objAccount = new Account(appInstance, objAccountData);
      //Provision the account to user with usr_key=6
      long oiuKey = provisioningService.provision("6", objAccount);

  • How to create a Connection to UDB Database through OIM APIs.?

    Hi,
    In our OIM (9.1.0.2) implementation, there is a need to connect to a UDB database to execute some select queries and get the data. Is there any way in which I can do this?
    I tried creating an ITResource to have all static database related information, but I was not able to use that ITResource and create an actual database connection in the java code.
    As far as possible, I don't want to use any JDBC code to create the connection but want to know if there are any inbuilt OIM APIs which can help me in creating a database connection to point to the UDB database.
    (We don't have the DBUM connector deployed.)
    Please get back with your views/info on this.
    Thanks,
    Kulesh...

    Here is a constructor code for connecting to a database:
         public DatabaseConnection(String hostname, String port, String driver, String sid, String admin, String password) throws ClassNotFoundException, SQLException{
              log.info(CLASS_NAME + " -----> inputs=hostname[" + hostname +
                        "]port[" + port +
                        "]driver[" + driver +
                        "]sid[" + sid +
                        "]admin[" + admin +
                        "]password[********]");
              Properties connectionProps=new Properties();
         connectionProps.setProperty("user", admin);
         connectionProps.setProperty("password", password);     
         String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=" + hostname +
              ")(PORT=" + port +
              "))(CONNECT_DATA=(SID=" + sid + ")))";
         Class.forName(driver);
              con = null;     
         con = DriverManager.getConnection(url, connectionProps);
    If you want to use SSL, you will want to configure tcps for jdbc connection to the database, or any other form of connection and update your URL string for it.
    -Kevin

  • Using OIM APIs

    I need to use OIM APIs from a third party web application.
    I would like to know, would it be possible as our OIM server would be at a different m/c then the client web application.
    So how would the settings be done in this case, as we set some system variables in the code for accessing the OIM APIs which include mentioning the path of Xellerate folder.
    Kindly guide.

    I have gone through this link, and have used OIM APIs earlier, but in that case both my code and the OIM server were running on the same m/c.
    But now its a third party web app which wants to call OIM APIs, hence I would like to knw, how d following settings would be done.
    System.setProperty("XL.HomeDir", "D:/NewOIM/xellerate");
    System.setProperty("java.security.policy", "D:/NewOIM/xellerate/config/xl.policy");
    System.setProperty("java.security.auth.login.config", "D:/NewOIM/xellerate/config/authwl.conf");
    System.setProperty("log4j.configuration", "D:/NewOIM/xellerate/config/log.properties");
    System.setProperty("java.naming.provider.url", "t3://blrkec87910d:7001");
    As uptil now I was giving the local location of these folders.
    But now how would I give it?

  • Disable provisioned resource via API

    Hi All,
    could anyone of you post an example of request "Disable Provisioned Resource" by using the OIM API?
    Thank you,
    Giuseppe.

    there is no API for enable/disable but you have to call Enable User and Disable User task using OIM API
    Use below API for same
    use tcProvisioningOperationsIntf API.
    public void addProcessTaskInstance(long plTaskKey,long plOrcKey)
    plTaskKey - The key of the process task defined in process definition(nothing but MIL_KEY)
    plOrcKey - The key of the process order instance
    Use belo query to get MIL_KEY/plTaskKey before executing above method
    String sqlquery="select mil.mil_key from mil,pkg,tos,obj " +
    "where mil.mil_name = "Enable User" +
    "and obj.obj_name='<RO NAME>' " +
    "and obj.obj_key = pkg.obj_key " +
    "and tos.pkg_key = pkg.pkg_key " +
    "and mil.tos_key = tos.tos_key" ;
    use below for db connection in oim 11g
    Connection con=Platform.getOperationalDS().getConnection();
    Statement st=con.prepareStatement(query);
    ResultSet rs=st.executeQuery();
    while(rs.next())
    ong milkey=rs.getLong("mil_key");
    similarly you can get the ORC_KEY and call this method for running process task using code. Make sure 'manual insert' and 'Allow Multiple' property is enabled for this task. if not do it using design console

  • Creating a Request via OIM 11g API

    I'm trying to create a request in OIM using the API. I found this post ( OIM 11g - Setting Process Form Data through Request API ) which has the code to do it but I'm getting an error:
    Here is what I have
    OIMClient client = getOIMClient(url, username, password);
          long resKey = 0L;
          String str = null;
          String resourceKey = null;
          Map<String, String> searchMap = new HashMap<String, String>();
          tcResultSet resultSet = null;
          RequestData requestData = null;
          Beneficiary beneficiary = null;
          RequestBeneficiaryEntity entity = null;
          List<Beneficiary> beneficiaryList = new ArrayList<Beneficiary>();
          List<RequestBeneficiaryEntity> entityList = null;
          List<RequestBeneficiaryEntityAttribute> entityAttrList = null;
          String RESOURCE = "TESTRESOURCE_GTC";
          tcITResourceInstanceOperationsIntf operations = client.getService(tcITResourceInstanceOperationsIntf.class);
          Map<String, String> conditions = new HashMap<String, String>();
          conditions.put("IT Resources.Name", "TESTRESOURCE_GTC");
          resultSet = operations.findITResourceInstances(conditions);           
          resKey = resultSet.getLongValue("IT Resource.Key");
          resourceKey = Long.toString(resKey);
          RequestBeneficiaryEntityAttribute parantAttr = new RequestBeneficiaryEntityAttribute();
          parantAttr.setType(TYPE.String);
          parantAttr.setName("Title");
          parantAttr.setValue("Mr.");
          entityAttrList = new ArrayList<RequestBeneficiaryEntityAttribute>();
          entityAttrList.add(parantAttr);
          entity = new RequestBeneficiaryEntity();
          entity.setEntityKey(resourceKey);
          entity.setEntityType(RequestConstants.RESOURCE);
          entity.setEntitySubType(RESOURCE);
          entity.setEntityData(entityAttrList);
          entityList = new ArrayList<RequestBeneficiaryEntity>();
          entityList.add(entity);
          System.out.println("*********** USR KEY" + usrKey);
          beneficiary = new Beneficiary();
          beneficiary.setBeneficiaryType(Beneficiary.USER_BENEFICIARY);
          beneficiary.setBeneficiaryKey(usrKey);
          beneficiary.setTargetEntities(entityList);
          beneficiaryList.add(beneficiary);
          requestData = new RequestData();
          requestData.setRequestTemplateName("Self-Request Resource");
          requestData.setJustification("Test");
          requestData.setBeneficiaries(beneficiaryList);
          UnauthenticatedRequestService reqsrvc = client.getService(UnauthenticatedRequestService.class);
          str = reqsrvc.submitRequest(requestData);
          System.out.println("Value from submitRequest : '" + (str != null ? str : null) + "'");I'm getting
    <Feb 14, 2012 4:53:24 PM EST> <Error> <oracle.iam.request.impl> <IAM-2050128> <Invalid beneficiary key was specified for Self-Request. >
    oracle.iam.request.exception.InvalidRequestDataException: IAM-2050128:Invalid beneficiary key was specified for Self-Request.
    I can see that USER KEY is getting populated.
    Edited by: DJ on Feb 14, 2012 4:59 PM
    Edited by: DJ on Feb 14, 2012 5:00 PM

    While creating a request to provision iPlanet User one of the errors I was getting:
    oracle.iam.request.exception.RequestServiceException: IAM-2050061:Type mismatch for the attribute Server. The type passed is String, but the corresponding type in the data set is Long.:Server:String:Long
    So I replaced the value of the attribute Server to the IT Resource.Key which is 5. After making the changes, it goes through approvals with no problems, but when I approve all the work items, it errors out with an error:
    Error occurred while provisioning resource with key 45 to user 5
    User Key is 45 and Resource Key is 5. I'm not sure why it swapped it.
    Here is the code I'm using:
    public static void createRequest(String userLogin, String templateName, String resourceName, HashMap<String, Object> attrs, OIMClient client) {
        try {
          String usrKey = searchUserByLogin(userLogin, client).get(0).getId();
          long resKey = 0L;
          String str = null;
          String resourceKey = null;
          Map<String, String> searchMap = new HashMap<String, String>();
          tcResultSet resultSet = null;
          RequestData requestData = null;
          Beneficiary beneficiary = null;
          RequestBeneficiaryEntity entity = null;
          List<Beneficiary> beneficiaryList = new ArrayList<Beneficiary>();
          List<RequestBeneficiaryEntity> entityList = null;
          List<RequestBeneficiaryEntityAttribute> entityAttrList = new ArrayList<RequestBeneficiaryEntityAttribute>();
          tcITResourceInstanceOperationsIntf operations = client == null ? Platform.getService(tcITResourceInstanceOperationsIntf.class) : client.getService(tcITResourceInstanceOperationsIntf.class);
          Map<String, String> conditions = new HashMap<String, String>();
          conditions.put("IT Resources.Name", resourceName);
          resultSet = operations.findITResourceInstances(conditions);
          resKey = resultSet.getLongValue("IT Resource.Key");
          resourceKey = Long.toString(resKey);
          for (String attr : attrs.keySet()) {
            RequestBeneficiaryEntityAttribute parantAttr = new RequestBeneficiaryEntityAttribute();
            if (attrs.get(attr) instanceof String) {
              parantAttr.setType(TYPE.String);
              parantAttr.setName(attr);
              parantAttr.setValue(String.valueOf(attrs.get(attr)));
              entityAttrList.add(parantAttr);
            } else if (attrs.get(attr) instanceof Long) {
              parantAttr.setType(TYPE.Long);
              parantAttr.setName(attr);
              parantAttr.setValue(String.valueOf(attrs.get(attr)));
              entityAttrList.add(parantAttr);
            } else {
              // do nothing
          entity = new RequestBeneficiaryEntity();
          entity.setEntityKey(resourceKey);
          entity.setEntityType(RequestConstants.RESOURCE);
          entity.setEntitySubType(resourceName);
          entity.setEntityData(entityAttrList);
          entityList = new ArrayList<RequestBeneficiaryEntity>();
          entityList.add(entity);
          beneficiary = new Beneficiary();
          beneficiary.setBeneficiaryType(Beneficiary.USER_BENEFICIARY);
          beneficiary.setBeneficiaryKey(usrKey);
          beneficiary.setTargetEntities(entityList);
          beneficiaryList.add(beneficiary);
          requestData = new RequestData();
          requestData.setRequestTemplateName(templateName);
          requestData.setJustification("Test");
          requestData.setBeneficiaries(beneficiaryList);
          System.out.println("Resource Keys " + resKey + " " + resourceKey);
          System.out.println("User Key " + usrKey);
          RequestService reqsrvc = client == null ? Platform.getService(RequestService.class) : client.getService(RequestService.class);
          str = reqsrvc.submitRequest(requestData);
          System.out.println("Value from submitRequest : '" + (str != null ? str : null) + "'");
        } catch (Throwable t) {
          t.printStackTrace();
      }Edited by: DJ on Feb 16, 2012 5:01 PM

  • How to enable only one resource profile outof 3 while disabling user in OIM

    Hello,
    I have 3 resource profile for AD user with 3 diffrent IT resources.
    When i try to disable the user in OIM, then it disables all the resource profiles attached for that user.
    I would like NOT to disable one of AD User Resource profile out of 3 .
    How can I do that?
    Thanks

    This is the same post as one made about a week ago.
    I would suggest the following:
    1. Create an adapter that has an input of the domain, or some other identifying attribute. In this adapter, use logic to return a response of either DISABLE or DO_NOTHING.
    2. Create a new Process Task called something like "Disable Resource Determiner". Attach your adapter you just made, and on your response codes, for DISABLE, trigger the disable task, and on DO_NOTHING, then do nothing... Set this adapter to be triggered on disable.
    3. On your previous disable task, remove the disable trigger.
    Now when your disable is triggered, you have logic to determine which target resource is being used, and then whether or not to disable the resource or do nothing.
    -Kevin

  • Disabling Resource Governor via trace flag 8040 is failing

    Hi,
    I am attempting to disable resource governor completely via trace flag 8040 (specified at startup in windows server) for SQL Server 2012 is faling. DBCC TraceStatus (8040) does show status as "1" and Global as "1" which means it
    took the flag, but apparently I'm still able to "enable" resoure governor - which should have failed (at least according to Microsoft SQL Server 2012 Internals book by Kim Delaney).
    I was wondering if anyone else has faced the similar issue, and knows the workaround then please share it on this forum.
    Thanks,
    Vijay

    I am experiencing this issue.
    You cannot disable the resource governor, this is a serious terminological fail from the developers. It is always enabled, and the default values which it uses are challenged. In my case they effectively limit the number of concurrent jobs to 4.
    My counter intuitive partial solution is this.
    Enable the resource governor
    Modify the default resource pool to "High Importance" and with "memory grant" = 100 (this is in the SSMS interface). Leave the other exposed values at zero (unlimited)
    Increase the maximum queued IO per volume to the maximum value of 100 (pretty low value, but there you have it). http://msdn.microsoft.com/en-us/library/bb934013%28v=sql.120%29.aspx
    Doing this enabled me to have up to 12 serious threads of execution concurrently in operation, before jobs stall with memory allocation grant wait. So far so good, but ...
    The target and actual CPU usage shown in perfmon SQLServerResourceStats is still pegged around 75%. CPU monitor shows 85% for SQLServer though (go figure). In my real live case, the processes are CPU bound, so I expect to get all the CPU available.
    However, the next attempt to do anything at all on the instance will wait for some indeterminate amount of time before the grant memory allocation occurs. There is no LOCK shown in the LOCK statistics that I have found and sp_who2 simply reports the active
    verb (INSERT etc) with no indication that the SPID is doing nothing.
    This will let you know that the governor is stalling requests. You have to figure out which ones and when.
    select pool_id, name, active_memgrant_count,memgrant_waiter_count,* from sys.dm_resource_governor_resource_pool
    All in all a sub-optimal solution. It is better than the default, which is fatally crippled, but still a completely inappropriate result

  • OIM APIs about Resource STATUS information

    Is there any OIM API that provides developers with the information of resource status which is related to 'PROVISIONED', 'PROVISIONING', 'ENABLED', 'REVOKED'?

    use below query for this
    select usr.usr_login, usr.usr_status, obj.obj_name, ost.ost_status
    from oiu, usr, ost, obj, usg, act
    where oiu.usr_key=usr.usr_key
    and oiu.ost_key=ost.ost_key
    and ost.obj_key=obj.obj_key
    and usr.act_key=act.act_key
    and obj.obj_name in ('Resource Name')
    --and ost.ost_status in ('Enabled','Provisioned')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Unable to start process via GP API in which group is exposed as input

    Hi,
         I am not been able to start process using GP API for the particular senario.
    I created Process at design time.
    In this process I mapped parameters to a group and exposed this group, So that input is required for initiating the process.
    Now I want to initiate this process via GP API.
    I got sucess in starting processes which takes parameters as inputs or which does not need any inputs, but i was not been able to start process where group is exposed.
    it's giving me GP INVOCATION Exception.
    Please Help ASAP
    Regards,
    Pratik

    Pratik,
    I try to simulate with scenario described by you and I got success with my test.
    Follow my java code:
         public boolean initiateProcessSDN () {
              boolean ret = false;
              try {
                   IUser user = UMFactory.getUserFactory().getUserByLogonID("uces");
                   IGPUserContext userContext = GPContextFactory.getContextManager().createUserContext(user);
                   IGPProcess processTemplate
                        = GPProcessFactory.getDesigntimeManager().getActiveTemplate(
                                  "8DC0B411957D11DDB7910017F2EBE4A5", userContext);
                   IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
                   IGPStructure params     = GPStructureFactory.getStructure(processTemplate.getInputParameters());
                   params.setAttributeValue("NameGroup", "Pedro");
                   params.setAttributeValue("AddressGroup", "XPTO");
                   IGPProcessRoleInstanceList roles = rtm.createProcessRoleInstanceList();
                   IGPProcessInstance prInstance
                        = rtm.startProcess(     processTemplate,
                                            "Test 1",
                                            "Test 2",
                                            user,
                                            roles,
                                            params,
                                            user);
                   ret = true;
                   } catch (Exception ex) {
                        ret = false;
              return ret;
    Print screen about my GP design:
    Callable Object with 4 parameters
    http://img530.imageshack.us/img530/16/sdngpgroup001bt5.jpg
    Action grouping CO parameters into 2 groups
    http://img147.imageshack.us/img147/2006/sdngpgroup002xy3.jpg
    Process reflecting these groups as input parameters
    http://img147.imageshack.us/img147/9184/sdngpgroup003pp0.jpg
    Process started by java code above
    http://img530.imageshack.us/img530/8833/sdngpgroup004no4.jpg
    Best Regards,
    Pedro Nunes

  • How to Create Resource Object in OIM through SQL queries or OIM APIs

    Hello,
    I have to create few (100) resource Objects in OIM. I was creating manually through Design console one by one. In future we might need to create many more Resource Objects .It takes lot of time if we do it through Manually.
    Is there any possiblity we can create Resource Objects through SQL query or OIM APIs ???
    Thanks!!

    Yes. I do it all the time.
    If you are using 11G 11.1.1.3
    Go here
    http://fredforester.org/code/xmlstarters/
    Download the files.
    RESCFORM.xml is an example resource built from the template
    buildtemplate.sh is a shell script that creates a resource from the template
    index.php - you dont need this
    templateresource.xml - this is the template resource. it was created by building a simple resource with all its basic tasks and components then editing it and renaming things so I can find them with sed
    to create Resource C you would
    ./buildtemplate.sh RESCFORM "Resc Resource" "Resc Process"
    you would end up with a file called RESCFORM.xml where when imported would have
    UD_RESCFORM
    Resc Resource Resouce Defintion
    Resc Process Process Defition with basic tasks pointing to a dummy adapter.
    You can optionally create your own prepop so it will get assigned to the form when you import.
    Good luck

  • Creating self registration request using OIM API

    Hi guys,
    When we try to create a self regisrtation request using OIM API , we ge the following exception:
    We get this error when we set the following in Design console.
    Does user have to provide challenge information during registration = FALSE
    and passed an blank object in place of challenge question parameter in createSelfRegistrationRequest method in tcUtilityBaseClass.
    19:22:17,218 ERROR [REQUESTS] Error: Failed to save REQ_CONSOLIDATED_DATA_VALUE
    data for Create Entity.
    java.lang.NullPointerException
    at org.apache.xml.serializer.TreeWalker.dispatachChars(TreeWalker.java:2
    44)
    at org.apache.xml.serializer.TreeWalker.startNode(TreeWalker.java:414)
    at org.apache.xml.serializer.TreeWalker.traverse(TreeWalker.java:143)
    at org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transf
    ormerIdentityImpl.java:389)
    at com.thortech.xl.dataobj.util.RequestDataConsolidator.convertNodeToXML
    (Unknown Source)
    at com.thortech.xl.dataobj.util.RequestDataConsolidator.addUser(Unknown
    Source)
    at com.thortech.xl.dataobj.tcDataBase.createRequestForCreateEntity(Unkno
    wn Source)
    at com.thortech.xl.dataobj.tcDataBase.createRegistrationRequest(Unknown
    Source)
    at com.thortech.xl.dataobj.tcDataBase.createRegistrationRequest(Unknown
    Source)
    at com.thortech.xl.ejb.beansimpl.tcUnauthenticatedOperationsBean.createR
    egistrationRequest(Unknown Source)
    at com.thortech.xl.ejb.beans.tcUnauthenticatedOperationsSession.createRe
    gistrationRequest(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
    tatelessSessionContainer.java:237)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
    ke(CachedConnectionInterceptor.java:158)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
    elessSessionInstanceInterceptor.java:169)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
    Interceptor.java:63)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
    rceptor.java:121)
    How do we create a self registration request , using OIM API , with and without challenge questions?

    Well try this piece of code. This might be similar to yours but it worked perfectly for me. For you the error might be the attribute names which you are passing, it should be the one dfined in the FormMetaData xml as below.
         import Thor.API.tcUtilityFactory;
         // define you class below
         ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
         final Hashtable env = config.getAllSettings();
         Hashtable quesAns = new Hashtable();
         HashMap user = new HashMap();
         user.put("Users.User ID", "SelfTesting");
         user.put("Users.First Name", "SelfTesting");
         user.put("Users.Last Name", "SelfTesting");
         user.put("Users.Email", "[email protected]");
         user.put("Users.Password", "SelfTesting");
         user.put("ConfirmPassword", "SelfTesting");
         tcUtilityFactory.createRegistrationRequest(env, user, quesAns);
    And for the query of challenge QnA, these are the following combinations possible:
    1) Property Does user have to provide challenge information during registration set to TRUE
    - During self-registration from web console, it will show you Challenge Questions section on the right. If you do not select any questions, it will thow you an error there itself.
    - Doing it from API will create no difference(even if you pass a blank HashTable). The request will be created successfully and on completion when the user tries to login, it will ask for Security QnA.
    2) Property Does user have to provide challenge information during registration set to FALSE
    - During self-registration from web console, it doesn't show you Challenge Questions section on the right. The request will be created successfully and on completion when the user tries to login, it will ask for Security QnA.
    - Doing it from API, you will have to pass a blank HashTable as in above code. The request will be created successfully and on completion when the user tries to login, it will ask for Security QnA.
    Hope it works.
    Thanks
    Sunny

  • Creating form using OIM API

    Hi
    can anyone help me in creatig a form and assigning it to a resource object.
    please tell what all should i mention in the map which is to be passed to createForm() method.
    Thank you

    Hi all
    what attributes i need to to map to create a from using OIM API
    createForm Method?
    I have tried with this but did not work:The form is getting created , i.e I am seeing an entry in DB.
    At the same time I am aslo getting an exception which is whown below:
    formMap.put("Structure Utility.Table Name", "SAM");
              formMap.put("Structure Utility.Description", "TESTING API USAGE FOR FORM");
    The Exceptions I get are :
    Thor.API.Exceptions.tcInvalidNameException
         at com.thortech.xl.ejb.beansimpl.tcFormDefinitionOperationsBean.createForm(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcFormDefinitionOperationsBean.createForm(Unknown Source)
         at com.thortech.xl.ejb.beans.tcFormDefinitionOperationsSession.createForm(Unknown Source)
    09:05:13,772 ERROR [DATABASE] Class/Method: tcDataBase/writeStatement encounter
    some problems: ORA-02089: COMMIT is not allowed in a subordinate session
    java.sql.SQLException: ORA-02089: COMMIT is not allowed in a subordinate session
    09:05:13,819 ERROR [ADAPTERS] Event: Adding Columns to SDC. has encountered an error.
    09:05:13,819 ERROR [SERVER] Class/Method: tcDataObj/runEvent Error :EVT Fatal Rejection Occured
    09:05:13,819 ERROR [APIS] Class/Method: tcFormDefinitionOperationsBean/createForm encounter some problems: maoErrors:Error Adding Column.
    How can i resolve this?
    When and where can I view the form that I have created?
    Thank you

  • Transaction Management - OIM API

    We wanted to know how to handle transaction from OIMClient, when we make OIM API call.
    eg:
    from a java client, we invoke create organization and provision resource to that organization.
    i.e we end up calling two OIM api calls
    1)
        organizationManager.create(organizationObj);
    2)
    tcOrganizationOperationsIntf.provisionObject(orgKey,resourceKey);
    Now, if 2nd one fails, then transaction should be rolled back and organization create should be rolled back. we wanted single unit of work to be achieved.
    how can this be achieved?
    how do we control transaction from OIMClient/API?
    public String createOrganization(OrganizationVO ovo) {
      String result = "";
      OrganizationManager omgr = null; // OIMClient API
      Organization org = null; // OIMClient API
      try { 
      omgr=ULMServiceLocator.getInstance().getOrganizationManager();
      org = new Organization();
      org.setAttribute("Organization Name", ovo.getOrgName());
      org.setAttribute("Organization Customer Type", ovo.getOrgType());
      result = omgr.create(org);
      tcUtilityFactory ioutilityFactory = ULMServiceLocator.getInstance().getcUtilityFactory();
      //TODO
      tcOrganizationOperationsIntf utilityFactory1 = (tcOrganizationOperationsIntf) ioutilityFactory
      .getUtility("Thor.API.Operations.tcOrganizationOperationsIntf");
      long l1 = utilityFactory1.provisionObject(Long.parseLong(result),
      123l);
      } catch (oracle.jrf.UnknownPlatformException e) {
      e.printStackTrace();
      } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return result;

    Hi Abhay,
    <b>If there is another way to add a record to Main table and Lookup/Qualified/Hierarchy table simultaneously then there is no need of Transaction.</b>
    There are no direct methods currently(as of MDM 5.5SP3) available in MDM API.
    You have to build your own logic to implement.
    Regarding the Transaction management, I guess you are talking aboout two phase commit scenarios. I would say you can achieve this using EJB's in which u write the business logic (In this case the MDM API code).
    For Example:
    Adding a record to Main table,
    Let say 2 fields
    1. Free text field.
    Its straight forward method, use A2iFiled object and assign some value to it.
    2. Lookup field.
    For this.
    First get the Record id for the value, which you are trying to add, from the lookup table.
    If the lookup table does not find the value in the table, it return zero or some negative value(which I am not sure).
    Based on the return value you can add the value into the lookup table and then into the main table.
    Just putting a sample scenario. Hope this helps.
    Thanks and regards
    Subbu

Maybe you are looking for