Nested Date comparison transform

I’ve been attempting to work through a transform to develop a staged roll off for termination lifecycle events. The goal is to have accounts go into an inactive state for the first thirty days post termination before being set to terminated status.

I’ve been working with the following transform based on others that I have seen in discussions but keep running up against some variation of {attributes=com.sailpoint.seaspray.transform.DateCompare@66d362e4} for each of the dateCompare statements.

I’ve tried to format and unformat all the time segments with either a complete failure to evaluate error or just some variation of the one above.

Any insights would be very welcome!

{

"id": "xxxxxxxxxxxxxxxxxxxx",

"name": "test lifecycle 3",

"type": "static",

"attributes": {

    "terminated": {

        "attributes": {

            "firstDate": {

                "attributes": {

                    "input": {

                        "attributes": {

                            "sourceName": "SuccessFactors",

                            "attributeName": "Termination Date"

                        },

                        "type": "accountAttribute"

                    },

                    "inputFormat": "yyyy-MM-dd'T'HH:mm",

                    "outputFormat": "ISO8601"

                },

                "type": "dateFormat"

            },

            "secondDate": {

                "type": "dateFormat",

                "attributes": {

                    "input": {

                        "type": "dateMath",

                        "attributes": {

                            "expression": "now"

                        }

                    },

                    "inputFormat": "yyyy-MM-dd'T'HH:mm",

                    "outputFormat": "ISO8601"

                }

            },

            "operator": "gt",

            "positiveCondition": "active",

            "negativeCondition": "terminated",

            "type": "dateCompare"

        }

    },

    "inactive": {

        "attributes": {

            "firstDate": {

                "attributes": {

                    "input": {

                        "attributes": {

                            "sourceName": "SuccessFactors",

                            "attributeName": "Termination Date"

                        },

                        "type": "accountAttribute"

                    },

                    "inputFormat": "yyyy-MM-dd'T'HH:mm",

                    "outputFormat": "ISO8601"

                },

                "type": "dateFormat"

            },

            "secondDate": {

                "type": "dateFormat",

                "attributes": {

                    "input": {

                        "type": "dateMath",

                        "attributes": {

                            "expression": "now-30d"

                        }

                    },

                    "inputFormat": "yyyy-MM-dd'T'HH:mm",

                    "outputFormat": "ISO8601"

                }

            },

            "operator": "gt",

            "positiveCondition": "yes",

            "negativeCondition": "no",

            "type": "dateCompare"

        }

    },

    "value": "#if($terminated=='active')active#elseif($terminated=='terminated'&&$inactive=='yes')inactive#{else}ERROR#end"

},

"internal": false

}

Hi @nathanieljjohnson ,

You can try the below transform

{
    "id": "xxxxxxxxxxxxxxxxxxxx",
    "name": "test lifecycle 3",
    "type": "static",
    "attributes": {
        "termCheck": {
            "attributes": {
                "negativeCondition": "FALSE",
                "positiveCondition": "TRUE",
                "firstDate": "now",
                "operator": "gt",
                "secondDate": {
                    "attributes": {
                        "input": {
                            "attributes": {
                                "values": [
                                    {
                                        "attributes": {
                                            "attributeName": "Termination Date",
                                            "sourceName": "SuccessFactors"
                                        },
                                        "type": "accountAttribute"
                                    },
                                    "12/31/9999"
                                ],
                                "ignoreErrors": "true"
                            },
                            "type": "firstValid"
                        },
                        "inputFormat": "yyyy-MM-dd'T'HH:mm",
                        "outputFormat": "ISO8601"
                    },
                    "type": "dateFormat"
                }
            },
            "type": "dateCompare"
        },
        "thirtyDaysTerm": {
            "attributes": {
                "negativeCondition": "FALSE",
                "positiveCondition": "TRUE",
                "firstDate": {
                    "attributes": {
                        "input": {
                            "attributes": {
                                "values": [
                                    {
                                        "attributes": {
                                            "attributeName": "Termination Date",
                                            "sourceName": "SuccessFactors"
                                        },
                                        "type": "accountAttribute"
                                    },
                                    "12/31/9999"
                                ],
                                "ignoreErrors": "true"
                            },
                            "type": "firstValid"
                        },
                        "inputFormat": "yyyy-MM-dd'T'HH:mm",
                        "outputFormat": "ISO8601"
                    },
                    "type": "dateFormat"
                },
                "secondDate": {
                    "attributes": {
                        "input": {
                            "attributes": {
                                "expression": "now-30d/d"
                            },
                            "type": "dateMath"
                        },
                        "inputFormat": "yyyy-MM-dd'T'HH:mm",
                        "outputFormat": "ISO8601"
                    },
                    "type": "dateFormat"
                },
                "operator": "lte"
            },
            "type": "dateCompare"
        },
        "value": "#if($termCheck == 'TRUE' && $thirtyDaysTerm == 'TRUE')terminated#{elseif}($termCheck == 'TRUE')inactive#{else}error#end"
    },
    "internal": false
}

This transform checks first both the terminated status and 30 days from termination date and set the value to terminated and proceed with other conditions.

Hope this helps you.

Had to change out the input format as ours does not have time elements just date, but after that this worked perfectly! Thank you

1 Like

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