cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Send data in bulk (any kind of object) in LaunchedWorkflow API of SCIM

Send data in bulk (any kind of object) in LaunchedWorkflow API of SCIM

The System for Cross-domain Identity Management (more commonly known as SCIM) is a universally accepted API for managing the services on the cloud-based application. Sailpoint IIQ has its own implementation for the SCIM. You can refer to the SCIM API help book on the below link

7.3 IdentityIQ SCIM API Reference.pdf - Compass (sailpoint.com)

While working with /LaunchedWorkflow end-point generally come across a complex type of request where we required to send data in a more natural way rather than just a "String" format. As we are aware the LaunchedWorkflow schema is written in such a way, that it only allows us to pass the data into String format like below

{
    "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow": {
        "workflowName": "workflowName",
        "input": [
            {
                "key": "key1",
                "value":"value1"
            },
            {
                "key": "key2",
                "value":"value2"
            }
        ]
    }
}
 
but in the real world, we need to deal with a more complex format like below
 
{
    "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow": {
        "workflowName": "WorkflowName",
        "input": [
            {
                "key": "key1",
                "value": [
                    "value1",
                    "value2",
                    "value3"
                ]
            }
        ]
    }
}

 

Or like below

 

{
    "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow": {
        "workflowName": "WorkflowName",
        "input": [
            {
                "key": "key1",
                "value": {
                    "valueKey1": "value1",
                    "valueKey2": "value2",
                }
            },
            {
                "key": "key2",
                "value": {
                    "valueKey1": "value1",
                    "valueKey2": "value2"
                }
            }
        ]
    }
}

or even like below

{
    "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow": {
        "workflowName": "workflowName",
        "input": [
            {
                "key": "key1",
                "value": "value1"
            },
            {
                "key": "key2",
                "value": [
                    "value21",
                    "value22"
                ]
            }
        ]
    }
}

There can N number of Permutations and Combinations, which can't be achieved with "String" (can be but the request becomes more unreadable, unnatural, and harder to parse).

And if we try to read the request in the workflow we get the below error

Cannot cast java.lang.String to java.util.List

or

Cannot cast java.lang.String to java.util.Map

etc.

 

To resolve the above class cast exception, we can utilize "sailpoint.integration.JsonUtil" class.

 

let's say, the request looks like below

{
    "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow": {
        "workflowName": "WorkflowName",
        "input": [
            {
                "key": "groups",
                "value": [
                    "Group1",
                    "Group2",
                    "Group3"
                ]
            }
        ]
    }
}

in the workflow, we can write below code

import java.util.Map;
import java.util.List;
import sailpoint.integration.JsonUtil;
Map wfMap = wfcontext.getArguments().getMap();
List groupList = JsonUtil.parse(wfMap.get("groups"));
log.debug(groupList);
log.debug(groupList.getClass());

Below is the output

[Group1, Group2, Group3]
class java.util.ArrayList 

 

Version history
Revision #:
2 of 2
Last update:
‎Jul 26, 2023 05:26 PM
Updated by: