[Home] [Help]
PACKAGE BODY: APPS.HXC_SEEDDATA_BY_LEVEL_API
Source
1 Package Body hxc_seeddata_by_level_api as
2 /* $Header: hxchsdapi.pkb 120.2 2005/09/23 10:44:38 sechandr noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' hxc_seeddata_by_level_api.';
7 g_debug boolean :=hr_utility.debug_enabled;
8 --
9 -- ----------------------------------------------------------------------------
10 -- |----------------------< create_seed_data_by_level >-----------------------|
11 -- ----------------------------------------------------------------------------
12 --
13 procedure create_seed_data_by_level
14 (p_validate in boolean default false
15 ,p_object_id in number
16 ,p_object_type in varchar2
17 ,p_hxc_required in varchar2
18 ,p_owner_application_id in number
19 ) is
20 --
21 -- Declare cursors and local variables
22 --
23 l_proc varchar2(72);
24 begin
25 g_debug:=hr_utility.debug_enabled;
26 if g_debug then
27 l_proc := g_package||'create_seed_data_by_level';
28 hr_utility.set_location('Entering:'|| l_proc, 10);
29 end if;
30 --
31 -- Issue a savepoint
32 --
33 savepoint create_seed_data_by_level;
34
35 --
36 -- Call Before Process User Hook
37 --
38 begin
39 hxc_seeddata_by_level_bk1.create_seed_data_by_level_b
40 (p_object_id => p_object_id
41 ,p_object_type => p_object_type
42 ,p_hxc_required => p_hxc_required
43 ,p_owner_application_id => p_owner_application_id
44 );
45 exception
46 when hr_api.cannot_find_prog_unit then
47 hr_api.cannot_find_prog_unit_error
48 (p_module_name => 'create_seed_data_by_level'
49 ,p_hook_type => 'BP'
50 );
51 end;
52 --
53 -- Validation in addition to Row Handlers
54 --
55
56
57 --
58 -- Process Logic
59 --
60 hxc_hsd_ins.ins(
61 p_hxc_required => p_hxc_required
62 ,p_owner_application_id => p_owner_application_id
63 ,p_object_id => p_object_id
64 ,p_object_type => p_object_type
65 );
66
67
68 --
69 -- Call After Process User Hook
70 --
71 begin
72 hxc_seeddata_by_level_bk1.create_seed_data_by_level_a
73 (p_object_id => p_object_id
74 ,p_object_type => p_object_type
75 ,p_hxc_required => p_hxc_required
76 ,p_owner_application_id => p_owner_application_id
77 );
78 exception
79 when hr_api.cannot_find_prog_unit then
80 hr_api.cannot_find_prog_unit_error
81 (p_module_name => 'create_seed_data_by_level'
82 ,p_hook_type => 'AP'
83 );
84 end;
85 --
86 -- When in validation only mode raise the Validate_Enabled exception
87 --
88 if p_validate then
89 raise hr_api.validate_enabled;
90 end if;
91 --
92 if g_debug then
93 hr_utility.set_location(' Leaving:'||l_proc, 70);
94 end if;
95 exception
96 when hr_api.validate_enabled then
97 --
98 -- As the Validate_Enabled exception has been raised
99 -- we must rollback to the savepoint
100 --
101 rollback to create_seed_data_by_level;
102 --
103 if g_debug then
104 hr_utility.set_location(' Leaving:'||l_proc, 80);
105 end if;
106 when others then
107 --
108 -- A validation or unexpected error has occured
109 --
110 rollback to create_seed_data_by_level;
111 --
112 if g_debug then
113 hr_utility.set_location(' Leaving:'||l_proc, 90);
114 end if;
115 raise;
116 end create_seed_data_by_level;
117 --
118
119 -- ----------------------------------------------------------------------------
120 -- |----------------------< update_seed_data_by_level >-----------------------|
121 -- ----------------------------------------------------------------------------
122 --
123 procedure update_seed_data_by_level
124 (p_validate in boolean default false
125 ,p_object_id in number
126 ,p_object_type in varchar2
127 ,p_hxc_required in varchar2
128 ,p_owner_application_id in number
129 ) is
130 --
131 -- Declare cursors and local variables
132 --
133 l_proc varchar2(72);
134 begin
135 g_debug:=hr_utility.debug_enabled;
136 if g_debug then
137 l_proc := g_package||'update_seed_data_by_level';
138 hr_utility.set_location('Entering:'|| l_proc, 10);
139 end if;
140 --
141 -- Issue a savepoint
142 --
143 savepoint update_seed_data_by_level;
144
145 --
146 -- Call Before Process User Hook
147 --
148 begin
149 hxc_seeddata_by_level_bk1.update_seed_data_by_level_b
150 (p_object_id => p_object_id
151 ,p_object_type => p_object_type
152 ,p_hxc_required => p_hxc_required
153 ,p_owner_application_id => p_owner_application_id
154 );
155
156 exception
157 when hr_api.cannot_find_prog_unit then
158 hr_api.cannot_find_prog_unit_error
159 (p_module_name => 'update_seed_data_by_level'
160 ,p_hook_type => 'BP'
161 );
162 end;
163 --
164 -- Validation in addition to Row Handlers
165 --
166
167
168 --
169 -- Process Logic
170 --
171 hxc_hsd_upd.upd(
172 p_hxc_required => p_hxc_required
173 ,p_owner_application_id => p_owner_application_id
174 ,p_object_id => p_object_id
175 ,p_object_type => p_object_type
176 );
177
178
179 --
180 -- Call After Process User Hook
181 --
182 begin
183 hxc_seeddata_by_level_bk1.update_seed_data_by_level_a
184 (p_object_id => p_object_id
185 ,p_object_type => p_object_type
186 ,p_hxc_required => p_hxc_required
187 ,p_owner_application_id => p_owner_application_id
188 );
189 exception
190 when hr_api.cannot_find_prog_unit then
191 hr_api.cannot_find_prog_unit_error
192 (p_module_name => 'update_seed_data_by_level'
193 ,p_hook_type => 'AP'
194 );
195 end;
196 --
197 -- When in validation only mode raise the Validate_Enabled exception
198 --
199 if p_validate then
200 raise hr_api.validate_enabled;
201 end if;
202 --
203 if g_debug then
204 hr_utility.set_location(' Leaving:'||l_proc, 70);
205 end if;
206 exception
207 when hr_api.validate_enabled then
208 --
209 -- As the Validate_Enabled exception has been raised
210 -- we must rollback to the savepoint
211 --
212 rollback to update_seed_data_by_level;
213 --
214 if g_debug then
215 hr_utility.set_location(' Leaving:'||l_proc, 80);
216 end if;
217 when others then
218 --
219 -- A validation or unexpected error has occured
220 --
221 rollback to update_seed_data_by_level;
222 --
223 if g_debug then
224 hr_utility.set_location(' Leaving:'||l_proc, 90);
225 end if;
226 raise;
227 end update_seed_data_by_level;
228
229
230 -- ----------------------------------------------------------------------------
231 -- |----------------------< delete_seed_data_by_level >-----------------------|
232 -- ----------------------------------------------------------------------------
233 --
234 procedure delete_seed_data_by_level
235 (p_validate in boolean default false
236 ,p_object_id in number
237 ,p_object_type in varchar2
238 ) is
239 --
240 -- Declare cursors and local variables
241 --
242 l_proc varchar2(72);
243 begin
244 g_debug:=hr_utility.debug_enabled;
245 if g_debug then
246 l_proc := g_package||'delete_seed_data_by_level';
247 hr_utility.set_location('Entering:'|| l_proc, 10);
248 end if;
249 --
250 -- Issue a savepoint
251 --
252 savepoint delete_seed_data_by_level;
253
254 --
255 -- Call Before Process User Hook
256 --
257 begin
258 hxc_seeddata_by_level_bk1.delete_seed_data_by_level_b
259 (p_object_id => p_object_id
260 ,p_object_type => p_object_type
261 );
262
263
264 exception
265 when hr_api.cannot_find_prog_unit then
266 hr_api.cannot_find_prog_unit_error
267 (p_module_name => 'delete_seed_data_by_level'
268 ,p_hook_type => 'BP'
269 );
270 end;
271 --
272 -- Validation in addition to Row Handlers
273 --
274
275 --
276 -- Process Logic
277 --
278 hxc_hsd_del.del(
279 p_object_id => p_object_id
280 ,p_object_type => p_object_type
281 );
282
283
284 -- Call After Process User Hook
285 --
286 begin
287 hxc_seeddata_by_level_bk1.delete_seed_data_by_level_a
288 (p_object_id => p_object_id
289 ,p_object_type => p_object_type
290 );
291 exception
292 when hr_api.cannot_find_prog_unit then
293 hr_api.cannot_find_prog_unit_error
294 (p_module_name => 'delete_seed_data_by_level'
295 ,p_hook_type => 'AP'
296 );
297 end;
298 --
299 -- When in validation only mode raise the Validate_Enabled exception
300 --
301 if p_validate then
302 raise hr_api.validate_enabled;
303 end if;
304 --
305 if g_debug then
306 hr_utility.set_location(' Leaving:'||l_proc, 70);
307 end if;
308 exception
309 when hr_api.validate_enabled then
310 --
311 -- As the Validate_Enabled exception has been raised
312 -- we must rollback to the savepoint
313 --
314 rollback to delete_seed_data_by_level;
315 --
316 if g_debug then
317 hr_utility.set_location(' Leaving:'||l_proc, 80);
318 end if;
319 when others then
320 --
321 -- A validation or unexpected error has occured
322 --
323 rollback to delete_seed_data_by_level;
324 --
325 if g_debug then
326 hr_utility.set_location(' Leaving:'||l_proc, 90);
327 end if;
328 raise;
329 end delete_seed_data_by_level;
330
331 end hxc_seeddata_by_level_api;