How to make comments field mandatory for an approver in workflow notification

Add below function in Approval Notification in Oracle Workflow.

PROCEDURE comment_reject (
itemtype IN VARCHAR2,
itemkey IN VARCHAR2,
actid IN NUMBER,
funcmode IN VARCHAR2,
resultout IN OUT VARCHAR2
)
IS
l_notfication_result VARCHAR2 (1000);
l_sup_comments VARCHAR2 (10000);
BEGIN
IF (funcmode = ‘RESPOND’)
THEN
l_notfication_result :=
wf_notification.getattrtext (wf_engine.context_nid, ‘RESULT’);
l_comments :=
wf_notification.getattrtext (nid => wf_engine.context_nid,
aname => ‘COMMENTS’
);

IF (l_notfication_result = ‘REJECTED’)
THEN
IF l_comments IS NULL
THEN
raise_application_error
(‘-20002’,
‘Comments are mandatory while rejecting request’
);
ELSE
resultout := ‘COMPLETE:REJECT’;
END IF;
ELSIF (l_notfication_result = ‘APPROVED’)
THEN
resultout := ‘COMPLETE:APPROVE’;
END IF;

wf_engine.setitemattrtext (itemtype, itemkey, ‘COMMENTS’, l_comments);
END IF;
EXCEPTION
WHEN OTHERS
THEN
wf_core.CONTEXT (‘check_comment_reject’,
itemtype,
itemkey,
actid,
funcmode
);
END;

Advertisements