Monday, 11 July 2011

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')

No comments:

Post a Comment