DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_ASSESSMENT_GROUPS_API

Source


1 Package Body hr_assessment_groups_api as
2 /* $Header: peasrapi.pkb 115.3 99/07/17 18:43:44 porting ship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  hr_assessment_groups_api.';
7 --
8 -- ---------------------------------------------------------------------------
9 -- |---------------------< <create_assessment_group> >----------------------|
10 -- ---------------------------------------------------------------------------
11 --
12 procedure create_assessment_group
13  (p_assessment_group_id           out 	number,
14   p_name                         in 	varchar2,
15   p_business_group_id            in 	number,
16   p_comments                     in 	varchar2         default null,
17   p_object_version_number        out 	number,
18   p_attribute_category           in 	varchar2         default null,
19   p_attribute1                   in 	varchar2         default null,
20   p_attribute2                   in 	varchar2         default null,
21   p_attribute3                   in 	varchar2         default null,
22   p_attribute4                   in 	varchar2         default null,
23   p_attribute5                   in     varchar2         default null,
24   p_attribute6                   in     varchar2         default null,
25   p_attribute7                   in     varchar2         default null,
26   p_attribute8                   in     varchar2         default null,
27   p_attribute9                   in     varchar2         default null,
28   p_attribute10                  in     varchar2         default null,
29   p_attribute11                  in     varchar2         default null,
30   p_attribute12                  in     varchar2         default null,
31   p_attribute13                  in     varchar2         default null,
32   p_attribute14                  in     varchar2         default null,
33   p_attribute15                  in     varchar2         default null,
34   p_attribute16                  in     varchar2         default null,
35   p_attribute17                  in     varchar2         default null,
36   p_attribute18                  in     varchar2         default null,
37   p_attribute19                  in     varchar2         default null,
38   p_attribute20                  in     varchar2         default null,
39   p_validate                     in 	boolean   default false,
40   p_effective_date               in 	date
41   ) is
42   --
43   -- Declare cursors and local variables
44   --
45   --
46   l_proc               	varchar2(72) := g_package||'create_assessment_groups';
47   l_assessment_group_id 		per_assessment_groups.assessment_group_id%TYPE;
48   l_object_version_number	per_assessment_groups.object_version_number%TYPE;
49   --
50 begin
51   hr_utility.set_location('Entering:'|| l_proc, 5);
52   --
53   -- Issue a savepoint.
54   --
55   savepoint create_assess_group;
56   hr_utility.set_location(l_proc, 6);
57   --
58   -- Call Before Process User Hook
59   --
60   begin
61 	hr_assessment_groups_bk1.create_assessment_group_b	(
62          p_name                         =>   p_name
63         ,p_business_group_id            =>   p_business_group_id
64         ,p_comments                     =>   p_comments
65         ,p_attribute_category           =>   p_attribute_category
66         ,p_attribute1                   =>   p_attribute1
67         ,p_attribute2                   =>   p_attribute2
68         ,p_attribute3                   =>   p_attribute3
69         ,p_attribute4                   =>   p_attribute4
70         ,p_attribute5                   =>   p_attribute5
71         ,p_attribute6                   =>   p_attribute6
72         ,p_attribute7                   =>   p_attribute7
73         ,p_attribute8                   =>   p_attribute8
74         ,p_attribute9                   =>   p_attribute9
75         ,p_attribute10                  =>   p_attribute10
76         ,p_attribute11                  =>   p_attribute11
77         ,p_attribute12                  =>   p_attribute12
78         ,p_attribute13                  =>   p_attribute13
79         ,p_attribute14                  =>   p_attribute14
80         ,p_attribute15                  =>   p_attribute14
81         ,p_attribute16                  =>   p_attribute16
82         ,p_attribute17                  =>   p_attribute17
83         ,p_attribute18                  =>   p_attribute18
84         ,p_attribute19                  =>   p_attribute19
85         ,p_attribute20                  =>   p_attribute20
86         ,p_effective_date               =>   p_effective_date );
87       exception
88 	   when hr_api.cannot_find_prog_unit then
89 		  hr_api.cannot_find_prog_unit_error
90 				(p_module_name	=> 'create_assessment_group',
91 				 p_hook_type	=> 'BP'
92 				);
93   end;
94   --
95   -- End of Before Process User Hook call
96   --
97   -- Validation in addition to Table Handlers
98   --
99   hr_utility.set_location(l_proc, 7);
100   --
101   -- Process Logic
102   --
103   per_asr_ins.ins (p_assessment_group_id =>   l_assessment_group_id
104         ,p_name                         =>   p_name
105         ,p_business_group_id            =>   p_business_group_id
106         ,p_comments                     =>   p_comments
107         ,p_object_version_number        =>   l_object_version_number
108         ,p_attribute_category           =>   p_attribute_category
109         ,p_attribute1                   =>   p_attribute1
110         ,p_attribute2                   =>   p_attribute2
111         ,p_attribute3                   =>   p_attribute3
112         ,p_attribute4                   =>   p_attribute4
113         ,p_attribute5                   =>   p_attribute5
114         ,p_attribute6                   =>   p_attribute6
115         ,p_attribute7                   =>   p_attribute7
116         ,p_attribute8                   =>   p_attribute8
117         ,p_attribute9                   =>   p_attribute9
118         ,p_attribute10                  =>   p_attribute10
119         ,p_attribute11                  =>   p_attribute11
120         ,p_attribute12                  =>   p_attribute12
121         ,p_attribute13                  =>   p_attribute13
122         ,p_attribute14                  =>   p_attribute14
123         ,p_attribute15                  =>   p_attribute14
124         ,p_attribute16                  =>   p_attribute16
125         ,p_attribute17                  =>   p_attribute17
126         ,p_attribute18                  =>   p_attribute18
127         ,p_attribute19                  =>   p_attribute19
128         ,p_attribute20                  =>   p_attribute20
129         ,p_validate                     =>   p_validate
130         ,p_effective_date               =>   p_effective_date
131   );
132   --
133   hr_utility.set_location(l_proc, 8);
134   --
135   -- Call After Process User Hook
136   --
137   begin
138 	hr_assessment_groups_bk1.create_assessment_group_a	(
139          p_assessment_group_id          =>   l_assessment_group_id
140         ,p_object_version_number        =>   l_object_version_number
141         ,p_name                         =>   p_name
142         ,p_business_group_id            =>   p_business_group_id
143         ,p_comments                     =>   p_comments
144         ,p_attribute_category           =>   p_attribute_category
145         ,p_attribute1                   =>   p_attribute1
146         ,p_attribute2                   =>   p_attribute2
147         ,p_attribute3                   =>   p_attribute3
148         ,p_attribute4                   =>   p_attribute4
149         ,p_attribute5                   =>   p_attribute5
150         ,p_attribute6                   =>   p_attribute6
151         ,p_attribute7                   =>   p_attribute7
152         ,p_attribute8                   =>   p_attribute8
153         ,p_attribute9                   =>   p_attribute9
154         ,p_attribute10                  =>   p_attribute10
155         ,p_attribute11                  =>   p_attribute11
156         ,p_attribute12                  =>   p_attribute12
157         ,p_attribute13                  =>   p_attribute13
158         ,p_attribute14                  =>   p_attribute14
159         ,p_attribute15                  =>   p_attribute14
160         ,p_attribute16                  =>   p_attribute16
161         ,p_attribute17                  =>   p_attribute17
162         ,p_attribute18                  =>   p_attribute18
163         ,p_attribute19                  =>   p_attribute19
164         ,p_attribute20                  =>   p_attribute20
165         ,p_effective_date               =>   p_effective_date );
166 
167       exception
168 	   when hr_api.cannot_find_prog_unit then
169 		  hr_api.cannot_find_prog_unit_error
170 				(p_module_name	=> 'create_assessment_group',
171 				 p_hook_type	=> 'AP'
172 				);
173   end;
174   --
175   -- End of After process user hook
176   --
177   -- When in validation only mode raise the Validate_Enabled exception
178   --
179   if p_validate then
180     raise hr_api.validate_enabled;
181   end if;
182   --
183   -- Set all output arguments
184   --
185   p_assessment_group_id          := l_assessment_group_id;
186   p_object_version_number  := l_object_version_number;
187   --
188   hr_utility.set_location(' Leaving:'||l_proc, 11);
189 exception
190   when hr_api.validate_enabled then
191     --
192     -- As the Validate_Enabled exception has been raised
193     -- we must rollback to the savepoint
194     --
195     ROLLBACK TO create_assess_group;
196     --
197     -- Only set output warning arguments
198     -- (Any key or derived arguments must be set to null
199     -- when validation only mode is being used.)
200     --
201     p_assessment_group_id          := null;
202     p_object_version_number  := null;
203     --
204   when others then
205     --
206     -- A validation or unexpected error has occurred
207     --
208     -- Added as part of fix to bug 632482
209     --
210     ROLLBACK TO create_assess_group;
211     raise;
212     --
213     -- End of fix.
214     --
215     hr_utility.set_location(' Leaving:'||l_proc, 12);
216 end create_assessment_group;
217 --
218 --
219 -- ---------------------------------------------------------------------------
220 -- |---------------------< <update_assessment_group> >-----------------------|
221 -- ---------------------------------------------------------------------------
222 --
223 procedure update_assessment_group
224  (p_assessment_group_id           in number,
225   p_name                         in varchar2         default hr_api.g_varchar2,
226   p_comments                     in varchar2         default hr_api.g_varchar2,
227   p_object_version_number        in out number,
228   --
229   p_attribute_category           in varchar2    default hr_api.g_varchar2,
230   p_attribute1                   in varchar2    default hr_api.g_varchar2,
231   p_attribute2                   in varchar2    default hr_api.g_varchar2,
232   p_attribute3                   in varchar2    default hr_api.g_varchar2,
233   p_attribute4                   in varchar2    default hr_api.g_varchar2,
234   p_attribute5                   in varchar2    default hr_api.g_varchar2,
235   p_attribute6                   in varchar2    default hr_api.g_varchar2,
236   p_attribute7                   in varchar2    default hr_api.g_varchar2,
237   p_attribute8                   in varchar2    default hr_api.g_varchar2,
238   p_attribute9                   in varchar2    default hr_api.g_varchar2,
239   p_attribute10                  in varchar2    default hr_api.g_varchar2,
240   p_attribute11                  in varchar2    default hr_api.g_varchar2,
241   p_attribute12                  in varchar2    default hr_api.g_varchar2,
242   p_attribute13                  in varchar2    default hr_api.g_varchar2,
243   p_attribute14                  in varchar2    default hr_api.g_varchar2,
244   p_attribute15                  in varchar2    default hr_api.g_varchar2,
245   p_attribute16                  in varchar2    default hr_api.g_varchar2,
246   p_attribute17                  in varchar2    default hr_api.g_varchar2,
247   p_attribute18                  in varchar2    default hr_api.g_varchar2,
248   p_attribute19                  in varchar2    default hr_api.g_varchar2,
249   p_attribute20                  in varchar2    default hr_api.g_varchar2,
250   p_validate                     in boolean      default false,
251   p_effective_date               in date
252   ) is
253   --
254   -- Declare cursors and local variables
255   --
256   l_proc               	varchar2(72) := g_package||'update_assessment_group';
257   l_object_version_number      per_assessment_groups.object_version_number%TYPE;
258   --
259 begin
260   hr_utility.set_location('Entering:'|| l_proc, 5);
261   --
262   -- Issue a savepoint.
263   --
264   savepoint update_assess_group;
265   hr_utility.set_location(l_proc, 6);
266   --
267   -- Call Before Process User Hook
268   --
269   begin
270 	hr_assessment_groups_bk2.update_assessment_group_b	(
271            p_assessment_group_id          =>     p_assessment_group_id,
272            p_name                         =>     p_name,
273            p_comments                     =>     p_comments,
274            p_object_version_number        =>     p_object_version_number,
275            p_attribute_category           =>     p_attribute_category,
276            p_attribute1                   =>     p_attribute1,
277            p_attribute2                   =>     p_attribute2,
278            p_attribute3                   =>     p_attribute3,
279            p_attribute4                   =>     p_attribute4,
280            p_attribute5                   =>     p_attribute5,
281            p_attribute6                   =>     p_attribute6,
282            p_attribute7                   =>     p_attribute7,
283            p_attribute8                   =>     p_attribute8,
284            p_attribute9                   =>     p_attribute9,
285            p_attribute10                  =>     p_attribute10,
286            p_attribute11                  =>     p_attribute11,
287            p_attribute12                  =>     p_attribute12,
288            p_attribute13                  =>     p_attribute13,
289            p_attribute14                  =>     p_attribute14,
290            p_attribute15                  =>     p_attribute15,
291            p_attribute16                  =>     p_attribute16,
292            p_attribute17                  =>     p_attribute17,
293            p_attribute18                  =>     p_attribute18,
294            p_attribute19                  =>     p_attribute19,
295            p_attribute20                  =>     p_attribute20,
296            p_effective_date               =>     p_effective_date		);
297       exception
298 	   when hr_api.cannot_find_prog_unit then
299 		  hr_api.cannot_find_prog_unit_error
300 				(p_module_name	=> 'update_assessment_group',
301 				 p_hook_type	=> 'BP'
302 				);
303   end;
304   --
305   -- End of Before Process User Hook call
306   --
307   -- Validation in addition to Table Handlers
308   --
309   hr_utility.set_location(l_proc, 7);
310   --
311   -- Process Logic
312   --
313   l_object_version_number := p_object_version_number;
314   --
315   per_asr_upd.upd
316   (p_assessment_group_id         =>     p_assessment_group_id,
317   p_name                         =>     p_name,
318   p_comments                     =>     p_comments,
319   p_object_version_number        =>     l_object_version_number,
320   p_attribute1                   =>     p_attribute1,
321   p_attribute2                   =>     p_attribute2,
322   p_attribute3                   =>     p_attribute3,
323   p_attribute4                   =>     p_attribute4,
324   p_attribute5                   =>     p_attribute5,
325   p_attribute6                   =>     p_attribute6,
326   p_attribute7                   =>     p_attribute7,
327   p_attribute8                   =>     p_attribute8,
328   p_attribute9                   =>     p_attribute9,
329   p_attribute10                  =>     p_attribute10,
330   p_attribute11                  =>     p_attribute11,
331   p_attribute12                  =>     p_attribute12,
332   p_attribute13                  =>     p_attribute13,
333   p_attribute14                  =>     p_attribute14,
334   p_attribute15                  =>     p_attribute15,
335   p_attribute16                  =>     p_attribute16,
336   p_attribute17                  =>     p_attribute17,
337   p_attribute18                  =>     p_attribute18,
338   p_attribute19                  =>     p_attribute19,
339   p_attribute20                  =>     p_attribute20,
340   p_validate                     =>     p_validate,
341   p_effective_date               =>     p_effective_date
342   );
343   --
344   --
345   hr_utility.set_location(l_proc, 8);
346   --
347   -- Call After Process User Hook
348   --
349   begin
350 	hr_assessment_groups_bk2.update_assessment_group_a	(
351            p_assessment_group_id          =>     p_assessment_group_id,
352            p_name                         =>     p_name,
353            p_comments                     =>     p_comments,
354            p_object_version_number        =>     l_object_version_number,
355            p_attribute_category           =>     p_attribute_category,
356            p_attribute1                   =>     p_attribute1,
357            p_attribute2                   =>     p_attribute2,
358            p_attribute3                   =>     p_attribute3,
359            p_attribute4                   =>     p_attribute4,
360            p_attribute5                   =>     p_attribute5,
361            p_attribute6                   =>     p_attribute6,
362            p_attribute7                   =>     p_attribute7,
363            p_attribute8                   =>     p_attribute8,
364            p_attribute9                   =>     p_attribute9,
365            p_attribute10                  =>     p_attribute10,
366            p_attribute11                  =>     p_attribute11,
367            p_attribute12                  =>     p_attribute12,
368            p_attribute13                  =>     p_attribute13,
369            p_attribute14                  =>     p_attribute14,
370            p_attribute15                  =>     p_attribute15,
371            p_attribute16                  =>     p_attribute16,
372            p_attribute17                  =>     p_attribute17,
373            p_attribute18                  =>     p_attribute18,
374            p_attribute19                  =>     p_attribute19,
375            p_attribute20                  =>     p_attribute20,
376            p_effective_date               =>     p_effective_date		);
377       exception
378 	   when hr_api.cannot_find_prog_unit then
379 		  hr_api.cannot_find_prog_unit_error
380 				(p_module_name	=> 'update_assessment_group',
381 				 p_hook_type	=> 'AP'
382 				);
383   end;
384   --
385   -- End After Process User Hook
386   --
387   -- When in validation only mode raise the Validate_Enabled exception
388   --
389   if p_validate then
390     raise hr_api.validate_enabled;
391   end if;
392   --
393   -- Set all output arguments. l_object_version_number now has the new
394   -- object version number as the update was successful
395   --
396   p_object_version_number  := l_object_version_number;
397   --
398   hr_utility.set_location(' Leaving:'||l_proc, 11);
399 exception
400   when hr_api.validate_enabled then
401     --
402     -- As the Validate_Enabled exception has been raised
403     -- we must rollback to the savepoint
404     --
405     ROLLBACK TO update_assess_group;
406     --
407     -- Only set output warning arguments and in out arguments back
408     -- to their IN value
409     -- (Any key or derived arguments must be set to null
410     -- when validation only mode is being used.)
411     --
412     p_object_version_number  := l_object_version_number;
413     --
414   when others then
415     --
416     -- A validation or unexpected error has occurred
417     --
418     -- Added as part of fix to bug 632482
419     --
420     ROLLBACK TO update_assess_group;
421     raise;
422     --
423     -- End of fix.
424     --
425     hr_utility.set_location(' Leaving:'||l_proc, 12);
426 --
427 end update_assessment_group;
428 --
429 --
430 -- ---------------------------------------------------------------------------
431 -- |-----------------------< delete_assessment_group >-----------------------|
432 -- ---------------------------------------------------------------------------
433 --
434 procedure delete_assessment_group
435 (p_validate                           in boolean default false,
436  p_assessment_group_id 		      in number,
437  p_object_version_number              in number
438 ) is
439   --
440   -- Declare cursors and local variables
441   --
442   l_proc                varchar2(72) := g_package||'delete_assessment_group';
443 begin
444   hr_utility.set_location('Entering:'|| l_proc, 5);
445   --
446   -- Issue a savepoint.
447   --
448   savepoint delete_assess_group;
449   hr_utility.set_location(l_proc, 6);
450   --
451   -- Call Before Process User Hook
452   --
453   begin
454 	hr_assessment_groups_bk3.delete_assessment_group_b
455 		(
456                p_assessment_group_id      =>  p_assessment_group_id
457               ,p_object_version_number    =>  p_object_version_number
458 		);
459       exception
460 	   when hr_api.cannot_find_prog_unit then
461 		  hr_api.cannot_find_prog_unit_error
462 				(p_module_name	=> 'delete_assessment_group',
463 				 p_hook_type	=> 'BP'
464 				);
465   end;
466   --
467   -- End of Before Process User hook
468   --
469   -- Validation in addition to Table Handlers
470   --
471   hr_utility.set_location(l_proc, 7);
472   --
473   -- Process Logic
474   --
475   --  The check to see whether the assessment_type is being used by an
476   --  assessment is done in the row handler
477   --
478   per_asr_del.del
479      (p_validate                 =>  FALSE
480      ,p_assessment_group_id      =>  p_assessment_group_id
481      ,p_object_version_number    =>  p_object_version_number
482      );
483   --
484   hr_utility.set_location(l_proc, 8);
485   --
486   -- Call After Process User Hook
487   --
488   begin
489 	hr_assessment_groups_bk3.delete_assessment_group_a	(
490                p_assessment_group_id      =>  p_assessment_group_id
491               ,p_object_version_number    =>  p_object_version_number
492 		);
493       exception
494 	   when hr_api.cannot_find_prog_unit then
495 		  hr_api.cannot_find_prog_unit_error
496 				(p_module_name	=> 'delete_assessment_group',
497 				 p_hook_type	=> 'AP'
498 				);
499   end;
500   --
501   -- End of After Process User hook
502   --
503   -- When in validation only mode raise the Validate_Enabled exception
504   --
505   if p_validate then
506     raise hr_api.validate_enabled;
507   end if;
508   --
509   hr_utility.set_location(' Leaving:'||l_proc, 11);
510 exception
511   when hr_api.validate_enabled then
512     --
513     -- As the Validate_Enabled exception has been raised
514     -- we must rollback to the savepoint
515     --
516     ROLLBACK TO delete_assess_group;
517     --
518     --
519   when others then
520     --
521     -- A validation or unexpected error has occurred
522     --
523     -- Added as part of fix to bug 632482
524     --
525     ROLLBACK TO delete_assess_group;
526     raise;
527     --
528     -- End of fix.
529     --
530     hr_utility.set_location(' Leaving:'||l_proc, 12);
531 end delete_assessment_group;
532 --
533 end hr_assessment_groups_api;