Need to compare date today's plus one padding in transform

I’m trying below transforms with given conditions… but somehow missing something… Can someone please help me with it to correct this transform

  1. when the authoritative source status field is disabled set the LCS is disabled.
  2. When the authoritative source status field is suspended set the LCS is suspended.
  3. when the term date is set to today’s plus one padding and set LCS termination.
  4. when the worker type is contractor status is inactive, set the LCS is active.

The transform that I build is

{
	"attributes": {
		"EMPL_STATUS": {
			"attributes": {
				"attributeName": "STATUS",
				"sourceName": "Oracle ERP"
			},
			"type": "accountAttribute"
		},
		"WORKER_TYPE": {
			"attributes": {
				"attributeName": "WORKER_TYPE",
				"sourceName": "Oracle ERP"
			},
			"type": "accountAttribute"
		},
		"DATE": {
			"attributes": {
				"firstDate": {
					"attributes": {
						"sourceName": "Oracle ERP",
						"attributeName": "TERMDT"
					},
					"inputFormat": "ddMMyyyy",
					"outputFormat": "ISO8601",
					"type": "accountAttribute"
				},
				"secondDate": "now",
				"expression": "+1d",
				"roundUp": true,
				"operator": "gt",
				"positiveCondition": "active",
				"negativeCondition": "terminated"
			},
			"type": "dateCompare"
		},
		"value": "#if($EMPL_STATUS == 'ACTIVE')active#elseif($EMPL_STATUS == 'SUSPENDED')suspended#elseif($EMPL_STATUS == 'INACTIVE' || $WORKER_TYPE =='Pending Worker')active#end"
	},
	"type": "static",
	"Name": "Test Calculate EmployeeLifeCycleState"
}

Hi @swapnil.kotwal ,

Can you help us pinpoint what piece of this transform is failing? Is the entire transform not working, or just a section of it. What is the desired outcome, and what is the actual outcome?

I’m little stuck with this date attribute comparison

  1. when the term date is set to today’s plus one padding and set LCS termination.

I’m going to take a stab at this without testing it on my end. Looking at your date-compare, I don’t think it is valid to include expression and roundUp within the attributes block. The documentation for the date-compare transform makes no mention of those two fields being allowed directly in the date-compare body. However, you can use the date-math transform to wrap that logic up and include it in the date-compare body. Given this information, can you try something like this?

"DATE": {
    "attributes": {
        "firstDate": {
            "attributes": {
                "sourceName": "Oracle ERP",
                "attributeName": "TERMDT"
            },
            "inputFormat": "ddMMyyyy",
            "outputFormat": "ISO8601",
            "type": "accountAttribute"
        },
        "secondDate": {
            "type": "dateMath",
            "attributes": {
                "expression": "now+1d",
                "roundUp": true
            }
        },
        "operator": "gt",
        "positiveCondition": "active",
        "negativeCondition": "terminated"
    },
    "type": "dateCompare"
},