Hi team,
i have a requirement as below.
1.if user startdate is within next 5 days from today (end date can be null or not) - prehire
2.if user startdate is more than 5 days from today (end date can be null or not) – futureprehire
3.user enddate+1 till enddate+7 , user should be in inactive
4.post 7 days from inactive state (enddate), user should be into termination state.
i have a transform, which is failing wither inactive or termination cases. any help is much appreciated. i am copying my transformation here.please help.
{
"name": "LCS",
"type": "static",
"attributes": {
"requiresPeriodicRefresh": "true",
"activestate": {
"attributes": {
"firstDate": "now",
"secondDate": {
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "employeeStartDate",
"sourceName": ""
}
},
"inputFormat": "dd/MM/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"operator": "GTE",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"prehire": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now+5d/d",
"roundUp": false
},
"type": "dateMath"
},
"secondDate": {
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "employeeStartDate",
"sourceName": ""
}
},
"inputFormat": "dd/MM/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"operator": "GTE",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"futureprehire": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now+5d/d",
"roundUp": false
},
"type": "dateMath"
},
"secondDate": {
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "employeeStartDate",
"sourceName": ""
}
},
"inputFormat": "dd/MM/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"operator": "LT",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"inactivestate": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now",
"roundUp": false
},
"type": "dateMath"
},
"secondDate": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"expression": "+7d/d",
"input": {
"type": "accountAttribute",
"attributes": {
"sourceName": "",
"attributeName": "employeeEndDate"
}
},
"inputFormat": "dd/MM/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
{
"attributes": {
"expression": "now+999d/d",
"roundUp": false
},
"type": "dateMath"
}
],
"ignoreErrors": "true"
}
},
"operator": "LT",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"terminated": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now",
"roundUp": false
},
"type": "dateMath"
},
"secondDate": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"expression": "+7d/d",
"input": {
"type": "accountAttribute",
"attributes": {
"sourceName": "",
"attributeName": "employeeEndDate"
}
},
"inputFormat": "dd/MM/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
{
"attributes": {
"expression": "now+999d/d",
"roundUp": false
},
"type": "dateMath"
}
]
}
},
"operator": "GT",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"value": "#if(($inactivestate=='yes')&&($terminated=='no'))inactive#elseif($terminated=='yes')terminated#elseif(($activestate=='yes') && ($inactivestate=='no'))active#elseif(($prehire=='yes')&&($activestate=='no'))prehire#elseif(($prehire=='no')&&($activestate=='no'))futureprehire#{else}UNKNOWN#end"
},
"internal": false
}
Thanks
Stella