PeopleSoft HCM BuildMap Rule
A BuildMap rule is used to manipulate the raw input data (provided via the rows and columns in the file) and build a map out of the incoming data.

Copy
import java.sql.Statement;
import java.sql.ResultSet;
import java.util.HashMap;
import java.util.Map;
import sailpoint.connector.JDBCConnector;
import sailpoint.connector.PeopleSoftHRMSConnector;
import sailpoint.connector.PeopleSoftDirectConnector;
Statement statement=null;
ResultSet resultSet = null;
String type = schema.getObjectType();
// Return the map with all attribute values which are present in the schema. The connector object
// will call the buildMap method which contains the resource object. The type will be account.
// The query retrieve the Network ID of the PeopleSoft HR record which has primary flag as 'Y'. The Network ID is a collection
// attribute defined in PeopleSof HRMS. Table for accessing the Network ID is PS_PERSON_IMCHAT and MCF_IMUSERID is the attribute which
// is mapped as NetworkID in PeopleSoft portal.
String query = "select MCF_IMUSERID from PS_PERSON_IMCHAT where PREF_CHATID_FLAG = 'Y' and EMPLID ='" + identity + "'";
//The connection object is in context ,and executing the above query.The result will return the data of the field .
statement = connection.createStatement();
resultSet = statement.executeQuery(query);
if (resultSet.next()) {
String networkIDValue = resultSet.getObject(1);
map.put("MCF_IMUSERID",networkIDValue);
}else{
if(log.isDebugEnabled()){
log.debug("No NetworkID exist for user:"+ identity );
}
}
statement.close();
resultSet.close();
//Return the map of which contains the final resource object map with the new field value.
return map;