Danışmanlık
Okunan
Oracle BPEL içerisinde OIM Api kullanımı
0

Oracle BPEL içerisinde OIM Api kullanımı

by Arda Eralp13 Temmuz 2017

Using OIM APIs in Oracle BPEL

Step by step using OIMClient classes in Oracle BPEL with Java_Embedding

Lets start

Step 1: authwl.conf file

Create folder into your project and copy authwl.conf file into it

Step 2: oimclient.jar file

Get oimclient.jar file from your OIM server and copy into SCA-INF/lib folder.

Open your project properties and add oimclient.jar file to libraries

Step 3: Java_Embedding action

Add Java Embedding action into your bpel and write java code in it.

 



try {    
//oracle.xml.parser.v2.XMLElement input = (oracle.xml.parser.v2.XMLElement) getVariableData("inputVariable", "payload", "/client:process/client:input");   
//String name = input.getTextContent();   
String name = (String)getVariableData("SchedulerInput"); 
 
String oim_user = "xelsysadm";     
String oim_pass = "password";     
String oimProviderURL = "t3://10.10.10.10:14000";       
String authWlPath =  "..\\oimresource\\authwl.conf";     
     
java.util.Hashtable<string,string> env = new  java.util.Hashtable<string,string>();     
env.put(oracle.iam.platform.OIMClient.JAVA_NAMING_PROVIDER_URL.toString(), oimProviderURL);      
env.put(oracle.iam.platform.OIMClient.JAVA_NAMING_FACTORY_INITIAL.toString(), "weblogic.jndi.WLInitialContextFactory");      
System.setProperty("java.security.auth.login.config", authWlPath);     
System.setProperty("OIM.AppServerType", "wls");     
System.setProperty("APPSERVER_TYPE", "wls");     
     
oracle.iam.platform.OIMClient oimClient = new oracle.iam.platform.OIMClient(env);     
     
oimClient.login(oim_user, oim_pass.toCharArray());     
     
oracle.iam.scheduler.api.SchedulerService schedulerService = oimClient.getService(oracle.iam.scheduler.api.SchedulerService.class);      
      
String scheduleJobName="AR HR Real Time Integration";      
oracle.iam.scheduler.vo.JobDetails jobdetails=schedulerService.getJobDetail(scheduleJobName);      
java.util.HashMap<string, oracle.iam.scheduler.vo.jobparameter=""> params= jobdetails.getParams();      
   
String parameterName="User";      
String parameterValue= name;      
oracle.iam.scheduler.vo.JobParameter jobParam= params.get(parameterName);      
jobParam.setValue(parameterValue);      
params.put(parameterName, jobParam);      
schedulerService.updateJob(jobdetails);      
      
schedulerService.triggerNow(scheduleJobName);    
oimClient.logout();   
} catch (Exception e) {    
  System.out.println("exception "+e.getMessage());   
  addAuditTrailEntry("Error: "+e.getMessage());  
  setVariableData("SchedulerError","Error: "+e.getMessage()); 
}

       

Step 4: Test

Test your project 🙂

About The Author
Arda Eralp
Arda Eralp
T-shaped professional gathering superior technical knowledge, sales-oriented mindset, and extensive business expertise in the Information Technology industry. Over 10 years of experience in multinational technology companies, my journey spans various functions from software development to sales consultancy. Passionate about cutting-edge technologies and their transformational impacts on business and daily life.
Yorumlar

Yanıt Bırak