Error: BeanShell script error: bsh.ParseException: Parse error at line 124, column 26

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);
	}
}

Hi ,

Please see line no: 18 in log statment concatenation + operator is missing:

log.debug("======Identity map for [ " + identityId + " ] is: " +identityData);

Thanks.

2 Likes

You’re an absolute lifesaver! Thank you for the extra set of eyes…I’m quite embarrassed I missed that, but appreciate you nonetheless!

1 Like

Welcome Nicholas,

Hahaha…nothing to be embarrassed about, it happens to me as well all the time.

Happy Learning!!.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.