Custom Apply On Date (Custom Unit Date)

This section contains sample code for the custom apply on date (custom unit date).


import com.workbrain2.ta.publ.api.entitlements.CustomUnitDateScriptable
import com.workbrain2.ta.publ.api.rules.RCContext
import com.workbrain2.ta.publ.api.rules.TARulesPublicServiceAccess
import com.workbrain2.ta.publ.api.rules.ctx.EmployeeCtxPublService

class CustomUnitDate extends CustomUnitDateScriptable{

    EmployeeCtxPublService employeeCtxPublService = TARulesPublicServiceAccess.getEmployeeCtxService()

    public Date getUnitDate(RCContext context, String applyOnUnit, String applyOnValue, boolean previous){
        return employeeCtxPublService.getEmployeeTerminationDate
(context,employeeCtxPublService.getCurrentWorkDate(context))
    }
}