Facing issue while creating Lifecycle state transform for a condition

ERROR :

TRANFORM :

{
“name”: “WD_LCS_LifecycleState_Transform”,
“type”: “static”,
“attributes”: {
“isPreHireDisable”: {
“type”: “condition”,
“attributes”: {
“operator”: “eq”,
“operands”: [
{
“type”: “accountAttribute”,
“attributes”: {
“sourceName”: “WD_LCS”,
“attributeName”: “ACTIVE_STATUS”
}
},
“0”
]
}
},
“isHireDateWithin21Days”: {
“type”: “dateCompare”,
“attributes”: {
“firstDate”: {
“type”: “dateFormat”,
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“sourceName”: “WD_LCS”,
“attributeName”: “HIREDATE”
}
},
“inputFormat”: “MM/dd/yyyy”,
“outputFormat”: “ISO8601”
}
},
“secondDate”: {
“type”: “dateMath”,
“attributes”: {
“expression”: “now+21d”
}
},
“operator”: “lte”
}
},
“isOnLeaveOrLTDSep”: {
“type”: “condition”,
“attributes”: {
“operator”: “or”,
“operands”: [
{
“type”: “accountAttribute”,
“attributes”: {
“sourceName”: “WD_LCS”,
“attributeName”: “ON_LEAVE”
}
},
{
“type”: “accountAttribute”,
“attributes”: {
“sourceName”: “WD_LCS”,
“attributeName”: “SEPLTD”
}
}
]
}
},
“isHireDatePastOrToday”: {
“type”: “dateCompare”,
“attributes”: {
“firstDate”: {
“type”: “dateFormat”,
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“sourceName”: “WD_LCS”,
“attributeName”: “HIREDATE”
}
},
“inputFormat”: “MM/dd/yyyy”,
“outputFormat”: “ISO8601”
}
},
“secondDate”: {
“type”: “dateMath”,
“attributes”: {
“expression”: “now”
}
},
“operator”: “lte”
}
},
“isTerminationDateLessThan35Days”: {
“type”: “dateCompare”,
“attributes”: {
“firstDate”: {
“type”: “dateFormat”,
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“sourceName”: “WD_LCS”,
“attributeName”: “TERMINATION_DATE”
}
},
“inputFormat”: “MM/dd/yyyy”,
“outputFormat”: “ISO8601”
}
},
“secondDate”: {
“type”: “dateMath”,
“attributes”: {
“expression”: “now-35d”
}
},
“operator”: “gte”
}
},
“isTerminationDateGreaterThan35Days”: {
“type”: “dateCompare”,
“attributes”: {
“firstDate”: {
“type”: “dateFormat”,
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“sourceName”: “WD_LCS”,
“attributeName”: “TERMINATION_DATE”
}
},
“inputFormat”: “MM/dd/yyyy”,
“outputFormat”: “ISO8601”
}
},
“secondDate”: {
“type”: “dateMath”,
“attributes”: {
“expression”: “now-35d”
}
},
“operator”: “lt”
}
},
“value”: “#if($isPreHireDisable && $isHireDateWithin21Days)PreHire Disable#elseif($isHireDatePastOrToday && !$isOnLeaveOrLTDSep)Active#elseif($isOnLeaveOrLTDSep)LOA Disabled#elseif($isTerminationDateLessThan35Days)Terminated - Disabled#elseif($isTerminationDateGreaterThan35Days)Terminated - Delete#{else}Keep current state#end”
},
“internal”: false
}

Hi @Rakesh_Singh_1234
There is no transform called condition. We have a transform type called “conditional” ,
Please take a look here: Conditional | SailPoint Developer Community

hey gourab when i corrected it to conditional as type now this error is coming .

There was an exception while calculating the value for this attribute. Error during transformation for attribute: cloudLifecycleState (Transform ID: _LifecycleState_Transform) Cause: Attribute ‘positiveCondition’ must be configured with a value

ON FURTHER FIXING (PUTTING NEGATIVE AND POSITIVE CONDITION ) IT GAVE ME AN ERROR

There was an exception while calculating the value for this attribute. Error during transformation for attribute: cloudLifecycleState (Transform ID: _LifecycleState_Transform) Cause: null

Hi @Rakesh_Singh_1234 ,
It might be helpful to take a look at the Transform documentation, as it seems the structure could use a bit of adjustment: Transforms | SailPoint Developer Community. Additionally, you might find the lifecycle state transform guide useful for LCS: Lifecycle State Transform | SailPoint Developer Community.

