Hi Everyone,
We have a webservices connector and create account operation. Once the account is created in the target system, the NATIVE IDENTITY will be generated in the target system. We are trying to aggregate native identity using get object (single account aggregation). However, it is not working and single account aggregation is not working.
We wrote an after-operation rule to call http request to get the native identity and update it in processed response object as well. This is not working as well.
Any help/suggestions are much appreciated.
After Rule for create account
*import java.util.HashMap;*
*import java.util.List;*
*import java.util.Map;*
*import java.util.Map.Entry;*
*import java.util.Iterator;*
*import java.util.ArrayList;*
*import java.util.HashMap;*
*import java.util.Map;*
*import connector.common.JsonUtil;*
*import connector.common.Util;*
*import sailpoint.connector.webservices.EndPoint;*
*import sailpoint.connector.webservices.WebServicesClient;*
*import sailpoint.object.Application;*
*import sailpoint.object.ProvisioningPlan;*
*import sailpoint.object.ProvisioningPlan.AccountRequest; *
*import connector.common.JsonUtil;*
*import sailpoint.connector.webservices.WebServicesClient;*
*//We can parse the response(rawResponseObject) to fetch from the respective executed Endpoint operation.*
*Map updatedMapInfo = new HashMap();*
*log.error("Processed response object" + processedResponseObject);*
*if (processedResponseObject != null){*
* *
* for (Map iterateMap : processedResponseObject) {*
* if (iterateMap != null ) {*
* Set keySet = iterateMap.keySet();*
* for (String s : keySet) {*
* if (s.equals("id")) {*
* Map body = requestEndPoint.getBody();*
* String jsonBody = (String) body.get("jsonBody");*
* log.info("Rule - Modify Body: running");*
* *
* *
* String role = "";*
* String ID = "";*
* Map jsonMap = JsonUtil.toMap(jsonBody);*
* if (jsonMap != null) {*
* Object roleEntry = jsonMap.get("userID");*
* if (roleEntry != null) {*
* role = (String) roleEntry;*
* log.error("responserole: " + role);*
* }*
* *
* }*
* *
* //iterateMap.put("id", ID);*
* WebServicesClient client = new WebServicesClient();*
* String url = "http://aligne5dev-core.atmosenergy.com:8080/ums/rest/user/userList?status=3&searchBy=User%20ID&searchStr=" + role;*
* Map args = new HashMap();*
* args.put(WebServicesClient.ARG_URL, url);*
* client.configure(args);*
* Map header = new HashMap();*
* // Information can be fetched from requestEndpoint and updated in the header and body*
* // header.put("Authorization","XXXX XXXX");*
* header.put("Content-Type","application/json");*
* *
* List<String> allowedStatuses = new ArrayList();*
* allowedStatuses.add("2**");*
* Map payload = new HashMap();*
* *
* *
* String response = client.executeGet(url, header, allowedStatuses);*
* *
* // if response contains token it can be updated in the requestEndpoint header or body*
* // the requestEndpoint will be used for execution of the particular operation configured*
* log.error("responsealign: " + response);*
* Map responseMap = JsonUtil.toMap(response);*
* if (response != null) {*
* Object IDentry = jsonMap.get("id");*
* if (IDentry != null) {*
* ID = (String) IDentry;*
* log.error("responseID: " + ID);*
* iterateMap.put("id",ID);*
* }*
* }*
* *
* }*
* }*
* }*
* }*
*updatedMapInfo.put("data", processedResponseObject);*
*}*
*return updatedMapInfo;*