Custom date class

Infor offers date class customization for installations requiring additional custom logic to determine which date to use (instead of the default date) for a public holiday. For example, if you want alternate arrangements for statutory holidays, such as Passover instead of Christmas, this is one way to implement those arrangements.

Custom date classes can implement the com.workbrain.app.ta.holiday.HolidayRollDate interface.

You can develop a fairly complex custom date class because you are given parameters to specify employee, holiday, holiday roll, and database handle values. You will need to write the class, add the class to the HOLIDAY_ROLL table, list the class in the HROLL_DATE_CLASS field as com.mycustomer.app.ta.holiday.MyClassName, and ensure that the class is compiled into the customer.jar file.

Interface definition

package com.workbrain.app.ta.holiday ;

import com.workbrain.app.ta.ruleengine.*;
import com.workbrain.app.ta.model.*;
import com.workbrain.sql.*;
import java.sql.*;package com.workbrain.app.ta.holiday ;

import com.workbrain.app.ta.ruleengine.*;
import com.workbrain.app.ta.model.*;
import com.workbrain.sql.*;
import java.sql.*;

/**
 * Interface for Custom Holiday Roll dates
 */
public interface HolidayRollDate {
   
    /**
     * Returns custom roll date
     *
     * @param empData Employee data that holiday roll will be 
     * evaluated against
     * @param holidayRollData Holiday Roll data
     * @param holidayData Holiday data that holiday roll will 
     * apply to
     * @param conn DBConnection
     *
     * @return Date
     * @throws SQLException
     */
    public Date getHolidayDate(EmployeeData empData,
        HolidayRollData holidayRollData, HolidayData holidayData,
        DBConnection conn) throws SQLException;
}

Example

package com.workbrain;

import com.workbrain.util.DateHelper;
import com.workbrain.app.ta.holiday.*;
import com.workbrain.app.ta.model.*;
import com.workbrain.sql.*;
import java.sql.*;

public class Test implements HolidayRollDate {

    public boolean isAtheist(EmployeeData empData) {
        return empData.getEmpFlag1().equalsIgnoreCase("Y");
    }

    public Date getHolidayDate(EmployeeData empData,
        HolidayRollData holidayRollData,
        HolidayData holidayData,
        DBConnection conn) throws SQLException {

        //get the default date
        Date theDate = new Date(holidayData.getHolDate().getTime());
        //if this person is an atheist then their holiday is 
        //always 7 days later than those choosing to celebrate 
        //on the default date
        if isAtheist(empData) {
            theDate = DateHelper.addDays(theDate, 7);
        }
        return theDate;
    }
}