Hi Rakesh,
If you want help with a transform, post it in its entirety, but please encapsulate it with ``` on the first and last lines

hey Phil thansk for rplying the transfom is giving all 3 LCS like prehire disable active LOA disable but when i tried a use case for terminated disabled it is still giving me active status i dont know i mentioned terminated date as well for the user then also can u pls chk :

{
“id”: “39cac6cc-9ab9-480e-8011-aefc9f4a47e1”,
“name”: “DUMMY-WORKDAY_LifecycleState_Transform”,
“type”: “static”,
“attributes”: {
“requiresPeriodicRefresh”: “true”,
“activeStatus”: {
“attributes”: {
“values”: [
{
“attributes”: {
“attributeName”: “ACTIVE_STATUS”,
“sourceName”: “DUMMY-WORKDAY”
},
“type”: “accountAttribute”
},
{
“attributes”: {
“value”: “0”
},
“type”: “static”
}
]
},
“type”: “firstValid”
},
“prehire”: {
“attributes”: {
“firstDate”: {
“attributes”: {
“expression”: “now+21d/d”,
“roundUp”: false
},
“type”: “dateMath”
},
“secondDate”: {
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“attributeName”: “HIREDATE”,
“sourceName”: “DUMMY-WORKDAY”
}
},
“inputFormat”: “MM/dd/yyyy”,
“outputFormat”: “ISO8601”
},
“type”: “dateFormat”
},
“operator”: “GTE”,
“positiveCondition”: “yes”,
“negativeCondition”: “no”
},
“type”: “dateCompare”
},
“activestate”: {
“attributes”: {
“firstDate”: {
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“attributeName”: “HIREDATE”,
“sourceName”: “DUMMY-WORKDAY”
}
},
“inputFormat”: “MM/dd/yyyy”,
“outputFormat”: “ISO8601”
},
“type”: “dateFormat”
},
“secondDate”: “now”,
“operator”: “LTE”,
“positiveCondition”: “yes”,
“negativeCondition”: “no”
},
“type”: “dateCompare”
},
“onleave”: {
“attributes”: {
“values”: [
{
“attributes”: {
“attributeName”: “ON_LEAVE”,
“sourceName”: “DUMMY-WORKDAY”
},
“type”: “accountAttribute”
},
{
“attributes”: {
“value”: “0”
},
“type”: “static”
}
]
},
“type”: “firstValid”
},
“terminationState”: {
“attributes”: {
“values”: [
{
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“attributeName”: “TERMINATION_DATE”,
“sourceName”: “DUMMY-WORKDAY”
}
},
“inputFormat”: “MM/dd/yyyy”,
“outputFormat”: “ISO8601”
},
“type”: “dateFormat”
},
“now”
]
},
“type”: “firstValid”
},
“terminationWithin35Days”: {
“attributes”: {
“firstDate”: “now”,
“secondDate”: {
“type”: “firstValid”,
“attributes”: {
“values”: [
{
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“attributeName”: “TERMINATION_DATE”,
“sourceName”: “DUMMY-WORKDAY”
}
},
“inputFormat”: “MM/dd/yyyy”,
“outputFormat”: “ISO8601”
},
“type”: “dateFormat”
},
“now”
]
}
},
“operator”: “LTE”,
“positiveCondition”: “yes”,
“negativeCondition”: “no”
},
“type”: “dateCompare”
},
“terminationBeyond35Days”: {
“attributes”: {
“firstDate”: “now”,
“secondDate”: {
“type”: “firstValid”,
“attributes”: {
“values”: [
{
“attributes”: {
“input”: {
“type”: “accountAttribute”,
“attributes”: {
“attributeName”: “TERMINATION_DATE”,
“sourceName”: “DUMMY-WORKDAY”
}
},
“inputFormat”: “MM/dd/yyyy”,
“outputFormat”: “ISO8601”
},
“type”: “dateFormat”
},
“now”
]
}
},
“operator”: “GT”,
“positiveCondition”: “yes”,
“negativeCondition”: “no”
},
“type”: “dateCompare”
},
“value”: “#if(($activeStatus == ‘1’) && ($activestate == ‘yes’) && ($onleave == ‘0’))Active#elseif($activeStatus == ‘0’ && $prehire == ‘yes’ && $onleave != ‘1’)PreHire Disable#elseif($onleave == ‘1’)LOA Disabled#elseif($terminationWithin35Days == ‘yes’)Terminated - Disabled#elseif($terminationBeyond35Days == ‘yes’)Terminated - Delete#{else}Keep current state#end”
},
“internal”: false
}

i am using below test cases ;

the above 3 are working grt prehire disabel, active ,loa disabel but when i tried term-disable and term-delete in both scnenarios i am getting active as life cycle state output in preview

@phil_awlings Hey Phil can you please have a look here

You haven’t used any dateMath transforms to check if they are +/- 35 days.

All dateMath transforms also need to be followed with a dateFormat to put them into ISO8601 to allow dateCompare to work

It is a very large transform I suggest breaking it down to the individual outputs and check each one works separately before building the whole thing.

I would create a test identity.attribute and apply your above transform but remove all except the term-disabled AND re-write your value= to just check the output. Then repeat for term-delete

AND please encapsulate your code with ``` on the first and last lines so it is legible in VSC

See above. Make your code legible for others to help you

i am not sure i tried to do it @phil_awlings can u please post this in that format here i tried not happening

