1 Package hr_hierarchy_element_internal AUTHID CURRENT_USER as
2 /* $Header: peosebsi.pkh 115.4 2002/12/06 16:21:11 pkakar noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |----------------< create_hier_element_internal >-------------------------|
6 -- ----------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- This business support process calls the business process to creates a
11 -- new parent-child element in an organization hierarchy. When called from
12 -- here, p_validate is always set to false.
13 --
14 -- Prerequisites:
15 -- Parent Organization must be active from the Hierarchy Version date
16 --
17 -- In Parameters:
18 -- Name Reqd Type Description
19 --
20 -- p_organization_id_parent yes number fk to hr_all_organization_units
21 -- p_org_structure_version_id yes number fk to per_org_structure_versions
22 -- p_organization_id_child yes number fk to hr_all_organization_units
23 -- p_business_group_id yes number business group context
24 -- p_date_from yes DATE required to check parent org is
25 -- active for hierarchy version
26 -- p_security_profile_id yes NUMBER used to add orgs in hierarchy
27 -- to per_organization_list
28 -- p_view_all_orgs yes VARCHAR2 flag used to define if
29 -- per_organization_list should
30 -- be populated (secure_user)
31 -- p_end_of_time yes DATE end of time
32 -- p_hr_installed yes VARCHAR2 check fnd_product_installations
33 -- set to 'I' if installed
34 -- p_pa_installed yes VARCHAR2 check fnd_product_installations
35 -- set to 'I' if installed
36 -- p_warning_raised no VARCHAR2 flag if org is not active from
37 -- Hierarchy Version date
38 --
39 --
40 -- Post Success:
41 -- row is created
42 --
43 --
44 -- Post Failure:
45 --
46 -- The procedure will raise an error.
47 --
48 -- Access Status:
49 -- Internal Development Use Only.
50 --
51 -- {End Of Comments}
52 --
53 procedure create_hier_element_internal
54 (p_organization_id_parent in number
55 ,p_org_structure_version_id in number
56 ,p_organization_id_child in number
57 ,p_business_group_id in number default null
58 ,p_effective_date in DATE
59 ,p_date_from in DATE
60 ,p_security_profile_id in NUMBER
61 ,p_view_all_orgs in VARCHAR2
62 ,p_end_of_time in DATE
63 ,p_hr_installed in VARCHAR2
64 ,p_pa_installed in VARCHAR2
65 ,p_pos_control_enabled_flag in varchar2
66 ,p_warning_raised IN OUT NOCOPY VARCHAR2
67 ,p_org_structure_element_id out nocopy number
68 ,p_object_version_number out nocopy number
69 );
70 --
71 --
72 -- ----------------------------------------------------------------------------
73 -- |----------------< update_hier_element_internal >-------------------------|
74 -- ----------------------------------------------------------------------------
75 -- {Start Of Comments}
76 --
77 -- Description:
78 -- This business support process calls the business process to update a
79 -- parent-child element in an organization hierarchy. When called from
80 -- here, p_validate is always set to false.
81 --
82 -- Prerequisites:
83 -- none
84 --
85 -- In Parameters:
86 -- Name Reqd Type Description
87 --
88 -- p_org_structure_element_id yes number primary key
89 -- p_organization_id_parent yes number fk to hr_all_organization_units
90 -- p_organization_id_child yes number fk to hr_all_organization_units
91 -- p_object_version_number yes number object version number
92 --
93 --
94 -- Post Success:
95 -- row is updated
96 --
97 --
98 -- Post Failure:
99 --
100 -- The procedure will raise an error.
101 --
102 --
103 -- Access Status:
104 -- Internal Development Use Only.
105 --
106 -- {End Of Comments}
107 --
108 procedure update_hier_element_internal
109 (p_org_structure_element_id in number
110 ,p_effective_date in date
111 ,p_organization_id_parent in number default hr_api.g_number
112 ,p_organization_id_child in number default hr_api.g_number
113 ,p_pos_control_enabled_flag in varchar2 default hr_api.g_varchar2
114 ,p_object_version_number in out nocopy number
115 );
116 --
117 --
118 -- ----------------------------------------------------------------------------
119 -- |----------------< delete_hier_element_internal >-------------------------|
120 -- ----------------------------------------------------------------------------
121 -- {Start Of Comments}
122 --
123 -- Description:
124 -- This business support process calls the business process to remove a
125 -- parent-child element from an organization hierarchy. When called from
126 -- here, p_validate is always set to false.
127 --
128 -- Prerequisites:
129 -- element cannot be deleted if children exist.
130 -- If the child org in the element = top org in an
131 -- security_profile and hierarchies are the same
132 -- then cannot delete it.
133 -- Similarly if the parent_org in the element = top org in a
134 -- security_profile and hierarchies are the same
135 -- then you cannot delete it if it is the parent of no other
136 -- org_structure_element for this version.
137 -- If an Org structure has been specified for
138 -- PA use then it should not be allowed to be deleted.
139 --
140 --
141 -- In Parameters:
142 -- Name Reqd Type Description
143 --
144 -- p_org_structure_element_id yes number primary key
145 -- p_object_version_number yes number object version number
146 -- p_hr_installed yes VARCHAR2 check fnd_product_installations
147 -- set to 'I' if installed
148 -- p_pa_installed yes VARCHAR2 check fnd_product_installations
149 -- set to 'I' if installed
150 -- p_exists_in_hierarchy yes VARCHAR2 set in value to 'Y'
151 -- is set to 'Y' if the child org is
152 -- present in the hierarchy after
153 -- the delete, else set to 'N'
154 --
155 --
156 -- Post Success:
157 -- row is deleted
158 --
159 --
160 -- Post Failure:
161 --
162 -- The procedure will raise an error.
163 --
164 --
165 -- Access Status:
166 -- Internal Development Use Only.
167 --
168 -- {End Of Comments}
169 --
170 procedure delete_hier_element_internal
171 (p_org_structure_element_id in number
172 ,p_object_version_number in number
173 ,p_hr_installed in VARCHAR2
174 ,p_pa_installed in VARCHAR2
175 ,p_exists_in_hierarchy in out nocopy VARCHAR2
176 );
177 --
178 end hr_hierarchy_element_internal;