DBA Data[Home] [Help]

APPS.PA_RBS_ELEMENTS_PVT dependencies on PA_RBS_ELEMENTS

Line 1: Package Body Pa_Rbs_Elements_Pvt As

1: Package Body Pa_Rbs_Elements_Pvt As
2: /* $Header: PARELEVB.pls 120.1 2008/01/16 20:22:11 amehrotr ship $*/
3:
4: Procedure Process_RBS_Element (
5: P_RBS_Version_Id IN Number,

Line 48: Pa_Rbs_Elements_Pvt.DeleteRbsElement(

44: X_Error_Msg_Data := 'PA_RBS_ELE_USED_IN_ALLOC';
45: Return;
46: END IF;
47:
48: Pa_Rbs_Elements_Pvt.DeleteRbsElement(
49: P_RBS_Version_Id => P_RBS_Version_Id,
50: P_Element_Id => P_Element_Id,
51: X_Error_Msg_Data => X_Error_Msg_Data);
52:

Line 58: Pa_Rbs_Elements_Pvt.UpdateExisingRbsElement(

54:
55: ElsIf P_Process_Type = 'U' Then
56:
57: Pa_Debug.G_Stage := 'Call UpdateExistingRbsElement() procedure.';
58: Pa_Rbs_Elements_Pvt.UpdateExisingRbsElement(
59: P_Rbs_Version_Id => P_Rbs_Version_Id,
60: P_Parent_Element_Id => P_Parent_Element_Id,
61: P_Rbs_Element_Id => P_Element_Id,
62: P_Resource_Type_Id => P_Resource_Type_Id,

Line 73: Pa_Rbs_Elements_Pvt.CreateNewRbsElement(

69:
70: Else
71:
72: Pa_Debug.G_Stage := 'Call CreateNewRbsElement() procedure.';
73: Pa_Rbs_Elements_Pvt.CreateNewRbsElement(
74: P_Rbs_Version_Id => P_Rbs_Version_Id,
75: P_Parent_Element_Id => P_Parent_Element_Id,
76: P_Rbs_Element_Id => P_Element_Id,
77: P_Resource_Type_Id => P_Resource_Type_Id,

Line 103: FROM pa_rbs_elements

99: IS
100:
101: CURSOR c1 (P_Rbs_Elem_Id IN Number) IS
102: SELECT rbs_element_id
103: FROM pa_rbs_elements
104: START WITH rbs_element_Id = p_rbs_elem_id
105: CONNECT BY prior rbs_element_id = parent_element_Id;
106:
107: CURSOR get_later_sibs(p_rbs_version_id IN NUMBER,

Line 111: FROM pa_rbs_elements

107: CURSOR get_later_sibs(p_rbs_version_id IN NUMBER,
108: p_del_outline_number IN VARCHAR2,
109: p_parent_id IN NUMBER) IS
110: SELECT rbs_element_id, outline_number
111: FROM pa_rbs_elements
112: WHERE rbs_version_id = p_rbs_version_id
113: AND parent_element_Id = p_parent_id
114: AND to_number(replace(outline_number, '.')) >
115: to_number(replace(p_del_outline_number, '.'))

Line 120: FROM pa_rbs_elements

116: ORDER BY to_number(replace(outline_number, '.'));
117:
118: CURSOR get_sib_children (P_Rbs_Elem_Id IN Number) IS
119: SELECT rbs_element_id
120: FROM pa_rbs_elements
121: START WITH rbs_element_Id = p_rbs_elem_id
122: CONNECT BY prior rbs_element_id = parent_element_Id;
123:
124: l_Id Number := Null;

Line 142: FROM pa_rbs_elements

138: -- Get the parent ID and parent outline number for the element
139: -- being deleted.
140: SELECT parent_element_Id, outline_number
141: INTO l_parent_id, l_del_outline_number
142: FROM pa_rbs_elements
143: WHERE rbs_element_id = P_Element_Id;
144:
145: SELECT outline_number
146: INTO l_parent_outline_number

Line 147: FROM pa_rbs_elements

143: WHERE rbs_element_id = P_Element_Id;
144:
145: SELECT outline_number
146: INTO l_parent_outline_number
147: FROM pa_rbs_elements
148: WHERE rbs_element_id = l_parent_id;
149:
150: Pa_Debug.G_Stage := 'Entering DeleteRbsElement().';
151: Pa_Debug.TrackPath('ADD','DeleteRbsElement');

Line 154: IF Pa_Rbs_Elements_Utils.RbsElementExists( P_Element_Id => P_Element_Id ) = 'Y' Then

150: Pa_Debug.G_Stage := 'Entering DeleteRbsElement().';
151: Pa_Debug.TrackPath('ADD','DeleteRbsElement');
152:
153: Pa_Debug.G_Stage := 'Call DeleteRbsElement() procedure.';
154: IF Pa_Rbs_Elements_Utils.RbsElementExists( P_Element_Id => P_Element_Id ) = 'Y' Then
155:
156: Pa_Debug.G_Stage := 'Delete the children elements/nodes using cursor and loop.';
157: Open c1(P_Element_Id);
158: Loop

Line 164: Pa_Rbs_Elements_Pkg.Delete_Row(P_Rbs_Element_Id => l_id);

160: Fetch c1 Into l_id;
161: Exit When c1%NotFound;
162:
163: Pa_Debug.G_Stage := 'Delete child element/node by calling table handler.';
164: Pa_Rbs_Elements_Pkg.Delete_Row(P_Rbs_Element_Id => l_id);
165:
166:
167: End Loop;
168:

Line 202: UPDATE pa_rbs_elements

198: l_new_outline := to_char(l_new_last);
199: END IF;
200:
201: -- update sibling outline number
202: UPDATE pa_rbs_elements
203: SET outline_number = l_new_outline
204: WHERE rbs_element_id = l_upd_rbs_id;
205:
206: -- Update all the children's outline numbers by replacing the prefix

Line 220: UPDATE pa_rbs_elements

216: -- of the old 3 to 2. But a straight replace won't work - it will replace
217: -- 3.3.1 to 2.2.1 instead of 2.3.1. Hence just replace the first
218: -- part which is the length of the outline number plus 1 for the '.'
219: -- and then append the rest - so you get 2. || 3.1
220: UPDATE pa_rbs_elements
221: SET outline_number = replace(substr(outline_number, 1,
222: length(l_upd_outline_number) + 1),
223: l_upd_outline_number || '.',
224: l_new_outline || '.') ||

Line 287: From Pa_Rbs_Elements

283:
284: --For bug 4047578:perf fix
285: Cursor Read_Element_Id_c IS
286: Select Rbs_Element_Id
287: From Pa_Rbs_Elements
288: Where Rule_Flag = 'Y'
289: Start With Parent_Element_Id = P_Rbs_Element_Id
290: Connect By Prior Rbs_Element_Id = Parent_Element_Id;
291: BEGIN

Line 300: If Pa_Rbs_Elements_Utils.RbsElementExists( P_Element_Id => P_Parent_Element_Id ) = 'Y' Then

296: -- Check if the parent element is valid.
297: Pa_Debug.G_Stage := 'Check to see if parent element/node exists.';
298:
299:
300: If Pa_Rbs_Elements_Utils.RbsElementExists( P_Element_Id => P_Parent_Element_Id ) = 'Y' Then
301:
302:
303: Pa_Debug.G_Stage := 'Call ValidateAndBuildElement() procedure.';
304: Pa_Rbs_Elements_Pvt.ValidateAndBuildElement(

Line 304: Pa_Rbs_Elements_Pvt.ValidateAndBuildElement(

300: If Pa_Rbs_Elements_Utils.RbsElementExists( P_Element_Id => P_Parent_Element_Id ) = 'Y' Then
301:
302:
303: Pa_Debug.G_Stage := 'Call ValidateAndBuildElement() procedure.';
304: Pa_Rbs_Elements_Pvt.ValidateAndBuildElement(
305: P_Mode => l_Mode,
306: P_Rbs_Version_Id => P_Rbs_Version_Id,
307: P_Parent_Element_Id => P_Parent_Element_Id,
308: P_Rbs_Element_Id => P_Rbs_Element_Id,

Line 345: Pa_Debug.G_Stage := 'Call Pa_Rbs_Elements_Pkg.Update_Row() procedure.';

341:
342: If X_Error_Msg_Data is Null Then
343:
344: -- call the table handler to update the record.
345: Pa_Debug.G_Stage := 'Call Pa_Rbs_Elements_Pkg.Update_Row() procedure.';
346: Pa_Rbs_Elements_Pkg.Update_Row(
347: P_Rbs_Element_Id => P_Rbs_Element_Id,
348: P_Rbs_Element_Name_Id => l_Rbs_Element_Name_Id,
349: P_Rbs_Version_Id => P_Rbs_Version_Id,

Line 346: Pa_Rbs_Elements_Pkg.Update_Row(

342: If X_Error_Msg_Data is Null Then
343:
344: -- call the table handler to update the record.
345: Pa_Debug.G_Stage := 'Call Pa_Rbs_Elements_Pkg.Update_Row() procedure.';
346: Pa_Rbs_Elements_Pkg.Update_Row(
347: P_Rbs_Element_Id => P_Rbs_Element_Id,
348: P_Rbs_Element_Name_Id => l_Rbs_Element_Name_Id,
349: P_Rbs_Version_Id => P_Rbs_Version_Id,
350: P_Outline_Number => l_outline_number,

Line 380: P_Last_Update_Date => Pa_Rbs_Elements_Pvt.G_Last_Update_Date,

376: P_User_Defined_Custom2_Id => l_User_Def_Custom2_Id,
377: P_User_Defined_Custom3_Id => l_User_Def_Custom3_Id,
378: P_User_Defined_Custom4_Id => l_User_Def_Custom4_Id,
379: P_User_Defined_Custom5_Id => l_User_Def_Custom5_Id,
380: P_Last_Update_Date => Pa_Rbs_Elements_Pvt.G_Last_Update_Date,
381: P_Last_Updated_By => Pa_Rbs_Elements_Pvt.G_Last_Updated_By,
382: P_Last_Update_Login => Pa_Rbs_Elements_Pvt.G_Last_Update_Login,
383: X_Error_Msg_Data => X_Error_Msg_Data);
384:

Line 381: P_Last_Updated_By => Pa_Rbs_Elements_Pvt.G_Last_Updated_By,

377: P_User_Defined_Custom3_Id => l_User_Def_Custom3_Id,
378: P_User_Defined_Custom4_Id => l_User_Def_Custom4_Id,
379: P_User_Defined_Custom5_Id => l_User_Def_Custom5_Id,
380: P_Last_Update_Date => Pa_Rbs_Elements_Pvt.G_Last_Update_Date,
381: P_Last_Updated_By => Pa_Rbs_Elements_Pvt.G_Last_Updated_By,
382: P_Last_Update_Login => Pa_Rbs_Elements_Pvt.G_Last_Update_Login,
383: X_Error_Msg_Data => X_Error_Msg_Data);
384:
385:

Line 382: P_Last_Update_Login => Pa_Rbs_Elements_Pvt.G_Last_Update_Login,

378: P_User_Defined_Custom4_Id => l_User_Def_Custom4_Id,
379: P_User_Defined_Custom5_Id => l_User_Def_Custom5_Id,
380: P_Last_Update_Date => Pa_Rbs_Elements_Pvt.G_Last_Update_Date,
381: P_Last_Updated_By => Pa_Rbs_Elements_Pvt.G_Last_Updated_By,
382: P_Last_Update_Login => Pa_Rbs_Elements_Pvt.G_Last_Update_Login,
383: X_Error_Msg_Data => X_Error_Msg_Data);
384:
385:
386: If X_Error_Msg_Data Is Null Then

Line 403: Update Pa_Rbs_Elements

399: LOOP
400: FETCH Read_Element_Id_c INTO l_Element_Id;
401: EXIT WHEN Read_Element_Id_c%NOTFOUND;
402:
403: Update Pa_Rbs_Elements
404: Set Rule_Flag = 'N'
405: Where Rbs_Element_Id =l_Element_Id;
406:
407: END LOOP;

Line 411: Update Pa_Rbs_Elements

407: END LOOP;
408: CLOSE Read_Element_Id_c;
409:
410: ElsIf l_Rule_Flag = 'Y' Then
411: Update Pa_Rbs_Elements
412: Set Rule_Flag = 'Y'
413: Where Rbs_Element_Id In ( Select Rbs_Element_Id
414: From Pa_Rbs_Elements
415: Start With Rbs_Element_Id = P_Rbs_Element_Id

Line 414: From Pa_Rbs_Elements

410: ElsIf l_Rule_Flag = 'Y' Then
411: Update Pa_Rbs_Elements
412: Set Rule_Flag = 'Y'
413: Where Rbs_Element_Id In ( Select Rbs_Element_Id
414: From Pa_Rbs_Elements
415: Start With Rbs_Element_Id = P_Rbs_Element_Id
416: Connect By Prior Rbs_Element_Id = Parent_Element_Id
417: And Resource_Source_Id = -1 );
418: End If; --End of Bug fix 3736374

Line 423: PA_Debug.G_Stage := 'Call Pa_Rbs_Elements_Pvt.Update_Children_Data() procedure.';

419:
420: -- Bug 3636175
421: -- This call is to update the elements below the one just updated with the changes made
422: -- so that the mapping for the rbs does not become broken.
423: PA_Debug.G_Stage := 'Call Pa_Rbs_Elements_Pvt.Update_Children_Data() procedure.';
424: Pa_Rbs_Elements_Pvt.Update_Children_Data(
425: P_Rbs_Element_Id => P_Rbs_Element_Id,
426: X_Error_Msg_Data => X_Error_Msg_Data);
427:

Line 424: Pa_Rbs_Elements_Pvt.Update_Children_Data(

420: -- Bug 3636175
421: -- This call is to update the elements below the one just updated with the changes made
422: -- so that the mapping for the rbs does not become broken.
423: PA_Debug.G_Stage := 'Call Pa_Rbs_Elements_Pvt.Update_Children_Data() procedure.';
424: Pa_Rbs_Elements_Pvt.Update_Children_Data(
425: P_Rbs_Element_Id => P_Rbs_Element_Id,
426: X_Error_Msg_Data => X_Error_Msg_Data);
427:
428: End If;

Line 438: End If; -- Pa_Rbs_Elements_Utils.RbsElementExists()

434:
435: Pa_Debug.G_Stage := 'Parent element/node does not exists.';
436: Raise No_Data_Found;
437:
438: End If; -- Pa_Rbs_Elements_Utils.RbsElementExists()
439:
440: Pa_Debug.G_Stage := 'Leaving UpdateExisingRbsElement() procedure.';
441: Pa_Debug.TrackPath('STRIP','UpdateExisingRbsElement');
442:

Line 499: If Pa_Rbs_Elements_Utils.RbsElementExists( P_Element_Id => P_Parent_Element_Id ) = 'Y' Then

495: Pa_Debug.TrackPath('ADD','CreateNewRbsElement');
496:
497: -- Check if the parent element is valid.
498: Pa_Debug.G_Stage := 'Check to see if parent element/node exists.';
499: If Pa_Rbs_Elements_Utils.RbsElementExists( P_Element_Id => P_Parent_Element_Id ) = 'Y' Then
500:
501: Pa_Debug.G_Stage := 'Call ValidateAndBuildElement() procedure.';
502: Pa_Rbs_Elements_Pvt.ValidateAndBuildElement(
503: P_Mode => l_Mode,

Line 502: Pa_Rbs_Elements_Pvt.ValidateAndBuildElement(

498: Pa_Debug.G_Stage := 'Check to see if parent element/node exists.';
499: If Pa_Rbs_Elements_Utils.RbsElementExists( P_Element_Id => P_Parent_Element_Id ) = 'Y' Then
500:
501: Pa_Debug.G_Stage := 'Call ValidateAndBuildElement() procedure.';
502: Pa_Rbs_Elements_Pvt.ValidateAndBuildElement(
503: P_Mode => l_Mode,
504: P_Rbs_Version_Id => P_Rbs_Version_Id,
505: P_Parent_Element_Id => P_Parent_Element_Id,
506: P_Rbs_Element_Id => P_Rbs_Element_Id,

Line 542: Pa_Debug.G_Stage := 'Call Pa_Rbs_Elements_Pkg.Insert_Row() procedure.';

538:
539: If X_Error_Msg_Data is Null Then
540:
541: -- call the table handler to update the record.
542: Pa_Debug.G_Stage := 'Call Pa_Rbs_Elements_Pkg.Insert_Row() procedure.';
543: Pa_Rbs_Elements_Pkg.Insert_Row(
544: P_Rbs_Element_Name_Id => l_Rbs_Element_Name_Id,
545: P_Rbs_Version_Id => P_Rbs_Version_Id,
546: P_Outline_Number => l_outline_number,

Line 543: Pa_Rbs_Elements_Pkg.Insert_Row(

539: If X_Error_Msg_Data is Null Then
540:
541: -- call the table handler to update the record.
542: Pa_Debug.G_Stage := 'Call Pa_Rbs_Elements_Pkg.Insert_Row() procedure.';
543: Pa_Rbs_Elements_Pkg.Insert_Row(
544: P_Rbs_Element_Name_Id => l_Rbs_Element_Name_Id,
545: P_Rbs_Version_Id => P_Rbs_Version_Id,
546: P_Outline_Number => l_outline_number,
547: P_Order_Number => l_Order_Number,

Line 576: P_Last_Update_Date => Pa_Rbs_Elements_Pvt.G_Last_Update_Date,

572: P_User_Defined_Custom2_Id => l_User_Def_Custom2_Id,
573: P_User_Defined_Custom3_Id => l_User_Def_Custom3_Id,
574: P_User_Defined_Custom4_Id => l_User_Def_Custom4_Id,
575: P_User_Defined_Custom5_Id => l_User_Def_Custom5_Id,
576: P_Last_Update_Date => Pa_Rbs_Elements_Pvt.G_Last_Update_Date,
577: P_Last_Updated_By => Pa_Rbs_Elements_Pvt.G_Last_Updated_By,
578: P_Last_Update_Login => Pa_Rbs_Elements_Pvt.G_Last_Update_Login,
579: P_Creation_Date => Pa_Rbs_Elements_Pvt.G_Creation_Date,
580: P_Created_By => Pa_Rbs_Elements_Pvt.G_Created_By,

Line 577: P_Last_Updated_By => Pa_Rbs_Elements_Pvt.G_Last_Updated_By,

573: P_User_Defined_Custom3_Id => l_User_Def_Custom3_Id,
574: P_User_Defined_Custom4_Id => l_User_Def_Custom4_Id,
575: P_User_Defined_Custom5_Id => l_User_Def_Custom5_Id,
576: P_Last_Update_Date => Pa_Rbs_Elements_Pvt.G_Last_Update_Date,
577: P_Last_Updated_By => Pa_Rbs_Elements_Pvt.G_Last_Updated_By,
578: P_Last_Update_Login => Pa_Rbs_Elements_Pvt.G_Last_Update_Login,
579: P_Creation_Date => Pa_Rbs_Elements_Pvt.G_Creation_Date,
580: P_Created_By => Pa_Rbs_Elements_Pvt.G_Created_By,
581: X_Rbs_Element_Id => X_Rbs_Element_Id,

Line 578: P_Last_Update_Login => Pa_Rbs_Elements_Pvt.G_Last_Update_Login,

574: P_User_Defined_Custom4_Id => l_User_Def_Custom4_Id,
575: P_User_Defined_Custom5_Id => l_User_Def_Custom5_Id,
576: P_Last_Update_Date => Pa_Rbs_Elements_Pvt.G_Last_Update_Date,
577: P_Last_Updated_By => Pa_Rbs_Elements_Pvt.G_Last_Updated_By,
578: P_Last_Update_Login => Pa_Rbs_Elements_Pvt.G_Last_Update_Login,
579: P_Creation_Date => Pa_Rbs_Elements_Pvt.G_Creation_Date,
580: P_Created_By => Pa_Rbs_Elements_Pvt.G_Created_By,
581: X_Rbs_Element_Id => X_Rbs_Element_Id,
582: X_Error_Msg_Data => X_Error_Msg_Data);

Line 579: P_Creation_Date => Pa_Rbs_Elements_Pvt.G_Creation_Date,

575: P_User_Defined_Custom5_Id => l_User_Def_Custom5_Id,
576: P_Last_Update_Date => Pa_Rbs_Elements_Pvt.G_Last_Update_Date,
577: P_Last_Updated_By => Pa_Rbs_Elements_Pvt.G_Last_Updated_By,
578: P_Last_Update_Login => Pa_Rbs_Elements_Pvt.G_Last_Update_Login,
579: P_Creation_Date => Pa_Rbs_Elements_Pvt.G_Creation_Date,
580: P_Created_By => Pa_Rbs_Elements_Pvt.G_Created_By,
581: X_Rbs_Element_Id => X_Rbs_Element_Id,
582: X_Error_Msg_Data => X_Error_Msg_Data);
583:

Line 580: P_Created_By => Pa_Rbs_Elements_Pvt.G_Created_By,

576: P_Last_Update_Date => Pa_Rbs_Elements_Pvt.G_Last_Update_Date,
577: P_Last_Updated_By => Pa_Rbs_Elements_Pvt.G_Last_Updated_By,
578: P_Last_Update_Login => Pa_Rbs_Elements_Pvt.G_Last_Update_Login,
579: P_Creation_Date => Pa_Rbs_Elements_Pvt.G_Creation_Date,
580: P_Created_By => Pa_Rbs_Elements_Pvt.G_Created_By,
581: X_Rbs_Element_Id => X_Rbs_Element_Id,
582: X_Error_Msg_Data => X_Error_Msg_Data);
583:
584: End If; -- error returned from ResourceNameCheck() procedure

Line 591: End If; -- Pa_Rbs_Elements_Utils.RbsElementExists()

587:
588: Pa_Debug.G_Stage := 'Parent element/node does not exist.';
589: Raise No_Data_Found;
590:
591: End If; -- Pa_Rbs_Elements_Utils.RbsElementExists()
592:
593: Pa_Debug.G_Stage := 'Leaving CreateNewRbsElement() procedure.';
594: Pa_Debug.TrackPath('STRIP','CreateNewRbsElement');
595:

Line 647: FROM pa_rbs_elements

643: p_rbs_element_id IN NUMBER,
644: P_rbs_level IN NUMBER)
645: IS
646: SELECT 'Y', rbs_element_id
647: FROM pa_rbs_elements
648: WHERE resource_type_id = p_resource_type_id
649: AND resource_source_id = p_resource_source_id
650: AND Rbs_Version_Id = P_Rbs_Version_Id
651: AND rbs_element_id <> nvl(p_rbs_element_id, -99)

Line 659: FROM pa_rbs_elements

655: p_resource_source_id IN NUMBER,
656: p_rbs_element_id IN NUMBER)
657: IS
658: SELECT 'Y'
659: FROM pa_rbs_elements
660: WHERE resource_type_id = p_resource_type_id
661: AND resource_source_id = p_resource_source_id
662: AND Rbs_Version_Id = P_Rbs_Version_Id
663: AND rbs_element_id <> nvl(p_rbs_element_id, -99);

Line 698: FROM PA_RBS_ELEMENTS

694: SELECT resource_type_id,
695: resource_source_id
696: INTO l_old_resource_type_id,
697: l_old_resource_source_id
698: FROM PA_RBS_ELEMENTS
699: WHERE rbs_element_id = p_rbs_element_id;
700: END IF;
701:
702: Pa_Debug.G_Stage := 'Call ValidateRbsElement() procedure.';

Line 704: Pa_Rbs_Elements_Pvt.ValidateRbsElement(

700: END IF;
701:
702: Pa_Debug.G_Stage := 'Call ValidateRbsElement() procedure.';
703: --dbms_output.put_line('before ValidateRbsElement');
704: Pa_Rbs_Elements_Pvt.ValidateRbsElement(
705: P_Mode => P_Mode,
706: P_Rbs_Version_Id => P_Rbs_Version_Id,
707: P_Parent_Element_Id => P_Parent_Element_Id,
708: P_Rbs_Element_Id => P_Rbs_Element_Id,

Line 721: Pa_Rbs_Elements_Pvt.GetParentRbsData(

717: If X_Error_Msg_Data is Null Then
718:
719: Pa_Debug.G_Stage := 'Call GetParentRbsData() procedure.';
720: --dbms_output.put_line('before GetParentRbsData');
721: Pa_Rbs_Elements_Pvt.GetParentRbsData(
722: P_Parent_Element_Id => P_Parent_Element_Id,
723: X_Person_Id => X_Person_Id,
724: X_Job_Id => X_Job_Id,
725: X_Organization_Id => X_Organization_Id,

Line 878: pa_rbs_elements r

874: Decode(r.rule_flag,'Y',Decode(P_Resource_Source_Id,-1,'Y','N'),'N'))
875: Into
876: X_Rule_Based_Flag
877: From
878: pa_rbs_elements r
879: Where
880: r.rbs_element_id = P_Parent_Element_Id; --End of bug fix 3736374.
881:
882: --dbms_output.put_line('after get rule based flag');

Line 931: FROM pa_rbs_elements

927: -- hr_utility.trace('x_job_id IS : ' || x_job_id);
928: -- hr_utility.trace('x_person_id IS : ' || x_person_id);
929: SELECT 'N'
930: INTO l_unique_branch
931: FROM pa_rbs_elements
932: WHERE rbs_element_id = l_exists_element_id
933: AND nvl(person_id, -99) = nvl(x_person_id, -99)
934: AND nvl(organization_id, -99) = nvl(x_organization_id, -99)
935: AND nvl(job_id, -99) = nvl(x_job_id, -99)

Line 1008: FROM pa_rbs_elements

1004: --dbms_output.put_line('P_Rbs_Element_Id IS ' || P_Rbs_Element_Id);
1005: --dbms_output.put_line('P_Rbs_Version_Id IS ' || P_Rbs_Version_Id);
1006: SELECT 'N'
1007: INTO l_unique_branch
1008: FROM pa_rbs_elements
1009: WHERE rbs_element_id <> nvl(P_Rbs_Element_Id,-99)
1010: AND rbs_version_id = P_Rbs_Version_Id
1011: AND rbs_level = X_Rbs_level
1012: AND nvl(person_id, -99) = nvl(x_person_id, -99)

Line 1113: Pa_Debug.G_Stage := 'Retrieve the element identifier value from pa_rbs_elements for update.';

1109: From Dual;
1110:
1111: ELSE
1112:
1113: Pa_Debug.G_Stage := 'Retrieve the element identifier value from pa_rbs_elements for update.';
1114: -- Get the value from the rbs_elements table.
1115: Select Element_Identifier
1116: Into X_Element_Identifier
1117: From Pa_Rbs_Elements

Line 1117: From Pa_Rbs_Elements

1113: Pa_Debug.G_Stage := 'Retrieve the element identifier value from pa_rbs_elements for update.';
1114: -- Get the value from the rbs_elements table.
1115: Select Element_Identifier
1116: Into X_Element_Identifier
1117: From Pa_Rbs_Elements
1118: Where Rbs_Element_Id = P_Rbs_Element_Id;
1119:
1120: END IF;
1121:

Line 1131: FROM PA_RBS_ELEMENTS

1127: -- Set the outline number
1128:
1129: SELECT count(*)
1130: INTO l_number_of_peers
1131: FROM PA_RBS_ELEMENTS
1132: WHERE parent_element_id = p_parent_element_id
1133: AND USER_CREATED_FLAG = 'Y';
1134:
1135: IF l_number_of_peers = 0 THEN

Line 1151: FROM PA_RBS_ELEMENTS

1147: -- Mode is update. Get the outline number of the element
1148:
1149: SELECT outline_number
1150: INTO x_outline_number
1151: FROM PA_RBS_ELEMENTS
1152: WHERE RBS_ELEMENT_ID = P_RBS_ELEMENT_ID;
1153:
1154: END IF;
1155:

Line 1205: FROM PA_RBS_ELEMENTS

1201: P_ResTypeId IN Number)
1202: IS
1203:
1204: SELECT Count(*)
1205: FROM PA_RBS_ELEMENTS
1206: WHERE Rbs_Version_Id = P_RbsVersionId
1207: AND Resource_Type_Id = P_ResTypeId
1208: AND Resource_Source_Id = P_ResSourceId
1209: AND parent_element_id = p_parentId;

Line 1220: From Pa_Rbs_Elements

1216: P_Parent_Elem_Id IN Number)
1217: IS
1218:
1219: Select Count(*)
1220: From Pa_Rbs_Elements
1221: Where Resource_Type_Id = P_Res_Type_Id
1222: And Resource_Source_Id = P_Res_Srce_Id
1223: Start With Rbs_Element_Id = P_Parent_Elem_Id
1224: Connect By Prior Parent_Element_Id = Rbs_Element_Id;

Line 1232: From Pa_Rbs_Elements

1228: P_Res_Srce_Id IN Number,
1229: P_Rbs_Elem_Id IN Number)
1230: IS
1231: Select Count(*)
1232: From Pa_Rbs_Elements
1233: Where Resource_Type_Id = P_Res_Type_Id
1234: And Resource_Source_Id = P_Res_Srce_Id
1235: Start With Parent_Element_Id = P_Rbs_Elem_Id
1236: Connect By Prior Rbs_Element_Id = Parent_Element_Id;

Line 1255: FROM Pa_Rbs_Elements

1251:
1252: CURSOR c_GetCurrentLevel(P_Parent_Id IN Number)
1253: IS
1254: SELECT rbs_level + 1
1255: FROM Pa_Rbs_Elements
1256: WHERE Rbs_Element_Id = P_Parent_Id;
1257:
1258: CURSOR c_CheckResTypeInRbs
1259: (P_Res_Type_Id IN Number,

Line 1264: FROM Pa_Rbs_Elements

1260: P_Rbs_Level IN Number,
1261: P_Version_Id IN Number)
1262: IS
1263: SELECT Count(*)
1264: FROM Pa_Rbs_Elements
1265: WHERE Resource_Type_Id = P_Res_Type_Id
1266: AND Rbs_Level not in (P_Rbs_Level, P_Rbs_Level - 1, P_Rbs_Level + 1)
1267: AND Rbs_Version_Id = P_Version_Id;
1268:

Line 1272: FROM pa_rbs_elements

1268:
1269: CURSOR children_elements(P_Rbs_Element_Id IN NUMBER)
1270: IS
1271: SELECT rbs_element_id , resource_type_id, resource_source_id
1272: FROM pa_rbs_elements
1273: WHERE parent_element_id = P_Rbs_Element_Id;
1274:
1275: BEGIN
1276:

Line 1285: X_Resource_Type := Pa_Rbs_Elements_Utils.GetResTypeCode

1281: -- We need this validation irrespective of whether the resource type is
1282: -- changed or not. The x_resource_type we get below is used by the
1283: -- calling API to populate the element record in both update and insert mode.
1284:
1285: X_Resource_Type := Pa_Rbs_Elements_Utils.GetResTypeCode
1286: (P_Res_Type_Id => P_Resource_Type_Id);
1287:
1288:
1289: IF X_Resource_Type is Null or X_Resource_Type = 'NAMED_ROLE'

Line 1317: Pa_Rbs_Elements_Pvt.ValidateResource(

1313:
1314: -- 3. If the element is not rule based, and resource_type is not user-defined,
1315: -- validate the resource_source_id.
1316: Pa_Debug.G_Stage := 'Validate the resource by calling the ValidateResource() procedure.';
1317: Pa_Rbs_Elements_Pvt.ValidateResource(
1318: P_Resource_Type_Id => P_Resource_Type_Id,
1319: P_Resource_Source_Id => P_Resource_Source_Id,
1320: P_Resource_Type => X_Resource_Type,
1321: X_Error_Msg_Data => X_Error_Msg_Data);

Line 1408: FROM PA_RBS_ELEMENTS

1404: -- Get parent's resource type
1405: BEGIN
1406: SELECT resource_type_id, resource_source_id
1407: INTO l_parent_resource_type_id, l_parent_resource_source_id
1408: FROM PA_RBS_ELEMENTS
1409: WHERE rbs_element_id = P_Parent_Element_Id;
1410: EXCEPTION
1411: WHEN OTHERS THEN
1412: null;

Line 1432: FROM PA_RBS_ELEMENTS

1428: l_dummy_count := 0;
1429:
1430: SELECT count(*)
1431: INTO l_dummy_count
1432: FROM PA_RBS_ELEMENTS
1433: WHERE RESOURCE_TYPE_ID = P_Resource_Type_Id
1434: START WITH rbs_element_id = p_parent_element_id
1435: CONNECT BY PRIOR parent_element_id = rbs_element_id;
1436:

Line 1465: FROM PA_RBS_ELEMENTS

1461: l_dummy_count := 0;
1462:
1463: SELECT count(*)
1464: INTO l_dummy_count
1465: FROM PA_RBS_ELEMENTS
1466: WHERE RESOURCE_TYPE_ID = P_Resource_Type_Id
1467: START WITH parent_element_id = c1.rbs_element_id
1468: CONNECT BY PRIOR rbs_element_id = parent_element_id;
1469:

Line 1495: FROM PA_RBS_ELEMENTS

1491: l_dummy_count := 0;
1492:
1493: select count(*)
1494: INTO l_dummy_count
1495: FROM PA_RBS_ELEMENTS
1496: WHERE PARENT_ELEMENT_ID = p_rbs_element_id
1497: AND RESOURCE_TYPE_ID = p_old_resource_type_id;
1498:
1499: IF l_dummy_count > 0 THEN

Line 2048: Pa_Rbs_Elements

2044: X_Supplier_Id,
2045: X_Rbs_Level,
2046: X_Outline_Number
2047: From
2048: Pa_Rbs_Elements
2049: Where
2050: Rbs_Element_Id = P_Parent_Element_Id;
2051: -- And Rbs_Level <> 0;
2052:

Line 2084: Pa_Rbs_Elements

2080: Cursor c1(P_Par_Element_Id IN Number) is
2081: Select
2082: Max(Order_Number)
2083: From
2084: Pa_Rbs_Elements
2085: Where
2086: Parent_Element_Id = P_Par_Element_Id;
2087:
2088: -- Gets the parent outline number

Line 2093: Pa_Rbs_Elements

2089: Cursor c2(P_Par_Element_Id IN Number) Is
2090: Select
2091: Outline_Number
2092: From
2093: Pa_Rbs_Elements
2094: Where
2095: Rbs_Element_Id = P_Par_Element_Id;
2096:
2097: -- Gets all the children of the parent for update.

Line 2103: Pa_Rbs_Elements

2099: Select
2100: Rbs_Element_Id,
2101: Order_Number
2102: From
2103: Pa_Rbs_Elements
2104: Where
2105: Parent_Element_Id = P_Par_Element_Id
2106: For Update of Outline_Number NoWait;
2107:

Line 2159: Update pa_rbs_elements

2155: l_order_number := l_order_number + 1;
2156:
2157: Pa_Debug.G_Stage := 'Update the child rbs element record with new ' ||
2158: 'order number and outline number - update 1.';
2159: Update pa_rbs_elements
2160: Set
2161: Order_Number = l_Order_Number,
2162: Outline_Number = decode(l_Par_Outline_Number,'0',
2163: to_char(l_Order_Number),

Line 2172: Update Pa_Rbs_Elements

2168: Else
2169:
2170: Pa_Debug.G_Stage := 'Update the child rbs element record with the ' ||
2171: 'outline number - update 2 .';
2172: Update Pa_Rbs_Elements
2173: Set
2174: Outline_Number = decode(l_Par_Outline_Number,'0',
2175: to_char(l_Rbs_Rec.Order_Number),
2176: l_Par_Outline_Number || '.' || to_char(l_Rbs_Rec.Order_Number))

Line 2210: Pa_Rbs_Elements

2206: Parent_Element_Id,
2207: Resource_Type_Id,
2208: Resource_Source_Id
2209: From
2210: Pa_Rbs_Elements
2211: Where
2212: User_Created_Flag = 'Y'
2213: Start With
2214: Parent_Element_Id = P_Rbs_Elem_Id

Line 2264: Pa_Rbs_Elements_Pvt.GetParentRbsData(

2260: Fetch c1 Into l_Child_Rec;
2261: Exit When c1%NotFound;
2262:
2263: Pa_Debug.G_Stage := 'Call GetParentRbsData() procedure.';
2264: Pa_Rbs_Elements_Pvt.GetParentRbsData(
2265: P_Parent_Element_Id => l_Child_Rec.Parent_Element_Id,
2266: X_Person_Id => l_Person_Id,
2267: X_Job_Id => l_Job_Id,
2268: X_Organization_Id => l_Organization_Id,

Line 2290: Pa_Debug.G_Stage := 'Get the Resource Type by calling Pa_Rbs_Elements_Utils.GetResTypeCode() function.';

2286: X_Supplier_Id => l_Supplier_Id,
2287: X_Rbs_Level => l_Dummy_Rbs_Level,
2288: X_Outline_Number => l_Dummy_Outline_Number);
2289:
2290: Pa_Debug.G_Stage := 'Get the Resource Type by calling Pa_Rbs_Elements_Utils.GetResTypeCode() function.';
2291: l_Resource_Type := Pa_Rbs_Elements_Utils.GetResTypeCode(P_Res_Type_Id => l_Child_Rec.Resource_Type_Id);
2292:
2293: Pa_Debug.G_Stage := 'Determine which resource type we have for this element to properly assign the resource source id.';
2294: If l_Resource_Type = 'BOM_LABOR' Then

Line 2291: l_Resource_Type := Pa_Rbs_Elements_Utils.GetResTypeCode(P_Res_Type_Id => l_Child_Rec.Resource_Type_Id);

2287: X_Rbs_Level => l_Dummy_Rbs_Level,
2288: X_Outline_Number => l_Dummy_Outline_Number);
2289:
2290: Pa_Debug.G_Stage := 'Get the Resource Type by calling Pa_Rbs_Elements_Utils.GetResTypeCode() function.';
2291: l_Resource_Type := Pa_Rbs_Elements_Utils.GetResTypeCode(P_Res_Type_Id => l_Child_Rec.Resource_Type_Id);
2292:
2293: Pa_Debug.G_Stage := 'Determine which resource type we have for this element to properly assign the resource source id.';
2294: If l_Resource_Type = 'BOM_LABOR' Then
2295:

Line 2412: Update Pa_Rbs_Elements

2408:
2409: End If;
2410:
2411: Pa_Debug.G_Stage := 'Update the child element record.';
2412: Update Pa_Rbs_Elements
2413: Set
2414: Person_Id = l_Person_Id,
2415: Job_Id = l_Job_Id,
2416: Organization_Id = l_Organization_Id,

Line 2453: End Pa_Rbs_Elements_Pvt;

2449: Raise;
2450:
2451: End Update_Children_Data;
2452:
2453: End Pa_Rbs_Elements_Pvt;