{
    "id": "39cac6cc-9ab9-480e-8011-aefc9f4a47e1",
    "name": "DUMMY-WORKDAY_LifecycleState_Transform",
    "type": "static",
    "attributes": {
        "requiresPeriodicRefresh": "true",
        "activeStatus": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "attributeName": "ACTIVE_STATUS",
                            "sourceName": "DUMMY-WORKDAY"
                        },
                        "type": "accountAttribute"
                    },
                    {
                        "attributes": {
                            "value": "0"
                        },
                        "type": "static"
                    }
                ]
            },
            "type": "firstValid"
        },
        "prehire": {
            "attributes": {
                "firstDate": {
                    "attributes": {
                        "expression": "now+21d/d",
                        "roundUp": false
                    },
                    "type": "dateMath"
                },
                "secondDate": {
                    "attributes": {
                        "input": {
                            "type": "accountAttribute",
                            "attributes": {
                                "attributeName": "HIREDATE",
                                "sourceName": "DUMMY-WORKDAY"
                            }
                        },
                        "inputFormat": "MM/dd/yyyy",
                        "outputFormat": "ISO8601"
                    },
                    "type": "dateFormat"
                },
                "operator": "GTE",
                "positiveCondition": "yes",
                "negativeCondition": "no"
            },
            "type": "dateCompare"
        },
        "activestate": {
            "attributes": {
                "firstDate": {
                    "attributes": {
                        "input": {
                            "type": "accountAttribute",
                            "attributes": {
                                "attributeName": "HIREDATE",
                                "sourceName": "DUMMY-WORKDAY"
                            }
                        },
                        "inputFormat": "MM/dd/yyyy",
                        "outputFormat": "ISO8601"
                    },
                    "type": "dateFormat"
                },
                "secondDate": "now",
                "operator": "LTE",
                "positiveCondition": "yes",
                "negativeCondition": "no"
            },
            "type": "dateCompare"
        },
        "onleave": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "attributeName": "ON_LEAVE",
                            "sourceName": "DUMMY-WORKDAY"
                        },
                        "type": "accountAttribute"
                    },
                    {
                        "attributes": {
                            "value": "0"
                        },
                        "type": "static"
                    }
                ]
            },
            "type": "firstValid"
        },
        "terminationState": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "input": {
                                "type": "accountAttribute",
                                "attributes": {
                                    "attributeName": "TERMINATION_DATE",
                                    "sourceName": "DUMMY-WORKDAY"
                                }
                            },
                            "inputFormat": "MM/dd/yyyy",
                            "outputFormat": "ISO8601"
                        },
                        "type": "dateFormat"
                    },
                    "now"
                ]
            },
            "type": "firstValid"
        },
        "terminationWithin35Days": {
            "attributes": {
                "firstDate": "now",
                "secondDate": {
                    "type": "firstValid",
                    "attributes": {
                        "values": [
                            {
                                "attributes": {
                                    "input": {
                                        "type": "accountAttribute",
                                        "attributes": {
                                            "attributeName": "TERMINATION_DATE",
                                            "sourceName": "DUMMY-WORKDAY"
                                        }
                                    },
                                    "inputFormat": "MM/dd/yyyy",
                                    "outputFormat": "ISO8601"
                                },
                                "type": "dateFormat"
                            },
                            "now"
                        ]
                    }
                },
                "operator": "LTE",
                "positiveCondition": "yes",
                "negativeCondition": "no"
            },
            "type": "dateCompare"
        },
        "terminationBeyond35Days": {
            "attributes": {
                "firstDate": "now",
                "secondDate": {
                    "type": "firstValid",
                    "attributes": {
                        "values": [
                            {
                                "attributes": {
                                    "input": {
                                        "type": "accountAttribute",
                                        "attributes": {
                                            "attributeName": "TERMINATION_DATE",
                                            "sourceName": "DUMMY-WORKDAY"
                                        }
                                    },
                                    "inputFormat": "MM/dd/yyyy",
                                    "outputFormat": "ISO8601"
                                },
                                "type": "dateFormat"
                            },
                            "now"
                        ]
                    }
                },
                "operator": "GT",
                "positiveCondition": "yes",
                "negativeCondition": "no"
            },
            "type": "dateCompare"
        },
        "value": "#if(($activeStatus == '1') && ($activestate == 'yes') && ($onleave == '0'))Active#elseif($activeStatus == '0' && $prehire == 'yes' && $onleave != '1')PreHire Disable#elseif($onleave == '1')LOA Disabled#elseif($terminationWithin35Days == 'yes')Terminated - Disabled#elseif($terminationBeyond35Days == 'yes')Terminated - Delete#{else}Keep current state#end"
    },
    "internal": false
}

hey @phil_awlings can u please look into it and kindly fix it what i am doing wrong ? and give me corrected transfrom that will run all life cycle state thanks

@phil_awlings can u pls give me updated transform that satisfy all life cycle pls

@phil_awlings i am able to only achieve first 3 life cycle sate by the transform i gave you in chat not the last two

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