99: --
100: BEGIN
101: --
102:
103: hr_dm_utility.message('ROUT','entry:hr_dm_aol_down.spawn_down', 5);
104: hr_dm_utility.message('PARA','(p_migration_id - ' || p_migration_id ||
105: '(p_phase_id - ' || p_phase_id ||
106: '(p_phase_item_id - ' || p_phase_item_id ||
107: ')',10);
100: BEGIN
101: --
102:
103: hr_dm_utility.message('ROUT','entry:hr_dm_aol_down.spawn_down', 5);
104: hr_dm_utility.message('PARA','(p_migration_id - ' || p_migration_id ||
105: '(p_phase_id - ' || p_phase_id ||
106: '(p_phase_item_id - ' || p_phase_item_id ||
107: ')',10);
108:
240: ELSIF (l_parameter10 = ':secgrp') THEN l_parameter10 := l_security_group;
241: END IF;
242:
243:
244: hr_dm_utility.message('INFO','application ' || l_loader_application, 115);
245: hr_dm_utility.message('INFO','program ' || l_program, 115);
246: hr_dm_utility.message('INFO','sub_request TRUE', 115);
247: hr_dm_utility.message('INFO','argument1 ' || l_parameter1, 115);
248: hr_dm_utility.message('INFO','argument2 ' || l_parameter2, 115);
241: END IF;
242:
243:
244: hr_dm_utility.message('INFO','application ' || l_loader_application, 115);
245: hr_dm_utility.message('INFO','program ' || l_program, 115);
246: hr_dm_utility.message('INFO','sub_request TRUE', 115);
247: hr_dm_utility.message('INFO','argument1 ' || l_parameter1, 115);
248: hr_dm_utility.message('INFO','argument2 ' || l_parameter2, 115);
249: hr_dm_utility.message('INFO','argument3 ' || l_parameter3, 115);
242:
243:
244: hr_dm_utility.message('INFO','application ' || l_loader_application, 115);
245: hr_dm_utility.message('INFO','program ' || l_program, 115);
246: hr_dm_utility.message('INFO','sub_request TRUE', 115);
247: hr_dm_utility.message('INFO','argument1 ' || l_parameter1, 115);
248: hr_dm_utility.message('INFO','argument2 ' || l_parameter2, 115);
249: hr_dm_utility.message('INFO','argument3 ' || l_parameter3, 115);
250: hr_dm_utility.message('INFO','argument4 ' || l_parameter4, 115);
243:
244: hr_dm_utility.message('INFO','application ' || l_loader_application, 115);
245: hr_dm_utility.message('INFO','program ' || l_program, 115);
246: hr_dm_utility.message('INFO','sub_request TRUE', 115);
247: hr_dm_utility.message('INFO','argument1 ' || l_parameter1, 115);
248: hr_dm_utility.message('INFO','argument2 ' || l_parameter2, 115);
249: hr_dm_utility.message('INFO','argument3 ' || l_parameter3, 115);
250: hr_dm_utility.message('INFO','argument4 ' || l_parameter4, 115);
251: hr_dm_utility.message('INFO','argument5 ' || l_parameter5, 115);
244: hr_dm_utility.message('INFO','application ' || l_loader_application, 115);
245: hr_dm_utility.message('INFO','program ' || l_program, 115);
246: hr_dm_utility.message('INFO','sub_request TRUE', 115);
247: hr_dm_utility.message('INFO','argument1 ' || l_parameter1, 115);
248: hr_dm_utility.message('INFO','argument2 ' || l_parameter2, 115);
249: hr_dm_utility.message('INFO','argument3 ' || l_parameter3, 115);
250: hr_dm_utility.message('INFO','argument4 ' || l_parameter4, 115);
251: hr_dm_utility.message('INFO','argument5 ' || l_parameter5, 115);
252: hr_dm_utility.message('INFO','argument6 ' || l_parameter6, 115);
245: hr_dm_utility.message('INFO','program ' || l_program, 115);
246: hr_dm_utility.message('INFO','sub_request TRUE', 115);
247: hr_dm_utility.message('INFO','argument1 ' || l_parameter1, 115);
248: hr_dm_utility.message('INFO','argument2 ' || l_parameter2, 115);
249: hr_dm_utility.message('INFO','argument3 ' || l_parameter3, 115);
250: hr_dm_utility.message('INFO','argument4 ' || l_parameter4, 115);
251: hr_dm_utility.message('INFO','argument5 ' || l_parameter5, 115);
252: hr_dm_utility.message('INFO','argument6 ' || l_parameter6, 115);
253: hr_dm_utility.message('INFO','argument7 ' || l_parameter7, 115);
246: hr_dm_utility.message('INFO','sub_request TRUE', 115);
247: hr_dm_utility.message('INFO','argument1 ' || l_parameter1, 115);
248: hr_dm_utility.message('INFO','argument2 ' || l_parameter2, 115);
249: hr_dm_utility.message('INFO','argument3 ' || l_parameter3, 115);
250: hr_dm_utility.message('INFO','argument4 ' || l_parameter4, 115);
251: hr_dm_utility.message('INFO','argument5 ' || l_parameter5, 115);
252: hr_dm_utility.message('INFO','argument6 ' || l_parameter6, 115);
253: hr_dm_utility.message('INFO','argument7 ' || l_parameter7, 115);
254: hr_dm_utility.message('INFO','argument8 ' || l_parameter8, 115);
247: hr_dm_utility.message('INFO','argument1 ' || l_parameter1, 115);
248: hr_dm_utility.message('INFO','argument2 ' || l_parameter2, 115);
249: hr_dm_utility.message('INFO','argument3 ' || l_parameter3, 115);
250: hr_dm_utility.message('INFO','argument4 ' || l_parameter4, 115);
251: hr_dm_utility.message('INFO','argument5 ' || l_parameter5, 115);
252: hr_dm_utility.message('INFO','argument6 ' || l_parameter6, 115);
253: hr_dm_utility.message('INFO','argument7 ' || l_parameter7, 115);
254: hr_dm_utility.message('INFO','argument8 ' || l_parameter8, 115);
255: hr_dm_utility.message('INFO','argument9 ' || l_parameter9, 115);
248: hr_dm_utility.message('INFO','argument2 ' || l_parameter2, 115);
249: hr_dm_utility.message('INFO','argument3 ' || l_parameter3, 115);
250: hr_dm_utility.message('INFO','argument4 ' || l_parameter4, 115);
251: hr_dm_utility.message('INFO','argument5 ' || l_parameter5, 115);
252: hr_dm_utility.message('INFO','argument6 ' || l_parameter6, 115);
253: hr_dm_utility.message('INFO','argument7 ' || l_parameter7, 115);
254: hr_dm_utility.message('INFO','argument8 ' || l_parameter8, 115);
255: hr_dm_utility.message('INFO','argument9 ' || l_parameter9, 115);
256: hr_dm_utility.message('INFO','argument10 ' || l_parameter10, 115);
249: hr_dm_utility.message('INFO','argument3 ' || l_parameter3, 115);
250: hr_dm_utility.message('INFO','argument4 ' || l_parameter4, 115);
251: hr_dm_utility.message('INFO','argument5 ' || l_parameter5, 115);
252: hr_dm_utility.message('INFO','argument6 ' || l_parameter6, 115);
253: hr_dm_utility.message('INFO','argument7 ' || l_parameter7, 115);
254: hr_dm_utility.message('INFO','argument8 ' || l_parameter8, 115);
255: hr_dm_utility.message('INFO','argument9 ' || l_parameter9, 115);
256: hr_dm_utility.message('INFO','argument10 ' || l_parameter10, 115);
257:
250: hr_dm_utility.message('INFO','argument4 ' || l_parameter4, 115);
251: hr_dm_utility.message('INFO','argument5 ' || l_parameter5, 115);
252: hr_dm_utility.message('INFO','argument6 ' || l_parameter6, 115);
253: hr_dm_utility.message('INFO','argument7 ' || l_parameter7, 115);
254: hr_dm_utility.message('INFO','argument8 ' || l_parameter8, 115);
255: hr_dm_utility.message('INFO','argument9 ' || l_parameter9, 115);
256: hr_dm_utility.message('INFO','argument10 ' || l_parameter10, 115);
257:
258:
251: hr_dm_utility.message('INFO','argument5 ' || l_parameter5, 115);
252: hr_dm_utility.message('INFO','argument6 ' || l_parameter6, 115);
253: hr_dm_utility.message('INFO','argument7 ' || l_parameter7, 115);
254: hr_dm_utility.message('INFO','argument8 ' || l_parameter8, 115);
255: hr_dm_utility.message('INFO','argument9 ' || l_parameter9, 115);
256: hr_dm_utility.message('INFO','argument10 ' || l_parameter10, 115);
257:
258:
259:
252: hr_dm_utility.message('INFO','argument6 ' || l_parameter6, 115);
253: hr_dm_utility.message('INFO','argument7 ' || l_parameter7, 115);
254: hr_dm_utility.message('INFO','argument8 ' || l_parameter8, 115);
255: hr_dm_utility.message('INFO','argument9 ' || l_parameter9, 115);
256: hr_dm_utility.message('INFO','argument10 ' || l_parameter10, 115);
257:
258:
259:
260: l_request_id := fnd_request.submit_request(
330: p_phase_item_id => p_phase_item_id);
331:
332: COMMIT;
333:
334: hr_dm_utility.message('INFO','Slave request ID#' || l_request_id, 15);
335: IF (l_request_id = 0) THEN
336: l_fatal_error_message := 'Unable to start slave process';
337: hr_dm_master.report_error('DA', p_migration_id,
338: l_fatal_error_message, 'P');
339: RAISE e_fatal_error;
340: END IF;
341:
342:
343: hr_dm_utility.message('INFO','Spawned DA slave', 115);
344: hr_dm_utility.message('SUMM','Spawned DA slave', 120);
345: hr_dm_utility.message('ROUT','exit:hr_dm_aol_down.spawn_slaves', 125);
346: hr_dm_utility.message('PARA','(none)', 130);
347:
340: END IF;
341:
342:
343: hr_dm_utility.message('INFO','Spawned DA slave', 115);
344: hr_dm_utility.message('SUMM','Spawned DA slave', 120);
345: hr_dm_utility.message('ROUT','exit:hr_dm_aol_down.spawn_slaves', 125);
346: hr_dm_utility.message('PARA','(none)', 130);
347:
348:
341:
342:
343: hr_dm_utility.message('INFO','Spawned DA slave', 115);
344: hr_dm_utility.message('SUMM','Spawned DA slave', 120);
345: hr_dm_utility.message('ROUT','exit:hr_dm_aol_down.spawn_slaves', 125);
346: hr_dm_utility.message('PARA','(none)', 130);
347:
348:
349: -- error handling
342:
343: hr_dm_utility.message('INFO','Spawned DA slave', 115);
344: hr_dm_utility.message('SUMM','Spawned DA slave', 120);
345: hr_dm_utility.message('ROUT','exit:hr_dm_aol_down.spawn_slaves', 125);
346: hr_dm_utility.message('PARA','(none)', 130);
347:
348:
349: -- error handling
350: EXCEPTION
348:
349: -- error handling
350: EXCEPTION
351: WHEN e_fatal_error THEN
352: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.spawn_down',
353: l_fatal_error_message,'R');
354: hr_dm_master.report_error('DA', p_migration_id,
355: 'Error in hr_dm_aol_down.spawn_down', 'P');
356: RAISE;
354: hr_dm_master.report_error('DA', p_migration_id,
355: 'Error in hr_dm_aol_down.spawn_down', 'P');
356: RAISE;
357: WHEN OTHERS THEN
358: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.spawn_down','(none)','R');
359: hr_dm_master.report_error('DA', p_migration_id,
360: 'Untrapped error in hr_dm_aol_down.spawn_down',
361: 'P');
362: RAISE;
475: --
476:
477: -- initialize messaging (only for concurrent processing)
478: IF (p_concurrent_process = 'Y') THEN
479: hr_dm_utility.message_init;
480: END IF;
481:
482: hr_dm_utility.message('ROUT','entry:hr_dm_aol_down.main', 5);
483: hr_dm_utility.message('PARA','(p_migration_id - ' || p_migration_id ||
478: IF (p_concurrent_process = 'Y') THEN
479: hr_dm_utility.message_init;
480: END IF;
481:
482: hr_dm_utility.message('ROUT','entry:hr_dm_aol_down.main', 5);
483: hr_dm_utility.message('PARA','(p_migration_id - ' || p_migration_id ||
484: ')(p_last_migration_date - ' ||
485: p_last_migration_date || ')', 10);
486:
479: hr_dm_utility.message_init;
480: END IF;
481:
482: hr_dm_utility.message('ROUT','entry:hr_dm_aol_down.main', 5);
483: hr_dm_utility.message('PARA','(p_migration_id - ' || p_migration_id ||
484: ')(p_last_migration_date - ' ||
485: p_last_migration_date || ')', 10);
486:
487: -- get the current phase_id
484: ')(p_last_migration_date - ' ||
485: p_last_migration_date || ')', 10);
486:
487: -- get the current phase_id
488: l_phase_id := hr_dm_utility.get_phase_id('DA', p_migration_id);
489:
490: -- get the business_group_id
491: OPEN csr_migration_info;
492: FETCH csr_migration_info INTO l_business_group_id;
498: END IF;
499: CLOSE csr_migration_info;
500:
501: -- get the number of threads to enable modulus locking
502: l_no_of_threads := hr_dm_utility.number_of_threads(l_business_group_id);
503:
504:
505: -- see if this is the first run? (l_request_data = NULL or '?')
506: -- or
506: -- or
507: -- is it a restart after a slave has finished? (l_request_data =
508: -- paused phase item code)
509: l_request_data := fnd_conc_global.request_data;
510: hr_dm_utility.message('INFO','l_request_data ' || l_request_data, 11);
511: IF (l_request_data IS NOT NULL) THEN
512: -- unpaused processing...
513:
514: -- check for error in slave
525: -- make sure that each slave is complete and normal, if not then log
526: IF ( NOT( (l_dev_phase = 'COMPLETE') AND (l_dev_status = 'NORMAL') )) THEN
527:
528: -- update status to error
529: hr_dm_utility.update_phase_items(p_new_status => 'E',
530: p_id => l_phase_item_id);
531: l_fatal_error_message := 'Sub-slave process in error - slave exiting';
532: RAISE e_fatal_error;
533: ELSE
531: l_fatal_error_message := 'Sub-slave process in error - slave exiting';
532: RAISE e_fatal_error;
533: ELSE
534: -- update status to completed
535: hr_dm_utility.update_phase_items(p_new_status => 'C',
536: p_id => l_phase_item_id);
537: END IF;
538:
539: -- reset request data flag
542:
543:
544: -- get status of DA phase, is phase completed?
545: -- if null returned, then assume it is NS.
546: l_current_phase_status := NVL(hr_dm_utility.get_phase_status('DA',
547: p_migration_id), 'NS');
548:
549: -- if status is error, then raise an exception
550: IF (l_current_phase_status = 'E') THEN
562: l_status;
563: IF (csr_get_pi%FOUND) THEN
564:
565: -- update status to started
566: hr_dm_utility.update_phase_items(p_new_status => 'S',
567: p_id => l_phase_item_id);
568:
569: -- send info on current table to logfile
570: hr_dm_utility.message('INFO','Processing - ' || l_loader_name, 13);
566: hr_dm_utility.update_phase_items(p_new_status => 'S',
567: p_id => l_phase_item_id);
568:
569: -- send info on current table to logfile
570: hr_dm_utility.message('INFO','Processing - ' || l_loader_name, 13);
571:
572:
573: -- call code for AOL loader
574: spawn_down(p_migration_id => p_migration_id,
599: errbuf := 'Slave Controller is paused.';
600: END IF;
601:
602:
603: hr_dm_utility.message('INFO','DA - main controller', 15);
604: hr_dm_utility.message('SUMM','DA - main controller', 20);
605: hr_dm_utility.message('ROUT','exit:hr_dm_aol_down.main', 25);
606: hr_dm_utility.message('PARA','(retcode - ' || retcode ||
607: ')(errbuf - ' || errbuf || ')', 30);
600: END IF;
601:
602:
603: hr_dm_utility.message('INFO','DA - main controller', 15);
604: hr_dm_utility.message('SUMM','DA - main controller', 20);
605: hr_dm_utility.message('ROUT','exit:hr_dm_aol_down.main', 25);
606: hr_dm_utility.message('PARA','(retcode - ' || retcode ||
607: ')(errbuf - ' || errbuf || ')', 30);
608:
601:
602:
603: hr_dm_utility.message('INFO','DA - main controller', 15);
604: hr_dm_utility.message('SUMM','DA - main controller', 20);
605: hr_dm_utility.message('ROUT','exit:hr_dm_aol_down.main', 25);
606: hr_dm_utility.message('PARA','(retcode - ' || retcode ||
607: ')(errbuf - ' || errbuf || ')', 30);
608:
609: -- error handling
602:
603: hr_dm_utility.message('INFO','DA - main controller', 15);
604: hr_dm_utility.message('SUMM','DA - main controller', 20);
605: hr_dm_utility.message('ROUT','exit:hr_dm_aol_down.main', 25);
606: hr_dm_utility.message('PARA','(retcode - ' || retcode ||
607: ')(errbuf - ' || errbuf || ')', 30);
608:
609: -- error handling
610: EXCEPTION
611: WHEN e_fatal_error THEN
612: retcode := 2;
613: errbuf := 'An error occurred during the migration - ' ||
614: 'examine logfiles for detailed reports.';
615: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main',
616: l_fatal_error_message,'DA');
617: hr_dm_utility.update_phase_items(p_new_status => 'E',
618: p_id => l_phase_item_id);
619: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main','(none)','R');
613: errbuf := 'An error occurred during the migration - ' ||
614: 'examine logfiles for detailed reports.';
615: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main',
616: l_fatal_error_message,'DA');
617: hr_dm_utility.update_phase_items(p_new_status => 'E',
618: p_id => l_phase_item_id);
619: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main','(none)','R');
620: WHEN e_fatal_error2 THEN
621: retcode := 0;
615: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main',
616: l_fatal_error_message,'DA');
617: hr_dm_utility.update_phase_items(p_new_status => 'E',
618: p_id => l_phase_item_id);
619: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main','(none)','R');
620: WHEN e_fatal_error2 THEN
621: retcode := 0;
622: errbuf := 'An error occurred during the migration - ' ||
623: 'examine logfiles for detailed reports.';
620: WHEN e_fatal_error2 THEN
621: retcode := 0;
622: errbuf := 'An error occurred during the migration - ' ||
623: 'examine logfiles for detailed reports.';
624: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main',
625: l_fatal_error_message,'DA');
626: hr_dm_utility.update_phases(p_new_status => 'E',
627: p_id => l_phase_id);
628: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main','(none)','R');
622: errbuf := 'An error occurred during the migration - ' ||
623: 'examine logfiles for detailed reports.';
624: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main',
625: l_fatal_error_message,'DA');
626: hr_dm_utility.update_phases(p_new_status => 'E',
627: p_id => l_phase_id);
628: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main','(none)','R');
629: WHEN OTHERS THEN
630: retcode := 2;
624: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main',
625: l_fatal_error_message,'DA');
626: hr_dm_utility.update_phases(p_new_status => 'E',
627: p_id => l_phase_id);
628: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main','(none)','R');
629: WHEN OTHERS THEN
630: retcode := 2;
631: errbuf := 'An error occurred during the migration - ' ||
632: 'examine logfiles for detailed reports.';
630: retcode := 2;
631: errbuf := 'An error occurred during the migration - ' ||
632: 'examine logfiles for detailed reports.';
633: -- update status to error
634: hr_dm_utility.update_phase_items(p_new_status => 'E',
635: p_id => l_phase_item_id);
636: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main','(none)','R');
637:
638:
632: 'examine logfiles for detailed reports.';
633: -- update status to error
634: hr_dm_utility.update_phase_items(p_new_status => 'E',
635: p_id => l_phase_item_id);
636: hr_dm_utility.error(SQLCODE,'hr_dm_aol_down.main','(none)','R');
637:
638:
639: --
640: END main;