Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

eBenefits: Life Events Approvals

Updating the Document Upload status icon based on approvals


ORACLE WHITE PAPER | MARCH 2015
Disclaimer
The following is intended to outline our general product direction. It is intended for information
purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any
material, code, or functionality, and should not be relied upon in making purchasing decisions. The
development, release, and timing of any features or functionality described for Oracles products
remains at the sole discretion of Oracle.

[EBENEFITS: LIFE EVENTS APPROVALS


Table of Contents

Purpose of the Workaround 2

Guidelines to implement the workaround 4

Summary of the application objects 5

All of the object changes are required, except for the page peoplecode change,

which is optional. 5

Details of the modified application objects 6

Validate the workaround code changes 17

1 | EBENEFITS: LIFE EVENTS APPROVALS


Purpose of the Workaround
The 9.2 eBenefits Life Event feature allows an employee to use a guided process, to complete a list of
task(s), which are related to their life event change i.e. having a baby, getting married etc..
The guided process displays a list of task(s) (called action items) that employees can review/complete,
in order to complete their life event.

Within the life event guided process, is a document upload action item. The document upload action
item allows the employee to attach a document that is required for their life event process i.e. birth
certificate for an I had a baby life event.

The document can be marked as needing approval from the Benefits Administrator, based on
selecting the approve document(s) checkbox on the Life Event Rules Table page.

Currently, if a document that needs approval is uploaded, the document upload status will have a
value of complete and the icon will display as a green circle with a white check mark.
When actually, the status should be in-process (icon with green outline w/white inner), since the
Benefits Administrator has not approved the document.

WORKAROUND CODE for:

Document upload status and icon

After applying the workaround code listed on pages 6 - 16, the document upload status will remain as
in-process until the document is approved by the Benefits Administrator.

After the document is approved, and the employee re-enters their life event, the document upload
status will have a value of complete and the icon will display as a green circle with a white check
mark.

NOTE: The workaround code changes will only apply to:


1. Newly uploaded documents. If an employee uploaded a document prior to the workaround
code, the document upload icon will still display as complete.
It must be a newly uploaded document for the workaround code to correctly display the
appropriate status and icon.
2. The workaround code only applies to the latest document uploaded for the life event. The
document upload feature works based on 1 document per life event type.

Complete pushbutton on the Event Completion and Exit page

The workaround code will also address the case where, the employee completes their Life Event using
the complete pushbutton on the Event Completion and Exit page.

Currently, if a document that needs approval is uploaded, the status of the document is set to
complete, after clicking on the complete pushbutton. This causes the document to bypass the
approval process.
After applying the workaround code, if a document needs approval, and the employee click on
complete a message will display. The message will inform the employee that an approval is needed.

2 | EBENEFITS: LIFE EVENTS APPROVALS


The following table provides definitions for some of the common terms that are used in this guide.

TABLE [X]. COMMON TERMS

TERM DEFINITION

Action Items Defines the action the employee must take on the Life Event pagelet. Action items can be tied to a
transaction page such as a document upload, URL link, or state external websites.

Action Item Icon Icon for the action item, on the Life Event pagelet, which indicates the action item status

Approvals Process Action taken by Benefits Administrator on a document uploaded by an employee, which needs
approval

3 | EBENEFITS: LIFE EVENTS APPROVALS


Guidelines to implement the workaround
The pages listed below will provide:

o High-level summary of the application objects that must be modified for the workaround

o Details of the code changes needed for each application object. The User implementing the
workaround should follow each these steps:

1. Locate the area where the peoplecode will be modified (code in bold text).

2. Copy and paste the code from this document into the application object (code in BLUE
text).

3. Validate the peoplecode changes.

4. Save the modified application object.

4 | EBENEFITS: LIFE EVENTS APPROVALS


Summary of the application objects

All of the object changes are required, except for the page peoplecode change, which is optional.

1. Record
BN_LE_ATTACH.
o Modify the record to add 2 fields to track the document upload action item.

2. Record peoplecode
FUNCLIB_W3EB.APPROVAL_INFO FieldFormula
o Add a new function, which will store the action item ID of documents being selected for
approval on Benefits > Approve Document Upload page. The ID will be stored in an
array.

o New function that will set the document upload status = complete (icon w/check mark),
on the Life Event pagelet.

W3EB_LE_WRK.COMPLETE_STS_IND.FieldChange
o New code will display message, when the employee attempts to complete a Life Event
(event completion and exit action item/page), and their uploaded document still needs
approval.

3. Page peoplecode
HR_ATT_DD_HDR.Activate
o Add code to set add attachment pushbutton to enable = false, when the uploaded
document has been approved. Setting the pushbutton = false, will not allow other
documents to be uploaded for the life event.

4. Component peoplecode
HR_ATT_DD
W3EB_ATTACH
o Add code, when document is submitted and needs approval, set the document upload
icon to in-progress (outer circle is green and inner is white).

o Add code, when document is submitted and needs approval, update the record
BN_LE_ATTACH with the document upload action item ID.

o Add code to get the document upload action item ID.

5. Application package peoplecode


W3EB_APPR_EVT_HNDLR
W3EB_LIFE_EVENT
o Add code, after a documented is approved, execute the function to set the icon =
complete.

o Add code, to set the document upload icon equal to in-progress or complete, based on
variables within the code.

5 | EBENEFITS: LIFE EVENTS APPROVALS


Details of the modified application objects

1. Record: BN_LE_ATTACH
Modify: Add 2 existing fields to the record.

o File > Open > Record > BN_LE_ATTACH > OPEN


o Insert the 2 fields, after the field W3EB_APPR_STATUS
Position the cursor on the field W3EB_APPR_STATUS
Insert > Field > LE_TEMPLATE_ID
Insert > Field > LE_ITEM_ID
o Save the record change: File > Save
o Alter the record: Build > Current Definition >
Options = Alter Table, Execute and Build script
Click Build pushbutton
o Build results should be:
1 record processed, 0 errors and 0 warnings

2. Record Peoplecode: FUNCLIB_W3EB.Approval_Info FieldFormula


Add new code

o File > Open > Record > FUNCLIB_W3EB > OPEN


o Click on Peoplecode Display icon
o Double click on Approval_Info FFo

o After the import statements add this new import statement:


import W3EB_LIFE_EVENT:ItemStatus;

o Locate this code Global boolean &DelegateUsed


Replace it with this code:
Global boolean &DelegateUsed, &docAppr;

o After Global boolean &DelegateUsed, &docAppr


Add this code:
Global array of string &ApprItems;

o Locate this code Component date &action_dt_ss;


Add this code below it: Component W3EB_LIFE_EVENT:ItemStatus
&CompleteStatus;

o Locate this code Function AWEpostSave()


Add this code after the End-Function; statement

Rem this function is used to store the itemID of rows that are being approved;
Function RowsToApprove()

&ApprItems = CreateArrayRept(" ", 0);

For &i = 1 To &RSAppr.ActiveRowCount


If &RSAppr(&i).W3EB_LE_WRK.APPROVED.Value = "Y" Then

6 | EBENEFITS: LIFE EVENTS APPROVALS


&pushItemID = &RSAppr(&i).BN_LE_ATTACH.LE_ITEM_ID.Value;

If &ApprItems.Len >= 1 Then

If &ApprItems.Find(&pushItemID) = 0 Then
&ApprItems.Push(&pushItemID);
End-If;
End-If;

If &ApprItems.Len = 0 Then
&ApprItems.Push(&pushItemID);
End-If;

End-If;

End-For;

End-Function;

o Locate this code Function PrepApproval(&pAction As string); and then locate


this statement If &returnvalue = %MsgResult_Yes Then

Add this code below it:

rem Store itemID in an array ;


If &pAction = "A" Then
RowsToApprove();
End-If;

o Locate this code Function SetupDelegations


Add this code after the End-Function; statement

Function DocUploadIcon(&FindItemID)

If &ApprItems.Len > 0 Then

For &p = 1 To &ApprItems.Len

If &ApprItems [&p] = &FindItemID Then;


&docAppr = False;

SQLExec("select A.W3EB_APPR_STATUS from PS_BN_LE_ATTACH A


where A.le_item_id = :1 and A.SEQ_NBR = (SELECT MAX(b.seq_nbr) FROM
PS_BN_LE_ATTACH B WHERE B.LE_ITEM_ID = A.LE_ITEM_ID)", &FindItemID,
&aprStatus);

If &aprStatus = "AP" Then

&docAppr = True;

&CompleteStatus = create W3EB_LIFE_EVENT:ItemStatus();

7 | EBENEFITS: LIFE EVENTS APPROVALS


&CompleteStatus.ItemPostProcess(&list_id, &FindItemID, &Nodename);

End-If;

End-If;

End-For;

End-If;

End-Function;

o Click on the Validate Syntax icon.

o SAVE the record peoplecode.

8 | EBENEFITS: LIFE EVENTS APPROVALS


3. Record Peoplecode: W3EB_LE_WRK.COMPLETE_STS_IND.FieldChange

o File > Open > Record > W3EB_LE_WRK > Open


o Click on Peoplecode Display icon
o Double click on Complete__STS_IND FCh

o Locate the code import W3EB_LIFE_EVENT:ListStatus;


Add this code after the import statement:
Global Record &LEGlobal_Rec;

o Locate the code Component boolean &checkreq, &benefitcomplete;


Add this code below the above code:

Local number &needapprCNT;

Rem check if document needing approval is approved;


&LIFE_EVENT_VALUE = &LEGlobal_Rec.LIFE_EVENT_TYPE.Value;

&list_Id = &LEGlobal_Rec.LE_INSTANCE_ID.Value;

&Item_Id = &LEGlobal_Rec.LE_ITEM_ID.Value;

SQLExec("SELECT COUNT(*) FROM PS_BN_LE_ATTACH A WHERE A.EMPLID =


:1 AND A.LIFE_EVENT_TYPE = :2 AND A.W3EB_APPR_STATUS = 'NA' AND
LE_TEMPLATE_ID = :3 AND A.SEQ_NBR = (SELECT MAX(B.SEQ_NBR) FROM
PS_BN_LE_ATTACH B WHERE A.EMPLID = B.EMPLID AND
A.LIFE_EVENT_TYPE = B.LIFE_EVENT_TYPE AND A.LE_TEMPLATE_ID =
B.LE_TEMPLATE_ID AND B.W3EB_APPR_STATUS = 'NA') ", %EmployeeId,
&LIFE_EVENT_VALUE, &list_Id, &needapprCNT);

If &needapprCNT >= 1 Then

Error (MsgGet(3001, 1144, "Message not found in Catalog"));


End-If;

o Click on the Validate Syntax icon.


o SAVE the record peoplecode.

9 | EBENEFITS: LIFE EVENTS APPROVALS


4. Page Peoplecode: HR_ATT_DD_HDR.Activate

o File > Open > Page > HR_ATT_DD_HDR > Open


o View > View Page Peoplecode

o Locate the code:


If &RS_DocDefns(&JJ).DERIVED_HR_ATT.W3EB_APPR_STATUS.Value = "AP"
Or
&RS_DocDefns(&JJ).DERIVED_HR_ATT.W3EB_APPR_STATUS.Value = "CP"
End-If;

Add this code below the above code:

Rem this will prevent other document from being added when the employee life event
document has been approved;
If &RS_DocDefns(&JJ).DERIVED_HR_ATT.W3EB_APPR_STATUS.Value =
"AP" Then
DERIVED_HR_ATT.HR_ATT_ADD_PB.Enabled = False;
End-If;

o Click on the Validate Syntax icon.


o SAVE the page peoplecode.

10 | EBENEFITS: LIFE EVENTS APPROVALS


5. Component peoplecode: HR_ATT_DD.SavePostchange

o File > Open > Component > HR_ATT_DD > Open


o View > View Peoplecode
o Use the dropdown and select SavePostChange

o At the beginning, add this code:


import W3EB_LIFE_EVENT:ItemStatus;

Global Record &LEGlobal_Rec;

o Locate this code: Component boolean &LaunchAWE, &BNrowsToBeDeleted;

Add this code below the above code:

Component string &list_id, &item_id, &Nodename;

Component W3EB_LIFE_EVENT:ItemStatus &CompleteStatus;

o Locate this code: &LaunchAWE = False;

Add this code below the above code:

&list_id = &LEGlobal_Rec.LE_INSTANCE_ID.Value;
&item_id = &LEGlobal_Rec.LE_ITEM_ID.Value;

&CompleteStatus = create W3EB_LIFE_EVENT:ItemStatus();


&CompleteStatus.ItemPostProcess(&list_id, &item_id, &Nodename);

o Click on the Validate Syntax icon.


o SAVE the peoplecode.

11 | EBENEFITS: LIFE EVENTS APPROVALS


6. Component peoplecode: HR_ATT_DD.SavePreChange

o File > Open > Component > HR_ATT_DD > Open


o View > View Peoplecode
o Use the dropdown and select SavePreChange

o Locate this code: Global date &GBL_LifeEventDate;

Add this code below the above code:

Global Record &LEGlobal_Rec;


Global boolean &update_status;

o Locate this code: &LaunchAWE = False;

Add this code below the above code:


&update_status = False;

o Locate this code: &att_Dat_rec.W3EB_APPR_STATUS.Value = "NA";

Add this code below the above code:


&att_Dat_rec.LE_TEMPLATE_ID.Value = &LEGlobal_Rec.LE_INSTANCE_ID.Value;
&att_Dat_rec.LE_ITEM_ID.Value = &LEGlobal_Rec.LE_ITEM_ID.Value;

o Locate this code: &att_Dat_rec.Update();


Add this code below the above code:
&update_status = True;

o Click on the Validate Syntax icon.


o SAVE the peoplecode.

12 | EBENEFITS: LIFE EVENTS APPROVALS


7. Component peoplecode: W3EB_ATTACH.PostBuild

o File > Open > Component > W3EB_ATTACH > Open


o View > View Peoplecode

o After the import statements, add this code:


Declare Function GetPTAIparms PeopleCode
FUNCLIB_W3EB.ACTION_ITEM_FUNC FieldFormula;

o Locate this code: Local string &LifeEventType, &MyRole, &PlanType;

Add this code below the above code:


GetPTAIparms();

o Click on the Validate Syntax icon.


o SAVE the peoplecode.

13 | EBENEFITS: LIFE EVENTS APPROVALS


8. Application package peoplecode: W3EB_APPR_EVT_HNDLR

o File > Open > Application package > W3EB_APPR_EVT_HNDLR > Open
o Double click on appEventHandler

o Locate this code: Declare Function CreateTrigger

Add this code below the above code:


Declare Function DocUploadIcon PeopleCode FUNCLIB_W3EB.APPROVAL_INFO
FieldFormula;

o Locate this code: method OnHeaderApprove

Within method OnHeaderApprove:

o Locate this code: Local string &life_event_type, &emplID


Replace it with this code:
Local string &life_event_type, &emplID, &FindItemID;

o Locate this code: &emplID = &W3EBRec.EMPLID.Value;


Add this code below the above code:
&FindItemID = &W3EBRec.LE_ITEM_ID.Value;

o Locate this code: CreateTrigger(&life_event_type, &emplID);


Add this code below the above code:
DocUploadIcon(&FindItemID);

o Click on the Validate Syntax icon.


o SAVE the peoplecode

14 | EBENEFITS: LIFE EVENTS APPROVALS


9. Application package peoplecode: W3EB_LIFE_EVENT

o File > Open > Application package > W3EB_LIFE_EVENT > Open
o Double click on IPStatus

o Locate code: Global boolean &FromEnrSummary


Replace the code with: Global boolean &FromEnrSummary, &update_status;

o Locate the IF statement:


If &ObjAItem.Status <> "4" Then
&ObjAItem.Status = "2";
&ObjAItem.PercCompl = 50;
End-If;

o Add this IF statement below the above IF statement:


If &ObjAItem.ServiceId = "EF_W3EB_ATTACH" And
&update_status Then

&ObjAItem.Status = "2";
&ObjAItem.PercCompl = 50;
End-If;

o Click on the Validate Syntax icon.


o SAVE the peoplecode

15 | EBENEFITS: LIFE EVENTS APPROVALS


10. Application package peoplecode: W3EB_LIFE_EVENT

o File > Open > Application package > W3EB_LIFE_EVENT > Open
o Double click on ItemStatus

o Locate the code: Global boolean &ATTACH_DOC


Replace the code with:
Global boolean &ATTACH_DOC, &update_status, &docAppr;

o Locate the code: method ItemPostProcess

Within method ItemPostProcess


o Locate the last IF statement

o Add this code after the last IF statement:

If &item.ServiceId = "EF_W3EB_ATTACH" And


&update_status Then
&item.Status = "2";
&item.PercCompl = 50;
&return = &item.save();
End-If;

rem Used for approval of the employee document;

If &item.ServiceId = "EF_W3EB_ATTACH" And


&docAppr Then
&item.Status = "4";
&item.PercCompl = 100;
&return = &item.save();
End-If;

o Click on the Validate Syntax icon.


o SAVE the peoplecode.

16 | EBENEFITS: LIFE EVENTS APPROVALS


Validate the workaround code changes

o As an employee, start a life event, where approve document is checked on the Life
Event Rules page i.e. the pre-delivered adoption life event.
o Using the document upload action item, upload a document and SAVE the page
RESULTS: The document upload icon will display as green circle with white inner
color
o Click Continue Later and then re-enter the life event.

RESULTS: The document upload icon will still display as green circle with white
inner color
o Click on the Event Completion and Exit action item. Then click on the complete
pushbutton.
RESULTS: Message displays Your record will open for election once your request is
approved
o Log out and log in as Benefits Admin, and navigate to Benefits > Approve Document
Upload
o Approve the needs approval document.
o Log out and log in to the employee life event: Self Service > Benefits > Life Events >
Continue my Event
RESULTS: The document upload icon will display as green circle with a white check
mark.
o Click on the Event Completion and Exit action item. Then click on the complete
pushbutton.

RESULTS: The life event will be marked as complete.

17 | EBENEFITS: LIFE EVENTS APPROVALS


Oracle Corporation, World Headquarters Worldwide Inquiries
500 Oracle Parkway Phone: +1.650.506.7000
Redwood Shores, CA 94065, USA Fax: +1.650.506.7200

18 | EBENEFITS: LIFE EVENTS APPROVALS


CONNECT W ITH US

blogs.oracle.com/oracle Copyright 2015, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only, and the
contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other
warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or
facebook.com/oracle fitness for a particular purpose. We specifically disclaim any liability with respect to this document, and no contractual obligations are
formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any
twitter.com/oracle means, electronic or mechanical, for any purpose, without our prior written permission.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
oracle.com
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and
are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are
trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.0115

White Paper Title


March 2015

2 | EBENEFITS: LIFE EVENTS APPROVALS

You might also like