We need some help with this. We are having a validation on the Notification using PL/SQL where we validate that when the user Rejects the notification without entering any Comments in the Response section/text area then we would throw an error message : "Please Enter Rejection Comments".
This works fine when someone accesses the notification from the Notification Queue within Oracle Applications from Workflow Administrator and when he clicks the Reject Button without entering any rejection comments it would do the PL/Sql function validation and check for notification response using below (wf_notification.getattrtext) and throw error message and notification won't go to Closed status.
wf_notification.getattrtext (notification_id, 'WF_NOTE') : this would give the Comments entered for the given notification id by the user who is rejecting the notification
The issue is happening when the same user tries to Reject the Notification which they would be received via email as well ( because Oracle user setup & Oracle HRMS setup for the same employee would have the email address linked to it ) . In the email notification when the user clicks the Reject hyperlink then the email response window opens up and without entering any Comments , they click the Send button in the Outlook email client and the notification gets Closed status.
Is there any way we could handle this requirement when Rejecting any Notification via email to validate for the presence of Response Comments.
Could someone please review and help us here with this problem.
You can define a post-notification function that validates the comments fields and throws the error if its empty. The post-notification function is a PL/SQL procedure having the same API standards as that of function activities.
You can refer to workflow Developer guide for more details about defining the post notification function.
Simple example for 'TRANSFER' or 'FORWARD' operation is given below.
procedure Post_Notification (itemtype in varchar2,
itemkey in varchar2,
actid in varchar2,
funcmode in varchar2,
resultout in out nocopy varchar2) is
if funcmode in ('TRANSFER','FORWARD') then
select count(1) into l_count
where WF_ENGINE.context_new_role in ('SPIERSON','CBAKER');
--and/or any other conditions
if l_count<1 then
When a recipient responds, the Workflow Engine initially runs the post-notification function in VALIDATE mode which allows you to validate the response values before accepting the response. So you need to add your comments value validation for 'VALIDATE' mode (like funcmode in ('VALIDATE') )