We have onboarded a new source for contractors called LDAP. We need to set up lifecycle states based on three attributes start date, exit date, and Isexpired date. The condition is that when the exit date is valid and greater than the expiration date, then the lifecycle state should be set to “Is expired.” We have already developed two states: isPreHire and isTerminated. Can you please help me with setting up the Is Expired state?
"name": "Calculate Lifecycle State - Sandbox",
"type": "static",
"attributes": {
"requiresPeriodicRefresh": "true",
"isPreHire": {
"attributes": {
"negativeCondition": "no",
"positiveCondition": "yes",
"firstDate": "now",
"operator": "lt",
"secondDate": {
"attributes": {
"inputFormat": "yyyy-MM-dd",
"outputFormat": "ISO8601",
"input": {
"attributes": {
"attributeName": "startDate",
"sourceName": "LDAP 2"
},
"type": "accountAttribute"
}
},
"type": "dateFormat"
}
},
"type": "dateCompare"
},
"isTerminated": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "dateCompare",
"attributes": {
"negativeCondition": "no",
"positiveCondition": "yes",
"firstDate": "now",
"operator": "gt",
"secondDate": {
"attributes": {
"inputFormat": "yyyy-MM-dd",
"outputFormat": "ISO8601",
"input": {
"attributes": {
"attributeName": "exitDate",
"sourceName": "LDAP 2"
},
"type": "accountAttribute"
}
},
"type": "dateFormat"
}
}
},
{
"type": "static",
"attributes": {
"value": "{null}"
}
}
]
}
},
"value": "#if($isPreHire=='yes')preActive#elseif($isTerminated != '{null}' && $isTerminated=='yes')inactive#elseif($isPreHire=='no')active{else}unknown#end"
},
"internal": false