1: PACKAGE BODY PA_XC_PROJECT_PUB AS
2: /*$Header: PAXCPR1B.pls 120.10 2011/06/29 19:42:12 rbruno ship $*/
3:
4: --
5: --Name: import_task
194:
195: -- Fix for Bug # 4513291. Added Debug write calls
196: l_debug_mode := NVL(FND_PROFILE.value_specific('PA_DEBUG_MODE',fnd_global.user_id,fnd_global.login_id,275,null,null), 'N');
197: IF l_debug_mode = 'Y' THEN
198: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'PA_XC_PROJECT_PUB.IMPORT_TASK Start : Passed Parameters :', x_Log_Level=> 3);
199: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_project_id='||p_project_id, x_Log_Level=> 3);
200: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_structure_version_id='||p_structure_version_id, x_Log_Level=> 3);
201: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_calling_mode='||p_calling_mode, x_Log_Level=> 3);
202: END IF;
195: -- Fix for Bug # 4513291. Added Debug write calls
196: l_debug_mode := NVL(FND_PROFILE.value_specific('PA_DEBUG_MODE',fnd_global.user_id,fnd_global.login_id,275,null,null), 'N');
197: IF l_debug_mode = 'Y' THEN
198: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'PA_XC_PROJECT_PUB.IMPORT_TASK Start : Passed Parameters :', x_Log_Level=> 3);
199: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_project_id='||p_project_id, x_Log_Level=> 3);
200: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_structure_version_id='||p_structure_version_id, x_Log_Level=> 3);
201: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_calling_mode='||p_calling_mode, x_Log_Level=> 3);
202: END IF;
203:
196: l_debug_mode := NVL(FND_PROFILE.value_specific('PA_DEBUG_MODE',fnd_global.user_id,fnd_global.login_id,275,null,null), 'N');
197: IF l_debug_mode = 'Y' THEN
198: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'PA_XC_PROJECT_PUB.IMPORT_TASK Start : Passed Parameters :', x_Log_Level=> 3);
199: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_project_id='||p_project_id, x_Log_Level=> 3);
200: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_structure_version_id='||p_structure_version_id, x_Log_Level=> 3);
201: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_calling_mode='||p_calling_mode, x_Log_Level=> 3);
202: END IF;
203:
204: l_stage := '1';
197: IF l_debug_mode = 'Y' THEN
198: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'PA_XC_PROJECT_PUB.IMPORT_TASK Start : Passed Parameters :', x_Log_Level=> 3);
199: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_project_id='||p_project_id, x_Log_Level=> 3);
200: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_structure_version_id='||p_structure_version_id, x_Log_Level=> 3);
201: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_TASK', x_Msg => 'p_calling_mode='||p_calling_mode, x_Log_Level=> 3);
202: END IF;
203:
204: l_stage := '1';
205:
307: l_stage := '3.2';
308:
309: -- fetch the task id from PA_TASKS based on the source reference
310:
311: PA_XC_PROJECT_PUB.fetch_task_id
312: ( p_task_index => l_pm_source_reference -- Bug 3302732 to_number(l_pm_source_reference)
313: ,p_project_id => p_project_id
314: ,p_pm_task_reference => l_pm_source_reference
315: ,x_task_id => l_task_id);
424:
425: EXCEPTION
426: WHEN OTHERS THEN
427:
428: fnd_msg_pub.add_exc_msg(p_pkg_name => 'PA_XC_PROJECT_PUB',
429: p_procedure_name => 'IMPORT_TASK',
430: p_error_text => SUBSTRB(SQLERRM,1,240)||' - stage '||l_stage);
431: raise;
432:
696:
697: BEGIN
698: -- Fix for Bug # 4513291. Added Debug.write calls instead of debug.debug
699: IF p_debug_mode = 'Y' THEN
700: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'PA_XC_PROJECT_PUB.IMPORT_PROJECT Start : Passed Parameters :', x_Log_Level=> 3);
701: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_id='||p_project_id, x_Log_Level=> 3);
702: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_start_date='||p_project_mpx_start_date, x_Log_Level=> 3);
703: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_end_date='||p_project_mpx_end_date, x_Log_Level=> 3);
704: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_responsibility_id='||p_responsibility_id, x_Log_Level=> 3);
697: BEGIN
698: -- Fix for Bug # 4513291. Added Debug.write calls instead of debug.debug
699: IF p_debug_mode = 'Y' THEN
700: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'PA_XC_PROJECT_PUB.IMPORT_PROJECT Start : Passed Parameters :', x_Log_Level=> 3);
701: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_id='||p_project_id, x_Log_Level=> 3);
702: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_start_date='||p_project_mpx_start_date, x_Log_Level=> 3);
703: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_end_date='||p_project_mpx_end_date, x_Log_Level=> 3);
704: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_responsibility_id='||p_responsibility_id, x_Log_Level=> 3);
705: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_structure_version_id='||p_structure_version_id, x_Log_Level=> 3);
698: -- Fix for Bug # 4513291. Added Debug.write calls instead of debug.debug
699: IF p_debug_mode = 'Y' THEN
700: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'PA_XC_PROJECT_PUB.IMPORT_PROJECT Start : Passed Parameters :', x_Log_Level=> 3);
701: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_id='||p_project_id, x_Log_Level=> 3);
702: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_start_date='||p_project_mpx_start_date, x_Log_Level=> 3);
703: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_end_date='||p_project_mpx_end_date, x_Log_Level=> 3);
704: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_responsibility_id='||p_responsibility_id, x_Log_Level=> 3);
705: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_structure_version_id='||p_structure_version_id, x_Log_Level=> 3);
706: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_calling_mode='||p_calling_mode, x_Log_Level=> 3);
699: IF p_debug_mode = 'Y' THEN
700: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'PA_XC_PROJECT_PUB.IMPORT_PROJECT Start : Passed Parameters :', x_Log_Level=> 3);
701: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_id='||p_project_id, x_Log_Level=> 3);
702: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_start_date='||p_project_mpx_start_date, x_Log_Level=> 3);
703: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_end_date='||p_project_mpx_end_date, x_Log_Level=> 3);
704: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_responsibility_id='||p_responsibility_id, x_Log_Level=> 3);
705: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_structure_version_id='||p_structure_version_id, x_Log_Level=> 3);
706: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_calling_mode='||p_calling_mode, x_Log_Level=> 3);
707: END IF;
700: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'PA_XC_PROJECT_PUB.IMPORT_PROJECT Start : Passed Parameters :', x_Log_Level=> 3);
701: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_id='||p_project_id, x_Log_Level=> 3);
702: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_start_date='||p_project_mpx_start_date, x_Log_Level=> 3);
703: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_end_date='||p_project_mpx_end_date, x_Log_Level=> 3);
704: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_responsibility_id='||p_responsibility_id, x_Log_Level=> 3);
705: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_structure_version_id='||p_structure_version_id, x_Log_Level=> 3);
706: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_calling_mode='||p_calling_mode, x_Log_Level=> 3);
707: END IF;
708:
701: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_id='||p_project_id, x_Log_Level=> 3);
702: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_start_date='||p_project_mpx_start_date, x_Log_Level=> 3);
703: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_end_date='||p_project_mpx_end_date, x_Log_Level=> 3);
704: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_responsibility_id='||p_responsibility_id, x_Log_Level=> 3);
705: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_structure_version_id='||p_structure_version_id, x_Log_Level=> 3);
706: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_calling_mode='||p_calling_mode, x_Log_Level=> 3);
707: END IF;
708:
709: SAVEPOINT import_project;
702: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_start_date='||p_project_mpx_start_date, x_Log_Level=> 3);
703: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_project_mpx_end_date='||p_project_mpx_end_date, x_Log_Level=> 3);
704: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_responsibility_id='||p_responsibility_id, x_Log_Level=> 3);
705: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_structure_version_id='||p_structure_version_id, x_Log_Level=> 3);
706: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_calling_mode='||p_calling_mode, x_Log_Level=> 3);
707: END IF;
708:
709: SAVEPOINT import_project;
710: x_return_status := 'S';
859: -- This was wrong as the calling env. except MSP(I guess) does not look at the x_msg_data array.
860: -- Other calling envs. rely on fnd_msg_pub.count_msg, for which we need to add msgs in stack
861:
862: IF p_debug_mode = 'Y' THEN
863: pa_debug.write(x_Module=>'PA_XC_PROJECT_PUB.IMPORT_PROJECT', x_Msg => 'p_responsibility_id is not specified', x_Log_Level=> 3);
864: END IF;
865:
866: x_msg_count := x_msg_count + 1;
867: x_msg_data.extend(1);
1344:
1345: EXCEPTION --4537865
1346: WHEN OTHERS THEN
1347: x_task_id := NULL;
1348: fnd_msg_pub.add_exc_msg(p_pkg_name => 'PA_XC_PROJECT_PUB'
1349: ,p_procedure_name => 'fetch_task_id'
1350: ,p_error_text => SUBSTRB(SQLERRM,1,240));
1351: RAISE;
1352: END fetch_task_id;
1403:
1404: EXCEPTION --4537865
1405: WHEN OTHERS THEN
1406: x_task_id := NULL;
1407: fnd_msg_pub.add_exc_msg(p_pkg_name => 'PA_XC_PROJECT_PUB'
1408: ,p_procedure_name => 'fetch_proj_element_id'
1409: ,p_error_text => SUBSTRB(SQLERRM,1,240));
1410: RAISE;
1411: END fetch_proj_element_id;
1524: END check_ref_unique;
1525:
1526: --------------------------------------------------------------------------------
1527:
1528: end PA_XC_PROJECT_PUB;