[Home] [Help]
PACKAGE BODY: APPS.PQH_RT_MATRIX_NODE_VALUES_API
Source
1 Package Body PQH_RT_MATRIX_NODE_VALUES_API as
2 /* $Header: pqrmvapi.pkb 120.3 2005/07/13 04:53:01 srenukun noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := 'PQH_RT_MATRIX_NODE_VALUES_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------<create_rt_matrix_node_value >-------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_rt_matrix_node_value
13 (p_validate in boolean default false
14 ,p_effective_date in date
15 ,p_NODE_VALUE_ID out nocopy number
16 ,p_RATE_MATRIX_NODE_ID in number
17 ,p_SHORT_CODE in varchar2
18 ,p_CHAR_VALUE1 in varchar2 default null
19 ,p_CHAR_VALUE2 in varchar2 default null
20 ,p_CHAR_VALUE3 in varchar2 default null
21 ,p_CHAR_VALUE4 in varchar2 default null
22 ,p_NUMBER_VALUE1 in number default null
23 ,p_NUMBER_VALUE2 in number default null
24 ,p_NUMBER_VALUE3 in number default null
25 ,p_NUMBER_VALUE4 in number default null
26 ,p_DATE_VALUE1 in date default null
27 ,p_DATE_VALUE2 in date default null
28 ,p_DATE_VALUE3 in date default null
29 ,p_DATE_VALUE4 in date default null
30 ,p_BUSINESS_GROUP_ID in number default null
31 ,p_LEGISLATION_CODE in varchar2 default null
32 ,p_object_version_number out nocopy number
33 )
34 is
35 --
36 -- Declare cursors and local variables
37 --
38 l_effective_date date;
39 l_node_value_id PQH_RT_MATRIX_NODE_VALUES.node_value_id%TYPE;
40 l_object_version_number PQH_RT_MATRIX_NODE_VALUES.object_version_number%TYPE;
41 l_proc varchar2(72) := g_package||'create_rate_matrix_node';
42 begin
43 hr_utility.set_location('Entering:'|| l_proc, 10);
44 --
45 -- Issue a savepoint
46 --
47 savepoint create_rt_matrix_node_value;
48 --
49 -- Remember IN OUT parameter IN values
50 --
51
52 --
53 -- Truncate the time portion from all IN date parameters
54 --
55 l_effective_date := trunc(p_effective_date);
56
57 --
58 -- Call Before Process User Hook
59 --
60 begin
61 PQH_RT_MATRIX_NODE_VALUES_BK1.create_rt_matrix_node_value_b
62 (p_effective_date => l_effective_date
63 ,p_RATE_MATRIX_NODE_ID => p_rate_matrix_node_id
64 ,p_SHORT_CODE => p_short_code
65 ,p_CHAR_VALUE1 => p_char_value1
66 ,p_CHAR_VALUE2 => p_char_value2
67 ,p_CHAR_VALUE3 => p_char_value3
68 ,p_CHAR_VALUE4 => p_char_value4
69 ,p_NUMBER_VALUE1 => p_number_value1
70 ,p_NUMBER_VALUE2 => p_number_value2
71 ,p_NUMBER_VALUE3 => p_number_value3
72 ,p_NUMBER_VALUE4 => p_number_value4
73 ,p_DATE_VALUE1 => p_date_value1
74 ,p_DATE_VALUE2 => p_date_value2
75 ,p_DATE_VALUE3 => p_date_value3
76 ,p_DATE_VALUE4 => p_date_value4
77 ,p_BUSINESS_GROUP_ID => p_business_group_id
78 ,p_LEGISLATION_CODE => p_legislation_code
79 );
80 exception
81 when hr_api.cannot_find_prog_unit then
82 hr_api.cannot_find_prog_unit_error
83 (p_module_name => 'create_rt_matrix_node_value'
84 ,p_hook_type => 'BP'
85 );
86 end;
87 --
88 -- Validation in addition to Row Handlers
89 --
90
91
92
93 --
94 -- Process Logic
95 --
96 PQH_RMV_INS.ins
97 (p_rate_matrix_node_id => p_RATE_MATRIX_NODE_ID
98 ,p_short_code => p_short_code
99 ,p_char_value1 => p_char_value1
100 ,p_char_value2 => p_char_value2
101 ,p_char_value3 => p_char_value3
102 ,p_char_value4 => p_char_value4
103 ,p_number_value1 => p_number_value1
104 ,p_number_value2 => p_number_value2
105 ,p_number_value3 => p_number_value3
106 ,p_number_value4 => p_number_value4
107 ,p_date_value1 => p_date_value1
108 ,p_date_value2 => p_date_value2
109 ,p_date_value3 => p_date_value3
110 ,p_date_value4 => p_date_value4
111 ,p_business_group_id => p_business_Group_id
112 ,p_legislation_code => p_legislation_code
113 ,p_node_value_id => l_node_value_id
114 ,p_object_version_number =>l_object_version_number
115 );
116
117
118 --
119 -- Call After Process User Hook
120 --
121 begin
122 PQH_RT_MATRIX_NODE_VALUES_BK1.create_rt_matrix_node_value_a
123 (p_effective_date => p_effective_date
124 ,p_NODE_VALUE_ID =>l_node_value_id
125 ,p_RATE_MATRIX_NODE_ID => p_rate_matrix_node_id
126 ,p_SHORT_CODE => p_short_code
127 ,p_char_value1 => p_char_value1
128 ,p_char_value2 => p_char_value2
129 ,p_char_value3 => p_char_value3
130 ,p_char_value4 => p_char_value4
131 ,p_number_value1 => p_number_value1
132 ,p_number_value2 => p_number_value2
133 ,p_number_value3 => p_number_value3
134 ,p_number_value4 => p_number_value4
135 ,p_date_value1 => p_date_value1
136 ,p_date_value2 => p_date_value2
137 ,p_date_value3 => p_date_value3
138 ,p_date_value4 => p_date_value4
139 ,p_BUSINESS_GROUP_ID => p_business_group_id
140 ,p_LEGISLATION_CODE => p_legislation_code
141 ,p_object_version_number => l_object_version_number
142 );
143 exception
144 when hr_api.cannot_find_prog_unit then
145 hr_api.cannot_find_prog_unit_error
146 (p_module_name => 'create_rt_matrix_node_value'
147 ,p_hook_type => 'AP'
148 );
149 end;
150 --
151 -- When in validation only mode raise the Validate_Enabled exception
152 --
153 if p_validate then
154 raise hr_api.validate_enabled;
155 end if;
156 --
157 -- Set all IN OUT and OUT parameters with out values
158 --
159 p_node_VALUE_id := l_node_value_id;
160 p_object_version_number := l_object_version_number;
161 --
162 hr_utility.set_location(' Leaving:'||l_proc, 70);
163 exception
164 when hr_api.validate_enabled then
165 --
166 -- As the Validate_Enabled exception has been raised
167 -- we must rollback to the savepoint
168 --
169 rollback to create_rt_matrix_node_value;
170 --
171 -- Reset IN OUT parameters and set OUT parameters
172 -- (Any key or derived arguments must be set to null
173 -- when validation only mode is being used.)
174 --
175 p_NODE_VALUE_ID := null;
176 p_object_version_number := null;
177
178 hr_utility.set_location(' Leaving:'||l_proc, 80);
179 when others then
180 --
181 -- A validation or unexpected error has occured
182 --
183 rollback to create_rt_matrix_node_value;
184 --
185 -- Reset IN OUT parameters and set all
186 -- OUT parameters, including warnings, to null
187 --
188 p_NODE_VALUE_ID := null;
189 p_object_version_number := null;
190
191 hr_utility.set_location(' Leaving:'||l_proc, 90);
192 raise;
193 end create_rt_matrix_node_value;
194 --
195 -- ----------------------------------------------------------------------------
196 -- |--------------------------< update_rt_matrix_node_value>--------------------------|
197 -- ----------------------------------------------------------------------------
198 --
199 procedure update_rt_matrix_node_value
200 (p_validate in boolean default false
201 ,p_effective_date in date
202 ,p_NODE_VALUE_ID in number
203 ,p_RATE_MATRIX_NODE_ID in number
204 ,p_SHORT_CODE in varchar2
205 ,p_CHAR_VALUE1 in varchar2 default hr_api.g_varchar2
206 ,p_CHAR_VALUE2 in varchar2 default hr_api.g_varchar2
207 ,p_CHAR_VALUE3 in varchar2 default hr_api.g_varchar2
208 ,p_CHAR_VALUE4 in varchar2 default hr_api.g_varchar2
209 ,p_NUMBER_VALUE1 in number default hr_api.g_number
210 ,p_NUMBER_VALUE2 in number default hr_api.g_number
211 ,p_NUMBER_VALUE3 in number default hr_api.g_number
212 ,p_NUMBER_VALUE4 in number default hr_api.g_number
213 ,p_DATE_VALUE1 in date default hr_api.g_date
214 ,p_DATE_VALUE2 in date default hr_api.g_date
215 ,p_DATE_VALUE3 in date default hr_api.g_date
216 ,p_DATE_VALUE4 in date default hr_api.g_date
217 ,p_BUSINESS_GROUP_ID in number default hr_api.g_number
218 ,p_LEGISLATION_CODE in varchar2 default hr_api.g_varchar2
219 ,p_object_version_number in out nocopy number
220 )
221 is
222 --
223 -- Declare cursors and local variables
224 --
225 l_object_version_number PQH_RT_MATRIX_NODE_VALUES.object_version_number%TYPE;
226 l_effective_date date;
227 l_proc varchar2(72) := g_package||'update_rt_matrix_node_value';
228 begin
229 hr_utility.set_location('Entering:'|| l_proc, 10);
230 --
231 -- Issue a savepoint
232 --
233 savepoint update_rt_matrix_node_value;
234 --
235 -- Remember IN OUT parameter IN values
236 --
237 l_object_version_number := p_object_version_number;
238
239 --
240 -- Truncate the time portion from all IN date parameters
241 --
242 l_effective_date := trunc(p_effective_date);
243
244 --
245 -- Call Before Process User Hook
246 --
247 begin
248 PQH_RT_MATRIX_NODE_VALUES_BK2.update_rt_matrix_node_value_b
249 (p_effective_date => l_effective_date
250 ,p_NODE_VALUE_ID =>p_node_value_id
251 ,p_RATE_MATRIX_NODE_ID => p_rate_matrix_node_id
252 ,p_SHORT_CODE => p_short_code
253 ,p_CHAR_VALUE1 => p_char_value1
254 ,p_CHAR_VALUE2 => p_char_value2
255 ,p_CHAR_VALUE3 => p_char_value3
256 ,p_CHAR_VALUE4 => p_char_value4
257 ,p_NUMBER_VALUE1 => p_number_value1
258 ,p_NUMBER_VALUE2 => p_number_value2
259 ,p_NUMBER_VALUE3 => p_number_value3
260 ,p_NUMBER_VALUE4 => p_number_value4
261 ,p_DATE_VALUE1 => p_date_value1
262 ,p_DATE_VALUE2 => p_date_value2
263 ,p_DATE_VALUE3 => p_date_value3
264 ,p_DATE_VALUE4 => p_date_value4
265 ,p_BUSINESS_GROUP_ID => p_business_group_id
266 ,p_LEGISLATION_CODE => p_legislation_code
267 ,p_object_version_number => l_object_version_number
268 );
269
270 exception
271 when hr_api.cannot_find_prog_unit then
272 hr_api.cannot_find_prog_unit_error
273 (p_module_name => 'update_rt_matrix_node_value'
274 ,p_hook_type => 'BP'
275 );
276 end;
277 --
278 -- Validation in addition to Row Handlers
279 --
280
281
282
283 --
284 -- Process Logic
285 --
286 PQH_RMV_UPD.upd
287 (p_node_value_id => p_node_value_id
288 ,p_object_version_number => l_object_version_number
289 ,p_RATE_MATRIX_NODE_ID => p_rate_matrix_node_id
290 ,p_SHORT_CODE => p_short_code
291 ,p_CHAR_VALUE1 => p_char_value1
292 ,p_CHAR_VALUE2 => p_char_value2
293 ,p_CHAR_VALUE3 => p_char_value3
294 ,p_CHAR_VALUE4 => p_char_value4
295 ,p_NUMBER_VALUE1 => p_number_value1
296 ,p_NUMBER_VALUE2 => p_number_value2
297 ,p_NUMBER_VALUE3 => p_number_value3
298 ,p_NUMBER_VALUE4 => p_number_value4
299 ,p_DATE_VALUE1 => p_date_value1
300 ,p_DATE_VALUE2 => p_date_value2
301 ,p_DATE_VALUE3 => p_date_value3
302 ,p_DATE_VALUE4 => p_date_value4
303 ,p_BUSINESS_GROUP_ID => p_business_group_id
304 ,p_LEGISLATION_CODE => p_legislation_code
305 );
306
307
308 --
309 -- Call After Process User Hook
310 --
311 begin
312 PQH_RT_MATRIX_NODE_VALUES_BK2.update_rt_matrix_node_value_a
313 (p_effective_date => l_effective_date
314 ,p_NODE_VALUE_ID =>p_node_value_id
315 ,p_RATE_MATRIX_NODE_ID => p_rate_matrix_node_id
316 ,p_SHORT_CODE => p_short_code
317 ,p_CHAR_VALUE1 => p_char_value1
318 ,p_CHAR_VALUE2 => p_char_value2
319 ,p_CHAR_VALUE3 => p_char_value3
320 ,p_CHAR_VALUE4 => p_char_value4
321 ,p_NUMBER_VALUE1 => p_number_value1
322 ,p_NUMBER_VALUE2 => p_number_value2
323 ,p_NUMBER_VALUE3 => p_number_value3
324 ,p_NUMBER_VALUE4 => p_number_value4
325 ,p_DATE_VALUE1 => p_date_value1
326 ,p_DATE_VALUE2 => p_date_value2
327 ,p_DATE_VALUE3 => p_date_value3
328 ,p_DATE_VALUE4 => p_date_value4
329 ,p_BUSINESS_GROUP_ID => p_business_group_id
330 ,p_LEGISLATION_CODE => p_legislation_code
331 ,p_object_version_number => l_object_version_number
332 );
333 exception
334 when hr_api.cannot_find_prog_unit then
335 hr_api.cannot_find_prog_unit_error
336 (p_module_name => 'update_rt_matrix_node_value'
337 ,p_hook_type => 'AP'
338 );
339 end;
340 --
341 -- When in validation only mode raise the Validate_Enabled exception
342 --
343 if p_validate then
344 raise hr_api.validate_enabled;
345 end if;
346 --
347 -- Set all IN OUT and OUT parameters with out values
348 --
349 p_object_version_number := l_object_version_number;
350 --
351 hr_utility.set_location(' Leaving:'||l_proc, 70);
352 exception
353 when hr_api.validate_enabled then
354 --
355 -- As the Validate_Enabled exception has been raised
356 -- we must rollback to the savepoint
357 --
358 rollback to update_rt_matrix_node_value;
359 --
360 -- Reset IN OUT parameters and set OUT parameters
361 -- (Any key or derived arguments must be set to null
362 -- when validation only mode is being used.)
363 --
364 p_object_version_number := p_object_version_number;
365 hr_utility.set_location(' Leaving:'||l_proc, 80);
366 when others then
367 --
368 -- A validation or unexpected error has occured
369 --
370 rollback to update_rt_matrix_node_value;
371 --
372 -- Reset IN OUT parameters and set all
373 -- OUT parameters, including warnings, to null
374 --
375 p_object_version_number := p_object_version_number;
376 hr_utility.set_location(' Leaving:'||l_proc, 90);
377 raise;
378 end update_rt_matrix_node_value;
379 --
380 -- ----------------------------------------------------------------------------
381 -- |--------------------------< delete_rt_matrix_node_value>--------------------------|
382 -- ----------------------------------------------------------------------------
383 --
384 procedure delete_rt_matrix_node_value
385 (p_validate in boolean default false
386 ,p_effective_date in date
387 ,p_NODE_VALUE_ID in number
388 ,p_object_version_number in number
389 )
390 is
391 --
392 -- Declare cursors and local variables
393 --
394 l_effective_date date;
395 l_proc varchar2(72) := g_package||'delete_rt_matrix_node_value';
396 begin
397 hr_utility.set_location('Entering:'|| l_proc, 10);
398 --
399 -- Issue a savepoint
400 --
401 savepoint delete_rt_matrix_node_value;
402 --
403 -- Remember IN OUT parameter IN values
404 --
405
406 --
407 -- Truncate the time portion from all IN date parameters
408 --
409 l_effective_date := trunc(p_effective_date);
410
411 --
412 -- Call Before Process User Hook
413 --
414 begin
415 PQH_RT_MATRIX_NODE_VALUES_BK3.delete_rt_matrix_node_value_b
416 (p_effective_date => l_effective_date
417 ,p_NODE_value_ID => p_node_value_id
418 ,p_object_version_number => p_object_version_number
419 );
420
421 exception
422 when hr_api.cannot_find_prog_unit then
423 hr_api.cannot_find_prog_unit_error
424 (p_module_name => 'delete_rt_matrix_node_value'
425 ,p_hook_type => 'BP'
426 );
427 end;
428 --
429 -- Validation in addition to Row Handlers
430 --
431
432
433
434 --
435 -- Process Logic
436 --
437 PQH_RMV_DEL.del
438 (p_node_value_id => p_node_value_id
439 ,p_object_version_number => p_object_version_number
440 );
441
442
443 --
444 -- Call After Process User Hook
445 --
446 begin
447 PQH_RT_MATRIX_NODE_VALUES_BK3.delete_rt_matrix_node_value_a
448 (p_effective_date => l_effective_date
449 ,p_NODE_value_ID => p_node_value_id
450 ,p_object_version_number => p_object_version_number
451 );
452
453 exception
454 when hr_api.cannot_find_prog_unit then
455 hr_api.cannot_find_prog_unit_error
456 (p_module_name => 'delete_rt_matrix_node_value'
457 ,p_hook_type => 'AP'
458 );
459 end;
460 --
461 -- When in validation only mode raise the Validate_Enabled exception
462 --
463 if p_validate then
464 raise hr_api.validate_enabled;
465 end if;
466 --
467 -- Set all IN OUT and OUT parameters with out values
468 --
469 --
470 hr_utility.set_location(' Leaving:'||l_proc, 70);
471 exception
472 when hr_api.validate_enabled then
473 --
474 -- As the Validate_Enabled exception has been raised
475 -- we must rollback to the savepoint
476 --
477 rollback to delete_rt_matrix_node_value;
478 --
479 -- Reset IN OUT parameters and set OUT parameters
480 -- (Any key or derived arguments must be set to null
481 -- when validation only mode is being used.)
482 --
483 hr_utility.set_location(' Leaving:'||l_proc, 80);
484 when others then
485 --
486 -- A validation or unexpected error has occured
487 --
488 rollback to delete_rt_matrix_node_value;
489 --
490 -- Reset IN OUT parameters and set all
491 -- OUT parameters, including warnings, to null
492 --
493 hr_utility.set_location(' Leaving:'||l_proc, 90);
494 raise;
495 end delete_rt_matrix_node_value;
496 --
497 end PQH_RT_MATRIX_NODE_VALUES_API;