62:
63:
64: BEGIN
65:
66: hr_utility.set_location('Entering: '||l_proc, 5);
67:
68: -- populate the globals
69:
70: g_batch_id := p_batch_id;
69:
70: g_batch_id := p_batch_id;
71: g_module_cd := p_module_cd;
72:
73: hr_utility.set_location('Batch: '||g_batch_id, 10);
74: hr_utility.set_location('Module: '||g_module_cd, 15);
75: hr_utility.set_location('Context: '||p_log_context, 15);
76:
77: -- initialize the pl / sql table
70: g_batch_id := p_batch_id;
71: g_module_cd := p_module_cd;
72:
73: hr_utility.set_location('Batch: '||g_batch_id, 10);
74: hr_utility.set_location('Module: '||g_module_cd, 15);
75: hr_utility.set_location('Context: '||p_log_context, 15);
76:
77: -- initialize the pl / sql table
78:
71: g_module_cd := p_module_cd;
72:
73: hr_utility.set_location('Batch: '||g_batch_id, 10);
74: hr_utility.set_location('Module: '||g_module_cd, 15);
75: hr_utility.set_location('Context: '||p_log_context, 15);
76:
77: -- initialize the pl / sql table
78:
79: g_log_tab.DELETE;
153:
154: g_master_process_log_id := l_process_log_id;
155:
156:
157: hr_utility.set_location('Process Started ' ,29);
158: hr_utility.set_location('Process_log_id : '||l_process_log_id, 30);
159: hr_utility.set_location('OVN : '||l_object_version_number, 40);
160:
161:
154: g_master_process_log_id := l_process_log_id;
155:
156:
157: hr_utility.set_location('Process Started ' ,29);
158: hr_utility.set_location('Process_log_id : '||l_process_log_id, 30);
159: hr_utility.set_location('OVN : '||l_object_version_number, 40);
160:
161:
162: /*
155:
156:
157: hr_utility.set_location('Process Started ' ,29);
158: hr_utility.set_location('Process_log_id : '||l_process_log_id, 30);
159: hr_utility.set_location('OVN : '||l_object_version_number, 40);
160:
161:
162: /*
163: commit the autonomous transaction
165:
166: commit; -- allowed only in autonomous triggers
167:
168:
169: hr_utility.set_location('Leaving:'||l_proc, 1000);
170:
171: EXCEPTION
172: WHEN OTHERS THEN
173: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
169: hr_utility.set_location('Leaving:'||l_proc, 1000);
170:
171: EXCEPTION
172: WHEN OTHERS THEN
173: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
174: hr_utility.set_message_token('ROUTINE', l_proc);
175: hr_utility.set_message_token('REASON', SQLERRM);
176: hr_utility.raise_error;
177: END start_log;
170:
171: EXCEPTION
172: WHEN OTHERS THEN
173: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
174: hr_utility.set_message_token('ROUTINE', l_proc);
175: hr_utility.set_message_token('REASON', SQLERRM);
176: hr_utility.raise_error;
177: END start_log;
178:
171: EXCEPTION
172: WHEN OTHERS THEN
173: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
174: hr_utility.set_message_token('ROUTINE', l_proc);
175: hr_utility.set_message_token('REASON', SQLERRM);
176: hr_utility.raise_error;
177: END start_log;
178:
179: /*----------------------------------------------------------------
172: WHEN OTHERS THEN
173: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
174: hr_utility.set_message_token('ROUTINE', l_proc);
175: hr_utility.set_message_token('REASON', SQLERRM);
176: hr_utility.raise_error;
177: END start_log;
178:
179: /*----------------------------------------------------------------
180: ||
252:
253:
254: BEGIN
255:
256: hr_utility.set_location('Entering: '||l_proc, 5);
257:
258: /*
259: We will insert error for the current level in g_log_tab
260: */
276: l_curr_process_log_id := '';
277: FETCH csr_row_exists INTO l_row_exists, l_curr_process_log_id;
278: CLOSE csr_row_exists;
279:
280: hr_utility.set_location('Txn Id : '||g_log_tab(i).txn_id,6);
281: hr_utility.set_location('Row Exists : '||l_row_exists,7);
282: hr_utility.set_location('curr_process_log_id : '||l_curr_process_log_id,8);
283:
284: IF l_row_exists <> 'Y' THEN
277: FETCH csr_row_exists INTO l_row_exists, l_curr_process_log_id;
278: CLOSE csr_row_exists;
279:
280: hr_utility.set_location('Txn Id : '||g_log_tab(i).txn_id,6);
281: hr_utility.set_location('Row Exists : '||l_row_exists,7);
282: hr_utility.set_location('curr_process_log_id : '||l_curr_process_log_id,8);
283:
284: IF l_row_exists <> 'Y' THEN
285: l_txn_id := g_log_tab(i).txn_id ;
278: CLOSE csr_row_exists;
279:
280: hr_utility.set_location('Txn Id : '||g_log_tab(i).txn_id,6);
281: hr_utility.set_location('Row Exists : '||l_row_exists,7);
282: hr_utility.set_location('curr_process_log_id : '||l_curr_process_log_id,8);
283:
284: IF l_row_exists <> 'Y' THEN
285: l_txn_id := g_log_tab(i).txn_id ;
286: l_txn_table_route_id := g_log_tab(i).txn_table_route_id;
455: -- populate the process_log_id for this record
456: g_log_tab(i).process_log_id := l_process_log_id;
457:
458:
459: hr_utility.set_location('Inserted log Process log id: '||l_process_log_id,25);
460: hr_utility.set_location('Txn_id : '||l_txn_id, 30);
461: hr_utility.set_location('Txn Route_id : '||l_txn_table_route_id, 50);
462: hr_utility.set_location('OVN : '||l_object_version_number, 100);
463:
456: g_log_tab(i).process_log_id := l_process_log_id;
457:
458:
459: hr_utility.set_location('Inserted log Process log id: '||l_process_log_id,25);
460: hr_utility.set_location('Txn_id : '||l_txn_id, 30);
461: hr_utility.set_location('Txn Route_id : '||l_txn_table_route_id, 50);
462: hr_utility.set_location('OVN : '||l_object_version_number, 100);
463:
464: END IF;
457:
458:
459: hr_utility.set_location('Inserted log Process log id: '||l_process_log_id,25);
460: hr_utility.set_location('Txn_id : '||l_txn_id, 30);
461: hr_utility.set_location('Txn Route_id : '||l_txn_table_route_id, 50);
462: hr_utility.set_location('OVN : '||l_object_version_number, 100);
463:
464: END IF;
465:
458:
459: hr_utility.set_location('Inserted log Process log id: '||l_process_log_id,25);
460: hr_utility.set_location('Txn_id : '||l_txn_id, 30);
461: hr_utility.set_location('Txn Route_id : '||l_txn_table_route_id, 50);
462: hr_utility.set_location('OVN : '||l_object_version_number, 100);
463:
464: END IF;
465:
466: -- for the next record the current process_log_id is master
480: */
481:
482: commit;
483:
484: hr_utility.set_location('Leaving:'||l_proc, 1000);
485:
486: EXCEPTION
487: WHEN OTHERS THEN
488: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
484: hr_utility.set_location('Leaving:'||l_proc, 1000);
485:
486: EXCEPTION
487: WHEN OTHERS THEN
488: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
489: hr_utility.set_message_token('ROUTINE', l_proc);
490: hr_utility.set_message_token('REASON', SQLERRM);
491: g_Batch_Id := NULL;
492: g_Module_Cd := NULL;
485:
486: EXCEPTION
487: WHEN OTHERS THEN
488: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
489: hr_utility.set_message_token('ROUTINE', l_proc);
490: hr_utility.set_message_token('REASON', SQLERRM);
491: g_Batch_Id := NULL;
492: g_Module_Cd := NULL;
493: g_Master_Process_Log_Id := NULL;
486: EXCEPTION
487: WHEN OTHERS THEN
488: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
489: hr_utility.set_message_token('ROUTINE', l_proc);
490: hr_utility.set_message_token('REASON', SQLERRM);
491: g_Batch_Id := NULL;
492: g_Module_Cd := NULL;
493: g_Master_Process_Log_Id := NULL;
494: hr_utility.raise_error;
490: hr_utility.set_message_token('REASON', SQLERRM);
491: g_Batch_Id := NULL;
492: g_Module_Cd := NULL;
493: g_Master_Process_Log_Id := NULL;
494: hr_utility.raise_error;
495: END insert_log;
496:
497:
498:
517: l_current_level NUMBER;
518:
519: BEGIN
520:
521: hr_utility.set_location('Entering: '||l_proc, 5);
522:
523: -- determine the maximum level in the global table
524: l_max_level := NVL(g_log_tab.LAST,0);
525: l_current_level := p_level;
523: -- determine the maximum level in the global table
524: l_max_level := NVL(g_log_tab.LAST,0);
525: l_current_level := p_level;
526:
527: hr_utility.set_location('Current Level '||l_current_level,10);
528: hr_utility.set_location('Maximum Level '||l_max_level,11);
529:
530: -- delete from global table all levels below the current level
531: g_log_tab.DELETE(p_level,l_max_level);
524: l_max_level := NVL(g_log_tab.LAST,0);
525: l_current_level := p_level;
526:
527: hr_utility.set_location('Current Level '||l_current_level,10);
528: hr_utility.set_location('Maximum Level '||l_max_level,11);
529:
530: -- delete from global table all levels below the current level
531: g_log_tab.DELETE(p_level,l_max_level);
532:
533: -- check if all the levels above the current level exists else error out
534: WHILE l_current_level > NVL(g_log_tab.FIRST,9999)
535: LOOP
536: IF NOT g_log_tab.EXISTS(l_current_level - 1) THEN
537: hr_utility.set_message(8302, 'PQH_INVALID_MESSAGE_LEVEL');
538: hr_utility.raise_error;
539: END IF;
540: l_current_level := l_current_level - 1;
541: END LOOP;
534: WHILE l_current_level > NVL(g_log_tab.FIRST,9999)
535: LOOP
536: IF NOT g_log_tab.EXISTS(l_current_level - 1) THEN
537: hr_utility.set_message(8302, 'PQH_INVALID_MESSAGE_LEVEL');
538: hr_utility.raise_error;
539: END IF;
540: l_current_level := l_current_level - 1;
541: END LOOP;
542:
546: g_log_tab(p_level).level := p_level;
547: g_log_tab(p_level).log_context := p_log_context;
548:
549:
550: hr_utility.set_location('Leaving:'||l_proc, 1000);
551:
552: EXCEPTION
553: WHEN OTHERS THEN
554: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
550: hr_utility.set_location('Leaving:'||l_proc, 1000);
551:
552: EXCEPTION
553: WHEN OTHERS THEN
554: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
555: hr_utility.set_message_token('ROUTINE', l_proc);
556: hr_utility.set_message_token('REASON', SQLERRM);
557: g_Batch_Id := NULL;
558: g_Module_Cd := NULL;
551:
552: EXCEPTION
553: WHEN OTHERS THEN
554: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
555: hr_utility.set_message_token('ROUTINE', l_proc);
556: hr_utility.set_message_token('REASON', SQLERRM);
557: g_Batch_Id := NULL;
558: g_Module_Cd := NULL;
559: g_Master_Process_Log_Id := NULL;
552: EXCEPTION
553: WHEN OTHERS THEN
554: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
555: hr_utility.set_message_token('ROUTINE', l_proc);
556: hr_utility.set_message_token('REASON', SQLERRM);
557: g_Batch_Id := NULL;
558: g_Module_Cd := NULL;
559: g_Master_Process_Log_Id := NULL;
560: hr_utility.raise_error;
556: hr_utility.set_message_token('REASON', SQLERRM);
557: g_Batch_Id := NULL;
558: g_Module_Cd := NULL;
559: g_Master_Process_Log_Id := NULL;
560: hr_utility.raise_error;
561: END set_context_level;
562:
563:
564: /*----------------------------------------------------------------
588:
589:
590: BEGIN
591:
592: hr_utility.set_location('Entering: '||l_proc, 5);
593:
594:
595: /*
596: Compute the status of the batch. If there exists any record in the batch with
624: END IF;
625:
626: END IF;
627:
628: hr_utility.set_location('Batch Status : '||l_status,100);
629:
630: /*
631: update the 'start' record for this batch with message_type_cd = 'COMPLETE' and
632: update the batch_end_date with current date time
639: batch_end_date = sysdate
640: WHERE process_log_id = g_master_process_log_id;
641:
642:
643: hr_utility.set_location('Leaving:'||l_proc, 1000);
644:
645: /*
646: commit the autonomous transaction
647: */
654: g_Module_Cd := NULL;
655: g_Master_Process_Log_Id := NULL;
656: EXCEPTION
657: WHEN OTHERS THEN
658: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
659: hr_utility.set_message_token('ROUTINE', l_proc);
660: hr_utility.set_message_token('REASON', SQLERRM);
661: g_Batch_id := NULL;
662: G_Module_Cd := NULL;
655: g_Master_Process_Log_Id := NULL;
656: EXCEPTION
657: WHEN OTHERS THEN
658: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
659: hr_utility.set_message_token('ROUTINE', l_proc);
660: hr_utility.set_message_token('REASON', SQLERRM);
661: g_Batch_id := NULL;
662: G_Module_Cd := NULL;
663: g_Master_Process_Log_Id := NULL;
656: EXCEPTION
657: WHEN OTHERS THEN
658: hr_utility.set_message(8302, 'PQH_CATASTROPHIC_ERROR');
659: hr_utility.set_message_token('ROUTINE', l_proc);
660: hr_utility.set_message_token('REASON', SQLERRM);
661: g_Batch_id := NULL;
662: G_Module_Cd := NULL;
663: g_Master_Process_Log_Id := NULL;
664: hr_utility.raise_error;
660: hr_utility.set_message_token('REASON', SQLERRM);
661: g_Batch_id := NULL;
662: G_Module_Cd := NULL;
663: g_Master_Process_Log_Id := NULL;
664: hr_utility.raise_error;
665: END end_log;
666:
667:
668: