I am facing the exact issue. The rule was working fine . All of a sudden it stopped working . The error returned is
sailpoint.connector.ConnectorException: Error: The application script threw an exception: java.lang.NullPointerException: Null Pointer in Method Invocation BSF info: Rule-name After at line: 0 column: columnNo
Not sure why are you not using parent child configuration to get user data like in aggregation1 - you will get all Id’s and in aggregation2 - you will get the attributes of those ids (assuming you are not getting all the attributes in first call). Then you can use a rule to edit role info in a after rule.
Use a method to generate a token.
public String getNewToken() throws GeneralException
{
log.debug("Entering Example_BeforeOperation_Rule: getNewToken method");
OkHttpClient client = null;
Response response = null;
String newToken = null;
try
{
String baseUrl = (String) application.getAttributeValue("genericWebServiceBaseUrl");
String loginUrl = "/authentication/Login";
String finalUrl = baseUrl + loginUrl;
String bodyContent = "{\r\n \"username\": \""+ application.getAttributeValue("username") +"\",\r\n \"password\": \""+ application.getAttributeValue("password") +"\"\r\n}";
client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, bodyContent);
Request request = new Request.Builder().url(finalUrl).method("POST", body).addHeader("Content-Type", "application/x-www-form-urlencoded").build();
response = client.newCall(request).execute();
if (!response.isSuccessful())
{
throw new IOException("Unexpected code in getNewToken()" + response + " || " + response.body().string());
}
// Get response body
log.debug("Retrieving new toekn fromt he response...");
String res = response.body().string();
JSONObject jObject = new JSONObject(res);
newToken = jObject.getString("sessionId");
}
catch (Exception e)
{
log.error("Error while generating new token...." + e.getMessage());
throw new GeneralException("Error while generating new token...." + e.getMessage());
}
finally
{
if (null != response)
{
response.body().close();
}
}
log.debug("Exiting Example_BeforeOperation_Rule : getNewToken method");
return newToken;
}
Could you please provide the whole log of the exception so we can see what Line it ends on?
It could be that there is an account or anything on the endpoint that the rule is trying to call but is no longer present in either the endpoint or in ISC itself. It may be best to remove the rule, complete an aggregation and look for any changes, then rebuild the rule based off of those changes.