OIM API To Get Process Instance Key

package com.provision;

import java.util.HashMap;
import java.util.Map;

import com.connection.Platform;

import Thor.API.tcResultSet;
import Thor.API.Exceptions.tcAPIException;
import Thor.API.Exceptions.tcColumnNotFoundException;
import Thor.API.Exceptions.tcUserNotFoundException;
import Thor.API.Operations.tcUserOperationsIntf;

public class GetProcessInstanceKey {

 public static void main(String[] args) throws tcAPIException, tcUserNotFoundException, tcColumnNotFoundException {  
  tcUserOperationsIntf userOperationsIntf=Platform.getService(tcUserOperationsIntf.class); 
  
  long userKey=1004L; 
  Map<String,Long> resources= new HashMap<String,Long>();

                  tcResultSet trs= userOperationsIntf.getObjects(userKey);
                  if(trs != null)
                  {
                      int count=trs.getRowCount();
                      for(int i=0;i<count;i++)
                      {
                          trs.goToRow(i);
                          String objectName=trs.getStringValue("Objects.Name");
                          String status=trs.getStringValue("Objects.Object Status.Status");

                          if(status.equalsIgnoreCase("Provisioned") || status.equalsIgnoreCase("Enabled"))
                          {
                              resources.put(objectName,trs.getLongValue("Process Instance.Key"));
                          }
                      }
                  }
                  System.out.println("resources -> "+resources);

 }

}

No comments:

Post a Comment

About OIM

Oracle Identity Management enables organizations to effectively manage the end - to - end life - cycle of user ide...

Popular Posts