Thursday, 28 July 2011

How to Add a New Region In OA FrameWork With out extending The Controller

Step 1: Create Dff and Mapped Properly. Create required LOV
Step 2: Create Region in JDeveloper in custome folder with below mentioned Property
                   1. Region Style : Stack Layout
                   2. Create Another Header Region with text
                   3. Create Flex item
                             --View instance Name
                             --App Short Name
                             --Name(Dff name)
                             --Type(Descriptive)
                             --Segment List(Global Data Elements|Progress Met Expectations|OK To Confirm|Termination of Services)
                             --Display Context Field (False)
Step 3: Import The Region in Correct page location in server

import D:\JDeveloper\p9172975_R12_GENERIC\jdevhome\jdev\myprojects\XXtest\oracle\apps\per\selfservice\appraisals\webui\<PageName>.xml   -username <username> -password <password> -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<Host String>)(PORT=<Port No>))(CONNECT_DATA=(SID=<SID>)))" -rootdir D:\JDeveloper\p9172975_R12_GENERIC\jdevhome\jdev\myprojects

*Note D:\JDeveloper\p9172975_R12_GENERIC\jdevhome\jdev\myprojects\XXtest\oracle\apps\per\selfservice\appraisals\webui\<PageName>.xml will replaced By the local path where you have saved the region.

Step 4: Personalize the Page Create a new item-- style Stack Layout
                -- extends: The imported path in server like /xxTest/oracle/apps/per/selfservice/appraisals/webui/<region Name>

Monday, 11 July 2011

Custom Process Flow in OAF Continuation...


/*===========================================================================+
 |   XXHCMRei XXursementDetailsCO                                                                        |
 +===========================================================================+
 |  HISTORY      
 +===========================================================================*/
package xxhcm.oracle.apps.per.rei XX.webui;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OADBTransactionImpl;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;
import oracle.apps.fnd.framework.webui.beans.table.OATableBean;
import oracle.apps.xdo.oa.schema.server.TemplateHelper;
import oracle.cabo.ui.data.DataObject;
import oracle.xml.parser.v2.XMLElement;
import xxhcm.oracle.apps.per.rei XX.server.XXHCMEmpRei XXursementAMImpl;

/**
 * Controller for ...
 */
public class XXHCMRei XXursementDetailsCO extends OAControllerImpl {
    public static final String RCS_ID = "$Header$";
    public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

    private  String APP_NAME = "XX XX";
    private  String TEMPLATE_CODE = "XX_REI XX_REPORT";

    /**
     * Layout and page setup logic for a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
        super.processRequest(pageContext, webBean);
       
        /* calling Respective Template depending on Enterprise -- Added By saha Gopal */
        try{
        XXHCMEmpRei XXursementAMImpl am= (XXHCMEmpRei XXursementAMImpl)pageContext.getApplicationModule(webBean);
        String bg_id=am.findViewObject("XXHCMEnterpriseVO1").first().getAttribute(0).toString();
          if (bg_id.equalsIgnoreCase("2008") || bg_id.equalsIgnoreCase("1428")){
              APP_NAME      ="PER";
              TEMPLATE_CODE ="XX_REI XX_REPORT";
            }
        }catch(Exception e)
        {
          System.out.println("Error ");
        }
       
        String mode = pageContext.getParameter("MODE");
        if (mode == null) {
            return;
        }
              
