1 Reply Latest reply: Jul 14, 2013 2:15 PM by SarojaKandepuneni RSS

    Validating presence of Response Comments while responding to notification via email

    user5149250

      Hello All,

       

      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.

       

      with regards

        • 1. Re: Validating presence of Response Comments while responding to notification via email
          SarojaKandepuneni

          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.

          http://www-apps.us.oracle.com/wf/doc/wfr1213/wfapi/html/T341351T341380.htm#I_notfunc

           

          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
                l_count number;
              begin
                if funcmode in ('TRANSFER','FORWARD') then
                  select count(1) into l_count
                  from WF_ROLES
                  where WF_ENGINE.context_new_role in ('SPIERSON','CBAKER');
                        --and/or any other conditions
                  if l_count<1 then
                    WF_CORE.TOKEN('ROLE', WF_ENGINE.context_new_role);
                    WF_CORE.RAISE('WFNTF_TRANSFER_FAIL');
                  end if;
                end if;
              end Post_Notification;


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