CREATE PROCEDURE xx_activity (
errbuf IN OUT NOCOPY VARCHAR2,errcode IN OUT NOCOPY INTEGER,
p_itemtype IN VARCHAR2,
p_activity_name IN VARCHAR2
)
AS
v_errorname VARCHAR2 (30);
v_errormsg VARCHAR2 (2000);
v_errorstack VARCHAR2 (32000);
invalid_action EXCEPTION;
PRAGMA EXCEPTION_INIT (invalid_action, -20002);
CURSOR c1
IS
SELECT item_key
FROM wf_item_activity_statuses
WHERE item_type = p_itemtype
AND activity_status = 'NOTIFIED'
AND process_activity IN (
SELECT MAX (instance_id)
FROM wf_process_activities
WHERE activity_item_type = p_itemtype
AND activity_name = p_activity_name);
--AND item_key = 1228692;
BEGIN
FOR c1_rec IN c1
LOOP
BEGIN
fnd_file.put_line (fnd_file.output,
'EXECUTING FOR ITEM-KEY: ' || c1_rec.item_key
);
wf_engine.completeactivity (itemtype => p_itemtype,
itemkey => c1_rec.item_key,
activity => p_activity_name,
--'xx_INSUFF_RESPON_BLOCK',
RESULT => wf_engine.eng_null
);
COMMIT;
EXCEPTION
WHEN invalid_action
THEN
wf_core.get_error (v_errorname, v_errormsg, v_errorstack);
fnd_file.put_line (fnd_file.LOG, 'ITEM-KEY: ' || c1_rec.item_key);
fnd_file.put_line (fnd_file.LOG, 'ERROR NAME: ' || v_errorname);
fnd_file.put_line (fnd_file.LOG, 'ERROR MESSAGE: ' || v_errormsg);
fnd_file.put_line (fnd_file.LOG, 'ERROR STACK: ' || v_errorstack);
END;
END LOOP;
END xx_activity;
No comments:
Post a Comment