Hey Guys,
i tried making a trasnform for the below requirements :
but havent got success after trying hard can some one please give me a trasnform on the condition that i gave you :
{
"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"
},
{
"attributes": {
"value": "9999-12-31T00:00:00Z"
},
"type": "static"
}
]
},
"type": "firstValid"
},
"terminationWithin35Days": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now-35d/d"
},
"type": "dateMath"
},
"secondDate": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "TERMINATION_DATE",
"sourceName": "DUMMY-WORKDAY"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
{
"attributes": {
"value": "9999-12-31T00:00:00Z"
},
"type": "static"
}
]
}
},
"operator": "LT",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"terminationBeyond35Days": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now-35d/d"
},
"type": "dateMath"
},
"secondDate": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "TERMINATION_DATE",
"sourceName": "DUMMY-WORKDAY"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
{
"attributes": {
"value": "9999-12-31T00:00:00Z"
},
"type": "static"
}
]
}
},
"operator": "GTE",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"value": "#if(($activeStatus == '1') && ($activestate == 'yes') && ($onleave == '0'))Active\n#elseif(($activeStatus == '0') && ($prehire == 'yes') && ($onleave != '1'))PreHire Disable\n#elseif($onleave == '1')LOA Disabled\n#elseif($terminationWithin35Days == 'yes')Terminated - Disabled\n#elseif($terminationBeyond35Days == 'yes')Terminated - Delete\n#{else}Keep current state#end"
},
"internal": false
}