DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_RETRIEVAL_RULES_API

Source


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