DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_EXT_CRIT_CMBN_API

Source


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