38: p_prev_event_payload IN VARCHAR2,
39: p_grand_prev_event_payload IN VARCHAR2)
40: IS
41: PRAGMA AUTONOMOUS_TRANSACTION;
42: CURSOR fnd_jaf_event_log_cur
43: IS
44: SELECT *
45: FROM FND_JAF_EVENT_LOG
46: WHERE start_timestamp =
41: PRAGMA AUTONOMOUS_TRANSACTION;
42: CURSOR fnd_jaf_event_log_cur
43: IS
44: SELECT *
45: FROM FND_JAF_EVENT_LOG
46: WHERE start_timestamp =
47: (SELECT NVL(MAX(start_timestamp),0)
48: FROM FND_JAF_EVENT_LOG
49: WHERE request_id = p_request_id
44: SELECT *
45: FROM FND_JAF_EVENT_LOG
46: WHERE start_timestamp =
47: (SELECT NVL(MAX(start_timestamp),0)
48: FROM FND_JAF_EVENT_LOG
49: WHERE request_id = p_request_id
50: AND event_name = p_event_name
51: AND event_type = 'SEND'
52: ) FOR UPDATE;
50: AND event_name = p_event_name
51: AND event_type = 'SEND'
52: ) FOR UPDATE;
53: l_timestamp_value NUMBER;
54: fnd_jaf_event_log_rec FND_JAF_EVENT_LOG%ROWTYPE;
55: l_err_code NUMBER(38);
56: l_err_mesg VARCHAR2(250);
57: BEGIN
58: OPEN fnd_jaf_event_log_cur;
54: fnd_jaf_event_log_rec FND_JAF_EVENT_LOG%ROWTYPE;
55: l_err_code NUMBER(38);
56: l_err_mesg VARCHAR2(250);
57: BEGIN
58: OPEN fnd_jaf_event_log_cur;
59: FETCH fnd_jaf_event_log_cur INTO fnd_jaf_event_log_rec;
60: l_timestamp_value := getCurrentTimeInMillis();
61: IF fnd_jaf_event_log_cur%NOTFOUND THEN
62: -- insert to event log. event_type should be 'SEND' here, and timestampValue should be the start timestamp of the event
55: l_err_code NUMBER(38);
56: l_err_mesg VARCHAR2(250);
57: BEGIN
58: OPEN fnd_jaf_event_log_cur;
59: FETCH fnd_jaf_event_log_cur INTO fnd_jaf_event_log_rec;
60: l_timestamp_value := getCurrentTimeInMillis();
61: IF fnd_jaf_event_log_cur%NOTFOUND THEN
62: -- insert to event log. event_type should be 'SEND' here, and timestampValue should be the start timestamp of the event
63: INSERT
57: BEGIN
58: OPEN fnd_jaf_event_log_cur;
59: FETCH fnd_jaf_event_log_cur INTO fnd_jaf_event_log_rec;
60: l_timestamp_value := getCurrentTimeInMillis();
61: IF fnd_jaf_event_log_cur%NOTFOUND THEN
62: -- insert to event log. event_type should be 'SEND' here, and timestampValue should be the start timestamp of the event
63: INSERT
64: INTO FND_JAF_EVENT_LOG
65: (
60: l_timestamp_value := getCurrentTimeInMillis();
61: IF fnd_jaf_event_log_cur%NOTFOUND THEN
62: -- insert to event log. event_type should be 'SEND' here, and timestampValue should be the start timestamp of the event
63: INSERT
64: INTO FND_JAF_EVENT_LOG
65: (
66: request_id,
67: event_name,
68: event_type,
81: );
82: COMMIT;
83: ELSE
84: -- update event log. event_type should be 'RECEIVE' here, and timestampValue should be the end timestamp of the event
85: UPDATE FND_JAF_EVENT_LOG
86: SET end_timestamp = l_timestamp_value,
87: event_type = p_event_type
88: WHERE CURRENT OF fnd_jaf_event_log_cur;
89: COMMIT;
84: -- update event log. event_type should be 'RECEIVE' here, and timestampValue should be the end timestamp of the event
85: UPDATE FND_JAF_EVENT_LOG
86: SET end_timestamp = l_timestamp_value,
87: event_type = p_event_type
88: WHERE CURRENT OF fnd_jaf_event_log_cur;
89: COMMIT;
90: END IF;
91: CLOSE fnd_jaf_event_log_cur;
92: EXCEPTION
87: event_type = p_event_type
88: WHERE CURRENT OF fnd_jaf_event_log_cur;
89: COMMIT;
90: END IF;
91: CLOSE fnd_jaf_event_log_cur;
92: EXCEPTION
93: WHEN OTHERS THEN
94: l_err_code := SQLCODE;
95: l_err_mesg := SQLERRM;