I have a transform for calculating the cloudLifecycleState, that ultimately relies on a velocity script for the value returned. All states are returned normally except “inactive” when rescinded = true. In these cases, the transform errors out with:
There was an exception while calculating the value for this attribute. Error during transformation for attribute: cloudLifecycleState (Transform ID: Calculate LCS ) Cause: Error rendering template: [the velocity script]
I’m quite sure I’m missing something really dumb, but I confirmed that the IS_RESCINDED attribute is from right source, spelled correctly, does in fact give ‘true’ as a string in the account schema (not a boolean), etc. I also initially had the evaluation for “inactive” all in one statement to be cleaner, but that wasn’t working so I separated them out in the below:
{
"id": "[redacted]",
"name": "Calculate LCS ",
"type": "static",
"attributes": {
"isItInactive": {
"attributes": {
"firstDate": {
"attributes": {
"input": {
"attributes": {
"values": [
{
"type": "accountAttribute",
"attributes": {
"sourceName": "Workday",
"attributeName": "TERMINATION_DATE"
}
},
"12/31/2999"
]
},
"type": "firstValid"
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"secondDate": "now",
"operator": "lte",
"positiveCondition": "inactive",
"negativeCondition": "notTerminated"
},
"type": "dateCompare"
},
"isItActive": {
"attributes": {
"firstDate": {
"type": "dateMath",
"attributes": {
"expression": "-7d",
"roundUp": true,
"input": {
"attributes": {
"input": {
"attributes": {
"values": [
{
"attributes": {
"attributeName": "HIREDATE",
"sourceName": "Workday"
},
"type": "accountAttribute"
},
"12/31/2999"
]
},
"type": "firstValid"
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
}
}
},
"secondDate": "now",
"operator": "lte",
"positiveCondition": "active",
"negativeCondition": "notActive"
},
"type": "dateCompare"
},
"isItDelete": {
"attributes": {
"firstDate": {
"attributes": {
"input": {
"attributes": {
"values": [
{
"type": "reference",
"attributes": {
"id": "Woodward - Extension 8 Validation"
}
},
{
"type": "dateFormat",
"attributes": {
"inputFormat": "ISO8601",
"outputFormat": "MM/dd/yyyy",
"input": {
"type": "dateMath",
"attributes": {
"expression": "+30d/d",
"roundUp": true,
"input": {
"type": "dateFormat",
"attributes": {
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601",
"input": {
"attributes": {
"attributeName": "TERMINATION_DATE",
"sourceName": "Workday"
},
"type": "accountAttribute"
}
}
}
}
}
}
},
"12/31/2999"
]
},
"type": "firstValid"
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"secondDate": "now",
"operator": "lte",
"positiveCondition": "isItDelete",
"negativeCondition": "NO"
},
"type": "dateCompare"
},
"LOA": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"sourceName": "Workday",
"attributeName": "ON_LEAVE"
},
"type": "accountAttribute"
},
{
"type": "static",
"attributes": {
"value": "NA"
}
}
]
}
},
"RESCINDED": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"sourceName": "Workday",
"attributeName": "IS_RESCINDED"
},
"type": "accountAttribute"
},
{
"type": "static",
"attributes": {
"value": "NA"
}
}
]
}
},
"LCS": {
"type": "identityAttribute",
"attributes": {
"name": "cloudLifecycleState"
}
},
"STATUS": {
"type": "accountAttribute",
"attributes": {
"sourceName": "Workday",
"attributeName": "ACTIVE"
}
},
"requiresPeriodicRefresh": true,
"value": "#if($LOA=='1')loa#elseif($LCS=='adminleave')adminleave#elseif(($isItActive=='active') && ($STATUS=='1'))active#elseif(($isItInactive=='inactive') && ($STATUS=='0') && ($isItDelete=='NO'))inactive#elseif(($RESCINDED=='true') && ($STATUS=='0') && ($isItDelete=='NO'))inactive#elseif(($isItInactive=='inactive') && ($isItDelete=='isItDelete') && ($STATUS=='0'))delete#end"
},
"internal": false
}
Any thoughts on how to get rescinded users reporting as inactive as expected? Thank you!!
