DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_BATCH_DPNT_INFO_API

Source


1 Package Body ben_batch_dpnt_info_api as
2 /* $Header: bebdiapi.pkb 115.4 2002/12/16 17:33:58 glingapp ship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  ben_batch_dpnt_info_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_batch_dpnt_info >------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_batch_dpnt_info
13   (p_validate                       in  boolean   default false
14   ,p_batch_dpnt_id                  out nocopy number
15   ,p_benefit_action_id              in  number    default null
16   ,p_person_id                      in  number    default null
17   ,p_pgm_id                         in  number    default null
18   ,p_pl_id                          in  number    default null
19   ,p_oipl_id                        in  number    default null
20   ,p_contact_typ_cd                 in  varchar2  default null
21   ,p_dpnt_person_id                 in  number    default null
22   ,p_business_group_id              in  number    default null
23   ,p_object_version_number          out nocopy varchar2
24   ,p_enrt_cvg_strt_dt               in  date      default null
25   ,p_enrt_cvg_thru_dt               in  date      default null
26   ,p_actn_cd                        in  varchar2  default null
27   ,p_effective_date                 in  date) is
28   --
29   -- Declare cursors and local variables
30   --
31   l_batch_dpnt_id ben_batch_dpnt_info.batch_dpnt_id%TYPE;
32   l_proc varchar2(72) := g_package||'create_batch_dpnt_info';
33   l_object_version_number ben_batch_dpnt_info.object_version_number%TYPE;
34   --
35 begin
36   --
37   hr_utility.set_location('Entering:'|| l_proc, 10);
38   --
39   -- Issue a savepoint if operating in validation only mode
40   --
41   savepoint create_batch_dpnt_info;
42   --
43   hr_utility.set_location(l_proc, 20);
44   --
45   -- Process Logic
46   --
47   begin
48     --
49     -- Start of API User Hook for the before hook of create_batch_dpnt_info
50     --
51     ben_batch_dpnt_info_bk1.create_batch_dpnt_info_b
52       (p_benefit_action_id              =>  p_benefit_action_id
53       ,p_person_id                      =>  p_person_id
54       ,p_pgm_id                         =>  p_pgm_id
55       ,p_pl_id                          =>  p_pl_id
56       ,p_oipl_id                        =>  p_oipl_id
57       ,p_contact_typ_cd                 =>  p_contact_typ_cd
58       ,p_dpnt_person_id                 =>  p_dpnt_person_id
59       ,p_business_group_id              =>  p_business_group_id
60       ,p_enrt_cvg_strt_dt               =>  p_enrt_cvg_strt_dt
61       ,p_enrt_cvg_thru_dt               =>  p_enrt_cvg_thru_dt
62       ,p_actn_cd                        =>  p_actn_cd
63       ,p_effective_date                 =>  trunc(p_effective_date));
64     --
65   exception
66     --
67     when hr_api.cannot_find_prog_unit then
68       --
69       hr_api.cannot_find_prog_unit_error
70         (p_module_name => 'CREATE_batch_dpnt_info'
71         ,p_hook_type   => 'BP');
72     --
73     -- End of API User Hook for the before hook of create_batch_dpnt_info
74     --
75   end;
76   --
77   ben_bdi_ins.ins
78     (p_batch_dpnt_id                 => l_batch_dpnt_id
79     ,p_benefit_action_id             => p_benefit_action_id
80     ,p_person_id                     => p_person_id
81     ,p_pgm_id                        => p_pgm_id
82     ,p_pl_id                         => p_pl_id
83     ,p_oipl_id                       => p_oipl_id
84     ,p_contact_typ_cd                => p_contact_typ_cd
85     ,p_dpnt_person_id                => p_dpnt_person_id
86     ,p_business_group_id             => p_business_group_id
87     ,p_object_version_number         => l_object_version_number
88     ,p_enrt_cvg_strt_dt              => p_enrt_cvg_strt_dt
89     ,p_enrt_cvg_thru_dt              => p_enrt_cvg_thru_dt
90     ,p_actn_cd                       => p_actn_cd
91     ,p_effective_date                => trunc(p_effective_date));
92   --
93   begin
94     --
95     -- Start of API User Hook for the after hook of create_batch_dpnt_info
96     --
97     ben_batch_dpnt_info_bk1.create_batch_dpnt_info_a
98       (p_batch_dpnt_id                  =>  l_batch_dpnt_id
99       ,p_benefit_action_id              =>  p_benefit_action_id
100       ,p_person_id                      =>  p_person_id
101       ,p_pgm_id                         =>  p_pgm_id
102       ,p_pl_id                          =>  p_pl_id
103       ,p_oipl_id                        =>  p_oipl_id
104       ,p_contact_typ_cd                 =>  p_contact_typ_cd
105       ,p_dpnt_person_id                 =>  p_dpnt_person_id
106       ,p_business_group_id              =>  p_business_group_id
107       ,p_object_version_number          =>  l_object_version_number
108       ,p_enrt_cvg_strt_dt               =>  p_enrt_cvg_strt_dt
109       ,p_enrt_cvg_thru_dt               =>  p_enrt_cvg_thru_dt
110       ,p_actn_cd                        =>  p_actn_cd
111       ,p_effective_date                 =>  trunc(p_effective_date));
112     --
113   exception
114     --
115     when hr_api.cannot_find_prog_unit then
116       --
117       hr_api.cannot_find_prog_unit_error
118         (p_module_name => 'CREATE_batch_dpnt_info'
119         ,p_hook_type   => 'AP');
120     --
121     -- End of API User Hook for the after hook of create_batch_dpnt_info
122     --
123   end;
124   --
125   hr_utility.set_location(l_proc, 60);
126   --
127   -- When in validation only mode raise the Validate_Enabled exception
128   --
129   if p_validate then
130     raise hr_api.validate_enabled;
131   end if;
132   --
133   -- Set all output arguments
134   --
135   p_batch_dpnt_id := l_batch_dpnt_id;
136   p_object_version_number := l_object_version_number;
137   --
138   hr_utility.set_location(' Leaving:'||l_proc, 70);
139   --
140 exception
141   --
142   when hr_api.validate_enabled then
143     --
144     -- As the Validate_Enabled exception has been raised
145     -- we must rollback to the savepoint
146     --
147     ROLLBACK TO create_batch_dpnt_info;
148     --
149     -- Only set output warning arguments
150     -- (Any key or derived arguments must be set to null
151     -- when validation only mode is being used.)
152     --
153     p_batch_dpnt_id := null;
154     p_object_version_number  := null;
155     hr_utility.set_location(' Leaving:'||l_proc, 80);
156     --
157   when others then
158     --
159     -- A validation or unexpected error has occured
160     --
161     ROLLBACK TO create_batch_dpnt_info;
162     p_batch_dpnt_id := null;
163     p_object_version_number  := null;
164     raise;
165     --
166 end create_batch_dpnt_info;
167 -- ----------------------------------------------------------------------------
168 -- |------------------------< update_batch_dpnt_info >------------------------|
169 -- ----------------------------------------------------------------------------
170 --
171 procedure update_batch_dpnt_info
172   (p_validate                       in  boolean   default false
173   ,p_batch_dpnt_id                  in  number
174   ,p_benefit_action_id              in  number    default hr_api.g_number
175   ,p_person_id                      in  number    default hr_api.g_number
176   ,p_pgm_id                         in  number    default hr_api.g_number
177   ,p_pl_id                          in  number    default hr_api.g_number
178   ,p_oipl_id                        in  number    default hr_api.g_number
179   ,p_contact_typ_cd                 in  varchar2  default hr_api.g_varchar2
180   ,p_dpnt_person_id                 in  number    default hr_api.g_number
181   ,p_business_group_id              in  number    default hr_api.g_number
182   ,p_object_version_number          in out nocopy varchar2
183   ,p_enrt_cvg_strt_dt               in  date      default hr_api.g_date
184   ,p_enrt_cvg_thru_dt               in  date      default hr_api.g_date
185   ,p_actn_cd                        in  varchar2  default hr_api.g_varchar2
186   ,p_effective_date                 in  date) is
187   --
188   -- Declare cursors and local variables
189   --
190   l_proc varchar2(72) := g_package||'update_batch_dpnt_info';
191   l_object_version_number ben_batch_dpnt_info.object_version_number%TYPE;
192   --
193 begin
194   --
195   hr_utility.set_location('Entering:'|| l_proc, 10);
196   --
197   -- Issue a savepoint if operating in validation only mode
198   --
199   savepoint update_batch_dpnt_info;
200   --
201   hr_utility.set_location(l_proc, 20);
202   --
203   -- Process Logic
204   --
205   l_object_version_number := p_object_version_number;
206   --
207   begin
208     --
209     -- Start of API User Hook for the before hook of update_batch_dpnt_info
210     --
211     ben_batch_dpnt_info_bk2.update_batch_dpnt_info_b
212       (p_batch_dpnt_id                  =>  p_batch_dpnt_id
213       ,p_benefit_action_id              =>  p_benefit_action_id
214       ,p_person_id                      =>  p_person_id
215       ,p_pgm_id                         =>  p_pgm_id
216       ,p_pl_id                          =>  p_pl_id
217       ,p_oipl_id                        =>  p_oipl_id
218       ,p_contact_typ_cd                 =>  p_contact_typ_cd
219       ,p_dpnt_person_id                 =>  p_dpnt_person_id
220       ,p_business_group_id              =>  p_business_group_id
221       ,p_object_version_number          =>  p_object_version_number
222       ,p_enrt_cvg_strt_dt               =>  p_enrt_cvg_strt_dt
223       ,p_enrt_cvg_thru_dt               =>  p_enrt_cvg_thru_dt
224       ,p_actn_cd                        =>  p_actn_cd
225       ,p_effective_date                 =>  trunc(p_effective_date));
226     --
227   exception
228     --
229     when hr_api.cannot_find_prog_unit then
230       hr_api.cannot_find_prog_unit_error
231         (p_module_name => 'UPDATE_batch_dpnt_info'
232         ,p_hook_type   => 'BP');
233     --
234     -- End of API User Hook for the before hook of update_batch_dpnt_info
235     --
236   end;
237   --
238   ben_bdi_upd.upd
239     (p_batch_dpnt_id                 => p_batch_dpnt_id
240     ,p_benefit_action_id             => p_benefit_action_id
241     ,p_person_id                     => p_person_id
242     ,p_pgm_id                        => p_pgm_id
243     ,p_pl_id                         => p_pl_id
244     ,p_oipl_id                       => p_oipl_id
245     ,p_contact_typ_cd                => p_contact_typ_cd
246     ,p_dpnt_person_id                => p_dpnt_person_id
247     ,p_business_group_id             => p_business_group_id
248     ,p_object_version_number         => l_object_version_number
249     ,p_enrt_cvg_strt_dt              => p_enrt_cvg_strt_dt
250     ,p_enrt_cvg_thru_dt              => p_enrt_cvg_thru_dt
251     ,p_actn_cd                       => p_actn_cd
252     ,p_effective_date                => trunc(p_effective_date));
253   --
254   begin
255     --
256     -- Start of API User Hook for the after hook of update_batch_dpnt_info
257     --
258     ben_batch_dpnt_info_bk2.update_batch_dpnt_info_a
259       (p_batch_dpnt_id                  =>  p_batch_dpnt_id
260       ,p_benefit_action_id              =>  p_benefit_action_id
261       ,p_person_id                      =>  p_person_id
262       ,p_pgm_id                         =>  p_pgm_id
263       ,p_pl_id                          =>  p_pl_id
264       ,p_oipl_id                        =>  p_oipl_id
265       ,p_contact_typ_cd                 =>  p_contact_typ_cd
266       ,p_dpnt_person_id                 =>  p_dpnt_person_id
267       ,p_business_group_id              =>  p_business_group_id
268       ,p_object_version_number          =>  l_object_version_number
269       ,p_enrt_cvg_strt_dt               =>  p_enrt_cvg_strt_dt
270       ,p_enrt_cvg_thru_dt               =>  p_enrt_cvg_thru_dt
271       ,p_actn_cd                        =>  p_actn_cd
272       ,p_effective_date                 =>  trunc(p_effective_date));
273     --
274   exception
275     --
276     when hr_api.cannot_find_prog_unit then
277       --
278       hr_api.cannot_find_prog_unit_error
279         (p_module_name => 'UPDATE_batch_dpnt_info'
280         ,p_hook_type   => 'AP');
281     --
282     -- End of API User Hook for the after hook of update_batch_dpnt_info
283     --
284   end;
285   --
286   hr_utility.set_location(l_proc, 60);
287   --
288   -- When in validation only mode raise the Validate_Enabled exception
289   --
290   if p_validate then
291     raise hr_api.validate_enabled;
292   end if;
293   --
294   -- Set all output arguments
295   --
296   p_object_version_number := l_object_version_number;
297   --
298   hr_utility.set_location(' Leaving:'||l_proc, 70);
299   --
300 exception
301   --
302   when hr_api.validate_enabled then
303     --
304     -- As the Validate_Enabled exception has been raised
305     -- we must rollback to the savepoint
306     --
307     ROLLBACK TO update_batch_dpnt_info;
308     --
309     -- Only set output warning arguments
310     -- (Any key or derived arguments must be set to null
311     -- when validation only mode is being used.)
312     --
313     hr_utility.set_location(' Leaving:'||l_proc, 80);
314     --
315   when others then
316     --
317     -- A validation or unexpected error has occured
318     --
319     ROLLBACK TO update_batch_dpnt_info;
320     raise;
321     --
322 end update_batch_dpnt_info;
323 -- ----------------------------------------------------------------------------
324 -- |------------------------< delete_batch_dpnt_info >------------------------|
325 -- ----------------------------------------------------------------------------
326 --
327 procedure delete_batch_dpnt_info
328   (p_validate                       in  boolean  default false
329   ,p_batch_dpnt_id                  in  number
330   ,p_object_version_number          in out nocopy varchar2
331   ,p_effective_date                 in  date) is
332   --
333   -- Declare cursors and local variables
334   --
335   l_proc varchar2(72) := g_package||'update_batch_dpnt_info';
336   l_object_version_number ben_batch_dpnt_info.object_version_number%TYPE;
337   --
338 begin
339   --
340   hr_utility.set_location('Entering:'|| l_proc, 10);
341   --
342   -- Issue a savepoint if operating in validation only mode
343   --
344   savepoint delete_batch_dpnt_info;
345   --
346   hr_utility.set_location(l_proc, 20);
347   --
348   -- Process Logic
349   --
350   l_object_version_number := p_object_version_number;
351   --
352   --
353   begin
354     --
355     -- Start of API User Hook for the before hook of delete_batch_dpnt_info
356     --
357     ben_batch_dpnt_info_bk3.delete_batch_dpnt_info_b
358       (p_batch_dpnt_id                  =>  p_batch_dpnt_id
359       ,p_object_version_number          =>  p_object_version_number
360       ,p_effective_date                 =>  trunc(p_effective_date));
361     --
362   exception
363     --
364     when hr_api.cannot_find_prog_unit then
365       --
366       hr_api.cannot_find_prog_unit_error
367         (p_module_name => 'DELETE_batch_dpnt_info'
368         ,p_hook_type   => 'BP');
369     --
370     -- End of API User Hook for the before hook of delete_batch_dpnt_info
371     --
372   end;
373   --
374   ben_bdi_del.del
375     (p_batch_dpnt_id                 => p_batch_dpnt_id
376     ,p_object_version_number         => l_object_version_number
377     ,p_effective_date                => p_effective_date);
378   --
379   begin
380     --
381     -- Start of API User Hook for the after hook of delete_batch_dpnt_info
382     --
383     ben_batch_dpnt_info_bk3.delete_batch_dpnt_info_a
384       (p_batch_dpnt_id                  =>  p_batch_dpnt_id
388   exception
385       ,p_object_version_number          =>  l_object_version_number
386       ,p_effective_date                 =>  trunc(p_effective_date));
387     --
389     --
390     when hr_api.cannot_find_prog_unit then
391       --
395     --
392       hr_api.cannot_find_prog_unit_error
393         (p_module_name => 'DELETE_batch_dpnt_info'
394         ,p_hook_type   => 'AP');
396     -- End of API User Hook for the after hook of delete_batch_dpnt_info
397     --
398   end;
399   --
400   hr_utility.set_location(l_proc, 60);
401   --
402   -- When in validation only mode raise the Validate_Enabled exception
403   --
404   if p_validate then
405     raise hr_api.validate_enabled;
406   end if;
407   --
408   hr_utility.set_location(' Leaving:'||l_proc, 70);
409   --
410 exception
411   --
412   when hr_api.validate_enabled then
413     --
414     -- As the Validate_Enabled exception has been raised
415     -- we must rollback to the savepoint
416     --
417     ROLLBACK TO delete_batch_dpnt_info;
418     --
419     -- Only set output warning arguments
420     -- (Any key or derived arguments must be set to null
421     -- when validation only mode is being used.)
422     --
423     --
424   when others then
425     --
426     -- A validation or unexpected error has occured
427     --
428     ROLLBACK TO delete_batch_dpnt_info;
429     raise;
430     --
431 end delete_batch_dpnt_info;
432 --
433 -- ----------------------------------------------------------------------------
434 -- |-------------------------------< lck >------------------------------------|
435 -- ----------------------------------------------------------------------------
436 --
437 procedure lck
438   (p_batch_dpnt_id                  in     number
439   ,p_object_version_number          in     number) is
440   --
441   --
442   -- Declare cursors and local variables
443   --
444   l_proc varchar2(72) := g_package||'lck';
445   --
446 begin
447   --
448   hr_utility.set_location('Entering:'|| l_proc, 10);
449   --
450   ben_bdi_shd.lck
451     (p_batch_dpnt_id              => p_batch_dpnt_id
452     ,p_object_version_number      => p_object_version_number);
453   --
454   hr_utility.set_location(' Leaving:'||l_proc, 70);
455   --
456 end lck;
457 --
458 end ben_batch_dpnt_info_api;