Entitlement displayed in array

Hi All,
In the webservice connector, during group aggregation, the entitlements are loaded as an array. Using the after-operation rule, im trying to aggregate the entitlements. Im missing some entitlements in the IDn. It seems it is overwritten by new vales
Eg. [1,2,3}
Only 3 is displayed in the output. Is there anyissues with myrule? Can anyone help me resolvethis?.

The current code is iterating through each item of the result-set and returning the results, hence you are getting the result of last iteration. Here you need to create an array list to add all the roles into it and add the array-list into your data key and it will provide you all the roles. Considering you are trying to get only the list of roles, giving you the below sample code,

ArrayList resultsToReturn = new ArrayList();

if (processedResponseObject != null) {
......
.......
iterdateMap.put("description", role);
resultsToReturn.add(iterateMap);
}
updatedMapInfo.put("data",resultsToReturn);

Hope this may help you.

Hi,
We tried the logic you have mentioned. It again displays the entitlements data in the array format. The same data as processedResponseObject.

You need to debug the code by printing each object in one of java IDE by passing static values. Try to assign processedResponseObject to an arraylist and loop through it to get each record and place your empty role check conditions inside the loop.

for(int i = 0 ; i < responseArray.getLength();i++) {
}

The resultsToReturn.add(iterateMap) should be inside your if condition, placed after Line#14, also declare the Map variable inside For loop. Make sure the resultsToReturn object returns the array values by printing it in IDE.

Hi All,
Resolved the issue using another approach. Aggregated the entitlement using account aggregation. There is no separate endpoint for group aggregation. So loaded all entitlements using account aggregation. So it does not load as array values.

1 Like

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