        /*OAFormValueBean form =
            (OAFormValueBean)webBean.findIndexedChildRecursive("mode");
        form.setValue(mode);*/
        String submittedAmount = pageContext.getParameter("SUBMITTED_BILLS");
        OAMessageStyledTextBean dBean =
            (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("totalSubmitted");
        dBean.setText(submittedAmount);
        String title = new String();
        if (mode.equalsIgnoreCase("PENDING")) {
            OAMessageStyledTextBean bean =
                (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("totalExempted");
            bean.setRendered(false);
            bean =
(OAMessageStyledTextBean)webBean.findIndexedChildRecursive("totalPayable");
            bean.setRendered(false);
            title = "Expenses pending approval";
        } else {
            String text = pageContext.getParameter("EXEMPTED_AMOUNT");
            OAMessageStyledTextBean bean =
                (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("totalExempted");
            bean.setRendered(true);
            bean.setText(text);
            // int sAmount = Integer.parseInt(submittedAmount);
            // int tAmount = Integer.parseInt(text);
            // int total = sAmount - tAmount;
            // text = Integer.toString(total);
            bean =
(OAMessageStyledTextBean)webBean.findIndexedChildRecursive("totalPayable");
            bean.setRendered(true);
            bean.setText(text);
        }
        OATableBean table =
            (OATableBean)webBean.findChildRecursive("detailsTable");
        table.setText(title);
    }
    /**
     * Procedure to handle form submissions for form elements in
     * a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processFormRequest(OAPageContext pageContext,
                                   OAWebBean webBean) {
        super.processFormRequest(pageContext, webBean);
        if (pageContext.getParameter("backBtn") != null) {
            pageContext.forwardImmediately("OA.jsp?page=/xxhcm/oracle/apps/per/rei XX/webui/XXHCMEmpRei XXursementPG",
                                           null,
                                           OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                           null, null, true,
                                           OAWebBeanConstants.ADD_BREAD_CRU XX_NO);
        }
        if (pageContext.getParameter("print") != null) {
            /*OAFormValueBean form =
                (OAFormValueBean)webBean.findIndexedChildRecursive("mode");
            String mode = form.getValue();*/
            String mode = "PENDING";
            OAMessageStyledTextBean bean =
                (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("totalExempted");
            if (bean != null && bean.isRendered()) {
                mode = "APPROVED";
            }
            XXHCMEmpRei XXursementAMImpl am =
                (XXHCMEmpRei XXursementAMImpl)pageContext.getApplicationModule(webBean);
            XMLElement root = am.getReportXml(mode);
            generateReport(root, pageContext, webBean);
        }
    }
    private void generateReport(XMLElement xmlNode, OAPageContext pageContext,
                                OAWebBean webBean) {
        // Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
        // pageContext.putParameter("MODE",mode);   
        DataObject sessionDictionary =
            (DataObject)pageContext.getNamedDataObject("_SessionParameters");
        HttpServletResponse response =
            (HttpServletResponse)sessionDictionary.selectValue(null,
                                                               "HttpServletResponse");
        try {
            ServletOutputStream os = response.getOutputStream();
            // Set the Output Report File Name and Content Type
            String contentDisposition =
                "attachment;filename=Rei XXursement Report.pdf";
            response.setHeader("Content-Disposition", contentDisposition);
            response.setContentType("application/pdf");
            // Get the Data XML File as the XMLNode
            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
            xmlNode.print(outputStream);
            ByteArrayInputStream inputStream =
                new ByteArrayInputStream(outputStream.toByteArray());
            ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
            //Generate the PDF Report.
            System.out.println("APP_NAME :"+APP_NAME);
            System.out.println("TEMPLATE_CODE :"+TEMPLATE_CODE);
            System.out.println("language :"+((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage());
            TemplateHelper.processTemplate(((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
                                           APP_NAME, TEMPLATE_CODE,
                                           ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
                                           ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
                                           inputStream,
                                           TemplateHelper.OUTPUT_TYPE_PDF,
                                           null, pdfFile);
            // Write the PDF Report to the HttpServletResponse object and flush.
            byte[] b = pdfFile.toByteArray();
            response.setContentLength(b.length);
            os.write(b, 0, b.length);
            os.flush();
            os.close();
        } catch (Exception e) {
            response.setContentType("text/html");
            throw new OAException(e.getMessage(), OAException.ERROR);
        }
        pageContext.setDocumentRendered(false);
    }
}
======================================================================================================================================================

/*===========================================================================+
 |   XXHCMEmpDetailsCO:                                                                        |
 +===========================================================================+
 |  HISTORY      
 +===========================================================================*/
package xxhcm.oracle.apps.per.rei XX.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import xxhcm.oracle.apps.per.rei XX.server.XXHCMEmpRei XXursementAMImpl;
/**
 * Controller for ...
 */
public class XXHCMEmpDetailsCO extends OAControllerImpl {
    public static final String RCS_ID = "$Header$";
    public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    /**
     * Layout and page setup logic for a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
        super.processRequest(pageContext, webBean);
        /*Here initialize the EmpDetailsVO query*/
        XXHCMEmpRei XXursementAMImpl am =
            (XXHCMEmpRei XXursementAMImpl)pageContext.getApplicationModule(webBean);
        am.invokeMethod("initEmpDetailsVO");
    }
    /**
     * Procedure to handle form submissions for form elements in
     * a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processFormRequest(OAPageContext pageContext,
                                   OAWebBean webBean) {
        super.processFormRequest(pageContext, webBean);
    }
}
=================================================================================================================================================
/*===========================================================================+
 |    XXHCMEligibilityDetailsCO                                                                         |
 +===========================================================================+
 |  HISTORY      
 +===========================================================================*/
package xxhcm.oracle.apps.per.rei XX.webui;
import java.util.ArrayList;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.layout.OAMessageComponentLayoutBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;
import xxhcm.oracle.apps.per.rei XX.server.XXHCMEmpRei XXursementAMImpl;

/**
 * Controller for ...
 */
public class XXHCMEligibilityDetailsCO extends OAControllerImpl {
    public static final String RCS_ID = "$Header$";
    public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    /**
     * Layout and page setup logic for a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
        super.processRequest(pageContext, webBean);
        XXHCMEmpRei XXursementAMImpl am =
            (XXHCMEmpRei XXursementAMImpl)pageContext.getApplicationModule(webBean);
        //ArrayList eligibilities = am.initEligibilityDetailsVO();
        am.initEligibilityDetailsVO();
       // createChildren(pageContext, webBean, eligibilities);
    }
    /**
     * Procedure to handle form submissions for form elements in
     * a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processFormRequest(OAPageContext pageContext,
                                   OAWebBean webBean) {
        super.processFormRequest(pageContext, webBean);
    }
    private void createChildren(OAPageContext pageContext, OAWebBean webBean,
                                ArrayList eligibilities) {
        OAMessageComponentLayoutBean bean =
            (OAMessageComponentLayoutBean)webBean;
        for (int index = 0; index < eligibilities.size(); index += 2) {
            String id = "m" + index;
            OAMessageStyledTextBean childBean =
                (OAMessageStyledTextBean)createWebBean(pageContext,
                                                       MESSAGE_STYLED_TEXT_BEAN,
                                                       null, id);
            childBean.setStyleClass("OraDataText");
            childBean.setPrompt((String)eligibilities.get(index));
            childBean.setText((String)eligibilities.get(index + 1));
            bean.addIndexedChild(childBean);
        }       
       
        int rowCount = (int)eligibilities.size()/4;
        rowCount= rowCount+(eligibilities.size()%2);
        bean.setRows(rowCount);
       
    }
}
====================================================================================================================================================
/*===========================================================================+
 |   XXHCMDetailsTableCO                                                                        |
 +===========================================================================+
 |  HISTORY      
 +===========================================================================*/
package xxhcm.oracle.apps.per.rei XX.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import xxhcm.oracle.apps.per.rei XX.server.XXHCMEmpRei XXursementAMImpl;
/**
 * Controller for ...
 */
public class XXHCMDetailsTableCO extends OAControllerImpl
{
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
      XXHCMEmpRei XXursementAMImpl am =
          (XXHCMEmpRei XXursementAMImpl)pageContext.getApplicationModule(webBean);
      String mode = pageContext.getParameter("MODE");       
      am.initEmployeeRei XXursementVO(mode);
  }
  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
  }
}
=================================================================================================================================
XXBtnDisableVo:
SELECT XXHCM_REI XXURSMENT_PKG.XXHCM_DISABLE_BTN_FNC BTN_STATUS FROM DUAL;
XXCheckReimEligVo:SELECT xxhcm_rei XXursment_pkg.XXHCM_REIM_ELIG(:1,:2,:3) IS_REI XX_ELIGIBLE FROM DUAL
XXConatactDetailsVO:SELECT PAPF.FULL_NAME CONTACT_NAME
      ,'Self' RELATIONSHIP
  FROM PER_PEOPLE_X PAPF
      ,FND_USER FU
 WHERE PAPF.PERSON_ID=FU.EMPLOYEE_ID
    AND FU.USER_ID=:1 --FND_PROFILE.VALUE('USER_ID')
    AND PAPF.BUSINESS_GROUP_ID=FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID') 
UNION ALL
SELECT PAPF.FULL_NAME CONTACT_NAME
      ,HL.MEANING RELATIONSHIP
  FROM HR_LOOKUPS HL
      ,PER_PEOPLE_X PAPF
      ,PER_CONTACT_RELATIONSHIPS PCR
      ,FND_USER FU
 WHERE HL.LOOKUP_TYPE= 'CONTACT'
   AND HL.LOOKUP_CODE=PCR.CONTACT_TYPE     
    AND FU.USER_ID= :1 --FND_PROFILE.VALUE('USER_ID')
   AND FU.EMPLOYEE_ID = PCR.PERSON_ID
  AND PAPF.BUSINESS_GROUP_ID=FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID')
   AND PAPF.PERSON_ID=PCR.CONTACT_PERSON_ID
 
 XXCreateRimVO: SELECT PEI_INFORMATION1 REI XXURSEMENT_TYPE
      ,PEI_INFORMATION2 BENEFICIARY_NAME
      ,PEI_INFORMATION3 BILL_NU XXER    
,TO_Date(Fnd_conc_date.string_to_date(PEI_INFORMATION4),'DD-Mon-YYYY') BILL_DATE
      ,PEI_INFORMATION5 BILL_AMOUNT      
      ,PEI_INFORMATION7 EMPLOYEE_COMMENTS
      ,PEI_INFORMATION8 EMPLOYER_COMMENTS
      ,PERSON_EXTRA_INFO_ID PERSON_EXTRA_INFO_ID
      ,OBJECT_VERSION_NU XXER OVN
      ,PEI_INFORMATION6 BILL_STATUS
FROM PER_PEOPLE_EXTRA_INFO PEI   
WHERE PEI.PERSON_ID=:1
  AND DECODE(PEI_INFORMATION6,'Pending Approval','U',PEI_INFORMATION6)=:2
AND PEI.PEI_INFORMATION_CATEGORY = 'IN_REI XXURSEMENT_DETAILS'
AND XXHCM_ENTERPRISE_PKG.Ret_Enterprise(FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID'))= (select ENTERPRISE_ID from per_enterprises where ENTERPRISE_SHORT_CODE like '%BG_NAME%')
UNION
SELECT PEI_INFORMATION1 REI XXURSEMENT_TYPE
      ,PEI_INFORMATION2 BENEFICIARY_NAME
      ,PEI_INFORMATION3 BILL_NU XXER    
,TO_Date(Fnd_conc_date.string_to_date(PEI_INFORMATION4),'DD-Mon-YYYY') BILL_DATE
      ,PEI_INFORMATION5 BILL_AMOUNT      
      ,PEI_INFORMATION7 EMPLOYEE_COMMENTS
      ,PEI_INFORMATION8 EMPLOYER_COMMENTS
      ,PERSON_EXTRA_INFO_ID PERSON_EXTRA_INFO_ID
      ,OBJECT_VERSION_NU XXER OVN
      ,PEI_INFORMATION6 BILL_STATUS
FROM PER_PEOPLE_EXTRA_INFO PEI   
WHERE PEI.PERSON_ID=:1
  AND DECODE(PEI_INFORMATION6,'Pending Approval','U',PEI_INFORMATION6)=:2
AND PEI.PEI_INFORMATION_CATEGORY='XX XX_IN_REI XXURSEMENT_DETAILS'
AND XXHCM_ENTERPRISE_PKG.Ret_Enterprise(FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID'))=(select ENTERPRISE_ID from per_enterprises where ENTERPRISE_SHORT_CODE like '%BG_Name%')

XXEligibilityVO:SELECT NVL(
(SELECT 'Y' FROM DUAL
WHERE EXISTS
    (
      SELECT 1
        FROM  PER_PEOPLE_X 
      WHERE   to_date(ORIGINAL_DATE_OF_HIRE,'dd-Mon-RRRR') <= to_date(FND_CONC_DATE.STRING_TO_DATE(:1),'dd-Mon-RRRR')
        AND   PERSON_ID = :2
        AND   BUSINESS_GROUP_ID =FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID')
      )),'N') IS_OLD_BILL FROM DUAL
  
XXEnterpriseVo:  
SELECT business_group_id bgid
FROM per_business_groups
WHERE
--business_group_id = FND_PROFILE.Value('PER_BUSINESS_GROUP_ID')
 NAME LIKE '%BG_NAME%'

 XXEntitlementVo: SELECT XXHCM_REI XXURSMENT_PKG.XXHCM_ENTITLE_AMOUNT(:1,:2) ENT_AMNT from dual

 XXDateeligibilityVo: SELECT XXHCM_REI XXURSMENT_PKG.XXHCM_REIM_ELIG_YEAR(:1) isBillDateValid
from dual

XXMedBenDetVo:SELECT   ROWNUM                    SL_NO
        , PEI.PEI_INFORMATION3      BILL_NU XXER
        , TO_CHAR(Fnd_conc_date.string_to_date(PEI.PEI_INFORMATION4),'DD-Mon-YYYY') BILL_DATE
        , PEI.PEI_INFORMATION2      BENEFICIARY_NAME
        , PEI.PEI_INFORMATION1      REI XXURSEMENT_TYPE
        , FU.EMPLOYEE_ID            PERSON_ID 
        , INITCAP(NVL(XXHCM_REI XXURSMENT_PKG.XX XX_DEP_REL_FNC(FU.EMPLOYEE_ID,PEI.PEI_INFORMATION2),'Self')) RELATIONSHIP
        , PEI.PEI_INFORMATION5      SUBMITTED_BILL_VALUE
  FROM    PER_PEOPLE_EXTRA_INFO PEI
        , FND_USER FU
  WHERE   FU.EMPLOYEE_ID  =PEI.PERSON_ID
  AND     FU.USER_ID      =:2
  AND     DECODE(PEI_INFORMATION6,'Pending Approval','PENDING','APPROVED')=:1
  AND     PEI.PEI_INFORMATION_CATEGORY='XX XX_IN_REI XXURSEMENT_DETAILS'
  AND     PEI.PEI_INFORMATION1  ='Medical Rei XXursement'
  AND     XXHCM_ENTERPRISE_PKG.Ret_Enterprise(FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID'))=
          (select ENTERPRISE_ID from per_enterprises where ENTERPRISE_SHORT_CODE like '%MAX%')
AND     PEI.CREATION_DATE BETWEEN TO_DATE('01-Apr'||TO_CHAR(SYSDATE,'RRRR')) AND TO_DATE('31-Mar'||(TO_CHAR(SYSDATE,'RRRR')+1))

 XXprintDetVO: SELECT REIM_TYPE
     , XXHCM_REI XXURSMENT_PKG.XXHCM_REIM_ELIG_VALUE(:1,REIM_TYPE) ANL_ELIG
     , XXHCM_REI XXURSMENT_PKG.XX XX_YTD_ELIG(:1,REIM_TYPE)  YTD_ELIG
     , XXHCM_REI XXURSMENT_PKG.XX XX_YTD_CLAIM_FNC(:1,REIM_TYPE) YTD_CLAIMED
     , XXHCM_REI XXURSMENT_PKG.XX XX_CLAIM_UNDER_PROS_FNC(:1,REIM_TYPE) CLAIM_UNDER_PROCESS
 FROM(
        SELECT DISTINCT PEI_INFORMATION1 REIM_TYPE
          FROM PER_PEOPLE_EXTRA_INFO
         WHERE person_id  = :2
           AND TRUNC(creation_date) between TO_DATE('01-'||TO_CHAR(SYSDATE,'Mon')||'-'||TO_CHAR(SYSDATE,'RRRR')) AND LAST_DAY(TRUNC(SYSDATE))
    )
XXRei XXStateVo:
 SELECT DECODE(SIGN(SYSDATE-PTP.CUT_OFF_DATE),1,'N','Y')STATE
  FROM PER_ALL_ASSIGNMENTS_F PAAF
      ,PER_ALL_PEOPLE_F PAPF
      ,FND_USER FU
      ,PAY_ALL_PAYROLLS_F PAPRF
      ,PER_TIME_PERIODS PTP
 WHERE PAPF.PERSON_ID= FU.EMPLOYEE_ID
   AND FU.USER_ID=:1 --FND_PROFILE.VALUE('USER_ID')
   AND PAPF.PERSON_ID=PAAF.PERSON_ID
   AND PAPRF.PAYROLL_ID = PAAF.PAYROLL_ID
   AND PTP.PAYROLL_ID= PAAF.PAYROLL_ID
   AND (TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND PAPF.EFFECTIVE_END_DATE)
   AND (TRUNC(SYSDATE) BETWEEN PAAF.EFFECTIVE_START_DATE AND PAAF.EFFECTIVE_END_DATE)
   AND (TRUNC(SYSDATE) BETWEEN PAPRF.EFFECTIVE_START_DATE AND PAPRF.EFFECTIVE_END_DATE)
   AND (TRUNC(SYSDATE)>= PTP.START_DATE AND TRUNC(SYSDATE)<=PTP.END_DATE)
  
  
 XXreimDetailsVo: 
   SELECT PEI_INFORMATION2 BENEFICIARY_NAME
      ,PEI_INFORMATION3 BILL_NU XXER   
      ,TO_CHAR(Fnd_conc_date.string_to_date(PEI_INFORMATION4),'DD-Mon-YYYY') BILL_DATE
      ,PEI_INFORMATION5 SUBMITTED_BILL_VALUE
      ,PEI_INFORMATION7 EMPLOYEE_COMMENTS
      ,PEI_INFORMATION8 EMPLOYER_COMMENTS
      ,PEI_INFORMATION1 REI XXURSEMENT_TYPE       
FROM PER_PEOPLE_EXTRA_INFO PEI
    ,FND_USER FU
WHERE FU.EMPLOYEE_ID=PEI.PERSON_ID
  AND FU.USER_ID=:2
AND DECODE(PEI_INFORMATION6,'Pending Approval','PENDING','APPROVED')=:1
AND PEI.PEI_INFORMATION_CATEGORY='IN_REI XXURSEMENT_DETAILS'
AND XXHCM_ENTERPRISE_PKG.Ret_Enterprise(FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID'))=
  (select ENTERPRISE_ID from per_enterprises where ENTERPRISE_SHORT_CODE like '% XX%')
UNION ALL
SELECT PEI_INFORMATION2 BENEFICIARY_NAME
      ,PEI_INFORMATION3 BILL_NU XXER   
      ,TO_CHAR(Fnd_conc_date.string_to_date(PEI_INFORMATION4),'DD-Mon-YYYY') BILL_DATE
      ,PEI_INFORMATION5 SUBMITTED_BILL_VALUE
      ,PEI_INFORMATION7 EMPLOYEE_COMMENTS
      ,PEI_INFORMATION8 EMPLOYER_COMMENTS
      ,PEI_INFORMATION1 REI XXURSEMENT_TYPE       
FROM PER_PEOPLE_EXTRA_INFO PEI
    ,FND_USER FU
WHERE FU.EMPLOYEE_ID=PEI.PERSON_ID
  AND FU.USER_ID=:2
AND DECODE(PEI_INFORMATION6,'Pending Approval','PENDING','APPROVED')=:1
AND PEI.PEI_INFORMATION_CATEGORY='XX XX_IN_REI XXURSEMENT_DETAILS'
AND XXHCM_ENTERPRISE_PKG.Ret_Enterprise(FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID'))=
  (select ENTERPRISE_ID from per_enterprises where ENTERPRISE_SHORT_CODE like '%BG_Name%')

Custom Process Flow in OAF Continuation


XXXHCMCreateReimbursementCO:

package xxhcm.oracle.apps.per.reimb.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageChoiceBean;

/**
 * Controller for ...
 */
public class XXXHCMCreateReimbursementCO extends OAControllerImpl {
    public static final String RCS_ID = "$Header$";
    public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    private String title = new String();
    /**
     * Layout and page setup logic for a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
        super.processRequest(pageContext, webBean);
        OAPageLayoutBean bean = (OAPageLayoutBean)webBean;
        title = pageContext.getParameter("PAGE_TITLE") + " Reimbursements";
        bean.setWindowTitle(title);
        bean.setTitle(title);

        OAMessageChoiceBean reimbTypes =
            (OAMessageChoiceBean)webBean.findChildRecursive("reimbTypeEle");
        OAMessageChoiceBean benNames =
            (OAMessageChoiceBean)webBean.findChildRecursive("benNameEle");
        reimbTypes.setPickListCacheEnabled(false);
        benNames.setPickListCacheEnabled(false);

    }
    /**
     * Procedure to handle form submissions for form elements in
     * a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processFormRequest(OAPageContext pageContext,
                                   OAWebBean webBean) {
        super.processFormRequest(pageContext, webBean);

        if (pageContext.getParameter("cancel") != null) {
            pageContext.forwardImmediately("OA.jsp?page=/xxhcm/oracle/apps/per/reimb/webui/XXHCMEmpReimbursementPG",
                                           null,
                                           OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                           null, null, true,
                                           OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
        }

    }

}

XXHCMCreateTableCO :

/*===========================================================================+
 |                                                                           |
 |                                                                           |
 +===========================================================================+
 |  HISTORY      
 +===========================================================================*/
package xxhcm.oracle.apps.per.reimb.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import xxhcm.oracle.apps.per.reimb.server.XXHCMEmpReimbursementAMImpl;

/**
 * Controller for ...
 */
public class XXHCMCreateTableCO extends OAControllerImpl {
    public static final String RCS_ID = "$Header$";
    public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    /**
     * Layout and page setup logic for a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    private String mode = new String();
    public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
        super.processRequest(pageContext, webBean);
        mode = pageContext.getParameter("PAGE_MODE");
        XXHCMEmpReimbursementAMImpl am =
            (XXHCMEmpReimbursementAMImpl)pageContext.getApplicationModule(webBean);
        am.invokeMethod("initEmpDetailsVO");
        if (mode.equalsIgnoreCase("U")) {
            webBean.findChildRecursive("addBtn").setRendered(false);
        }
        am.createRows(mode);
        am.initEligibilityDetailsVO();
       am.invokeMethod("initContactPicklist");
    }
    /**
     * Procedure to handle form submissions for form elements in
     * a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processFormRequest(OAPageContext pageContext,
                                   OAWebBean webBean) {
        super.processFormRequest(pageContext, webBean);
        if (pageContext.getParameter("addBtn") != null) {
            XXHCMEmpReimbursementAMImpl am =
                (XXHCMEmpReimbursementAMImpl)pageContext.getApplicationModule(webBean);
            am.addRows();           
        }
        if (pageContext.getParameter("submit") != null) {
            XXHCMEmpReimbursementAMImpl am =
                (XXHCMEmpReimbursementAMImpl)pageContext.getApplicationModule(webBean);
            if (mode.equalsIgnoreCase("C")) {
                am.createEIT();
            } else {
                am.updateEIT();
            }
            pageContext.putParameter("TRANSACTION_STATUS","S");
            pageContext.forwardImmediately("OA.jsp?page=/xxhcm/oracle/apps/per/reimb/webui/XXHCMEmpReimbursementPG",
                                           null,
                                           OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                           null, null, true,
                                           OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
          
        }
       
        if(pageContext.getParameter("delBtn")!=null){
            XXHCMEmpReimbursementAMImpl am =
                (XXHCMEmpReimbursementAMImpl)pageContext.getApplicationModule(webBean);
            am.deleteEIT(mode);
        }

    }

}
XXEligibilityVO:

SELECT PETF.ELEMENT_NAME ELIGIBILITY_TYPE
      ,0 ACCRUED_AMOUNT
  FROM PER_ALL_PEOPLE_F PAPF
      ,PER_ALL_ASSIGNMENTS_F PAAF  
      ,FND_USER FU
      ,PAY_ELEMENT_TYPES_F PETF
      ,PAY_ELEMENT_TYPE_EXTRA_INFO PETEI
      ,PAY_ELEMENT_ENTRIES_F PEEF
 WHERE PAPF.PERSON_ID=FU.EMPLOYEE_ID
   AND FU.USER_ID= :1
   AND PAPF.PERSON_ID=PAAF.PERSON_ID
   AND PAAF.PRIMARY_FLAG='Y'
   AND PETF.ELEMENT_TYPE_ID = PETEI.ELEMENT_TYPE_ID
   AND PETEI.EEI_INFORMATION_CATEGORY = 'XXHCM_IN_REIMB_CLASS'
   AND PETEI.EEI_INFORMATION1 = 'Y'
   AND PEEF.ASSIGNMENT_ID = PAAF.ASSIGNMENT_ID
   AND PEEF.ELEMENT_TYPE_ID = PETF.ELEMENT_TYPE_ID
   AND (SYSDATE BETWEEN PETF.EFFECTIVE_START_DATE AND PETF.EFFECTIVE_END_DATE)
   AND (SYSDATE BETWEEN PAAF.EFFECTIVE_START_DATE AND PAAF.EFFECTIVE_END_DATE)
   AND (SYSDATE BETWEEN PAPF.EFFECTIVE_START_DATE AND PAPF.EFFECTIVE_END_DATE)
   AND (SYSDATE BETWEEN PEEF.EFFECTIVE_START_DATE AND PEEF.EFFECTIVE_END_DATE)
UNION
SELECT petf.element_name ELIGIBILITY_TYPE
       ,0 ACCRUED_AMOUNT
FROM pay_element_types_f petf
WHERE 1=1
AND SYSDATE BETWEEN petf.effective_start_date AND petf.effective_end_date
AND petf.element_name IN ('Car Fuel',
'Car Maintenance',
'Communication Reimbursement',
'Higher Education Reimbursement',
'LTA',
'Driver Salary',
'Medical Reimbursement'
)
AND petf.business_group_id = fnd_profile.Value('PER_BUSINESS_GROUP_ID')

Custom Process Flow in OAF

Process Folw:

XXHCMEmpReimbursementsCO:

/*===========================================================================+
 |                                                                           |
 |                                                                           |
 +===========================================================================+
 |  HISTORY      
 |           |
 +===========================================================================*/
package xxhcm.oracle.apps.per.reimb.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
import xxhcm.oracle.apps.per.reimb.server.XXHCMEmpReimbursementAMImpl;

/**
 * Controller for ...
 */
public class XXHCMEmpReimbursementsCO extends OAControllerImpl {
    public static final String RCS_ID = "$Header$";
    public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    /**
     * Layout and page setup logic for a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
        super.processRequest(pageContext, webBean);
        XXHCMEmpReimbursementAMImpl am = (XXHCMEmpReimbursementAMImpl)pageContext.getApplicationModule(webBean);
        String status= am.getStatus();
        am.invokeMethod("initEnterpriseVO");
        if(status.equalsIgnoreCase("N")){
            OASubmitButtonBean btn = (OASubmitButtonBean)webBean.findChildRecursive("create");
            btn.setDisabled(true);
        }
        try{
        String bg_id=am.findViewObject("XXHCMEnterpriseVO1").first().getAttribute(0).toString();
        if (bg_id.equalsIgnoreCase("2008") || bg_id.equalsIgnoreCase("1428"))
            {
              am.invokeMethod("initBtnDiablsVO");
              System.out.println("Button Status :"+am.getBtnStatus());
              if(am.getBtnStatus().equalsIgnoreCase("Y")){
                  OASubmitButtonBean btn = (OASubmitButtonBean)webBean.findChildRecursive("create");
                  btn.setDisabled(true);
              }
            }
        }catch(Exception e)
        {
              System.out.println("Error ");
        }
       
        if(pageContext.getParameter("TRANSACTION_STATUS")!=null){
            pageContext.removeParameter("TRANSACTION_STATUS");
            throw new OAException("Transaction successful.",OAException.CONFIRMATION);
        }
       
       
       
    }
    /**
     * Procedure to handle form submissions for form elements in
     * a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processFormRequest(OAPageContext pageContext,
                                   OAWebBean webBean) {
        super.processFormRequest(pageContext, webBean);
        if ("VIEW_DETAILS".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM))) {
            pageContext.forwardImmediately("OA.jsp?page=/xxhcm/oracle/apps/per/reimb/webui/XXHCMReimbursementDetailsPG",
                                           null,
                                           OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                           null, null, true,
                                           OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
        }
   Vo


        if("ACTION_PENDING".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM))){
            pageContext.putParameter("PAGE_MODE","U");
            pageContext.putParameter("PAGE_TITLE","Update");
            pageContext.forwardImmediately("OA.jsp?page=/xxhcm/oracle/apps/per/reimb/webui/XXHCMCreateReimbursementPG",
                                           null,
                                           OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                           null, null, true,
                                           OAWebBeanConstants.ADD_BREAD_CRUMB_NO);      }
        if (pageContext.getParameter("create") != null) {
            pageContext.putParameter("PAGE_MODE","C");
            pageContext.putParameter("PAGE_TITLE","Create");
            pageContext.forwardImmediately("OA.jsp?page=/xxhcm/oracle/apps/per/reimb/webui/XXHCMCreateReimbursementPG",
                                           null,
                                           OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                           null, null, true,
                                           OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
        }
    }
}


XXEmpDetailsVo:

SELECT PAPF.FULL_NAME EMPLOYEE_NAME
      ,PAPF.EMPLOYEE_NUMBER
      ,HAOU.NAME ORGANIZATION_NAME
      ,HAOU.NAME COMPANY_NAME
      ,pay_in_utils.get_position_name(PAAF.assignment_id,   sysdate) POSITION
      ,pay_in_utils.get_hire_date(PAAF.assignment_id) HIRE_DATE     
      ,PG.NAME GRADE_NAME
      ,HRL.LOCATION_CODE    LOCATION_NAME
      ,XXHCM_REIMBURSMENT_PKG.XXMB_CURR_FIN_YEAR_FNC FIN_YEAR
  FROM PER_ALL_PEOPLE_F PAPF
      ,PER_ALL_ASSIGNMENTS_F PAAF   
      ,HR_ALL_ORGANIZATION_UNITS HAOU
      ,FND_USER FU
      ,PER_GRADES PG
      , HR_LOCATIONS_ALL HRL
 WHERE FU.USER_ID=:1  --FND_PROFILE.VALUE('USER_ID')
   AND PAPF.PERSON_ID = FU.EMPLOYEE_ID
   AND PAAF.PERSON_ID= PAPF.PERSON_ID
   AND PAAF.PRIMARY_FLAG='Y'
   AND PG.GRADE_ID (+) = PAAF.GRADE_ID
   AND PAAF.LOCATION_ID= HRL.LOCATION_ID(+)
   AND HAOU.ORGANIZATION_ID=PAAF.ORGANIZATION_ID
   AND (TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND PAPF.EFFECTIVE_END_DATE)
   AND (TRUNC(SYSDATE) BETWEEN PAAF.EFFECTIVE_START_DATE AND PAAF.EFFECTIVE_END_DATE)

XXPendingApprReimbVO:

SELECT SUM(A.SUBMITTED_BILLS)
      ,MAX(A.UPDATED_DATE)
      ,A.DETAILS
      ,DECODE(SIGN(SYSDATE-A.CUT),1,'pendingActionDisabled','pendingActionEnabled') Action
      ,a.assignment_id
FROM
(SELECT  SUM(NVL(FND_NUMBER.CANONICAL_TO_NUMBER(PEI_INFORMATION5),0)) SUBMITTED_BILLS
       ,MAX(PEI.LAST_UPDATE_DATE) UPDATED_DATE
      ,PTP.CUT_OFF_DATE CUT
      ,'Details' DETAILS
      ,paaf.assignment_id
  FROM PER_PEOPLE_EXTRA_INFO PEI
      ,FND_USER FU
      ,PER_ALL_ASSIGNMENTS_F PAAF 
      ,PAY_ALL_PAYROLLS_F PAPRF
      ,PER_TIME_PERIODS PTP
WHERE PEI.PERSON_ID = FU.EMPLOYEE_ID
  AND FU.USER_ID=:1
  AND PEI.PEI_INFORMATION_CATEGORY='IN_REIMBURSEMENT_DETAILS'  
  AND PEI.PEI_INFORMATION6 ='Pending Approval' 
  AND PEI.PERSON_ID=PAAF.PERSON_ID
  AND PAPRF.PAYROLL_ID = PAAF.PAYROLL_ID
  AND PTP.PAYROLL_ID= PAAF.PAYROLL_ID 
  AND (SYSDATE BETWEEN PAAF.EFFECTIVE_START_DATE AND PAAF.EFFECTIVE_END_DATE)
  AND (SYSDATE BETWEEN PAPRF.EFFECTIVE_START_DATE AND PAPRF.EFFECTIVE_END_DATE)
  AND (TRUNC(SYSDATE)>= PTP.START_DATE AND TRUNC(SYSDATE)<=PTP.END_DATE)
  group by PEI_INFORMATION5, PEI.LAST_UPDATE_DATE , PTP.CUT_OFF_DATE, paaf.assignment_id
 ) A
 GROUP BY a.assignment_id, A.CUT, A.DETAILS
UNION
 SELECT SUM(A.SUBMITTED_BILLS)
      ,MAX(A.UPDATED_DATE)
      ,A.DETAILS
      ,DECODE(SIGN(SYSDATE-A.CUT),1,'pendingActionDisabled','pendingActionEnabled') Action
      ,a.assignment_id
FROM
(SELECT  SUM(NVL(FND_NUMBER.CANONICAL_TO_NUMBER(PEI_INFORMATION5),0)) SUBMITTED_BILLS
       ,MAX(PEI.LAST_UPDATE_DATE) UPDATED_DATE
      ,PTP.CUT_OFF_DATE CUT
      ,'Details' DETAILS
      ,paaf.assignment_id
  FROM PER_PEOPLE_EXTRA_INFO PEI
      ,FND_USER FU
      ,PER_ALL_ASSIGNMENTS_F PAAF 
      ,PAY_ALL_PAYROLLS_F PAPRF
      ,PER_TIME_PERIODS PTP
WHERE PEI.PERSON_ID = FU.EMPLOYEE_ID
  AND FU.USER_ID= :1
  AND PEI.PEI_INFORMATION_CATEGORY='XX_IN_REIMBURSEMENT_DETAILS'  -- Information category Name  
  AND PEI.PEI_INFORMATION6 ='Pending Approval' 
  AND PEI.PERSON_ID=PAAF.PERSON_ID
  AND PAPRF.PAYROLL_ID = PAAF.PAYROLL_ID
  AND PTP.PAYROLL_ID= PAAF.PAYROLL_ID 
  AND (SYSDATE BETWEEN PAAF.EFFECTIVE_START_DATE AND PAAF.EFFECTIVE_END_DATE)
  AND (SYSDATE BETWEEN PAPRF.EFFECTIVE_START_DATE AND PAPRF.EFFECTIVE_END_DATE)
  AND (TRUNC(SYSDATE)>= PTP.START_DATE AND TRUNC(SYSDATE)<=PTP.END_DATE)
  group by PEI_INFORMATION5, PEI.LAST_UPDATE_DATE , PTP.CUT_OFF_DATE, paaf.assignment_id
 ) A
 GROUP BY a.assignment_id, A.CUT, A.DETAILS

XXExcemptedReimbVO:

SELECT NVL(SUM(FND_NUMBER.CANONICAL_TO_NUMBER(PEI_INFORMATION5)),0) SUBMITTED_BILLS
      ,NVL(SUM(FND_NUMBER.CANONICAL_TO_NUMBER(PEI_INFORMATION10)),0) EXEMPT_BILLS
   ,'DETAILS' DETAILS 
 FROM PER_PEOPLE_EXTRA_INFO PEI
     ,FND_USER FU
WHERE PEI.PERSON_ID = FU.EMPLOYEE_ID
  AND FU.USER_ID=:1 --FND_PROFILE.VALUE('USER_ID')
  AND PEI.PEI_INFORMATION_CATEGORY=Decode(
                                          XXHCM_ENTERPRISE_PKG.Ret_Enterprise(FND_PROFILE.Value('PER_BUSINESS_GROUP_ID'))
                                          ,42,'XX_IN_REIMBURSEMENT_DETAILS',
                                          'IN_REIMBURSEMENT_DETAILS'
                                          ) 
  AND PEI.PEI_INFORMATION6 in ('Approved','Rejected')



XXHCMPendingApprovalsCO:

/*===========================================================================+
 |                                                                           |
 |                                                                           |
 +===========================================================================+
 |  HISTORY      
 |          |
 +===========================================================================*/
package xxhcm.oracle.apps.per.reimb.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import xxhcm.oracle.apps.per.reimb.server.XXHCMEmpReimbursementAMImpl;
/**
 * Controller for ...
 */
public class XXHCMPendingApprovalsCO extends OAControllerImpl
{
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
    XXHCMEmpReimbursementAMImpl am =(XXHCMEmpReimbursementAMImpl)pageContext.getApplicationModule(webBean);
    am.invokeMethod("initPendingReimbursementsVO");
  }
  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
  }
}

XXHCMExemptedReimbursementsCO:

/*===========================================================================+
 |                                                                           |
 |                                                                           |
 +===========================================================================+
 |  HISTORY      
 |             |
 +===========================================================================*/
package xxhcm.oracle.apps.per.reimb.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import xxhcm.oracle.apps.per.reimb.server.XXHCMEmpReimbursementAMImpl;
import xxhcm.oracle.apps.per.reimb.server.XXHCMPendingApprReimbVOImpl;
/**
 * Controller for ...
 */
public class XXHCMExemptedReimbursementsCO extends OAControllerImpl {
    public static final String RCS_ID = "$Header$";
    public static final boolean RCS_ID_RECORDED =
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    /**
     * Layout and page setup logic for a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
        super.processRequest(pageContext, webBean);
        XXHCMEmpReimbursementAMImpl am =
            (XXHCMEmpReimbursementAMImpl)pageContext.getApplicationModule(webBean);
        am.invokeMethod("initApprovedReimbursementsVO");
    }
    /**
     * Procedure to handle form submissions for form elements in
     * a region.
     * @param pageContext the current OA page context
     * @param webBean the web bean corresponding to the region
     */
    public void processFormRequest(OAPageContext pageContext,
                                   OAWebBean webBean) {
        super.processFormRequest(pageContext, webBean);
    }
}

XXHCMEmpReiXXursementAMImpl :

package xxhcm.oracle.apps.per.reiXX.server;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.fnd.framework.server.OADBTransaction;
import oracle.jbo.Row;
import oracle.jbo.RowSet;
import oracle.xml.parser.v2.XMLDocument;
import oracle.xml.parser.v2.XMLElement;
import oracle.jbo.domain.NuXXer;

// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class XXHCMEmpReiXXursementAMImpl extends OAApplicationModuleImpl
{
    /**This is the default constructor (do not remove)
     */
    public XXHCMEmpReiXXursementAMImpl() {
    }
    private String isXX  = new String("N");
    /**Sample main for debugging Business Components code using the tester.
     */
    public static void main(String[] args) { /* package name */
        /* Configuration Name */launchTester("xxhcm.oracle.apps.per.reiXX.server",
                                             "XXHCMEmpReiXXursementAMLocal");
    }
    /**Container's getter for XXHCMEmployeeDetailsVO1
     */
    public XXHCMEmpDetailsVOImpl getXXHCMEmployeeDetailsVO1() {
        return (XXHCMEmpDetailsVOImpl)findViewObject("XXHCMEmployeeDetailsVO1");
    }
    public void initEmpDetailsVO() {
        XXHCMEmpDetailsVOImpl vo = getXXHCMEmployeeDetailsVO1();
        vo.clearCache();
        // if (!vo.isPreparedForExecution()) {
        int userId = getOADBTransaction().getUserId();
        vo.initQuery(userId);
        // }
    }

    public ArrayList initEligibilityDetailsVO() {
        ArrayList list = new ArrayList();
        XXHCMEligibilityVOImpl vo = getXXHCMEligibilityVO1();
        //if (!vo.isPreparedForExecution()) {
        vo.setFetchSize(vo.FETCH_ALL);
        int userId = getOADBTransaction().getUserId();
        vo.initQuery(userId);
        //}
        RowSet rowset = vo.getRowSet();
        while (rowset.hasNext()) {
            XXHCMEligibilityVORowImpl voRow =
                (XXHCMEligibilityVORowImpl)rowset.next();
            String eligibilityName = voRow.getEligibilityType();
            String accruedAmount = voRow.getAccruedAmount().toString();
            list.add(eligibilityName);
            list.add(accruedAmount);
        }
        return list;
    }
    /**Container's getter for XXHCMPendingApprReiXXVO1
     */
    public XXHCMPendingApprReiXXVOImpl getXXHCMPendingApprReiXXVO1() {
        return (XXHCMPendingApprReiXXVOImpl)findViewObject("XXHCMPendingApprReiXXVO1");
    }
    /**Container's getter for XXHCMExcemptedReiXXVO1
     */
    public XXHCMExcemptedReiXXVOImpl getXXHCMExcemptedReiXXVO1() {
        return (XXHCMExcemptedReiXXVOImpl)findViewObject("XXHCMExcemptedReiXXVO1");
    }

    public void initPendingReiXXursementsVO() {
        XXHCMPendingApprReiXXVOImpl vo = getXXHCMPendingApprReiXXVO1();
        int userId = getOADBTransaction().getUserId();
        vo.initQuery(userId);
    }
    public void initApprovedReiXXursementsVO() {
        XXHCMExcemptedReiXXVOImpl vo = getXXHCMExcemptedReiXXVO1();
        int userId = getOADBTransaction().getUserId();
        vo.initQuery(userId);
    }
    /**Container's getter for XXHCMReiXXursementDetailsVO1
     */
    public XXHCMReiXXursementDetailsVOImpl getXXHCMReiXXursementDetailsVO1() {
        return (XXHCMReiXXursementDetailsVOImpl)findViewObject("XXHCMReiXXursementDetailsVO1");
    }
    public void initEmployeeReiXXursementVO(String param) {
        XXHCMReiXXursementDetailsVOImpl vo = getXXHCMReiXXursementDetailsVO1();
        int userId = getOADBTransaction().getUserId();
        vo.initQuery(param, userId);
    }

    public XMLElement getReportXml(String param) {
        String bg_id  ="-1";
        NuXXer totalAmount=new NuXXer(0);
        NuXXer  totalPendingAmt =new NuXXer(0);
        int userId = getOADBTransaction().getUserId();
        XXHCMEmpDetailsVOImpl empDetailsVO = getXXHCMEmployeeDetailsVO1();
        empDetailsVO.initQuery(userId);
        XXHCMReiXXursementDetailsVOImpl reiXXDetailsVO =
            getXXHCMReiXXursementDetailsVO1();
     
      //added By Saha Gopal For execute VO depending on Enterprise
      try{
      XXHCMEnterpriseVOImpl entVo= getXXHCMEnterpriseVO1();
      bg_id=entVo.first().getAttribute(0).toString(); 
      System.out.println("bg_id :"+bg_id);
      } catch(Exception e)
      {
        System.out.println("Error during Medical ReiXXursement Filter");
       
      }
     
     
      //added By Saha Gopal For XX 
       if (bg_id.equalsIgnoreCase("2008") || bg_id.equalsIgnoreCase("1428")){
            reiXXDetailsVO.setWhereClauseParams(null);
            reiXXDetailsVO.setWhereClauseParam(0,param);
            reiXXDetailsVO.setWhereClauseParam(1,userId);
            reiXXDetailsVO.setWhereClause(" REIXXURSEMENT_TYPE <>'Medical ReiXXursement'");
            reiXXDetailsVO.executeQuery();
          }
        else{
          reiXXDetailsVO.initQuery(param, userId);
        }
       
     
        XMLDocument doc = new XMLDocument();
        XMLElement root = new XMLElement("root");
        doc.appendChild(root);
        XMLElement empDetails = new XMLElement("empDetails");
        root.appendChild(empDetails);
        for (int i = 0; i < empDetailsVO.getRowCount(); i++) {
            XXHCMEmpDetailsVORowImpl vor =
                (XXHCMEmpDetailsVORowImpl)empDetailsVO.getRowAtRangeIndex(i);
            String empName = vor.getEmployeeName();
            String empNo = vor.getEmployeeNuXXer();
            String organization = vor.getOrganizationName();
           // String position = vor.getPosition();
            //This is a change because we need to show grade name.
            String position = vor.getGradeName();
            String hireDate = vor.getHireDate().toString();
            String locationName = vor.getLocationName().toString();
            String finYear      = vor.getFinYear().toString();
           
            if (position == null) {
                position = " ";
            }
            XMLElement empNameElement = new XMLElement("empName");
            empNameElement.addText(empName);
            empDetails.appendChild(empNameElement);
            XMLElement empNoElement = new XMLElement("empNo");
            empNoElement.addText(empNo);
            empDetails.appendChild(empNoElement);
            XMLElement orgElement = new XMLElement("orgName");
            orgElement.addText(organization);
            empDetails.appendChild(orgElement);
            XMLElement positionElement = new XMLElement("position");
            positionElement.addText(position);
            empDetails.appendChild(positionElement);
            XMLElement hireDateElement = new XMLElement("hireDate");
            hireDateElement.addText(hireDate);
            empDetails.appendChild(hireDateElement);
           
            //ADDED BY SAHA GOPAL FOR XX 
           
            XMLElement locationElement = new XMLElement("locationName");
            locationElement.addText(locationName);
            empDetails.appendChild(locationElement);
           
            XMLElement finYearElement = new XMLElement("finYear");
            finYearElement.addText(finYear);
            empDetails.appendChild(finYearElement);
        }
        XMLElement reiXXElement = new XMLElement("reiXX");
        root.appendChild(reiXXElement);
        // reiXXDetailsVO.first(); 
        RowSet rs = reiXXDetailsVO.getRowSet();
        // System.out.println(rs.getRowCount());
        //      rs.first();
        //for (int i = 0; i < rs.getRowCount(); i++) {
        while (rs.hasNext()) {
            XMLElement reiXXDetailElement = new XMLElement("reiXXDetails");
            reiXXElement.appendChild(reiXXDetailElement);
            XXHCMReiXXursementDetailsVORowImpl vor =
                (XXHCMReiXXursementDetailsVORowImpl)rs.next();
            String reiXXType = vor.getReiXXursementType();
            XMLElement reiXXTypeElement = new XMLElement("reiXXType");
            reiXXTypeElement.addText(reiXXType);
            reiXXDetailElement.appendChild(reiXXTypeElement);
            String benName = vor.getBeneficiaryName();
            XMLElement benNameElement = new XMLElement("benName");
            benNameElement.addText(benName);
            reiXXDetailElement.appendChild(benNameElement);
            String billNuXXer = vor.getBillNuXXer();
            XMLElement billNuXXerElement = new XMLElement("billNuXXer");
            billNuXXerElement.addText(billNuXXer);
            reiXXDetailElement.appendChild(billNuXXerElement);
            String billDate = vor.getBillDate();
            XMLElement billDateElement = new XMLElement("billDate");
            billDateElement.addText(billDate);
            reiXXDetailElement.appendChild(billDateElement);
            String billAmount = vor.getSubmittedBillValue();
            XMLElement billAmountElement = new XMLElement("billAmount");
            billAmountElement.addText(billAmount);
            reiXXDetailElement.appendChild(billAmountElement);
            String empComments = vor.getEmployeeComments();
            if (empComments == null) {
                empComments = "";
            }
            XMLElement empCommentsElement = new XMLElement("empComments");
            empCommentsElement.addText(empComments);
            reiXXDetailElement.appendChild(empCommentsElement);
        }
        /*
        try {
           ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
            doc.print(outputStream);
            System.out.println(outputStream.toString());
        } catch (Exception e) {
            throw new OAException(e.getMessage());
        }*/
       
    //-- added By saha Gopal For XX   Medical ReiXXursement Details
    //added By Saha Gopal For XX 
    
     if (bg_id.equalsIgnoreCase("2008") || bg_id.equalsIgnoreCase("1428")){
        
         XXHCMMedBenDetailsVOImpl medVO = getXXHCMMedBenDetailsVO1();
         medVO.initMedQuery(param, userId);
       
         XXHCMPrintDetVOImpl printVO    = getXXHCMPrintDetVO1();
         printVO.initPrintQuery(userId,getPersonId());
       
        XMLElement medElement = new XMLElement("medDetail");
        root.appendChild(medElement);
        RowSet rs1 = medVO.getRowSet();
       
       
        XMLElement printElement = new XMLElement("printDetails");
        root.appendChild(printElement);
        RowSet rs2 = printVO.getRowSet();
       
        while (rs1.hasNext()) {
        System.out.println("~~~~~~~~~~~~~~~~~~~~~~inside record set1 ");
            XMLElement medDetailsElement = new XMLElement("medDetails");
            medElement.appendChild(medDetailsElement);
            XXHCMMedBenDetailsVORowImpl medVor = (XXHCMMedBenDetailsVORowImpl)rs1.next();
               
            String slNo = medVor.getSlNo().toString();
            XMLElement slTypeElement = new XMLElement("slNo");
            slTypeElement.addText(slNo);
            medDetailsElement.appendChild(slTypeElement);
           
            String billNuXXer = medVor.getBillNuXXer().toString();
            XMLElement billtypeElement = new XMLElement("billNuXXer");
            billtypeElement.addText(billNuXXer);
            medDetailsElement.appendChild(billtypeElement);
           
            String billDate = medVor.getBillDate().toString();
            XMLElement billDatetypeElement = new XMLElement("billDate");
            billDatetypeElement.addText(billDate);
            medDetailsElement.appendChild(billDatetypeElement);
           
            String benFinName = medVor.getBeneficiaryName().toString();
            XMLElement benNameElement = new XMLElement("benFinName");
            benNameElement.addText(benFinName);
            medDetailsElement.appendChild(benNameElement);
           
            String relationShip = medVor.getRelationship().toString();
            XMLElement relationShipElement = new XMLElement("relationShip");
            relationShipElement.addText(relationShip);
            medDetailsElement.appendChild(relationShipElement);
           
            String billAmount = medVor.getSubmittedBillValue().toString();
            System.out.println("billAmount :"+billAmount);
            XMLElement billAmountElement = new XMLElement("billAmount");
            billAmountElement.addText(billAmount);
            medDetailsElement.appendChild(billAmountElement);
           
           
           try {
            totalAmount = new NuXXer(totalAmount).add(new NuXXer(billAmount));
           }catch(Exception e){
            System.out.println("Error occured during total amount calculation");
           }
          
      }
       XMLElement totalAmtElement = new XMLElement("totalAmount");
       root.appendChild(totalAmtElement);
       totalAmtElement.addText(totalAmount.toString());
      
       while(rs2.hasNext()){
         System.out.println("~~~~~~~~~~~~~~~~~~~~~~inside record set2 ");
         XMLElement printDetElement = new XMLElement("printDet");
         printElement.appendChild(printDetElement);
         XXHCMPrintDetVORowImpl  printDetVor =(XXHCMPrintDetVORowImpl) rs2.next();
        
         String reimEleName = printDetVor.getReimType().toString();
         XMLElement reimTypeELement = new XMLElement("reimEleName");
         reimTypeELement.addText(reimEleName);
         printDetElement.appendChild(reimTypeELement);
        
         String anlElgAmt =printDetVor.getAnlElig().toString();
         XMLElement anlElgAmtElement = new XMLElement("anlElgAmt");
         anlElgAmtElement.addText(anlElgAmt);
         printDetElement.appendChild(anlElgAmtElement);
        
         String ytdElg = printDetVor.getYtdElig().toString();
         XMLElement ytdElgElement = new XMLElement("ytdElg");
         ytdElgElement.addText(ytdElg);
         printDetElement.appendChild(ytdElgElement);
        
         String ytdClaim = printDetVor.getYtdClaimed().toString();
         XMLElement ytdClaimElement = new XMLElement("ytdClaim");
         ytdClaimElement.addText(ytdClaim);
         printDetElement.appendChild(ytdClaimElement);
        
         String pendingClaims = printDetVor.getClaimUnderProcess().toString();
         XMLElement pendingClaimsElement = new XMLElement("pendingClaims");
         pendingClaimsElement.addText(pendingClaims);
         printDetElement.appendChild(pendingClaimsElement);
        
         try {
          totalPendingAmt = new NuXXer(totalPendingAmt).add(new NuXXer(pendingClaims));
         }catch(Exception e){
          System.out.println("Error occured during total amount calculation");
         }
        
       }
       XMLElement totalPendingAmtElement = new XMLElement("totalPendingAmt");
       root.appendChild(totalPendingAmtElement);
       totalPendingAmtElement.addText(totalPendingAmt.toString());
     }
        return root;
    }

    /**Container's getter for XXHCMCreateReiXXVO1
     */
    public XXHCMCreateReiXXVOImpl getXXHCMCreateReiXXVO1() {
        return (XXHCMCreateReiXXVOImpl)findViewObject("XXHCMCreateReiXXVO1");
    }
    public void createRows(String mode) {
        XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
        vo.clearCache();
        int personId = getPersonId();
        // if (!vo.isPreparedForExecution()) {
        vo.initQuery(mode, personId);
        //}
        if (mode.equalsIgnoreCase("U")) {
            return;
        }
        for (int i = 0; i < 20; i++) {
            XXHCMCreateReiXXVORowImpl row =
                (XXHCMCreateReiXXVORowImpl)vo.createRow();
            row.setNewRowState(Row.STATUS_INITIALIZED);
            vo.insertRow(row);
        }
     
    }

    /**Container's getter for XXHCMEligibilityVO1
     */
    public XXHCMEligibilityVOImpl getXXHCMEligibilityVO1() {
        return (XXHCMEligibilityVOImpl)findViewObject("XXHCMEligibilityVO1");
    }

    public void updateEIT() {
        String bgId = new String("");
        try
        {
            getXXHCMEnterpriseVO1().executeQuery();
            bgId = getXXHCMEnterpriseVO1().first().getAttribute(0).toString();
            System.out.println("bgId: "+bgId);
            isXX  = "Y";
        }
        catch(Exception e) {
            System.out.println("Exception while getting bgid ");
        }
       
        if(isXX .equalsIgnoreCase("Y"))
        {
            System.out.println("XX  .. Validate reiXXursments..");
            validateReiXXursment();
        }
       
        XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
        int personId = getPersonId();
        ArrayList<String> sqlStatements = new ArrayList<String>();
        for (int rowIndex = 0; rowIndex < vo.getRowCount(); rowIndex++) {
            int vcount = rowIndex+1;
            XXHCMCreateReiXXVORowImpl vor =
                (XXHCMCreateReiXXVORowImpl)vo.getRowAtRangeIndex(rowIndex);
            String reiXXType = vor.getReiXXursementType();
            if (reiXXType != null && reiXXType.length() > 0) {
                String beneficiaryName = vor.getBeneficiaryName();
                if (beneficiaryName == null)
                    beneficiaryName = " ";
                String billNuXXer = vor.getBillNuXXer();
                if (billNuXXer == null)
                    billNuXXer = " ";
                if (vor.getBillDate() == null) {
                    throw new OAException("Bill Date can not be empty for bill nuXXer:" +
                                          billNuXXer, OAException.ERROR);
                }
                String billDate = vor.getBillDate().toString();
                String billAmount = vor.getBillAmount();
                if (billAmount == null) {
                    throw new OAException("Bill Amount can not be empty for bill nuXXer:" +
                                          billNuXXer + " on bill date:" +
                                          billDate, OAException.ERROR);
                }
                try {
                    Double billAmountInt = Double.parseDouble(billAmount);
                    if (billAmountInt <= 0) {
                        throw new OAException("Bill Amount for bill nuXXer:" +
                                              billNuXXer + " on bill date:" +
                                              billDate +
                                              " should be more than zero.",
                                              OAException.ERROR);
                    }
                } catch (NuXXerFormatException nex) {
                  System.out.println("***********inside exception3");
                    throw new OAException("Bill Amount for bill nuXXer:" +
                                          billNuXXer + " on bill date:" +
                                          billDate + " should be numeric.",
                                          OAException.ERROR);
                }
                String empRemarks = vor.getEmployeeComments();
                if (empRemarks == null)
                    empRemarks = " ";
                empRemarks = empRemarks.replace("'", "''");
                int personExtraInfoId =
                    Integer.parseInt(vor.getPersonExtraInfoId().toString());
                int objectVersionNuXXer =
                    Integer.parseInt(vor.getObjectVersionNuXXer().toString());
                String sqlStatement =
                    "declare povn nuXXer:=" + objectVersionNuXXer + ";" +
                    "begin " +
                    "  hr_person_extra_info_api.update_person_extra_info(" +
                    "           p_person_extra_info_id =>" +
                    personExtraInfoId +
                    "          ,p_object_version_nuXXer => povn" +
                    "          ,p_pei_information1  =>'" + reiXXType + "'" +
                    "          ,p_pei_information2  =>'" + beneficiaryName +
                    "'" + "          ,p_pei_information3  =>'" + billNuXXer +
                    "'" + "          ,p_pei_information4    =>'" + billDate +
                    "'" + "          ,p_pei_information5    =>'" + billAmount +
                    "'" + "          ,p_pei_information7   =>'" + empRemarks +
                    "'" + "); " + "end;";
                sqlStatements.add(sqlStatement);
            }
        }
        executeStatement(sqlStatements);
    }

    public void createEIT() {
        System.out.println("Inside createEIT");
        String bgId = new String("");
        String billDate=new String("");
        String p_information_type =new String("IN_REIXXURSEMENT_DETAILS");
        String p_pei_information_category=new String("IN_REIXXURSEMENT_DETAILS");
//        try
//        {
       
    
//            getXXHCMEnterpriseVO1().executeQuery();
//           if(getXXHCMEnterpriseVO1().first()!=null){
//                     if(getXXHCMEnterpriseVO1().first()!=null)
//                        bgId =  (String)getXXHCMEnterpriseVO1().first().getAttribute("Bgid");}
//            System.out.println("bgId: "+bgId);
//          
//            if(bgId !=null || "".equals(bgId)){
//               isXX  = "N";
//                p_information_type =new String("IN_REIXXURSEMENT_DETAILS");
//                 p_pei_information_category=new String("IN_REIXXURSEMENT_DETAILS");
//          }
//            else{
//               isXX  = "Y";
//                p_information_type = "XXTEST_IN_REIXXURSEMENT_DETAILS";
//                p_pei_information_category = "XXTEST_IN_REIXXURSEMENT_DETAILS"; 
//            }
//        }
//        catch(Exception e) {
//            System.out.println("Exception while getting bgid ");
//            p_information_type = "IN_REIXXURSEMENT_DETAILS";
//            p_pei_information_category= "IN_REIXXURSEMENT_DETAILS";
//          getOADBTransaction().writeDiagnostics(e.getMessage(),"ARUMOY",1);
//        }
//       
//        if(isXX .equalsIgnoreCase("Y"))
//        {
//            System.out.println("XX  .. Validate reiXXursments..");
//            validateReiXXursment();
//        }
    if((getOADBTransaction().getBusinessGroupId()==2008 )|| (getOADBTransaction().getBusinessGroupId()==1428) )
      {        p_information_type = "XXTEST_IN_REIXXURSEMENT_DETAILS";
              p_pei_information_category = "XXTEST_IN_REIXXURSEMENT_DETAILS";
              validateReiXXursment();}
      else
      {
        p_information_type = "IN_REIXXURSEMENT_DETAILS";
        p_pei_information_category= "IN_REIXXURSEMENT_DETAILS";
      }
     
      System.out.println(p_information_type);
      System.out.println(p_pei_information_category);
      getOADBTransaction().writeDiagnostics(p_information_type,"ARUMOY",1);
      getOADBTransaction().writeDiagnostics(p_pei_information_category,"ARUMOY",1);
       
        XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
        int personId = getPersonId();
       
        ArrayList<String> sqlStatements = new ArrayList<String>();
        for (int rowIndex = 0; rowIndex < vo.getRowCount(); rowIndex++)
        {
            int vcount = rowIndex+1;
            System.out.println("At Row "+rowIndex+1);
            XXHCMCreateReiXXVORowImpl vor =
                (XXHCMCreateReiXXVORowImpl)vo.getRowAtRangeIndex(rowIndex);
            String reiXXType = vor.getReiXXursementType();
            System.out.println("ReiXXursment Type.."+reiXXType);
            if (reiXXType != null && reiXXType.length() > 0)
            {
                String beneficiaryName = vor.getBeneficiaryName();
                //if (beneficiaryName == null)
                //    beneficiaryName = " ";
                   
              if (vor.getBeneficiaryName() == null) {
                  throw new OAException("Benificery name cannot Be empty:" +
                                        OAException.ERROR);
              }
                String billNuXXer = vor.getBillNuXXer();
                if (billNuXXer == null)
                    billNuXXer = " ";
            //  if (vor.getBillNuXXer() == null) {
               //   throw new OAException("Bill NuXXer Can Not Be empty ");
             // }
                //if (vor.getBillDate() == null) {
                 //   throw new OAException("Bill Date can not be empty :" +
                      //                    billNuXXer, OAException.ERROR);
               // }
                if(vor.getBillDate()==null)
                  billDate ="";
                else
                 billDate = vor.getBillDate().toString();
                
                System.out.println("Bill Date "+billDate);
                String billAmount = vor.getBillAmount();
                if (billAmount == null) {
                    throw new OAException("Bill Amount can not be empty for bill nuXXer:" +
                                          billNuXXer + " on bill date:" +
                                          billDate, OAException.ERROR);
                }
                try {
                    Double billAmountInt = Double.parseDouble(billAmount);
                    if (billAmountInt <= 0) {
                        throw new OAException("Bill Amount for bill nuXXer:" +
                                              billNuXXer + " on bill date:" +
                                              billDate +
                                              " should be more than zero.",
                                              OAException.ERROR);
                    }
                } catch (NuXXerFormatException nex) {
                    throw new OAException("Bill Amount for bill nuXXer:" +
                                          billNuXXer + " on bill date:" +
                                          billDate + " should be numeric.",
                                          OAException.ERROR);
                }
               
             
               
                String empRemarks = vor.getEmployeeComments();
                if (empRemarks == null)
                    empRemarks = " ";
                empRemarks = empRemarks.replace("'", "''");
               
               
               
                String sqlStatement =
                    "declare " + "                  p_eeid nuXXer:=0; " +
                    "                  povn nuXXer:=0; " +
                    "                begin " +
                    "                  hr_person_extra_info_api.create_person_extra_info(" +
                    "                                   p_person_id =>" +
                    personId +
                    "                                  ,p_information_type  =>"+"'"+p_information_type+"'"+
                    "                                  ,p_pei_information_category  =>"+"'"+p_pei_information_category+"'"+
                    "                                  ,p_pei_information1  =>'" +
                    reiXXType + "'" +
                    "                                  ,p_pei_information2  =>'" +
                    beneficiaryName + "'" +
                    "                                  ,p_pei_information3  =>'" +
                    billNuXXer + "'" +
                    "                                  ,p_pei_information4    =>'" +
                    billDate + "'" +
                    "                                  ,p_pei_information5    =>'" +
                    billAmount + "'" +
                    "                                  ,p_pei_information6   =>'Pending Approval'" +
                    "                                  ,p_pei_information7   =>'" +
                    empRemarks + "'" +
                    "                                  ,p_pei_information10  =>0" +
                    "                                  ,p_pei_information11  => FND_DATE.DATE_TO_CANONICAL(FND_DATE.STRING_TO_DATE('31-DEC-4712','DD-MON-YYYY'))"+
                    "                                  ,p_person_extra_info_id =>p_eeid " +
                    "                                  ,p_object_version_nuXXer=>povn); " +
                    "                end;";

                sqlStatements.add(sqlStatement);
                //
            }
        }
        System.out.println("Callin executeStatement ");
        executeStatement(sqlStatements);
    }
    private void executeStatement(ArrayList<String> sqlStatements) {
        OADBTransaction tx = getOADBTransaction();
        for (String sqlStatement: sqlStatements) {
            try {
                PreparedStatement ps =
                    tx.createPreparedStatement(sqlStatement, 0);
                ps.executeUpdate();
            } catch (SQLException e) {
                e.printStackTrace();
               getOADBTransaction().writeDiagnostics(e.getMessage(),"",1);
              throw new OAException("Error", "A SQL Exception has occured",
                                               e);
            }
        }
        tx.commit();
    }
    private int getPersonId() {
        String statement = "SELECT EMPLOYEE_ID FROM FND_USER WHERE USER_ID=:1";
        OADBTransaction tx = getOADBTransaction();
        int userId = tx.getUserId();
        CallableStatement st = tx.createCallableStatement(statement, 1);
        int personId = -1;
        try {
            st.setInt(1, userId);
            st.execute();
            ResultSet rs = st.getResultSet();
            while (rs.next())
                personId = rs.getInt("EMPLOYEE_ID");
        } catch (SQLException e) {
            e.printStackTrace();
            throw new OAException("Error", "A SQL Exception has occured", e);
        }
        return personId;
    }
    public void addRows() {
        addRows(10);
    }
    private void addRows(int nuXXerOfRows) {
        XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
        Row row = vo.last();
        vo.setCurrentRow(row);
        for (int i = 0; i < nuXXerOfRows; i++) {
            XXHCMCreateReiXXVORowImpl vrow =
                (XXHCMCreateReiXXVORowImpl)vo.createRow();
            vrow.setNewRowState(Row.STATUS_INITIALIZED);
            vo.insertRow(vrow);
        }
    }
  public void initContactPicklist() {
        XXHCMContactDetailsVOImpl vo = getXXHCMContactDetailsVO1();
        vo.clearCache();
        int userId = getOADBTransaction().getUserId();
        vo.initQuery(userId);
    }
    public void deleteEIT(String mode) {
        XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
        int deletedRows = 0;
        if (!vo.isDirty()) {
            return;
        }
        Row[] rows = vo.getFilteredRows("Select", "Y");
        ArrayList<String> sqlStatements = new ArrayList<String>();
        for (int i = 0; i < rows.length; i++) {
            XXHCMCreateReiXXVORowImpl vor = (XXHCMCreateReiXXVORowImpl)rows[i];
            String select = vor.getSelect();
            if (select != null && select.equalsIgnoreCase("Y")) {
                if (mode.equalsIgnoreCase("U")) {
                    //System.out.println("In update Mode");
                    int ovn =
                        Integer.parseInt(vor.getObjectVersionNuXXer().toString());
                    int personExtraInfoId =
                        Integer.parseInt(vor.getPersonExtraInfoId().toString());
                    String sqlStatement =
                        "Begin hr_person_extra_info_api.delete_person_extra_info(" +
                        "p_person_extra_info_id =>" + personExtraInfoId +
                        ",p_object_version_nuXXer=>" + ovn + "); end;";
                    //executeStatement(sqlStatement);
                    sqlStatements.add(sqlStatement);
                }
                vo.setCurrentRow(vor);
                vo.removeCurrentRow();
                deletedRows++;
            }
        }
        executeStatement(sqlStatements);
        if (mode.equalsIgnoreCase("C")) {
            addRows(deletedRows);
        }
    }

    /**Container's getter for XXHCMReiXXStateVO1
     */
    public XXHCMReiXXStateVOImpl getXXHCMReiXXStateVO1() {
        return (XXHCMReiXXStateVOImpl)findViewObject("XXHCMReiXXStateVO1");
    }
    public String getStatus() {
        XXHCMReiXXStateVOImpl vo = getXXHCMReiXXStateVO1();
        int userId = getOADBTransaction().getUserId();
        System.out.println("User ID is "+userId);
        vo.initQuery(userId);
        System.out.println("Total Row in XXHCMReiXXStateVO  "+vo.getRowCount());
        System.out.println("Total Row_2 in XXHCMReiXXStateVO  "+vo.getFetchedRowCount());
        XXHCMReiXXStateVORowImpl vor = (XXHCMReiXXStateVORowImpl)vo.first();
       // return vor.getState();
       return "Y";
    }
    /**Container's getter for XXHCMContactDetailsVO1
     */
    public XXHCMContactDetailsVOImpl getXXHCMContactDetailsVO1() {
        return (XXHCMContactDetailsVOImpl)findViewObject("XXHCMContactDetailsVO1");
    }
    /**Container's getter for XXHCMEnterpriseVO1
     */
    public XXHCMEnterpriseVOImpl getXXHCMEnterpriseVO1() {
        return (XXHCMEnterpriseVOImpl)findViewObject("XXHCMEnterpriseVO1");
    }
    public void initEnterpriseVO() {
        getXXHCMEnterpriseVO1().executeQuery();
    }
    /**Container's getter for XXHCMIsBillDateValidVVO1
     */
    public XXHCMIsBillDateValidVVOImpl getXXHCMIsBillDateValidVVO1() {
        return (XXHCMIsBillDateValidVVOImpl)findViewObject("XXHCMIsBillDateValidVVO1");
    }
    /**Container's getter for XXHCMCheckReiXXEligibVO1
     */
    public XXHCMCheckReiXXEligibVOImpl getXXHCMCheckReiXXEligibVO1() {
        return (XXHCMCheckReiXXEligibVOImpl)findViewObject("XXHCMCheckReiXXEligibVO1");
    }
   
    public void validateReiXXursment()
    {
        System.out.println("Inside Validate ReiXXursment..");
        com.sun.java.util.collections.ArrayList ExceptionList = new com.sun.java.util.collections.ArrayList();
        XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
        int personId = getPersonId();
        int exceptionCount =0;
        Double billTotCarFuel               = new Double(0.00);
        Double billTotCarLease              = new Double(0.00);
        Double billTotCarMaintanance        = new Double(0.00);
        Double billTotCommReiXX             = new Double(0.00);
        Double billTotHigherEcucation       = new Double(0.00);
        Double billTotLTA                   = new Double(0.00);
        Double billTotDriverSal             = new Double(0.00);
        Double billTotMedicalReiXX          = new Double(0.00);
        Double billTotCompLeasedAccom       = new Double(0.00);
        Double billTotHardFurnishing        = new Double(0.00);
        Double billTotNotiecepayReiXX       = new Double(0.00);
        String reiXXType                    = new String("");
        String EligibleAmountCF             = new String("");
        String EligibleAmountCM             = new String("");
        String EligibleAmountCR             = new String("");
        String EligibleAmountHR             = new String("");
        String EligibleAmountLTA             = new String("");
        String EligibleAmountDS             = new String("");
        String EligibleAmountMR             = new String("");
        String billDate                     = new String("");
     
        ExceptionList.clear();
        for (int rowIndex = 0; rowIndex < vo.getRowCount(); rowIndex++)
        {
            int vcount = rowIndex+1;
            XXHCMCreateReiXXVORowImpl vor = (XXHCMCreateReiXXVORowImpl)vo.getRowAtRangeIndex(rowIndex);
            reiXXType = vor.getReiXXursementType();
            System.out.println("reiXXType :"+reiXXType);
            if(reiXXType!=null && reiXXType.length()>0)
            {
               // if(vor.getBillDate() == null){
               //  billDate  = "";
               // }
               // else
               // billDate=  vor.getBillDate().toString();
      //   Validating Benificery Name
              String empFullName = getXXHCMEmployeeDetailsVO1().first().getAttribute("EmployeeName").toString();
              empFullName = empFullName.trim();
             
              String benificieryName = vor.getBeneficiaryName();
              System.out.println("benificieryName" +benificieryName);
      
             if(benificieryName != null && benificieryName.length()>1)
             {
               String benificieryName1 = benificieryName.trim();
               System.out.println("benificieryName1" +benificieryName1);
              
               if(!(reiXXType.equalsIgnoreCase("Medical ReiXXursement"))){
                   if(!(empFullName.equalsIgnoreCase(benificieryName1)))
                 {
                   ExceptionList.add(new OAException("Line "+vcount+"Employee can only be Benificiery."));   
                   exceptionCount++;
                 }
               }
             }
             else{
                   System.out.println("Raising Exception For Benificiery Name");
                   ExceptionList.add(new OAException("Line "+vcount+" Benificiery Name is Mandatory."));   
                   exceptionCount++;
                 }
        //   Validating Bill NuXXer
            System.out.println("~~~~~~~Bill NuXXer~~~~");
              String billNuXXer = vor.getBillNuXXer();
              System.out.println("billNuXXer :"+billNuXXer);
                if(billNuXXer==null || billNuXXer.length()<1)
                {
                    if(reiXXType.equalsIgnoreCase("Car Fuel")
                      ||reiXXType.equalsIgnoreCase("Car Maintenance")
                      ||reiXXType.equalsIgnoreCase("Communication ReiXXursement")
                      ||reiXXType.equalsIgnoreCase("Medical ReiXXursement")
                      )
                      {
                          ExceptionList.add(new OAException("Line "+vcount+" Bill NuXXer is Mandatory."));   
                          exceptionCount++;
                      }
                }
               //   Validating Bill Date
                 if(vor.getBillDate() == null){
                  billDate  = null;
                 }
                else
                billDate=  vor.getBillDate().toString();
                if(billDate!=null && billDate.length()>1 ){
                    System.out.println("~~~~~~~BilDate~~~~ ");
                    getXXHCMIsBillDateValidVVO1().setWhereClause(null);
                    getXXHCMIsBillDateValidVVO1().setWhereClauseParams(null);
                    getXXHCMIsBillDateValidVVO1().setWhereClauseParam(0,billDate);
                    getXXHCMIsBillDateValidVVO1().executeQuery();
                    String isBilldateValie = getXXHCMIsBillDateValidVVO1().first().getAttribute(0).toString();
                    System.out.println("isBilldateValie : "+isBilldateValie);
               
                      if(isBilldateValie.equals("N"))
                      {
                          ExceptionList.add(new OAException("Line "+vcount+" Bill Date not in Current Financial Year/Can not Be future Date Please Correct."));   
                          exceptionCount++;
                     
                      }
                   try{
                        getXXHCMDateEligiblityVO1().setWhereClauseParams(null);
                        getXXHCMDateEligiblityVO1().setWhereClauseParam(0,billDate);
                        getXXHCMDateEligiblityVO1().setWhereClauseParam(1,personId);
                        getXXHCMDateEligiblityVO1().executeQuery();
                      }
                      catch(Exception e){
                          System.out.println("Exception Occured during executing getXXHCMDateEligiblityVO1");
                      }
              }
              else
              {
               
                    ExceptionList.add(new OAException("Line "+vcount+" Bill Date is Mandatory."));   
                    exceptionCount++;
                 
                 
              }
              if(vor.getBillDate() != null ){
               if(getXXHCMDateEligiblityVO1().first().getAttribute(0) !=null){ 
               
                String isOldBill = getXXHCMDateEligiblityVO1().first().getAttribute(0).toString();
               
                if (isOldBill.equalsIgnoreCase("N"))
                {
                  ExceptionList.add(new OAException("Line "+vcount+"Bill Date can not be before employee hire date."));   
                  exceptionCount++;
                }
               }
              }
              String billAmount = vor.getBillAmount();
          
            //----   Validating Bill Amount 
            try{               
                Double billAmount1 = Double.parseDouble(vor.getBillAmount());
                if(billAmount !=null){
                    try{
                    getXXHCMEntitleAmountVO1().setWhereClauseParams(null);
                    getXXHCMEntitleAmountVO1().setWhereClauseParam(0,personId);
                    getXXHCMEntitleAmountVO1().setWhereClauseParam(1,reiXXType);
                    getXXHCMEntitleAmountVO1().executeQuery();
                   
                    }catch(Exception e){
                      System.out.println("Exception Occured during executing XXHCMEntitleAmountVO1");
                    }
                
                 try {
                  if(reiXXType.equalsIgnoreCase("Car Fuel")) {
                    billTotCarFuel = billTotCarFuel+Double.parseDouble(vor.getBillAmount());
                    EligibleAmountCF =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
                    System.out.println("~~EligibleAmountCF :"+EligibleAmountCF);
                    }
                 }catch(Exception e){
                   if (billTotCarFuel==0){
                   ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
                                                       billNuXXer + " on bill date:" +
                                                       billDate + " should be more than 0.",
                                                       OAException.ERROR));
                   }
                   else{
                   EligibleAmountCF ="0";
                   ExceptionList.add(new OAException("Eligibility exceed for Car Fuel please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCF));
                   }
                   exceptionCount++;
                 }
                
                try{
                if(reiXXType.equalsIgnoreCase("Car Maintenance"))
                  {
                    billTotCarMaintanance = billTotCarMaintanance+Double.parseDouble(vor.getBillAmount());
                    EligibleAmountCM =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
                  }
                }catch(Exception e){
                  if (billTotCarMaintanance==0){
                  ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
                                                      billNuXXer + " on bill date:" +
                                                      billDate + " should be more than 0.",
                                                      OAException.ERROR));
                  }
                  else{
                  EligibleAmountCM ="0";
                  ExceptionList.add(new OAException("Eligibility exceed for Car Maintenance please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCM));
                  }
                  exceptionCount++;
                }
               
               
                try{
                if(reiXXType.equalsIgnoreCase("Communication ReiXXursement"))
                  { 
                    billTotCommReiXX = billTotCommReiXX+Double.parseDouble(vor.getBillAmount());
                    EligibleAmountCR =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
                  }
                }catch(Exception e){
                  if (billTotCommReiXX==0){
                  ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
                                                      billNuXXer + " on bill date:" +
                                                      billDate + " should be more than 0.",
                                                      OAException.ERROR));
                  }
                  else{
                  EligibleAmountCR ="0";
                  ExceptionList.add(new OAException("Eligibility exceed for Communication ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCR));
                  }
                  exceptionCount++;
                }
               
                try{
                if(reiXXType.equalsIgnoreCase("Higher Education ReiXXursement"))
                  {
                      billTotHigherEcucation = billTotHigherEcucation+Double.parseDouble(vor.getBillAmount());
                      EligibleAmountHR =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
                  }
               }catch(Exception e){
                  if (billTotHigherEcucation==0){
                  ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
                                                      billNuXXer + " on bill date:" +
                                                      billDate + " should be more than 0.",
                                                      OAException.ERROR));
                  }
                  else{
                  EligibleAmountHR ="0";
                  ExceptionList.add(new OAException("Eligibility exceed for Higher Education ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountHR));
                  }
                  exceptionCount++;
                 
                }
         
             try{ 
              if(reiXXType.equalsIgnoreCase("LTA"))
              {
                  billTotLTA = billTotLTA+Double.parseDouble(vor.getBillAmount());
                  EligibleAmountLTA =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
              }
              }catch(Exception e){
                if (billTotLTA==0){
                ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
                                                    billNuXXer + " on bill date:" +
                                                    billDate + " should be more than 0.",
                                                    OAException.ERROR));
                }
                else{
                EligibleAmountLTA ="0";
                ExceptionList.add(new OAException("Eligibility exceed for LTA ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountLTA));
                }
                exceptionCount++;
              }
             
              try{
                if(reiXXType.equalsIgnoreCase("Driver Salary"))
                {
                    billTotDriverSal = billTotDriverSal+Double.parseDouble(vor.getBillAmount());
                    EligibleAmountDS =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
                }
              }catch(Exception e){
                if (billTotDriverSal==0){
                ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
                                                    billNuXXer + " on bill date:" +
                                                    billDate + " should be more than 0.",
                                                    OAException.ERROR));
                }
                else{
                EligibleAmountDS ="0";
                ExceptionList.add(new OAException("Eligibility exceed for Driver Salary please correct and resubmit. XX Eligible Amount :"+ EligibleAmountDS));
                }
                exceptionCount++;
              } 
              
               try{
                if(reiXXType.equalsIgnoreCase("Medical ReiXXursement"))
                {
                    billTotMedicalReiXX = billTotMedicalReiXX+Double.parseDouble(vor.getBillAmount());
                    EligibleAmountMR =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
                }
              }catch(Exception e){
                if (billTotMedicalReiXX==0){
                ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
                                                    billNuXXer + " on bill date:" +
                                                    billDate + " should be more than 0.",
                                                    OAException.ERROR));
                }
                else{
                EligibleAmountMR ="0";
                ExceptionList.add(new OAException("Eligibility exceed for Medical ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountMR));
                }
                exceptionCount++;
              }
            }        
           
            }
            catch(Exception e)
            {
              if (billAmount==null )
              {
                System.out.println("***********inside exception1");
                throw new OAException("Line "+vcount+"Bill Amount is mandatory" );
              }
              else
              {
                System.out.println("***********inside exception2");
                throw new OAException("Bill Amount should be numeric" );
              }
             
            }
               
            }
        }
    // Call Validation VO if any of the bill amount is greater than 0.       
   
        if(EligibleAmountCF !="0" && EligibleAmountCF != null){
        if(billTotCarFuel>0)
        {
            String isError = returnError("Car Fuel",billTotCarFuel,personId);
              System.out.println("isError : "+isError);
            if(isError.equals("Y"))
            {
                ExceptionList.add(new OAException("Eligibility exceed for Car Fuel please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCF));
                exceptionCount++;
            }
         }
        }
      
      
      if(EligibleAmountCM !="0" && EligibleAmountCM != null){ 
        if(billTotCarMaintanance>0)
        {
            String isError = returnError("Car Maintenance",billTotCarMaintanance,personId);
              System.out.println("isError : "+isError);
            if(isError.equals("Y"))
            {
                ExceptionList.add(new OAException("Eligibility exceed for Car Maintenance please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCM));
                exceptionCount++;
            }
        }
    } 
      if(EligibleAmountCR !="0" && EligibleAmountCR != null){
        if(billTotCommReiXX>0)
        {
            String isError = returnError("Communication ReiXXursement",billTotCommReiXX,personId);
              System.out.println("isError : "+isError);
            if(isError.equals("Y"))
            {
                ExceptionList.add(new OAException("Eligibility exceed for Communication ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCR));
                exceptionCount++;
            }
        }
      } 
       
      
       
       if (EligibleAmountHR !="0" && EligibleAmountCF != null){
        if(billTotHigherEcucation>0)
        {
            String isError = returnError("Higher Education ReiXXursement",billTotHigherEcucation,personId);
              System.out.println("isError : "+isError);
            if(isError.equals("Y"))
            {
                ExceptionList.add(new OAException("Eligibility exceed for Higher Education ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountHR));
                exceptionCount++;
            }
        }
       }
      
      
      if(EligibleAmountLTA !="0" && EligibleAmountLTA != null){
        if(billTotLTA>0)
        {
            String isError = returnError("LTA",billTotLTA,personId);
              System.out.println("isError : "+isError);
            if(isError.equals("Y"))
            {
                ExceptionList.add(new OAException("Eligibility exceed for LTA ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountLTA));
                exceptionCount++;
            }
        }
      }
     
      if(EligibleAmountDS !="0" && EligibleAmountDS != null){
        if(billTotDriverSal>0)
        {
            String isError = returnError("Driver Salary",billTotDriverSal,personId);
              System.out.println("isError : "+isError);
            if(isError.equals("Y"))
            {
                ExceptionList.add(new OAException("Eligibility exceed for Driver Salary please correct and resubmit. XX Eligible Amount :"+ EligibleAmountDS));
                exceptionCount++;
            }
        }
      }
     
      if(EligibleAmountMR !="0" && EligibleAmountMR != null){
        if(billTotMedicalReiXX>0)
        {
            String isError = returnError("Medical ReiXXursement",billTotMedicalReiXX,personId);
              System.out.println("isError : "+isError);
            if(isError.equals("Y"))
            {
                ExceptionList.add(new OAException("Eligibility exceed for Medical ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountMR));
                exceptionCount++;
            }
        }
      }   
     
   
    System.out.println("Exception Size is "+ExceptionList.size());
    System.out.println("Error Count is : "+exceptionCount);
    if(ExceptionList.size()>0)
       OAException.raiseBundledOAException(ExceptionList);
    }     // End Validate ReiXXursment..
   
    public String returnError(String reiXXType, Double billTotCarFuel, int personId)
    {
        try
        {
        getXXHCMCheckReiXXEligibVO1().setWhereClauseParams(null);
        getXXHCMCheckReiXXEligibVO1().setWhereClauseParam(0,reiXXType);
        getXXHCMCheckReiXXEligibVO1().setWhereClauseParam(1,billTotCarFuel);
        getXXHCMCheckReiXXEligibVO1().setWhereClauseParam(2,personId);
        getXXHCMCheckReiXXEligibVO1().executeQuery();
       
        String isError = getXXHCMCheckReiXXEligibVO1().first().getAttribute(0).toString();
        return isError;
        }
        catch(Exception e)
        {
           return "N" ;
        }
   }
  public void initBtnDiablsVO(){
      getXXHCXXtnDisableVO1().executeQuery();
  }
 
  public String getBtnStatus()
  {
    try{ 
        String btnStatus= getXXHCXXtnDisableVO1().first().getAttribute(0).toString();
         System.out.println("Button Status"+btnStatus);
        return btnStatus;
    }catch(Exception e)
    {
      return "N";
    }
   
  }
  /**Container's getter for XXHCMDateEligiblityVO1
   */
  public XXHCMDateEligiblityVOImpl getXXHCMDateEligiblityVO1()
  {
    return (XXHCMDateEligiblityVOImpl)findViewObject("XXHCMDateEligiblityVO1");
  }
  /**Container's getter for XXHCMEntitleAmountVO1
   */
  public XXHCMEntitleAmountVOImpl getXXHCMEntitleAmountVO1()
  {
    return (XXHCMEntitleAmountVOImpl)findViewObject("XXHCMEntitleAmountVO1");
  }
  /**Container's getter for XXHCXXtnDisableVO1
   */
  public XXHCXXtnDisableVOImpl getXXHCXXtnDisableVO1()
  {
    return (XXHCXXtnDisableVOImpl)findViewObject("XXHCXXtnDisableVO1");
  }
  /**Container's getter for XXHCMMedBenDetailsVO1
   */
  public XXHCMMedBenDetailsVOImpl getXXHCMMedBenDetailsVO1()
  {
    return (XXHCMMedBenDetailsVOImpl)findViewObject("XXHCMMedBenDetailsVO1");
  }
  /**Container's getter for XXHCMPrintDetVO1
   */
  public XXHCMPrintDetVOImpl getXXHCMPrintDetVO1()
  {
    return (XXHCMPrintDetVOImpl)findViewObject("XXHCMPrintDetVO1");
  }
}