[Home] [Help]
PACKAGE BODY: APPS.HR_PERSONAL_SCORECARD_API
Source
1 Package Body hr_personal_scorecard_api as
2 /* $Header: pepmsapi.pkb 120.2 2006/02/27 11:29:46 tpapired noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' hr_personal_scorecard_api.';
7 g_debug boolean := hr_utility.debug_enabled;
8
9 --
10 -- ----------------------------------------------------------------------------
11 -- |--------------------------< create_scorecard >----------------------------|
12 -- ----------------------------------------------------------------------------
13 --
14 procedure create_scorecard
15 (p_validate in boolean default false
16 ,p_effective_date in date
17 ,p_scorecard_name in varchar2
18 ,p_assignment_id in number
19 ,p_start_date in date
20 ,p_end_date in date
21 ,p_plan_id in number default null
22 ,p_creator_type in varchar2 default 'MANUAL'
23 ,p_attribute_category in varchar2 default null
24 ,p_attribute1 in varchar2 default null
25 ,p_attribute2 in varchar2 default null
26 ,p_attribute3 in varchar2 default null
27 ,p_attribute4 in varchar2 default null
28 ,p_attribute5 in varchar2 default null
29 ,p_attribute6 in varchar2 default null
30 ,p_attribute7 in varchar2 default null
31 ,p_attribute8 in varchar2 default null
32 ,p_attribute9 in varchar2 default null
33 ,p_attribute10 in varchar2 default null
34 ,p_attribute11 in varchar2 default null
35 ,p_attribute12 in varchar2 default null
36 ,p_attribute13 in varchar2 default null
37 ,p_attribute14 in varchar2 default null
38 ,p_attribute15 in varchar2 default null
39 ,p_attribute16 in varchar2 default null
40 ,p_attribute17 in varchar2 default null
41 ,p_attribute18 in varchar2 default null
42 ,p_attribute19 in varchar2 default null
43 ,p_attribute20 in varchar2 default null
44 ,p_attribute21 in varchar2 default null
45 ,p_attribute22 in varchar2 default null
46 ,p_attribute23 in varchar2 default null
47 ,p_attribute24 in varchar2 default null
48 ,p_attribute25 in varchar2 default null
49 ,p_attribute26 in varchar2 default null
50 ,p_attribute27 in varchar2 default null
51 ,p_attribute28 in varchar2 default null
52 ,p_attribute29 in varchar2 default null
53 ,p_attribute30 in varchar2 default null
54 ,p_scorecard_id out nocopy number
55 ,p_object_version_number out nocopy number
56 ,p_status_code in varchar2
57 ,p_duplicate_name_warning out nocopy boolean
58 ) is
59 --
60 -- Declare cursors and local variables
61 --
62 l_proc varchar2(72) := g_package||'create_scorecard';
63 l_effective_date date;
64 l_start_date date;
65 l_end_date date;
66 l_scorecard_id number;
67 l_object_version_number number;
68 l_status_code per_personal_scorecards.status_code%TYPE;
69 l_duplicate_name_warning boolean;
70
71 begin
72
73 IF g_debug THEN
74
75 hr_utility.set_location('Entering:'|| l_proc, 10);
76
77 hr_utility.trace(' ');
78 hr_utility.trace(' --------------------------------'||
79 '---------------------------------');
80 hr_utility.trace(' IN / IN OUT PARAMETER '||
81 ' VALUE');
82 hr_utility.trace(' --------------------------------'||
83 '+--------------------------------');
84 hr_utility.trace(' p_effective_date '||
85 to_char(p_effective_date));
86 hr_utility.trace(' p_scorecard_name '||
87 p_scorecard_name);
88 hr_utility.trace(' p_assignment_id '||
89 to_char(p_assignment_id));
90 hr_utility.trace(' p_start_date '||
91 to_char(p_start_date));
92 hr_utility.trace(' p_end_date '||
93 to_char(p_end_date));
94 hr_utility.trace(' p_plan_id '||
95 to_char(p_plan_id));
96 hr_utility.trace(' p_creator_type '||
97 p_creator_type);
98 hr_utility.trace(' p_status_code '||
99 p_status_code);
100 hr_utility.trace(' --------------------------------'||
101 '---------------------------------');
102 hr_utility.trace(' ');
103
104 END IF;
105
106 --
107 -- Issue a savepoint
108 --
109 savepoint create_scorecard;
110
111 --
112 -- Truncate the time portion from all IN date parameters
113 --
114 l_effective_date := trunc(p_effective_date);
115 l_start_date := trunc(p_start_date);
116 l_end_date := trunc(p_end_date);
117
118 --
119 -- Call Before Process User Hook
120 --
121 begin
122 hr_personal_scorecard_bk1.create_scorecard_b
123 (p_effective_date => l_effective_date
124 ,p_scorecard_name => p_scorecard_name
125 ,p_assignment_id => p_assignment_id
126 ,p_start_date => l_start_date
127 ,p_end_date => l_end_date
128 ,p_plan_id => p_plan_id
129 ,p_creator_type => p_creator_type
130 ,p_status_code => p_status_code
131 ,p_attribute_category => p_attribute_category
132 ,p_attribute1 => p_attribute1
133 ,p_attribute2 => p_attribute2
134 ,p_attribute3 => p_attribute3
135 ,p_attribute4 => p_attribute4
136 ,p_attribute5 => p_attribute5
137 ,p_attribute6 => p_attribute6
138 ,p_attribute7 => p_attribute7
139 ,p_attribute8 => p_attribute8
140 ,p_attribute9 => p_attribute9
141 ,p_attribute10 => p_attribute10
142 ,p_attribute11 => p_attribute11
143 ,p_attribute12 => p_attribute12
144 ,p_attribute13 => p_attribute13
145 ,p_attribute14 => p_attribute14
146 ,p_attribute15 => p_attribute15
147 ,p_attribute16 => p_attribute16
148 ,p_attribute17 => p_attribute17
149 ,p_attribute18 => p_attribute18
150 ,p_attribute19 => p_attribute19
151 ,p_attribute20 => p_attribute20
152 ,p_attribute21 => p_attribute21
153 ,p_attribute22 => p_attribute22
154 ,p_attribute23 => p_attribute23
155 ,p_attribute24 => p_attribute24
156 ,p_attribute25 => p_attribute25
157 ,p_attribute26 => p_attribute26
158 ,p_attribute27 => p_attribute27
159 ,p_attribute28 => p_attribute28
160 ,p_attribute29 => p_attribute29
161 ,p_attribute30 => p_attribute30
162 );
163 exception
164 when hr_api.cannot_find_prog_unit then
165 hr_api.cannot_find_prog_unit_error
166 (p_module_name => 'CREATE_SCORECARD'
167 ,p_hook_type => 'BP'
168 );
169 end;
170
171 --
172 -- Process Logic
173 --
174 IF g_debug THEN hr_utility.set_location(l_proc, 30); END IF;
175
176 per_pms_ins.ins
177 (p_effective_date => l_effective_date
178 ,p_scorecard_name => p_scorecard_name
179 ,p_assignment_id => p_assignment_id
180 ,p_start_date => l_start_date
181 ,p_end_date => l_end_date
182 ,p_plan_id => p_plan_id
183 ,p_creator_type => p_creator_type
184 ,p_attribute_category => p_attribute_category
185 ,p_attribute1 => p_attribute1
186 ,p_attribute2 => p_attribute2
187 ,p_attribute3 => p_attribute3
188 ,p_attribute4 => p_attribute4
189 ,p_attribute5 => p_attribute5
190 ,p_attribute6 => p_attribute6
191 ,p_attribute7 => p_attribute7
192 ,p_attribute8 => p_attribute8
193 ,p_attribute9 => p_attribute9
194 ,p_attribute10 => p_attribute10
195 ,p_attribute11 => p_attribute11
196 ,p_attribute12 => p_attribute12
197 ,p_attribute13 => p_attribute13
198 ,p_attribute14 => p_attribute14
199 ,p_attribute15 => p_attribute15
200 ,p_attribute16 => p_attribute16
201 ,p_attribute17 => p_attribute17
202 ,p_attribute18 => p_attribute18
203 ,p_attribute19 => p_attribute19
204 ,p_attribute20 => p_attribute20
205 ,p_attribute21 => p_attribute21
206 ,p_attribute22 => p_attribute22
207 ,p_attribute23 => p_attribute23
208 ,p_attribute24 => p_attribute24
209 ,p_attribute25 => p_attribute25
210 ,p_attribute26 => p_attribute26
211 ,p_attribute27 => p_attribute27
212 ,p_attribute28 => p_attribute28
213 ,p_attribute29 => p_attribute29
214 ,p_attribute30 => p_attribute30
215 ,p_scorecard_id => l_scorecard_id
216 ,p_object_version_number => l_object_version_number
217 ,p_status_code => p_status_code
218 ,p_duplicate_name_warning => l_duplicate_name_warning
219 );
220
221
222 --
223 -- Call After Process User Hook
224 --
225 begin
226 hr_personal_scorecard_bk1.create_scorecard_a
227 (p_effective_date => l_effective_date
228 ,p_scorecard_name => p_scorecard_name
229 ,p_assignment_id => p_assignment_id
230 ,p_start_date => l_start_date
231 ,p_end_date => l_end_date
232 ,p_plan_id => p_plan_id
233 ,p_creator_type => p_creator_type
234 ,p_attribute_category => p_attribute_category
235 ,p_attribute1 => p_attribute1
236 ,p_attribute2 => p_attribute2
237 ,p_attribute3 => p_attribute3
238 ,p_attribute4 => p_attribute4
239 ,p_attribute5 => p_attribute5
240 ,p_attribute6 => p_attribute6
241 ,p_attribute7 => p_attribute7
242 ,p_attribute8 => p_attribute8
243 ,p_attribute9 => p_attribute9
244 ,p_attribute10 => p_attribute10
245 ,p_attribute11 => p_attribute11
246 ,p_attribute12 => p_attribute12
247 ,p_attribute13 => p_attribute13
248 ,p_attribute14 => p_attribute14
249 ,p_attribute15 => p_attribute15
250 ,p_attribute16 => p_attribute16
251 ,p_attribute17 => p_attribute17
252 ,p_attribute18 => p_attribute18
253 ,p_attribute19 => p_attribute19
254 ,p_attribute20 => p_attribute20
255 ,p_attribute21 => p_attribute21
256 ,p_attribute22 => p_attribute22
257 ,p_attribute23 => p_attribute23
258 ,p_attribute24 => p_attribute24
259 ,p_attribute25 => p_attribute25
260 ,p_attribute26 => p_attribute26
261 ,p_attribute27 => p_attribute27
262 ,p_attribute28 => p_attribute28
263 ,p_attribute29 => p_attribute29
264 ,p_attribute30 => p_attribute30
265 ,p_scorecard_id => l_scorecard_id
266 ,p_object_version_number => l_object_version_number
267 ,p_status_code => p_status_code
268 ,p_duplicate_name_warning => l_duplicate_name_warning
269 );
270 exception
271 when hr_api.cannot_find_prog_unit then
272 hr_api.cannot_find_prog_unit_error
273 (p_module_name => 'CREATE_SCORECARD'
274 ,p_hook_type => 'AP'
275 );
276 end;
277
278 IF g_debug THEN hr_utility.set_location(l_proc, 40); END IF;
279 --
280 -- When in validation only mode raise the Validate_Enabled exception
281 --
282 if p_validate then
283 raise hr_api.validate_enabled;
284 end if;
285 --
286 -- Set all IN OUT and OUT parameters with out values
287 --
288 p_scorecard_id := l_scorecard_id;
289 p_object_version_number := l_object_version_number;
290 -- p_status_code := l_status_code;
291 p_duplicate_name_warning := l_duplicate_name_warning;
292
293 --
294 -- Pipe the main IN OUT / OUT parameters for ease of debugging.
295 --
296 IF g_debug THEN
297
298 hr_utility.trace(' ');
299 hr_utility.trace(' --------------------------------'||
300 '---------------------------------');
301 hr_utility.trace(' IN OUT / OUT PARAMETER '||
302 ' VALUE');
303 hr_utility.trace(' --------------------------------'||
304 '+--------------------------------');
305 hr_utility.trace(' p_scorecard_id '||
306 to_char(p_scorecard_id));
307 hr_utility.trace(' p_object_version_number '||
308 to_char(p_object_version_number));
309 hr_utility.trace(' p_status_code '||
310 p_status_code);
311 IF p_duplicate_name_warning THEN
312 hr_utility.trace(' p_duplicate_name_warning '||
313 'TRUE');
314 ELSE
315 hr_utility.trace(' p_duplicate_name_warning '||
316 'FALSE');
317 END IF;
318 hr_utility.trace(' --------------------------------'||
319 '---------------------------------');
320 hr_utility.trace(' ');
321 hr_utility.set_location(' Leaving:'||l_proc, 970);
322
323 END IF;
324
325 exception
326 when hr_api.validate_enabled then
327 --
328 -- As the Validate_Enabled exception has been raised
329 -- we must rollback to the savepoint
330 --
331 rollback to create_scorecard;
332 --
333 -- Reset IN OUT parameters and set OUT parameters
334 -- (Any key or derived arguments must be set to null
335 -- when validation only mode is being used.)
336 --
337 p_scorecard_id := null;
338 p_object_version_number := null;
339 --p_status_code := l_status_code;
340 p_duplicate_name_warning := l_duplicate_name_warning;
341 hr_utility.set_location(' Leaving:'||l_proc, 980);
342 when others then
343 --
344 -- A validation or unexpected error has occured
345 --
346 rollback to create_scorecard;
347 --
348 -- Reset IN OUT parameters and set all
349 -- OUT parameters, including warnings, to null
350 --
351 p_scorecard_id := null;
352 p_object_version_number := null;
353 --p_status_code := null;
354 p_duplicate_name_warning := null;
355 hr_utility.set_location(' Leaving:'||l_proc, 990);
356 raise;
357 end create_scorecard;
358 --
359 -- ----------------------------------------------------------------------------
360 -- |--------------------------< update_scorecard >----------------------------|
361 -- ----------------------------------------------------------------------------
362 --
363 procedure update_scorecard
364 (p_validate in boolean default false
365 ,p_effective_date in date
366 ,p_scorecard_id in number
367 ,p_object_version_number in out nocopy number
368 ,p_scorecard_name in varchar2 default hr_api.g_varchar2
369 ,p_start_date in date default hr_api.g_date
370 ,p_end_date in date default hr_api.g_date
371 ,p_plan_id in number default hr_api.g_number
372 ,p_attribute_category in varchar2 default hr_api.g_varchar2
373 ,p_attribute1 in varchar2 default hr_api.g_varchar2
374 ,p_attribute2 in varchar2 default hr_api.g_varchar2
375 ,p_attribute3 in varchar2 default hr_api.g_varchar2
376 ,p_attribute4 in varchar2 default hr_api.g_varchar2
377 ,p_attribute5 in varchar2 default hr_api.g_varchar2
378 ,p_attribute6 in varchar2 default hr_api.g_varchar2
379 ,p_attribute7 in varchar2 default hr_api.g_varchar2
380 ,p_attribute8 in varchar2 default hr_api.g_varchar2
381 ,p_attribute9 in varchar2 default hr_api.g_varchar2
382 ,p_attribute10 in varchar2 default hr_api.g_varchar2
383 ,p_attribute11 in varchar2 default hr_api.g_varchar2
384 ,p_attribute12 in varchar2 default hr_api.g_varchar2
385 ,p_attribute13 in varchar2 default hr_api.g_varchar2
386 ,p_attribute14 in varchar2 default hr_api.g_varchar2
387 ,p_attribute15 in varchar2 default hr_api.g_varchar2
388 ,p_attribute16 in varchar2 default hr_api.g_varchar2
389 ,p_attribute17 in varchar2 default hr_api.g_varchar2
390 ,p_attribute18 in varchar2 default hr_api.g_varchar2
391 ,p_attribute19 in varchar2 default hr_api.g_varchar2
392 ,p_attribute20 in varchar2 default hr_api.g_varchar2
393 ,p_attribute21 in varchar2 default hr_api.g_varchar2
394 ,p_attribute22 in varchar2 default hr_api.g_varchar2
395 ,p_attribute23 in varchar2 default hr_api.g_varchar2
396 ,p_attribute24 in varchar2 default hr_api.g_varchar2
397 ,p_attribute25 in varchar2 default hr_api.g_varchar2
398 ,p_attribute26 in varchar2 default hr_api.g_varchar2
399 ,p_attribute27 in varchar2 default hr_api.g_varchar2
400 ,p_attribute28 in varchar2 default hr_api.g_varchar2
401 ,p_attribute29 in varchar2 default hr_api.g_varchar2
402 ,p_attribute30 in varchar2 default hr_api.g_varchar2
403 ,p_status_code in varchar2 default hr_api.g_varchar2
404 ,p_duplicate_name_warning out nocopy boolean
405 ) is
406 --
407 -- Declare cursors and local variables
408 --
409 l_proc varchar2(72) := g_package||'update_scorecard';
410 l_effective_date date;
411 l_start_date date;
412 l_end_date date;
413 l_object_version_number number := p_object_version_number;
414 l_duplicate_name_warning boolean;
415
416 begin
417
418 IF g_debug THEN
419
420 hr_utility.set_location('Entering:'|| l_proc, 10);
421
422 hr_utility.trace(' ');
423 hr_utility.trace(' --------------------------------'||
424 '---------------------------------');
425 hr_utility.trace(' IN / IN OUT PARAMETER '||
426 ' VALUE');
427 hr_utility.trace(' --------------------------------'||
428 '+--------------------------------');
429 hr_utility.trace(' p_effective_date '||
430 to_char(p_effective_date));
431 hr_utility.trace(' p_scorecard_id '||
432 to_char(p_scorecard_id));
433 hr_utility.trace(' p_object_version_number '||
434 to_char(p_object_version_number));
435 hr_utility.trace(' p_scorecard_name '||
436 p_scorecard_name);
437 hr_utility.trace(' p_plan_id '||
438 to_char(p_plan_id));
439 hr_utility.trace(' p_start_date '||
440 to_char(p_start_date));
441 hr_utility.trace(' p_end_date '||
442 to_char(p_end_date));
443 hr_utility.trace(' --------------------------------'||
444 '---------------------------------');
445 hr_utility.trace(' ');
446
447 END IF;
448
449 --
450 -- Issue a savepoint
451 --
452 savepoint update_scorecard;
453
454 --
455 -- Truncate the time portion from all IN date parameters
456 --
457 l_effective_date := trunc(p_effective_date);
458 l_start_date := trunc(p_start_date);
459 l_end_date := trunc(p_end_date);
460
461 --
462 -- Call Before Process User Hook
463 --
464 begin
465 hr_personal_scorecard_bk2.update_scorecard_b
466 (p_effective_date => l_effective_date
467 ,p_scorecard_id => p_scorecard_id
468 ,p_object_version_number => l_object_version_number
469 ,p_scorecard_name => p_scorecard_name
470 ,p_start_date => l_start_date
471 ,p_end_date => l_end_date
472 ,p_plan_id => p_plan_id
473 ,p_attribute_category => p_attribute_category
474 ,p_attribute1 => p_attribute1
475 ,p_attribute2 => p_attribute2
476 ,p_attribute3 => p_attribute3
477 ,p_attribute4 => p_attribute4
478 ,p_attribute5 => p_attribute5
479 ,p_attribute6 => p_attribute6
480 ,p_attribute7 => p_attribute7
481 ,p_attribute8 => p_attribute8
482 ,p_attribute9 => p_attribute9
483 ,p_attribute10 => p_attribute10
484 ,p_attribute11 => p_attribute11
485 ,p_attribute12 => p_attribute12
486 ,p_attribute13 => p_attribute13
487 ,p_attribute14 => p_attribute14
488 ,p_attribute15 => p_attribute15
489 ,p_attribute16 => p_attribute16
490 ,p_attribute17 => p_attribute17
491 ,p_attribute18 => p_attribute18
492 ,p_attribute19 => p_attribute19
493 ,p_attribute20 => p_attribute20
494 ,p_attribute21 => p_attribute21
495 ,p_attribute22 => p_attribute22
496 ,p_attribute23 => p_attribute23
497 ,p_attribute24 => p_attribute24
498 ,p_attribute25 => p_attribute25
499 ,p_attribute26 => p_attribute26
500 ,p_attribute27 => p_attribute27
501 ,p_attribute28 => p_attribute28
502 ,p_attribute29 => p_attribute29
503 ,p_attribute30 => p_attribute30
504 ,p_status_code => p_status_code
505 );
506 exception
507 when hr_api.cannot_find_prog_unit then
508 hr_api.cannot_find_prog_unit_error
509 (p_module_name => 'UPDATE_SCORECARD'
510 ,p_hook_type => 'BP'
511 );
512 end;
513
514 --
515 -- Process Logic
516 --
517 IF g_debug THEN hr_utility.set_location(l_proc, 30); END IF;
518
519 per_pms_upd.upd
520 (p_effective_date => l_effective_date
521 ,p_scorecard_id => p_scorecard_id
522 ,p_object_version_number => l_object_version_number
523 ,p_scorecard_name => p_scorecard_name
524 ,p_start_date => l_start_date
525 ,p_end_date => l_end_date
526 ,p_plan_id => p_plan_id
527 ,p_status_code => p_status_code
528 ,p_attribute_category => p_attribute_category
529 ,p_attribute1 => p_attribute1
530 ,p_attribute2 => p_attribute2
531 ,p_attribute3 => p_attribute3
532 ,p_attribute4 => p_attribute4
533 ,p_attribute5 => p_attribute5
534 ,p_attribute6 => p_attribute6
535 ,p_attribute7 => p_attribute7
536 ,p_attribute8 => p_attribute8
537 ,p_attribute9 => p_attribute9
538 ,p_attribute10 => p_attribute10
539 ,p_attribute11 => p_attribute11
540 ,p_attribute12 => p_attribute12
541 ,p_attribute13 => p_attribute13
542 ,p_attribute14 => p_attribute14
543 ,p_attribute15 => p_attribute15
544 ,p_attribute16 => p_attribute16
545 ,p_attribute17 => p_attribute17
546 ,p_attribute18 => p_attribute18
547 ,p_attribute19 => p_attribute19
548 ,p_attribute20 => p_attribute20
549 ,p_attribute21 => p_attribute21
550 ,p_attribute22 => p_attribute22
551 ,p_attribute23 => p_attribute23
552 ,p_attribute24 => p_attribute24
553 ,p_attribute25 => p_attribute25
554 ,p_attribute26 => p_attribute26
555 ,p_attribute27 => p_attribute27
556 ,p_attribute28 => p_attribute28
557 ,p_attribute29 => p_attribute29
558 ,p_attribute30 => p_attribute30
559 ,p_duplicate_name_warning => l_duplicate_name_warning
560 );
561
562 --
563 -- Call After Process User Hook
564 --
565 begin
566 hr_personal_scorecard_bk2.update_scorecard_a
567 (p_effective_date => l_effective_date
568 ,p_scorecard_id => p_scorecard_id
569 ,p_object_version_number => l_object_version_number
570 ,p_scorecard_name => p_scorecard_name
571 ,p_start_date => l_start_date
572 ,p_end_date => l_end_date
573 ,p_plan_id => p_plan_id
574 ,p_attribute_category => p_attribute_category
575 ,p_attribute1 => p_attribute1
576 ,p_attribute2 => p_attribute2
577 ,p_attribute3 => p_attribute3
578 ,p_attribute4 => p_attribute4
579 ,p_attribute5 => p_attribute5
580 ,p_attribute6 => p_attribute6
581 ,p_attribute7 => p_attribute7
582 ,p_attribute8 => p_attribute8
583 ,p_attribute9 => p_attribute9
584 ,p_attribute10 => p_attribute10
585 ,p_attribute11 => p_attribute11
586 ,p_attribute12 => p_attribute12
587 ,p_attribute13 => p_attribute13
588 ,p_attribute14 => p_attribute14
589 ,p_attribute15 => p_attribute15
590 ,p_attribute16 => p_attribute16
591 ,p_attribute17 => p_attribute17
592 ,p_attribute18 => p_attribute18
593 ,p_attribute19 => p_attribute19
594 ,p_attribute20 => p_attribute20
595 ,p_attribute21 => p_attribute21
596 ,p_attribute22 => p_attribute22
597 ,p_attribute23 => p_attribute23
598 ,p_attribute24 => p_attribute24
599 ,p_attribute25 => p_attribute25
600 ,p_attribute26 => p_attribute26
601 ,p_attribute27 => p_attribute27
602 ,p_attribute28 => p_attribute28
603 ,p_attribute29 => p_attribute29
604 ,p_attribute30 => p_attribute30
605 ,p_status_code => p_status_code
606 ,p_duplicate_name_warning => l_duplicate_name_warning
607 );
608 exception
609 when hr_api.cannot_find_prog_unit then
610 hr_api.cannot_find_prog_unit_error
611 (p_module_name => 'UPDATE_SCORECARD'
612 ,p_hook_type => 'AP'
613 );
614 end;
615
616 IF g_debug THEN hr_utility.set_location(l_proc, 40); END IF;
617 --
618 -- When in validation only mode raise the Validate_Enabled exception
619 --
620 if p_validate then
621 raise hr_api.validate_enabled;
622 end if;
623 --
624 -- Set all IN OUT and OUT parameters with out values
625 --
626 p_object_version_number := l_object_version_number;
627 p_duplicate_name_warning := l_duplicate_name_warning;
628
629 --
630 -- Pipe the main IN OUT / OUT parameters for ease of debugging.
631 --
632 IF g_debug THEN
633
634 hr_utility.trace(' ');
635 hr_utility.trace(' --------------------------------'||
636 '---------------------------------');
637 hr_utility.trace(' IN OUT / OUT PARAMETER '||
638 ' VALUE');
639 hr_utility.trace(' --------------------------------'||
640 '+--------------------------------');
641 hr_utility.trace(' p_object_version_number '||
642 to_char(p_object_version_number));
643 IF p_duplicate_name_warning THEN
644 hr_utility.trace(' p_duplicate_name_warning '||
645 'TRUE');
646 ELSE
647 hr_utility.trace(' p_duplicate_name_warning '||
648 'FALSE');
649 END IF;
650 hr_utility.trace(' --------------------------------'||
651 '---------------------------------');
652 hr_utility.trace(' ');
653 hr_utility.set_location(' Leaving:'||l_proc, 970);
654
655 END IF;
656
657 exception
658 when hr_api.validate_enabled then
659 --
660 -- As the Validate_Enabled exception has been raised
661 -- we must rollback to the savepoint
662 --
663 rollback to update_scorecard;
664 --
665 -- Reset IN OUT parameters and set OUT parameters
666 -- (Any key or derived arguments must be set to null
667 -- when validation only mode is being used.)
668 --
669 p_object_version_number := null;
670 p_duplicate_name_warning := l_duplicate_name_warning;
671 hr_utility.set_location(' Leaving:'||l_proc, 980);
672 when others then
673 --
674 -- A validation or unexpected error has occured
675 --
676 rollback to update_scorecard;
677 --
678 -- Reset IN OUT parameters and set all
679 -- OUT parameters, including warnings, to null
680 --
681 p_object_version_number := null;
682 p_duplicate_name_warning := null;
683 hr_utility.set_location(' Leaving:'||l_proc, 990);
684 raise;
685 end update_scorecard;
686 --
687 -- ----------------------------------------------------------------------------
688 -- |--------------------------< update_scorecard_status >---------------------|
689 -- ----------------------------------------------------------------------------
690 --
691 procedure update_scorecard_status
692 (p_validate in boolean default false
693 ,p_effective_date in date
694 ,p_scorecard_id in number
695 ,p_object_version_number in out nocopy number
696 ,p_status_code in varchar2
697 ) is
698 --
699 -- Declare cursors and local variables
700 --
701 l_proc varchar2(72) := g_package||'update_scorecard_status';
702 l_effective_date date;
703 l_object_version_number number := p_object_version_number;
704 l_dummy boolean;
705
706 begin
707
708 IF g_debug THEN
709
710 hr_utility.set_location('Entering:'|| l_proc, 10);
711
712 hr_utility.trace(' ');
713 hr_utility.trace(' --------------------------------'||
714 '---------------------------------');
715 hr_utility.trace(' IN / IN OUT PARAMETER '||
716 ' VALUE');
717 hr_utility.trace(' --------------------------------'||
718 '+--------------------------------');
719 hr_utility.trace(' p_effective_date '||
720 to_char(p_effective_date));
721 hr_utility.trace(' p_scorecard_id '||
722 to_char(p_scorecard_id));
723 hr_utility.trace(' p_object_version_number '||
724 to_char(p_object_version_number));
725 hr_utility.trace(' p_status_code '||
726 p_status_code);
727 hr_utility.trace(' --------------------------------'||
728 '---------------------------------');
729 hr_utility.trace(' ');
730
731 END IF;
732
733 --
734 -- Issue a savepoint
735 --
736 savepoint update_scorecard_status;
737
738 --
739 -- Truncate the time portion from all IN date parameters
740 --
741 l_effective_date := trunc(p_effective_date);
742
743 --
744 -- Call Before Process User Hook
745 --
746 begin
747 hr_personal_scorecard_bk3.update_scorecard_status_b
748 (p_effective_date => l_effective_date
749 ,p_scorecard_id => p_scorecard_id
750 ,p_object_version_number => l_object_version_number
751 ,p_status_code => p_status_code
752 );
753 exception
754 when hr_api.cannot_find_prog_unit then
755 hr_api.cannot_find_prog_unit_error
756 (p_module_name => 'UPDATE_SCORECARD_STATUS'
757 ,p_hook_type => 'BP'
758 );
759 end;
760
761 --
762 -- Process Logic
763 --
764 IF g_debug THEN hr_utility.set_location(l_proc, 30); END IF;
765
766 per_pms_upd.upd
767 (p_effective_date => l_effective_date
768 ,p_scorecard_id => p_scorecard_id
769 ,p_object_version_number => l_object_version_number
770 ,p_status_code => p_status_code
771 ,p_duplicate_name_warning => l_dummy
772 );
773
774 --
775 -- Call After Process User Hook
776 --
777 begin
778 hr_personal_scorecard_bk3.update_scorecard_status_a
779 (p_effective_date => l_effective_date
780 ,p_scorecard_id => p_scorecard_id
781 ,p_object_version_number => l_object_version_number
782 ,p_status_code => p_status_code
783 );
784 exception
785 when hr_api.cannot_find_prog_unit then
786 hr_api.cannot_find_prog_unit_error
787 (p_module_name => 'UPDATE_SCORECARD_STATUS'
788 ,p_hook_type => 'AP'
789 );
790 end;
791
792 IF g_debug THEN hr_utility.set_location(l_proc, 40); END IF;
793 --
794 -- When in validation only mode raise the Validate_Enabled exception
795 --
796 if p_validate then
797 raise hr_api.validate_enabled;
798 end if;
799 --
800 -- Set all IN OUT and OUT parameters with out values
801 --
802 p_object_version_number := l_object_version_number;
803
804 --
805 -- Pipe the main IN OUT / OUT parameters for ease of debugging.
806 --
807 IF g_debug THEN
808
809 hr_utility.trace(' ');
810 hr_utility.trace(' --------------------------------'||
811 '---------------------------------');
812 hr_utility.trace(' IN OUT / OUT PARAMETER '||
813 ' VALUE');
814 hr_utility.trace(' --------------------------------'||
815 '+--------------------------------');
816 hr_utility.trace(' p_object_version_number '||
817 to_char(p_object_version_number));
818 hr_utility.trace(' --------------------------------'||
819 '---------------------------------');
820 hr_utility.trace(' ');
821
822 END IF;
823
824 exception
825 when hr_api.validate_enabled then
826 --
827 -- As the Validate_Enabled exception has been raised
828 -- we must rollback to the savepoint
829 --
830 -- As the Validate_Enabled exception has been raised
831 -- we must rollback to the savepoint
832 --
833 rollback to update_scorecard_status;
834 --
835 -- Reset IN OUT parameters and set OUT parameters
836 -- (Any key or derived arguments must be set to null
837 -- when validation only mode is being used.)
838 --
839 p_object_version_number := null;
840 hr_utility.set_location(' Leaving:'||l_proc, 980);
841 when others then
842 --
843 -- A validation or unexpected error has occured
844 --
845 rollback to update_scorecard_status;
846 --
847 -- Reset IN OUT parameters and set all
848 -- OUT parameters, including warnings, to null
849 --
850 p_object_version_number := null;
851 hr_utility.set_location(' Leaving:'||l_proc, 990);
852 raise;
853 end update_scorecard_status;
854 --
855 -- ----------------------------------------------------------------------------
856 -- |--------------------------< delete_scorecard >----------------------------|
857 -- ----------------------------------------------------------------------------
858 --
859 procedure delete_scorecard
860 (p_validate in boolean default false
861 ,p_scorecard_id in number
862 ,p_object_version_number in number
863 ,p_created_by_plan_warning out nocopy boolean
864 ) is
865 --
866 -- Declare cursors and local variables
867 --
868 l_proc varchar2(72) := g_package||'delete_scorecard';
869 l_created_by_plan_warning boolean;
870
871 begin
872
873 IF g_debug THEN
874
875 hr_utility.set_location('Entering:'|| l_proc, 10);
876
877 hr_utility.trace(' ');
878 hr_utility.trace(' --------------------------------'||
879 '---------------------------------');
880 hr_utility.trace(' IN / IN OUT PARAMETER '||
881 ' VALUE');
882 hr_utility.trace(' --------------------------------'||
883 '+--------------------------------');
884 hr_utility.trace(' p_scorecard_id '||
885 to_char(p_scorecard_id));
886 hr_utility.trace(' p_object_version_number '||
887 to_char(p_object_version_number));
888 hr_utility.trace(' --------------------------------'||
889 '---------------------------------');
890 hr_utility.trace(' ');
891
892 END IF;
893
894 --
895 -- Issue a savepoint
896 --
897 savepoint delete_scorecard;
898
899 --
900 -- Call Before Process User Hook
901 --
902 begin
903 hr_personal_scorecard_bk4.delete_scorecard_b
904 (p_scorecard_id => p_scorecard_id
905 ,p_object_version_number => p_object_version_number
906 );
907 exception
908 when hr_api.cannot_find_prog_unit then
909 hr_api.cannot_find_prog_unit_error
910 (p_module_name => 'DELETE_SCORECARD'
911 ,p_hook_type => 'BP'
912 );
913 end;
914
915 --
916 -- Process Logic
917 --
918 IF g_debug THEN hr_utility.set_location(l_proc, 30); END IF;
919
920 per_pms_del.del
921 (p_scorecard_id => p_scorecard_id
922 ,p_object_version_number => p_object_version_number
923 ,p_created_by_plan_warning => l_created_by_plan_warning
924 );
925
926 --
927 -- Call After Process User Hook
928 --
929 begin
930 hr_personal_scorecard_bk4.delete_scorecard_a
931 (p_scorecard_id => p_scorecard_id
932 ,p_object_version_number => p_object_version_number
933 ,p_created_by_plan_warning => l_created_by_plan_warning
934 );
935 exception
936 when hr_api.cannot_find_prog_unit then
937 hr_api.cannot_find_prog_unit_error
938 (p_module_name => 'DELETE_SCORECARD'
939 ,p_hook_type => 'AP'
940 );
941 end;
942
943 IF g_debug THEN hr_utility.set_location(l_proc, 40); END IF;
944 --
945 -- When in validation only mode raise the Validate_Enabled exception
946 --
947 if p_validate then
948 raise hr_api.validate_enabled;
949 end if;
950 --
951 -- Set all IN OUT and OUT parameters with out values
952 --
953 p_created_by_plan_warning := l_created_by_plan_warning;
954
955 --
956 -- Pipe the main IN OUT / OUT parameters for ease of debugging.
957 --
958 IF g_debug THEN
959
960 hr_utility.trace(' ');
961 hr_utility.trace(' --------------------------------'||
962 '---------------------------------');
963 hr_utility.trace(' IN OUT / OUT PARAMETER '||
964 ' VALUE');
965 hr_utility.trace(' --------------------------------'||
966 '+--------------------------------');
967 hr_utility.trace(' p_object_version_number '||
968 to_char(p_object_version_number));
969 IF p_created_by_plan_warning THEN
970 hr_utility.trace(' p_created_by_plan_warning '||
971 'TRUE');
972 ELSE
973 hr_utility.trace(' p_created_by_plan_warning '||
974 'FALSE');
975 END IF;
976 hr_utility.trace(' --------------------------------'||
977 '---------------------------------');
978 hr_utility.trace(' ');
979 hr_utility.set_location(' Leaving:'||l_proc, 970);
980
981 END IF;
982
983 exception
984 when hr_api.validate_enabled then
985 --
986 -- As the Validate_Enabled exception has been raised
987 -- we must rollback to the savepoint
988 --
989 rollback to delete_scorecard;
990 --
991 -- Reset IN OUT parameters and set OUT parameters
992 -- (Any key or derived arguments must be set to null
993 -- when validation only mode is being used.)
994 --
995 p_created_by_plan_warning := l_created_by_plan_warning;
996 hr_utility.set_location(' Leaving:'||l_proc, 980);
997 when others then
998 --
999 -- A validation or unexpected error has occured
1000 --
1001 rollback to delete_scorecard;
1002 --
1003 -- Reset IN OUT parameters and set all
1004 -- OUT parameters, including warnings, to null
1005 --
1006 p_created_by_plan_warning := null;
1007 hr_utility.set_location(' Leaving:'||l_proc, 990);
1008 raise;
1009 end delete_scorecard;
1010 --
1011 end hr_personal_scorecard_api;