CREATE OR REPLACE PROCEDURE xx_error_itemkey_retry_p (
errbuf OUT VARCHAR2,
retcode OUT VARCHAR2,
p_date IN VARCHAR2
)
AS
CURSOR c_err_itemkey
IS
SELECT ias.item_type,
ias.item_key,
pa.process_name,
ias.process_activity,
pa.instance_label,
ias.activity_result_code result,
ias.error_message,
ias.error_stack
FROM wf_item_activity_statuses ias, wf_process_activities pa
WHERE ias.item_type = 'HRSSA'
AND ias.process_activity = pa.instance_id
AND ias.activity_status = 'ERROR'
AND TRUNC (ias.begin_date) >=
TO_DATE (p_date, 'YYYY/MM/DD HH24:MI:SS')
ORDER BY ias.begin_date DESC;
v_err VARCHAR2 (200);
v_cnt NUMBER := 0;
BEGIN
BEGIN
FOR x IN c_err_itemkey
LOOP
BEGIN
apps.wf_engine.handleerror (
'HRSSA',
x.item_key,
x.process_name || ':' || x.instance_label,
'RETRY',
'#EXCEPTION'
);
COMMIT;
BEGIN
SELECT COUNT ( * )
INTO v_cnt
FROM wf_item_activity_statuses ias,
wf_process_activities pa
WHERE ias.item_key = x.item_key
AND ias.item_type = 'HRSSA'
AND ias.process_activity = pa.instance_id
AND ias.activity_status = 'ERROR';
EXCEPTION
WHEN OTHERS
THEN
v_cnt := 0;
END;
INSERT INTO xxx_error_itemkey_retry_log_t
VALUES (
x.item_key,
x.process_activity,
x.instance_label,
x.error_message,
x.error_stack,
DECODE (v_cnt,
0, 'Retry Successfully',
'Error in Retried'),
SYSDATE
);
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
v_err := SUBSTR (SQLERRM, 1, 2000);
INSERT INTO xxx_error_itemkey_retry_log_t
VALUES (x.item_key,
x.process_activity,
x.instance_label,
x.error_message,
x.error_stack,
v_err,
SYSDATE);
COMMIT;
END;
END LOOP;
END;
END;
/
I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in ORACLE AME, kindly contact us http://www.maxmunus.com/contact
ReplyDeleteMaxMunus Offer World Class Virtual Instructor led training on ORACLE AME We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
For Demo Contact us.
Saurabh Srivastava
MaxMunus
E-mail: saurabh@maxmunus.com
Skype id: saurabhmaxmunus
Ph:+91 8553576305 / 080 - 41103383
http://www.maxmunus.com/