Web Services - Before Provisioning Rule - oldResponseMap not populated after primary endpoint

Which IIQ version are you inquiring about?

8.5sp1

Share all details about your problem, including any error messages you may have received.

I have been fighting the web service connector to add an entitlement. I have attempted endpoint chaining to first retrieve the account object, perform a before provisioning rule to adjust the payload body to update the list of roles a user has, but I cannot figure out how to retrieve the roles, add/remove the entitlement to be provisioned, and then submit the final API call to do it.

Endpoint Chaining:

Add Entitlement - Step 1

Did a test to see if I would get it in $response.roleIds$ in the second endpiont “Add Entitlements - Step 2” and I did. However, I still need to use that data to transform it into the final list. That said the BeforeProvisioningRule can’t see it in the “oldResponseMap”

// Get the current list of roles from the account data loaded before this operation.
  log.error("OldResponseMap: " + oldResponseMap);
if (oldResponseMap != null && oldResponseMap.get("roleIds") != null) {
  // 'oldResponseMap' is injected by the rule runner
  List currentRoles = (List) oldResponseMap.get("roleIds");
  for(Object id : currentRoles) {
      if (id instanceof Number) {
          finalRoleSet.add(new Long(((Number)id).longValue()));
      }
  }
}
// However, nothing is returned and the log.error() above prints an empty map

What is my deal here? It seems like it should work, but I can’t figure it out.

Figured it out. I had a bad response mapping on the primary endpoint.

The data was nested under “$.result”. therfore, when I did the after provisioning rule, I saw that there was no data in the processed response object. That made me see that I had issues on the first endpoint

Fix was “$.” → “$.result” and then the $response.roleIds$ worked correctly and the “oldResponseMap” had the correct data