7-How To Take Approver's Input - Making Approver Comments A Mandatory Free Text Field - Shareapps4u
7-How To Take Approver's Input - Making Approver Comments A Mandatory Free Text Field - Shareapps4u
Home Learning Topic > 3) Workflow Tutorial > e) How To Take Approver's Input >
Learning Topic
1) Flexfield
10) How to Add
Third Party Web
Page Link to Oracle
Application Web
Page
11) How to Create
Global User Defined e have already discussed how we can provide a free text field to approver. Now Our aim is to make the field mandatory.
Table(UDT)
12) How to Add
Element Value in Basic Requirement
Oracle Online
Payslip
13) How to ur 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 comments for
Enable/Disable
approval or rejection of the requisition(comments optional). Approver must also be able to select the Organization Leave Type from a list of values . If the leave gets
Concurrent Program
Parameter rejected, don’t store any information in database."
Dynamically
2) XML Publisher Now our changed requirement will looks like
3) Workflow Tutorial "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
a) ABC of
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
Workflow
application error.If he/she approves the requisition it should be optional.Approver must also be able to select the Organization Leave Type from a list of values . If the
b) Requirement
Mapping & leave gets rejected, don’t store any information in database."
Custom
Workflow Design
c) Custom
Design Appraoch
Workflow
Development
d) Triggering a ollowing interpretation can be drawn from the above requirement.
custom workflow
1) The comment field is mandatory while rejecting the leave request.
e) How To Take
Approver's Input 2) The comment field is remain as optional if he/she approves the requisition.
a) How To
Take From the above derivation, we are clear that when approver entered his/her response(on button click), we have to check whether he has entered some value in the text
Approver's
Input- box or not.
Providing a To implement the above business case we have to learn "Post Notification Function"( commonly known as PNF).
Free Text PNF is nothing but a pl/sql procedure that will be called on button click. The procedure is attached with the notification.
field
b) How To Let us first create a procedure then we will attach the same with the notification.
Take
Approver's
Input- 1) Any procedure that is attached with an activity(notification/Function activity) must have following input parameter.We need not to bother about how the parameter values
Providing a will be passed, the workflow engine takes the responsibility to pass the parameter value when it is called.
Drop Down
field ITEMTYPE IN VARCHAR2
c) How To ITEMKEY IN VARCHAR2,
Take ACTID IN NUMBER,
Approver's
FUNCTMODE IN VARCHAR2,
Input-
Making RESULT_OUT IN OUT VARCHAR2
approver
comments
a
mandatory
Free Text
field
d) How To
Take
Approver's
Input-
Launching
Oracle Form
from
Workflow(f…
Approver's
Notification)
f) How To Attach
Document With 2) Any procedure that is attached with an activity(notification/Function activity) must have a error handling section.if an exception occurs,so that you can include context
Notification
information in the error stack to help you locate the source of an error
g) How To Send
Notification To
Multiple Users Wf_Core.CONTEXT(<Package Name>,
h) How to Send <procedure name>,
Reminder itemtype,
Notification to
itemkey,
Approver
actid,
4) Form
Personalization - functmode);
How to Change Field RAISE;
Name
5) iRecruitment
Data Migration -
How To Migrate
Resume
6) How to Restrict
Agency from
entering Duplicate
Candidate
7)How to Change
User Password
8) How To
Customise Vacancy
Search in
iRecruitment-
Adding Subsidiary
Logo
9)Problem With
XML Parsing
Sitemap
3) We are almost ready with the format of pl/sql procedure that will be called by workflow process. Now we will build our logic step by step
a) First we have to read which button the performer has pressed. This can be identified by the following API
l_notfication_result := wf_notification.getAttrText(wf_engine.context_nid,
'RESULT');
The API will return the internal name of the lookup code corresponding to button.(as we know buttons are created with the lookup code attached with
message)
b) Now we have to find what is the comment approver has entered.
l_sup_comments:=wf_notification.GetAttrText(nid => wf_engine.context_nid,
aname => 'SUPEVISOR_COMMENT'
);
Here l_notfication_result and l_sup_comments are local variable.
c) Set all the inputs that we have taken from supervisor to corresponding attribute. This is to ensure that in future we can reference or share this value.(Say
once it is approved we can share the approver comments and org leave type he/she has selected with employee).
d) Now if the l_notfication_result is 'REJECT' and l_sup_comments is null then we have to raise application error with proper error message.
if l_notfication_result is 'REJECT' and l_sup_comments is not null then we have to set the RESULT_OUT parameter.
While setting the Result_out parameter we must follow the format
RESULT_OUT :='COMPLETE:<Internal name of result>;
e) If the l_notfication_result is 'APPROVE' then set the result_out
4) Our procedure is ready to attach with the workflow. Open the approver notification and attach the procedure in "Function Name" field.
5) validate the design and save it in database.
6) If the approver clicks on 'Reject' button without entering any comments, it will through an error(as soon below)
Note:- In our workflow we have not created any function that will store the data in custom table once it is approved. It is kept for reader.
Hint:- The functmode in that case will be 'RUN'.
TestLeaveworkflowwithcommentsmandatory.wft Suman Kalyan Malaker, v.1