Best way to achieve BuildMap rule functionality in WebServicesAfterOperation rule?

Hi SailPoint Community,

I have a WebServices source where I would like to compute and set an additional account attribute based on the information returned by the web service call during account aggregation. This can be most naturally achieved with a BuildMap rule, where values from the already-built ResourceObject map can be used to set another value into this map to form the account. This rule however is not available in ISC for this connector type.

I understand that the WebServicesAfterOperation rule can be used instead of a BuildMap rule, but examples I’ve seen more or less have to do the entire transformation from WebService response to the ResourceObject data map, in order to achieve the computation of that one additional attribute.

Does anyone know if there is a way to achieve this requirement using the WebServicesAfterOperation rule in a way that more closely mirrors the simplicity of a BuildMap rule?

And/or, does anyone have an example or template of a WebServicesAfterOperation rule that does something similar?

I could also do this computation at the Identity Attribute level but I would much rather do it in a connector rule where I can deploy and build myself, vis a vis cloud rule with a review process.

Thank you!

Alex King

@AlexFKing please find a sample after rule for your refrence

import connector.common.JsonUtil; 
import java.util.HashMap; 
import java.util.Map.Entry; 
import java.util.Map; 
import java.util.List; 
import java.util.ArrayList; 
import javax.net.ssl.HttpsURLConnection; 
import java.io.BufferedReader; 
import java.io.PrintStream; 
import java.io.StringWriter; 
import java.text.SimpleDateFormat; 
import sailpoint.tools.GeneralException; 
import com.google.gson.Gson; 
import org.json.*; 
import sailpoint.integration.*; 
 
 
List list = new ArrayList(); 
Map response = new Gson().fromJson(rawResponseObject, Map.class); 
 
List Finallist = new ArrayList(); 
log.info(\"Get raw response\"+response); 
 
list = response.get(\"Resources\"); 
log.info(\"get List\"+list); 
 
    for(int d = 0; d < list.size(); d++ ){ 
      Map responseMap = (Map) list.get(d); 
 
 
        Map newmap = new HashMap(); 
        newmap.put(\"id\", responseMap.get(\"id\")); 
        newmap.put(\"displayName\",responseMap.get(\"displayName\")); 
       Finallist.add(newmap); 
  } 
 
Map updatedMapInfo = new HashMap(); 
updatedMapInfo.put(\"data\", Finallist); 
log.info(\"Get Final List\"+Finallist);
 
return updatedMapInfo;

Hi Alex,

Use WebServices After Operation Rule.
Once you have the rule developed as per your requirements, attach it to your “Account Aggregation” Operation.

1 Like