Here's the code I have (basically copy / paste from this post). I have all import statements "working" / added and the error seems to be around the oracle.iam.request.vo.Beneficiary import which seems to be imported correctly just like the others. I've added the oimclient.jar which contains all the classes needed correct?
Your code throws an error:
ReplyDeleteIncompatible types: required: oracle.iam.request.vo.Beneficiary; found: java.lang.Object.
This is for the line:
for (Beneficiary benf : benList) {
Where "benf" is red/underlined, I'm not sure what the issue is at the moment.
Check if you got all the supported Jar files.
ReplyDeleteHere's the code I have (basically copy / paste from this post). I have all import statements "working" / added and the error seems to be around the oracle.iam.request.vo.Beneficiary import which seems to be imported correctly just like the others. I've added the oimclient.jar which contains all the classes needed correct?
ReplyDelete==================================
package com.custom.prepop.plugins;
import java.io.Serializable;
import java.util.HashSet;
import java.util.List;
import java.util.logging.Logger;
import oracle.iam.identity.usermgmt.api.UserManager;
import oracle.iam.identity.usermgmt.api.UserManagerConstants;
import oracle.iam.identity.usermgmt.vo.User;
import oracle.iam.platform.Platform;
import oracle.iam.request.exception.RequestServiceException;
import oracle.iam.request.vo.Beneficiary;
import oracle.iam.request.vo.RequestData;
public class PrePopulateFields implements oracle.iam.request.plugins.PrePopulationAdapter {
public Serializable prepopulate(RequestData requestData)
{
System.out.println("Inside Prepopulate Adapter.. ");
System.out.println("Request Data: " + requestData);
String prePopUserId = null;
List benList = requestData.getBeneficiaries();
UserManager usersvc;
if (benList.size() == 1) {
usersvc = (UserManager)Platform.getService(UserManager.class);
for (Beneficiary benf : benList) {
HashSet searchAttrs = new HashSet();
searchAttrs.add(UserManagerConstants.AttributeName.USER_LOGIN.getId());
try {
User userBenef = usersvc.getDetails(benf.getBeneficiaryKey(), searchAttrs, false);
if (userBenef != null)
prePopUserId = userBenef.getLogin();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
return prePopUserId;
}
}