There is a PL\SQL Script that can cancel or close workflow notifications through its API. The script below has 2 parameters (recepient_role and close_type). The workflows can be closed or cansel with the script below according to its close type value.
declare
-- declare Cursor
cursor get_notif is select * from wf_notifications where recipient_role='&UserName' and status='OPEN';
-- Local variables here
i integer number(10):=1;
notification_type varchar2(10):= '&nType';
begin
dbms_output.put_line('Executing Procedure');
-- open cursor to check open notifications which needs to be closed
for c_get_notif in get_notif
loop
begin
-- Check notificaiton type (close or cancel)
-- CLOSE - This will close information notifications only, all action required notification will not be close
-- CANCEL - This will cancel notification, action required notification such as Approve/Reject will be cancelled and cannot be rollback, users will not be able to take actiion on such notification later
if upper(notification_type)='CLOSE' then
wf_notification.Close(c_get_notif.notification_id, c_get_notif.recipient_role);
i:=i+1;
elsif upper(notification_type)='CANCEL' then
wf_notification.cancel(c_get_notif.notification_id, c_get_notif.recipient_role);
i:=i+1;
end if;
exception
when others then
null;
end;
end loop;
commit;
dbms_output.put_line(to_char(i)||' records effected');
dbms_output.put_line('Procedure Executed Successfully');
end;
Why This Is Important?
It is because if these workflows are not cleaned, they can cause some serious queue. That is to say it will prevent the other mails from going out or in.
Reference:
1-http://maqappsfusion.blogspot.com.tr/2013/05/close-or-cancel-workflow-notification.html
Hiç yorum yok:
Yorum Gönder