I’m working on a Web Services AfterOperation rule and for some reason I’m stuck with the random BeanShell parse error. I’ve tested the functionality of what I’m doing in a Java compiler AND used this same code on other rules, so can’t seem to understand what I’m missing.
The failure happens at line 4 below (the for loop). For reference, the list “groups” is a JSON response body that I used the method JsonUtil.toList to create a list of the JSON objects. The output of the object appears as expected in the logs and when I check the class on the “groups” object below, it’s ArrayList as expected. Anyone have any idea what might be wrong with that line?
ArrayList groups = groupData(idnURL, jwToken, appId);
log.debug("======Exited the group data loop with " + groups);
for (Object group: groups){
log.debug("======Parsing through Groups data.");
Map groupData = (Map) group;
log.debug("======Individual Group name data is " + groupData);
String groupId = groupData.get("id");
Map attributes = (Map) groupData.get("attributes");
List members = (List) attributes.get("members");
for (Object member: members){
Map account = new HashMap();
String identityId = (String) member;
log.debug("======Entering processing loop for identity sys " + identityId + " and group sys " + groupId);
Map identityData = getIdentityData(idnURL, jwToken, identityId);
log.debug("======Identity map for [ " + identityId + " ] is: " identityData);
account.put("id",identityId);
account.put("name", (String) identityData.get("name"));
account.put("employeeID", (String) identityData.get("EEID"));
processedResponseObject.add(account);
log.debug("==== processedResponseObject Object for identity [ " + identityId + " ] is: " + processedResponseObject);
}
}