Aggregating from multiple endpoints

Hello everybody!
I am integrating with an application which has active users and archived users and using Webservice SAAS connector. The difference between them is that “active” attribute is either true or false. Responses are the same from both endpoints in terms of structure and mapping. So, I configured 2 Account Aggregation HTTP operation with this endpoints, however, only one aggregation task is working and being executed based on the order of HTTP Operations. I tried to use parent endpoint functionality, ended up with errors, and I am not sure if it is going to suit in current situation.

It really depends on you configuration and how you did on the connector, can you share?

Also Parenting would be you solution in here, you would carry the response from the first endopoint to the second and utilized in any form if they are dependent .
Ex:

If endpoint 1 returns a ID that need to be provided for Endpoint 2 , you would carry this ID using $response.id$.

If not you can have booth Endpoints and each youu complement the Account Object with the results.

Whats your scenario?

Hi Ivan. My scenario is that, I have two lists and two endpoints.
Endpoint 1: List of all active users
Endpoint 2: List of all disabled users
They have the same scheme and the response structure, the only difference is that “active” attribute is “true” in identities from Endpoint 1, and it is false for users from Endpoint 2. The reason why I am saying parenting will not probably work is because I dont really need any info from my Parent endpoint, these are two independent endpoints.


If I have the http operations in this order, IDN aggregates only disabled users. But if I switch the order(User&Entitlement Aggregation first, and then User&Entitlement Aggregation(Archived Users)) I will have active users only.

@pulatoi So the parenting is like a Auto-Complete feature, if you ahve the same schema they are going to be overwritten by the most recent information.

If is really not possible to grab all the users at one call i would create a afterRule and have the call in there, as a example you can do is something simmilar to this

public String AggregateDisabledEmployees(Endpoint Endpoint){
    WebServicesClient client = new WebServicesClient();
    Map config = new HashMap();
    String employeeUrl = baseapiUrl + nativeIdentity;
    config.put(WebServicesClient.ARG_URL,baseapiUrl);
    config.put(WebServicesClient.ARG_USERNAME, application.getAttributeValue("username"));
    config.put(WebServicesClient.ARG_PASSWORD, application.getAttributeValue("password"));
    Map employeeInfo = new HashMap();
    try {
        client.configure(config);
        Map header = new HashMap();
        header.put("Content-Type","application/json");
        List allowedStatuses = new ArrayList();
        allowedStatuses.add("2**");

        String responseBody = client.executeGet(employeeUrl,header,allowedStatuses);
       

/* grab the data*/
        
        } catch (Exception e) {
            log.error("Exception Occurred! ");
        }
       
    }

After data you just need to grab the data from the body, and put inside the object list on the requestEndPoint Object.
This Object is a List of MAPS so you grab the response and trasnform each “user” ina a map and put in the list.

Best!

I will try this out, thanks Ivan

1 Like

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