DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_CHECKLIST_ITEMS_API

Source


1 Package Body per_checklist_items_api as
2 /* $Header: pechkapi.pkb 115.12 2002/12/10 15:06:28 pkakar noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  per_checklist_items_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_checklist_items >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 -- Made people , status and item mandatory
13 procedure create_checklist_items
14   (p_validate                       in  boolean   --default false
15   ,p_effective_date                 in  date
16   ,p_person_id                      in  number
17   ,p_item_code                      in  varchar2
18   ,p_date_due                       in  date      --default null
19   ,p_date_done                      in  date      --default null
20   ,p_status                         in  varchar2  --default null
21   ,p_notes                          in  varchar2  --default null
22   ,p_attribute_category             in  varchar2  --default null
23   ,p_attribute1                     in  varchar2  --default null
24   ,p_attribute2                     in  varchar2  --default null
25   ,p_attribute3                     in  varchar2  --default null
26   ,p_attribute4                     in  varchar2  --default null
27   ,p_attribute5                     in  varchar2  --default null
28   ,p_attribute6                     in  varchar2  --default null
29   ,p_attribute7                     in  varchar2  --default null
30   ,p_attribute8                     in  varchar2  --default null
31   ,p_attribute9                     in  varchar2  --default null
32   ,p_attribute10                    in  varchar2  --default null
33   ,p_attribute11                    in  varchar2  --default null
34   ,p_attribute12                    in  varchar2  --default null
35   ,p_attribute13                    in  varchar2  --default null
36   ,p_attribute14                    in  varchar2  --default null
37   ,p_attribute15                    in  varchar2  --default null
38   ,p_attribute16                    in  varchar2  --default null
39   ,p_attribute17                    in  varchar2  --default null
40   ,p_attribute18                    in  varchar2  --default null
41   ,p_attribute19                    in  varchar2  --default null
42   ,p_attribute20                    in  varchar2  --default null
43   ,p_attribute21                    in  varchar2  --default null
44   ,p_attribute22                    in  varchar2  --default null
45   ,p_attribute23                    in  varchar2  --default null
46   ,p_attribute24                    in  varchar2  --default null
47   ,p_attribute25                    in  varchar2  --default null
48   ,p_attribute26                    in  varchar2  --default null
49   ,p_attribute27                    in  varchar2  --default null
50   ,p_attribute28                    in  varchar2  --default null
51   ,p_attribute29                    in  varchar2  --default null
52   ,p_attribute30                    in  varchar2  --default null
53   ,p_checklist_item_id              out nocopy number
54   ,p_object_version_number          out nocopy number
55   ) is
56   --
57   -- Declare cursors and local variables
58   --
59   l_checklist_item_id per_checklist_items.checklist_item_id%TYPE;
60   l_proc varchar2(72) := g_package||'create_checklist_items';
61   l_object_version_number per_checklist_items.object_version_number%TYPE;
62   -- l_language_code         hr_locations_all_tl.language%TYPE;
63   --
64 begin
65   --
66   hr_utility.set_location('Entering:'|| l_proc, 10);
67   --
68   -- Issue a savepoint if operating in validation only mode
69   --
70   savepoint create_checklist_items;
71   --
72   hr_utility.set_location(l_proc, 20);
73   --
74   -- Process Logic
75   --
76   begin
77     --
78     -- Start of API User Hook for the before hook of create_checklist_items
79     --
80     per_checklist_items_bk1.create_checklist_items_b
81       (
82        p_effective_date                 =>  TRUNC(p_effective_date)
83       ,p_person_id                      =>  p_person_id
84       ,p_item_code                      =>  p_item_code
85       ,p_date_due                       =>  p_date_due
86       ,p_date_done                      =>  p_date_done
87       ,p_status                         =>  p_status
88       ,p_notes                          =>  p_notes
89       ,p_attribute_category             =>  p_attribute_category
90       ,p_attribute1                     =>  p_attribute1
91       ,p_attribute2                     =>  p_attribute2
92       ,p_attribute3                     =>  p_attribute3
93       ,p_attribute4                     =>  p_attribute4
94       ,p_attribute5                     =>  p_attribute5
95       ,p_attribute6                     =>  p_attribute6
96       ,p_attribute7                     =>  p_attribute7
97       ,p_attribute8                     =>  p_attribute8
98       ,p_attribute9                     =>  p_attribute9
99       ,p_attribute10                    =>  p_attribute10
100       ,p_attribute11                    =>  p_attribute11
101       ,p_attribute12                    =>  p_attribute12
102       ,p_attribute13                    =>  p_attribute13
103       ,p_attribute14                    =>  p_attribute14
104       ,p_attribute15                    =>  p_attribute15
105       ,p_attribute16                    =>  p_attribute16
106       ,p_attribute17                    =>  p_attribute17
107       ,p_attribute18                    =>  p_attribute18
108       ,p_attribute19                    =>  p_attribute19
109       ,p_attribute20                    =>  p_attribute20
110       ,p_attribute21                    =>  p_attribute21
111       ,p_attribute22                    =>  p_attribute22
112       ,p_attribute23                    =>  p_attribute23
113       ,p_attribute24                    =>  p_attribute24
114       ,p_attribute25                    =>  p_attribute25
115       ,p_attribute26                    =>  p_attribute26
116       ,p_attribute27                    =>  p_attribute27
117       ,p_attribute28                    =>  p_attribute28
118       ,p_attribute29                    =>  p_attribute29
119       ,p_attribute30                    =>  p_attribute30
120       );
121   exception
122     when hr_api.cannot_find_prog_unit then
123       hr_api.cannot_find_prog_unit_error
124         (
125          p_module_name => 'CREATE_checklist_items'
126         ,p_hook_type   => 'BP'
127         );
128     --
129     -- End of API User Hook for the before hook of create_checklist_items
130     --
131   end;
132   --
133   per_chk_ins.ins
134     (
135     p_effective_date                 =>  TRUNC(p_effective_date)
136     ,p_checklist_item_id             => l_checklist_item_id
137     ,p_person_id                     => p_person_id
138     ,p_item_code                     => p_item_code
139     ,p_date_due                      => p_date_due
140     ,p_date_done                     => p_date_done
141     ,p_status                        => p_status
142     ,p_notes                         => p_notes
143     ,p_object_version_number         => l_object_version_number
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_attribute15
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_attribute21                   => p_attribute21
166     ,p_attribute22                   => p_attribute22
167     ,p_attribute23                   => p_attribute23
168     ,p_attribute24                   => p_attribute24
169     ,p_attribute25                   => p_attribute25
170     ,p_attribute26                   => p_attribute26
171     ,p_attribute27                   => p_attribute27
172     ,p_attribute28                   => p_attribute28
173     ,p_attribute29                   => p_attribute29
174     ,p_attribute30                   => p_attribute30
175     );
176 --
177   begin
178     --
179     -- Start of API User Hook for the after hook of create_checklist_items
180     --
181     per_checklist_items_bk1.create_checklist_items_a
182       (
183       p_effective_date                 =>  TRUNC(p_effective_date)
184       ,p_person_id                      =>  p_person_id
185       ,p_item_code                      =>  p_item_code
186       ,p_date_due                       =>  p_date_due
187       ,p_date_done                      =>  p_date_done
188       ,p_status                         =>  p_status
189       ,p_notes                          =>  p_notes
190       ,p_attribute_category             =>  p_attribute_category
191       ,p_attribute1                     =>  p_attribute1
192       ,p_attribute2                     =>  p_attribute2
193       ,p_attribute3                     =>  p_attribute3
194       ,p_attribute4                     =>  p_attribute4
195       ,p_attribute5                     =>  p_attribute5
196       ,p_attribute6                     =>  p_attribute6
197       ,p_attribute7                     =>  p_attribute7
198       ,p_attribute8                     =>  p_attribute8
199       ,p_attribute9                     =>  p_attribute9
200       ,p_attribute10                    =>  p_attribute10
201       ,p_attribute11                    =>  p_attribute11
202       ,p_attribute12                    =>  p_attribute12
203       ,p_attribute13                    =>  p_attribute13
204       ,p_attribute14                    =>  p_attribute14
205       ,p_attribute15                    =>  p_attribute15
206       ,p_attribute16                    =>  p_attribute16
207       ,p_attribute17                    =>  p_attribute17
208       ,p_attribute18                    =>  p_attribute18
209       ,p_attribute19                    =>  p_attribute19
210       ,p_attribute20                    =>  p_attribute20
211       ,p_attribute21                    =>  p_attribute21
212       ,p_attribute22                    =>  p_attribute22
213       ,p_attribute23                    =>  p_attribute23
214       ,p_attribute24                    =>  p_attribute24
215       ,p_attribute25                    =>  p_attribute25
216       ,p_attribute26                    =>  p_attribute26
217       ,p_attribute27                    =>  p_attribute27
218       ,p_attribute28                    =>  p_attribute28
219       ,p_attribute29                    =>  p_attribute29
220       ,p_attribute30                    =>  p_attribute30
221       ,p_checklist_item_id              =>  l_checklist_item_id
222       ,p_object_version_number          =>  l_object_version_number
223       );
224   exception
228         ,p_hook_type   => 'AP'
225     when hr_api.cannot_find_prog_unit then
226       hr_api.cannot_find_prog_unit_error
227         (p_module_name => 'CREATE_checklist_items'
229         );
230     --
231     -- End of API User Hook for the after hook of create_checklist_items
232     --
233   end;
234   --
235   hr_utility.set_location(l_proc, 60);
236   --
237   -- When in validation only mode raise the Validate_Enabled exception
238   --
239   if p_validate then
240     raise hr_api.validate_enabled;
241   end if;
242   --
243   -- Set all output arguments
244   --
245   p_checklist_item_id := l_checklist_item_id;
246   p_object_version_number := l_object_version_number;
247   --
248   hr_utility.set_location(' Leaving:'||l_proc, 70);
249   --
250 exception
251   --
252   when hr_api.validate_enabled then
253     --
254     -- As the Validate_Enabled exception has been raised
255     -- we must rollback to the savepoint
256     --
257     ROLLBACK TO create_checklist_items;
258     --
259     -- Only set output warning arguments
260     -- (Any key or derived arguments must be set to null
261     -- when validation only mode is being used.)
262     --
263     p_checklist_item_id := null;
264     p_object_version_number  := null;
265     hr_utility.set_location(' Leaving:'||l_proc, 80);
266     --
267   when others then
268     --
269     -- A validation or unexpected error has occured
270     --
271     ROLLBACK TO create_checklist_items;
272     -- Reset IN OUT parameters and set OUT parameters
273      p_checklist_item_id := null;
274      p_object_version_number  := null;
275      hr_utility.set_location(' Leaving:'||l_proc, 90);
276     raise;
277     --
278 end create_checklist_items;
279 -- ----------------------------------------------------------------------------
280 -- |------------------------< update_checklist_items >------------------------|
281 -- ----------------------------------------------------------------------------
282 --
283 -- Made people , status and item code mandatory
284 procedure update_checklist_items
285   (p_validate                       in  boolean   --default false
286   ,p_effective_date                 in  date
287   ,p_checklist_item_id              in  number
288   ,p_person_id                      in  number    --default hr_api.g_number
289   ,p_item_code                      in  varchar2  --default hr_api.g_varchar2
290   ,p_date_due                       in  date      --default hr_api.g_date
291   ,p_date_done                      in  date      --default hr_api.g_date
292   ,p_status                         in  varchar2  --default hr_api.g_varchar2
293   ,p_notes                          in  varchar2  --default hr_api.g_varchar2
294   ,p_attribute_category             in  varchar2  --default hr_api.g_varchar2
295   ,p_attribute1                     in  varchar2  --default hr_api.g_varchar2
296   ,p_attribute2                     in  varchar2  --default hr_api.g_varchar2
297   ,p_attribute3                     in  varchar2  --default hr_api.g_varchar2
298   ,p_attribute4                     in  varchar2  --default hr_api.g_varchar2
299   ,p_attribute5                     in  varchar2  --default hr_api.g_varchar2
300   ,p_attribute6                     in  varchar2  --default hr_api.g_varchar2
301   ,p_attribute7                     in  varchar2  --default hr_api.g_varchar2
302   ,p_attribute8                     in  varchar2  --default hr_api.g_varchar2
303   ,p_attribute9                     in  varchar2  --default hr_api.g_varchar2
304   ,p_attribute10                    in  varchar2  --default hr_api.g_varchar2
305   ,p_attribute11                    in  varchar2  --default hr_api.g_varchar2
306   ,p_attribute12                    in  varchar2  --default hr_api.g_varchar2
307   ,p_attribute13                    in  varchar2  --default hr_api.g_varchar2
308   ,p_attribute14                    in  varchar2  --default hr_api.g_varchar2
309   ,p_attribute15                    in  varchar2  --default hr_api.g_varchar2
310   ,p_attribute16                    in  varchar2  --default hr_api.g_varchar2
311   ,p_attribute17                    in  varchar2  --default hr_api.g_varchar2
312   ,p_attribute18                    in  varchar2  --default hr_api.g_varchar2
313   ,p_attribute19                    in  varchar2  --default hr_api.g_varchar2
314   ,p_attribute20                    in  varchar2  --default hr_api.g_varchar2
315   ,p_attribute21                    in  varchar2  --default hr_api.g_varchar2
316   ,p_attribute22                    in  varchar2  --default hr_api.g_varchar2
317   ,p_attribute23                    in  varchar2  --default hr_api.g_varchar2
318   ,p_attribute24                    in  varchar2  --default hr_api.g_varchar2
319   ,p_attribute25                    in  varchar2  --default hr_api.g_varchar2
320   ,p_attribute26                    in  varchar2  --default hr_api.g_varchar2
321   ,p_attribute27                    in  varchar2  --default hr_api.g_varchar2
322   ,p_attribute28                    in  varchar2  --default hr_api.g_varchar2
323   ,p_attribute29                    in  varchar2  --default hr_api.g_varchar2
324   ,p_attribute30                    in  varchar2  --default hr_api.g_varchar2
325   ,p_object_version_number          in out nocopy number
326   ) is
327   --
328   -- Declare cursors and local variables
329   --
330   l_proc varchar2(72) := g_package||'update_checklist_items';
331   l_object_version_number per_checklist_items.object_version_number%TYPE;
332   l_temp_object_version_number per_checklist_items.object_version_number%TYPE;
333   --
334 begin
335   --
336   hr_utility.set_location('Entering:'|| l_proc, 10);
337   --
338   -- Issue a savepoint if operating in validation only mode
339   --
340   savepoint update_checklist_items;
341   --
345   --
342   hr_utility.set_location(l_proc, 20);
343   --
344   -- Process Logic
346   l_temp_object_version_number := p_object_version_number;
347   l_object_version_number := p_object_version_number;
348   --
349   begin
350     --
351     -- Start of API User Hook for the before hook of update_checklist_items
352     --
353     per_checklist_items_bk2.update_checklist_items_b
354       (
355       p_effective_date                  =>  TRUNC(p_effective_date)
356       ,p_checklist_item_id              =>  p_checklist_item_id
357       ,p_person_id                      =>  p_person_id
358       ,p_item_code                      =>  p_item_code
359       ,p_date_due                       =>  p_date_due
360       ,p_date_done                      =>  p_date_done
361       ,p_status                         =>  p_status
362       ,p_notes                          =>  p_notes
363       ,p_attribute_category             =>  p_attribute_category
364       ,p_attribute1                     =>  p_attribute1
365       ,p_attribute2                     =>  p_attribute2
366       ,p_attribute3                     =>  p_attribute3
367       ,p_attribute4                     =>  p_attribute4
368       ,p_attribute5                     =>  p_attribute5
369       ,p_attribute6                     =>  p_attribute6
370       ,p_attribute7                     =>  p_attribute7
371       ,p_attribute8                     =>  p_attribute8
372       ,p_attribute9                     =>  p_attribute9
373       ,p_attribute10                    =>  p_attribute10
374       ,p_attribute11                    =>  p_attribute11
375       ,p_attribute12                    =>  p_attribute12
376       ,p_attribute13                    =>  p_attribute13
377       ,p_attribute14                    =>  p_attribute14
378       ,p_attribute15                    =>  p_attribute15
379       ,p_attribute16                    =>  p_attribute16
380       ,p_attribute17                    =>  p_attribute17
381       ,p_attribute18                    =>  p_attribute18
382       ,p_attribute19                    =>  p_attribute19
383       ,p_attribute20                    =>  p_attribute20
384       ,p_attribute21                    =>  p_attribute21
385       ,p_attribute22                    =>  p_attribute22
386       ,p_attribute23                    =>  p_attribute23
387       ,p_attribute24                    =>  p_attribute24
388       ,p_attribute25                    =>  p_attribute25
389       ,p_attribute26                    =>  p_attribute26
390       ,p_attribute27                    =>  p_attribute27
391       ,p_attribute28                    =>  p_attribute28
392       ,p_attribute29                    =>  p_attribute29
393       ,p_attribute30                    =>  p_attribute30
394       ,p_object_version_number          =>  p_object_version_number
395       );
396   exception
397     when hr_api.cannot_find_prog_unit then
398       hr_api.cannot_find_prog_unit_error
399         (p_module_name => 'UPDATE_checklist_items'
400         ,p_hook_type   => 'BP'
401         );
402     --
403     -- End of API User Hook for the before hook of update_checklist_items
404     --
405   end;
406   --
407   per_chk_upd.upd
408     (
409     p_effective_date                 =>  TRUNC(p_effective_date)
410     ,p_checklist_item_id             => p_checklist_item_id
411     ,p_person_id                     => p_person_id
412     ,p_item_code                     => p_item_code
413     ,p_date_due                      => p_date_due
414     ,p_date_done                     => p_date_done
415     ,p_status                        => p_status
416     ,p_notes                         => p_notes
417     ,p_attribute_category            => p_attribute_category
418     ,p_attribute1                    => p_attribute1
419     ,p_attribute2                    => p_attribute2
420     ,p_attribute3                    => p_attribute3
421     ,p_attribute4                    => p_attribute4
422     ,p_attribute5                    => p_attribute5
423     ,p_attribute6                    => p_attribute6
424     ,p_attribute7                    => p_attribute7
425     ,p_attribute8                    => p_attribute8
426     ,p_attribute9                    => p_attribute9
427     ,p_attribute10                   => p_attribute10
428     ,p_attribute11                   => p_attribute11
429     ,p_attribute12                   => p_attribute12
430     ,p_attribute13                   => p_attribute13
431     ,p_attribute14                   => p_attribute14
432     ,p_attribute15                   => p_attribute15
433     ,p_attribute16                   => p_attribute16
434     ,p_attribute17                   => p_attribute17
435     ,p_attribute18                   => p_attribute18
436     ,p_attribute19                   => p_attribute19
437     ,p_attribute20                   => p_attribute20
438     ,p_attribute21                   => p_attribute21
439     ,p_attribute22                   => p_attribute22
440     ,p_attribute23                   => p_attribute23
441     ,p_attribute24                   => p_attribute24
442     ,p_attribute25                   => p_attribute25
443     ,p_attribute26                   => p_attribute26
444     ,p_attribute27                   => p_attribute27
445     ,p_attribute28                   => p_attribute28
446     ,p_attribute29                   => p_attribute29
447     ,p_attribute30                   => p_attribute30
448     ,p_object_version_number         => l_object_version_number
449     );
450   --
451   begin
452     --
453     -- Start of API User Hook for the after hook of update_checklist_items
454     --
455     per_checklist_items_bk2.update_checklist_items_a
456       (
457       p_effective_date                  =>  TRUNC(p_effective_date)
461       ,p_date_due                       =>  p_date_due
458       ,p_checklist_item_id              =>  p_checklist_item_id
459       ,p_person_id                      =>  p_person_id
460       ,p_item_code                      =>  p_item_code
462       ,p_date_done                      =>  p_date_done
463       ,p_status                         =>  p_status
464       ,p_notes                          =>  p_notes
465       ,p_attribute_category             =>  p_attribute_category
466       ,p_attribute1                     =>  p_attribute1
467       ,p_attribute2                     =>  p_attribute2
468       ,p_attribute3                     =>  p_attribute3
469       ,p_attribute4                     =>  p_attribute4
470       ,p_attribute5                     =>  p_attribute5
471       ,p_attribute6                     =>  p_attribute6
472       ,p_attribute7                     =>  p_attribute7
473       ,p_attribute8                     =>  p_attribute8
474       ,p_attribute9                     =>  p_attribute9
475       ,p_attribute10                    =>  p_attribute10
476       ,p_attribute11                    =>  p_attribute11
477       ,p_attribute12                    =>  p_attribute12
478       ,p_attribute13                    =>  p_attribute13
479       ,p_attribute14                    =>  p_attribute14
480       ,p_attribute15                    =>  p_attribute15
481       ,p_attribute16                    =>  p_attribute16
482       ,p_attribute17                    =>  p_attribute17
483       ,p_attribute18                    =>  p_attribute18
484       ,p_attribute19                    =>  p_attribute19
485       ,p_attribute20                    =>  p_attribute20
486       ,p_attribute21                    =>  p_attribute21
487       ,p_attribute22                    =>  p_attribute22
488       ,p_attribute23                    =>  p_attribute23
489       ,p_attribute24                    =>  p_attribute24
490       ,p_attribute25                    =>  p_attribute25
491       ,p_attribute26                    =>  p_attribute26
492       ,p_attribute27                    =>  p_attribute27
493       ,p_attribute28                    =>  p_attribute28
494       ,p_attribute29                    =>  p_attribute29
495       ,p_attribute30                    =>  p_attribute30
496       ,p_object_version_number          =>  l_object_version_number
497       );
498   exception
499     when hr_api.cannot_find_prog_unit then
500       hr_api.cannot_find_prog_unit_error
501         (p_module_name => 'UPDATE_checklist_items'
502         ,p_hook_type   => 'AP'
503         );
504     --
505     -- End of API User Hook for the after hook of update_checklist_items
506     --
507   end;
508   --
509   hr_utility.set_location(l_proc, 60);
510   --
511   -- When in validation only mode raise the Validate_Enabled exception
512   --
513   if p_validate then
514     raise hr_api.validate_enabled;
515   end if;
516   --
517   -- Set all output arguments
518   --
519   p_object_version_number := l_object_version_number;
520   --
521   hr_utility.set_location(' Leaving:'||l_proc, 70);
522   --
523 exception
524   --
525   when hr_api.validate_enabled then
526     --
527     -- As the Validate_Enabled exception has been raised
528     -- we must rollback to the savepoint
529     --
530     ROLLBACK TO update_checklist_items;
531     --
532     -- Only set output warning arguments
533     -- (Any key or derived arguments must be set to null
534     -- when validation only mode is being used.)
535     --
536     hr_utility.set_location(' Leaving:'||l_proc, 80);
537     --
538   when others then
539     --
540     -- A validation or unexpected error has occured
541     --
542     ROLLBACK TO update_checklist_items;
543 
544     -- Reset IN OUT parameters and set out OUT parameters
545     p_object_version_number 	:= l_temp_object_version_number;
546 
547     raise;
548     --
549 end update_checklist_items;
550 -- ----------------------------------------------------------------------------
551 -- |------------------------< delete_checklist_items >----------------------|
552 -- ----------------------------------------------------------------------------
553 --
554 procedure delete_checklist_items
555   (p_validate                       in  boolean  --default false
556   ,p_checklist_item_id              in  number
557   ,p_object_version_number          in  number
558   ) is
559   --
560   -- Declare cursors and local variables
561   --
562   l_proc varchar2(72) := g_package||'update_checklist_items';
563   --
564 begin
565   --
566   hr_utility.set_location('Entering:'|| l_proc, 10);
567   --
568   -- Issue a savepoint if operating in validation only mode
569   --
570   savepoint delete_checklist_items;
571   --
572   hr_utility.set_location(l_proc, 20);
573   --
574   -- Process Logic
575   --
576   --
577   --
578   begin
579     --
580     -- Start of API User Hook for the before hook of delete_checklist_items
581     --
582     per_checklist_items_bk3.delete_checklist_items_b
583       (
584        p_checklist_item_id              =>  p_checklist_item_id
585       ,p_object_version_number          =>  p_object_version_number
586       );
587   exception
588     when hr_api.cannot_find_prog_unit then
589       hr_api.cannot_find_prog_unit_error
590         (p_module_name => 'DELETE_checklist_items'
591         ,p_hook_type   => 'BP'
592         );
593     --
594     -- End of API User Hook for the before hook of delete_checklist_items
595     --
596   end;
597   --
598   per_chk_del.del
602     );
599     (
600      p_checklist_item_id             => p_checklist_item_id
601     ,p_object_version_number         => p_object_version_number
603   --
604   begin
605     --
606     -- Start of API User Hook for the after hook of delete_checklist_items
607     --
608     per_checklist_items_bk3.delete_checklist_items_a
609       (
610        p_checklist_item_id              =>  p_checklist_item_id
611       ,p_object_version_number          =>  p_object_version_number
612       );
613   exception
614     when hr_api.cannot_find_prog_unit then
615       hr_api.cannot_find_prog_unit_error
616         (p_module_name => 'DELETE_checklist_items'
617         ,p_hook_type   => 'AP'
618         );
619     --
620     -- End of API User Hook for the after hook of delete_checklist_items
621     --
622   end;
623   --
624   hr_utility.set_location(l_proc, 60);
625   --
626   -- When in validation only mode raise the Validate_Enabled exception
627   --
628   if p_validate then
629     raise hr_api.validate_enabled;
630   end if;
631   --
632   hr_utility.set_location(' Leaving:'||l_proc, 70);
633   --
634 exception
635   --
636   when hr_api.validate_enabled then
637     --
638     -- As the Validate_Enabled exception has been raised
639     -- we must rollback to the savepoint
640     --
641     ROLLBACK TO delete_checklist_items;
642     --
643     -- Only set output warning arguments
644     -- (Any key or derived arguments must be set to null
645     -- when validation only mode is being used.)
646     --
647     --
648   when others then
649     --
650     -- A validation or unexpected error has occured
651     --
652     ROLLBACK TO delete_checklist_items;
653     raise;
654     --
655 end delete_checklist_items;
656 --
657 -- ----------------------------------------------------------------------------
658 -- |-------------------------------< lck >------------------------------------|
659 -- ----------------------------------------------------------------------------
660 --
661 procedure lck
662   (
663    p_checklist_item_id                   in     number
664   ,p_object_version_number          in     number
665   ) is
666   --
667   --
668   -- Declare cursors and local variables
669   --
670   l_proc varchar2(72) := g_package||'lck';
671   --
672 begin
673   --
674   hr_utility.set_location('Entering:'|| l_proc, 10);
675   --
676   per_chk_shd.lck
677     (
678       p_checklist_item_id                 => p_checklist_item_id
679      ,p_object_version_number      => p_object_version_number
680     );
681   --
682   hr_utility.set_location(' Leaving:'||l_proc, 70);
683   --
684 end lck;
685 --
686 -- ----------------------------------------------------------------------------
687 -- |------------------------< cre_upd_checklist_items >-----------------------|
688 -- ----------------------------------------------------------------------------
689 --
690 procedure cre_or_upd_checklist_items
691   (
692    p_validate                       in boolean    --default false
693   ,p_effective_date                 in date
694   ,p_person_id                      in  number    --default hr_api.g_number
695   ,p_item_code                      in  varchar2  --default hr_api.g_varchar2
696   ,p_date_due                       in  date      --default hr_api.g_date
697   ,p_date_done                      in  date      --default hr_api.g_date
698   ,p_status                         in  varchar2  --default hr_api.g_varchar2
699   ,p_notes                          in  varchar2  --default hr_api.g_varchar2
700   ,p_attribute_category             in  varchar2  --default hr_api.g_varchar2
701   ,p_attribute1                     in  varchar2  --default hr_api.g_varchar2
702   ,p_attribute2                     in  varchar2  --default hr_api.g_varchar2
703   ,p_attribute3                     in  varchar2  --default hr_api.g_varchar2
704   ,p_attribute4                     in  varchar2  --default hr_api.g_varchar2
705   ,p_attribute5                     in  varchar2  --default hr_api.g_varchar2
706   ,p_attribute6                     in  varchar2  --default hr_api.g_varchar2
707   ,p_attribute7                     in  varchar2  --default hr_api.g_varchar2
708   ,p_attribute8                     in  varchar2  --default hr_api.g_varchar2
709   ,p_attribute9                     in  varchar2  --default hr_api.g_varchar2
710   ,p_attribute10                    in  varchar2  --default hr_api.g_varchar2
711   ,p_attribute11                    in  varchar2  --default hr_api.g_varchar2
712   ,p_attribute12                    in  varchar2  --default hr_api.g_varchar2
713   ,p_attribute13                    in  varchar2  --default hr_api.g_varchar2
714   ,p_attribute14                    in  varchar2  --default hr_api.g_varchar2
715   ,p_attribute15                    in  varchar2  --default hr_api.g_varchar2
716   ,p_attribute16                    in  varchar2  --default hr_api.g_varchar2
717   ,p_attribute17                    in  varchar2  --default hr_api.g_varchar2
718   ,p_attribute18                    in  varchar2  --default hr_api.g_varchar2
719   ,p_attribute19                    in  varchar2  --default hr_api.g_varchar2
720   ,p_attribute20                    in  varchar2  --default hr_api.g_varchar2
721   ,p_attribute21                    in  varchar2  --default hr_api.g_varchar2
722   ,p_attribute22                    in  varchar2  --default hr_api.g_varchar2
723   ,p_attribute23                    in  varchar2  --default hr_api.g_varchar2
724   ,p_attribute24                    in  varchar2  --default hr_api.g_varchar2
725   ,p_attribute25                    in  varchar2  --default hr_api.g_varchar2
729   ,p_attribute29                    in  varchar2  --default hr_api.g_varchar2
726   ,p_attribute26                    in  varchar2  --default hr_api.g_varchar2
727   ,p_attribute27                    in  varchar2  --default hr_api.g_varchar2
728   ,p_attribute28                    in  varchar2  --default hr_api.g_varchar2
730   ,p_attribute30                    in  varchar2  --default hr_api.g_varchar2
731   ,p_checklist_item_id              in out nocopy number
732   ,p_object_version_number          in out nocopy number
733   ) is
734   --
735   l_chk_rec    per_chk_shd.g_rec_type;
736   l_null_chk_rec    per_chk_shd.g_rec_type;
737   l_proc varchar2(72) := g_package||'cre_or_upd_checklist_items';
738   l_api_updating boolean;
739   l_checklist_item_id number;
740   l_object_version_number number;
741   --
742 begin
743   --
744   hr_utility.set_location('Entering:'|| l_proc, 10);
745   --
746   savepoint cre_or_upd_checklist_items;
747   --
748   l_checklist_item_id := p_checklist_item_id;
749   l_object_version_number:= p_object_version_number;
750   l_api_updating:=per_chk_shd.api_updating
751   (p_checklist_item_id     => p_checklist_item_id
752   ,p_object_version_number => p_object_version_number);
753   --
754   hr_utility.set_location(l_proc, 20);
755   --
756   l_chk_rec :=
757   per_chk_shd.convert_args
758   (p_checklist_item_id
759   ,p_person_id
760   ,p_item_code
761   ,p_date_due
762   ,p_date_done
763   ,p_status
764   ,p_notes
765   ,p_object_version_number
766   ,p_attribute_category
767   ,p_attribute1
768   ,p_attribute2
769   ,p_attribute3
770   ,p_attribute4
771   ,p_attribute5
772   ,p_attribute6
773   ,p_attribute7
774   ,p_attribute8
775   ,p_attribute9
776   ,p_attribute10
777   ,p_attribute11
778   ,p_attribute12
779   ,p_attribute13
780   ,p_attribute14
781   ,p_attribute15
782   ,p_attribute16
783   ,p_attribute17
784   ,p_attribute18
785   ,p_attribute19
786   ,p_attribute20
787   ,p_attribute21
788   ,p_attribute22
789   ,p_attribute23
790   ,p_attribute24
791   ,p_attribute25
792   ,p_attribute26
793   ,p_attribute27
794   ,p_attribute28
795   ,p_attribute29
796   ,p_attribute30
797   );
798   --
799   if not l_api_updating then
800     --
801     -- set g_old_rec to null;
802     --
803     per_chk_shd.g_old_rec:=l_null_chk_rec;
804     --
805     hr_utility.set_location(l_proc, 30);
806     --
807     -- convert the null values
808     --
809     hr_utility.set_location(l_proc, 40);
810     per_chk_upd.convert_defs(l_chk_rec);
811     --
812     -- insert the data
813     --
814     hr_utility.set_location(l_proc, 50);
815     --
816     per_checklist_items_api.create_checklist_items
817     (p_validate              => FALSE
818     ,p_effective_date        => TRUNC(p_effective_date)
819     ,p_person_id             => l_chk_rec.person_id
820     ,p_item_code             => l_chk_rec.item_code
821     ,p_date_due              => l_chk_rec.date_due
822     ,p_date_done             => l_chk_rec.date_done
823     ,p_status                => l_chk_rec.status
824     ,p_notes                 => l_chk_rec.notes
825     ,p_attribute_category    => l_chk_rec.attribute_category
826     ,p_attribute1            => l_chk_rec.attribute1
827     ,p_attribute2            => l_chk_rec.attribute2
828     ,p_attribute3            => l_chk_rec.attribute3
829     ,p_attribute4            => l_chk_rec.attribute4
830     ,p_attribute5            => l_chk_rec.attribute5
831     ,p_attribute6            => l_chk_rec.attribute6
832     ,p_attribute7            => l_chk_rec.attribute7
833     ,p_attribute8            => l_chk_rec.attribute8
834     ,p_attribute9            => l_chk_rec.attribute9
835     ,p_attribute10           => l_chk_rec.attribute10
836     ,p_attribute11           => l_chk_rec.attribute11
837     ,p_attribute12           => l_chk_rec.attribute12
838     ,p_attribute13           => l_chk_rec.attribute13
839     ,p_attribute14           => l_chk_rec.attribute14
840     ,p_attribute15           => l_chk_rec.attribute15
841     ,p_attribute16           => l_chk_rec.attribute16
842     ,p_attribute17           => l_chk_rec.attribute17
843     ,p_attribute18           => l_chk_rec.attribute18
844     ,p_attribute19           => l_chk_rec.attribute19
845     ,p_attribute20           => l_chk_rec.attribute20
846     ,p_attribute21           => l_chk_rec.attribute21
847     ,p_attribute22           => l_chk_rec.attribute22
848     ,p_attribute23           => l_chk_rec.attribute23
849     ,p_attribute24           => l_chk_rec.attribute24
850     ,p_attribute25           => l_chk_rec.attribute25
851     ,p_attribute26           => l_chk_rec.attribute26
852     ,p_attribute27           => l_chk_rec.attribute27
853     ,p_attribute28           => l_chk_rec.attribute28
854     ,p_attribute29           => l_chk_rec.attribute29
855     ,p_attribute30           => l_chk_rec.attribute30
856     ,p_checklist_item_id     => l_chk_rec.checklist_item_id
857     ,p_object_version_number => l_chk_rec.object_version_number);
858     hr_utility.set_location(l_proc, 60);
859   else
860   --
861   -- updating not inserting
862   --
863     hr_utility.set_location(l_proc, 70);
864     per_chk_shd.lck
865       (p_checklist_item_id         => p_checklist_item_id
866       ,p_object_version_number     => p_object_version_number);
867     --
868     -- convert the null values
869     --
870     hr_utility.set_location(l_proc, 80);
871     per_chk_upd.convert_defs(l_chk_rec);
872     --
876     --
873     -- update the data
874     --
875     hr_utility.set_location(l_proc, 90);
877     per_checklist_items_api.update_checklist_items
878     (p_validate              => FALSE
879     ,p_effective_date        => TRUNC(p_effective_date)
880     ,p_checklist_item_id     => l_chk_rec.checklist_item_id
881     ,p_person_id             => l_chk_rec.person_id
882     ,p_item_code             => l_chk_rec.item_code
883     ,p_date_due              => l_chk_rec.date_due
884     ,p_date_done             => l_chk_rec.date_done
885     ,p_status                => l_chk_rec.status
886     ,p_notes                 => l_chk_rec.notes
887     ,p_attribute_category    => l_chk_rec.attribute_category
888     ,p_attribute1            => l_chk_rec.attribute1
889     ,p_attribute2            => l_chk_rec.attribute2
890     ,p_attribute3            => l_chk_rec.attribute3
891     ,p_attribute4            => l_chk_rec.attribute4
892     ,p_attribute5            => l_chk_rec.attribute5
893     ,p_attribute6            => l_chk_rec.attribute6
894     ,p_attribute7            => l_chk_rec.attribute7
895     ,p_attribute8            => l_chk_rec.attribute8
896     ,p_attribute9            => l_chk_rec.attribute9
897     ,p_attribute10           => l_chk_rec.attribute10
898     ,p_attribute11           => l_chk_rec.attribute11
899     ,p_attribute12           => l_chk_rec.attribute12
900     ,p_attribute13           => l_chk_rec.attribute13
901     ,p_attribute14           => l_chk_rec.attribute14
902     ,p_attribute15           => l_chk_rec.attribute15
903     ,p_attribute16           => l_chk_rec.attribute16
904     ,p_attribute17           => l_chk_rec.attribute17
905     ,p_attribute18           => l_chk_rec.attribute18
906     ,p_attribute19           => l_chk_rec.attribute19
907     ,p_attribute20           => l_chk_rec.attribute20
908     ,p_attribute21           => l_chk_rec.attribute21
909     ,p_attribute22           => l_chk_rec.attribute22
910     ,p_attribute23           => l_chk_rec.attribute23
911     ,p_attribute24           => l_chk_rec.attribute24
912     ,p_attribute25           => l_chk_rec.attribute25
913     ,p_attribute26           => l_chk_rec.attribute26
914     ,p_attribute27           => l_chk_rec.attribute27
915     ,p_attribute28           => l_chk_rec.attribute28
916     ,p_attribute29           => l_chk_rec.attribute29
917     ,p_attribute30           => l_chk_rec.attribute30
918     ,p_object_version_number => l_chk_rec.object_version_number);
919     --
920     hr_utility.set_location(l_proc, 100);
921     --
922   end if;
923   --
924   if p_validate then
925     raise hr_api.validate_enabled;
926   end if;
927   --
928   hr_utility.set_location(l_proc, 110);
929   --
930   p_checklist_item_id := l_chk_rec.checklist_item_id;
931   p_object_version_number := l_chk_rec.object_version_number;
932   --
933   hr_utility.set_location(' Leaving:'||l_proc, 120);
934   --
935 exception
936   when hr_api.validate_enabled then
937     rollback to cre_or_upd_checklist_items;
938     p_checklist_item_id := null;
939     p_object_version_number:=null;
940     hr_utility.set_location('Leaving:'||l_proc, 130);
941   when others then
942     rollback to cre_or_upd_checklist_items;
943         --
944     -- set in out parameters and set out parameters
945     --
946     p_checklist_item_id := l_checklist_item_id;
947     p_object_version_number := l_object_version_number;
948     hr_utility.set_location('Leaving:'||l_proc, 140);
949     raise;
950   --
951 end cre_or_upd_checklist_items;
952 --
953 end per_checklist_items_api;