Hello, Hari Kumar.
Hope you are doing great.
To complement the other answers given previously, follow below a transform example that we have used recently and may help you to build your own.
The status in this case of the example would be like this:
• preLeaver → still active, but with status 0 and no inactivation data coming up.
• preInactive → status 0, already within the pre-inactivation window (after 06:00pm, customer time).
• inactive → status 0 and has already passed the inactivation data stage (after 15 days).
{
"type": "static",
"attributes": {
"status": {
"type": "accountAttribute",
"attributes": {
"sourceName": "AuthoritativeSource",
"attributeName": "COD_ESTADO_OCUPACION"
}
},
"fechaInativa": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateMath",
"attributes": {
"expression": "+15d",
"roundUp": false,
"input": {
"attributes": {
"input": {
"attributes": {
"sourceName": "AuthoritativeSource",
"attributeName": "FEC_RETIRO"
},
"type": "accountAttribute"
},
"inputFormat": "yyyyMMdd",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
}
}
},
"secondDate": {
"type": "dateMath",
"attributes": {
"expression": "now",
"roundUp": false
}
},
"operator": "lt",
"positiveCondition": "yes",
"negativeCondition": "no"
}
},
"none"
]
}
},
"fechaPreinativa": {
"type": "firstValid",
"attributes": {
"values": [
{
"type": "dateCompare",
"attributes": {
"firstDate": {
"type": "dateMath",
"attributes": {
"expression": "+18h",
"roundUp": false,
"input": {
"attributes": {
"input": {
"attributes": {
"sourceName": "AuthoritativeSource",
"attributeName": "FEC_RETIRO"
},
"type": "accountAttribute"
},
"inputFormat": "yyyyMMdd",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
}
}
},
"secondDate": {
"type": "dateMath",
"attributes": {
"expression": "now-5h",
"roundUp": false
}
},
"operator": "lt",
"positiveCondition": "yes",
"negativeCondition": "no"
}
},
"none"
]
}
},
"listaBlanca": {
"type": "reference",
"attributes": {
"id": "BCP-GetExceptionStatus"
}
},
"value": "#if($status == '0' && $fechaInativa == 'no' && $fechaPreinativa == 'no' && $listaBlanca == 'false')preLeaver#elseif($status == '0' && $fechaInativa == 'no' && $fechaPreinativa == 'yes' && $listaBlanca == 'false')preInactive#elseif($status == '0' && $fechaInativa == 'yes' && $listaBlanca == 'false')inactive#end"
}
},
Hope it helps.