In the oracle application day to day operation end user or sysadmin get many ERROR notification that required to be closed.
use the following scripts or step for the needful.
1. find out the item_type for the notification from wf_notifications tables
connect with apps/apps schema and execute below query
select message_type from wf_notifications where notification_id = {NID}
use the following scripts to abort /closed all the error notification from workflow list.
Declare
cursor c_item_keys is
select act.item_type , act.item_key
from wf_item_activity_statuses act
,wf_notifications n
,wf_items itm
where act.notification_id = n.notification_id
and act.item_type = itm.item_type
and act.item_key = itm.item_key
and itm.end_date is null
and act.item_type = ''
and act.activity_status in ('ERROR','NOTIFIED')
and n.status = 'OPEN'
and act.assigned_user = 'SYSADMIN';
counter number;
Begin
counter := 1 ;
for item in c_item_keys loop
wf_engine.abortprocess(item.item_type,item.item_key);
counter := counter + 1 ;
if counter > 1000 then
counter := 1 ;
commit;
end if;
end loop;
commit;
End;
cursor c_item_keys is
select act.item_type , act.item_key
from wf_item_activity_statuses act
,wf_notifications n
,wf_items itm
where act.notification_id = n.notification_id
and act.item_type = itm.item_type
and act.item_key = itm.item_key
and itm.end_date is null
and act.item_type = '
and act.activity_status in ('ERROR','NOTIFIED')
and n.status = 'OPEN'
and act.assigned_user = 'SYSADMIN';
counter number;
Begin
counter := 1 ;
for item in c_item_keys loop
wf_engine.abortprocess(item.item_type,item.item_key);
counter := counter + 1 ;
if counter > 1000 then
counter := 1 ;
commit;
end if;
end loop;
commit;
End;
replace the {item_type} by item_type received from step1.
after that run the concurrent request "Purge Obsolete Workflow Runtime Data".
No comments:
Post a Comment