How to Send Reminder Notification to Approver

Embed Size (px)

DESCRIPTION

How to Send Reminder Notification to Approver.

Citation preview

How to Send Reminder Notification to Approver

Oracle Workflowprovide us several standrad functions which helps us to implement our business requirement.

Here we will discuss about two such standard functions to implement our requirement.Basic RequirementOur old requirement looks like"when a person applies for a leave it should go his/her supervisor for approval.Approver must be able to provide his/her approval/rejection comments. The comments must be entered by the approver while rejecting the leave requisition.If he/she rejects the leave requisition without entering comments, then it should raise an application error.If he/she approves the requisition it should be optional.Approver must also be able to select theOrganization Leave Typefrom a list of values . If the leave gets rejected, dont store any information in database.The approver should able to view/edit the person "Special Information Types" before approving the leave request.Before approving the sick leave request the approver must able to see the submitted medical document."

Apart from the above requirement, We will introduce an additional requirement that "A reminder notification(email) must go to approver in every2 daysuntill he/she takes action (Approve or Reject) on the leave notification."

Solution ApproachFirst we willdesign discuss about the seeded function that we are going to use.

1)Compare TextThis function is use to compare the value of two Activity attribute.Test Value:- A value which will be compared with the referenced value.This can be a constant value or can reference a item attribute.Reference Value:-a text value which will be used as a reference value to compare.This can also be a constant value or can reference a item attribute.

The comparison activities use theComparison lookup type (Internal Name:-WFSTD_COMPARISON) for a result code. Possible values are "Greater Than," "Less Than," "Equal," or "Null,". You can guide your workflow process based on how the value of an item type attribute compares to a given value that one set.1)WaitThis function pauses the process for the time that we specified in the activity attribute during the design of the workflow.The wiat functionality can work for a) A specific date b) A given day of Month c) A given day of the week d) Relative time( A period of time after this activity is encountered).

Note:-1) When the process hit the Wait function, it goes to Deferred status. We must run background engine for deferredactivities to determine when the wait time has passed. The background engine then completes the Wait activity so that the process can continue.1) All the standard functions are available under itemtypeStandard(Internal NameWFSTD).

Now Lets design/enhance the existing workflow model for the same.

1) Create a item attribute of type TextInternal Name:- REMINDER_NOTIF_VAL_ATTRDisplay Name:- Reminder Notification Attribute ValType:- Text

This attribute will be set when approver acts on his/her notification. Intially the value of the attribute will remain Null. Thus untill approver acts on his/her notification, it will remain null and follow the path as shown above in the flowchart,i.e, will send notification.

2) Loadthe itme type "standard" (Internal Name:- WFSTD)workflow defintionin a separate workflow builder window.To copy the standrad functions please follow the following sequence. a) Copy(ctrl+C) the following lookup type Wait Mode (Internal Name:-WFSTD_WAIT_MODE) from the standard workflow(WFSTD) and Paste(ctrl+v) it in our customworkflow.b) Follow the same steps for "Day of Month"(WFSTD_DAY_OF_MONTH), "Day of Week"(WFSTD_DAY_OF_WEEK),"Comparison"(WFSTD_COMPARISON)

Copying of these lookup types is required as this lookup types are referenced by Wait and Comparison function.

3) Now in the similar way copy the Wait(Internal Name:-WAIT) and "Compare Text" (Internal Name:-COMPARETEXT) function.

4) Now drag and drop the copied function from navigator window to process window.

5) Now double click on the WAIT function in process window--> Go to "Node Attribute Tab" Select the Node attribute 1) Wait Mode:- Select value as "Relative Time" from the drop down2) Relative Time:- Enter the Value as 2 ( since as per business requirement business requirement, every 2 days we have to send the reminder).

6) Similarly Double click on COMPARETEXTfunction --> Go to Node Attribute a) SelectNode attribute "Test Value" --> The "Test Value" will determine whether approver acted on the notification or not, so we need reference a item attributewhich will be set when approver approves/Reject notification.Select Type:- Item Attribute Value:- Select the item attribute "Reminder Notification Attribute Val"(Internal Name:-REMINDER_NOTIF_VAL_ATTR)

b) Select Node Attribute "Reference Value":- This is the reference value, hence keep this static and enter "APPROVE_REJECT" in the Value field.

7) Now Create a notification. The performer of the notification will be same as the performer of the leave notification.Internal Name:- REMINDER_EMAIL_NOTIFDisplay Name:- Reminder Notification

Remember:- This is just a reminder notification/email,hence it will be a FYI notification.Hence no Result type is required.

8) Now create a message with the subitable text and subject Line

Internal Name:- REMINDER_MSG

Display Name:- Reminder Message

Subject :- Reminder:- Leave Approval for Person &REQUESTER_EMP_NAME(&REQUESTER_EMP_NO) is pending with you.

Body:- Dear &SUP_EMP_NAME,
The person &REQUESTER_EMP_NAME(&REQUESTER_EMP_NO) has submitted leave requisition. Request you please take necessary action on the requisition.
RegardsHR Team

As we did earlier(Refer earlier workflow tutorial/s) copy the desired item attribute and make them as message attribute (Highlighted in blue above).

9) Attach the message with the newly created notification.

10) Now join all the nodes in the process window as shown below

11) Validate and save your work in database.

Pl/SQL PART12) we have created an itemattributeof type Text which we need to set once approver acts on notification.We will use the existing post notification function used in approval notification "Test Leave Notification"(Internal Name:-XX_TEST_LEAVE_NOTIF).[for details of Post Notification function see the previous tutorial]

Now Compile your code and test the functionality.

Reminder notificationHere is a sample reminder notification that we created with the help of our above said modifications

Note:- 1) Ensure that Workflow background process is scheduled and running.2) Once approver approves/reject theleave request, the wait function willautomatically gets completed.Workflow will take care of that.See the screen shot below.

3) The point 2 holds true only when after execution of approval it hits "End" function. If it doesn't hit "END", Then we have to usecombination of OR and AND function as shown below.[Only flow diagram is given.Rest is kept unsolved for reader's interest...]

4) There are several ways to implement this requirement. We have discussed here about only one possible solution.If you are planning to modify the existing workflow, sometime it may not be possible to add anything in the existing Post Notification function. The attribute can be set by adding a custom function immediately after approval and/or rejection of the notification.