DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_FR_STAT_SIT_RULES_SWI

Source


1 Package Body pqh_fr_stat_sit_rules_swi As
2 /* $Header: pqstrswi.pkb 115.2 2003/10/16 11:43 svorugan noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'pqh_fr_stat_sit_rules_swi.';
7 
8 g_debug boolean := hr_utility.debug_enabled;
9 
10 --
11 -- ----------------------------------------------------------------------------
12 -- |----------------------< create_stat_situation_rule >----------------------|
13 -- ----------------------------------------------------------------------------
14 PROCEDURE create_stat_situation_rule
15   (p_validate                     in     number    default hr_api.g_false_num
16   ,p_effective_date               in     date      default null
17   ,p_statutory_situation_id       in     number
18   ,p_processing_sequence          in     number
19   ,p_txn_category_attribute_id    in     number
20   ,p_from_value                   in     varchar2
21   ,p_to_value                     in     varchar2  default null
22   ,p_enabled_flag                 in     varchar2  default null
23   ,p_required_flag                in     varchar2  default null
24   ,p_exclude_flag                 in     varchar2  default null
25   ,p_stat_situation_rule_id          out nocopy number
26   ,p_object_version_number           out nocopy number
27   ,p_return_status                   out nocopy varchar2
28   ) is
29   --
30   -- Variables for API Boolean parameters
31   l_validate                      boolean;
32   --
33   -- Variables for IN/OUT parameters
34   --
35   -- Other variables
36   l_stat_situation_rule_id       number;
37   l_proc    varchar2(72) := g_package ||'create_stat_situation_rule';
38 Begin
39 
40   if g_debug then
41   --
42   hr_utility.set_location(' Entering:' || l_proc,10);
43   --
44   End if;
45 
46   --
47   -- Issue a savepoint
48   --
49   savepoint create_stat_situation_rule_swi;
50   --
51   -- Initialise Multiple Message Detection
52   --
53   hr_multi_message.enable_message_list;
54   --
55   -- Remember IN OUT parameter IN values
56   --
57   --
58   -- Convert constant values to their corresponding boolean value
59   --
60   l_validate :=
61     hr_api.constant_to_boolean
62       (p_constant_value => p_validate);
63   --
64   -- Register Surrogate ID or user key values
65   --
66   pqh_str_ins.set_base_key_value
67     (p_stat_situation_rule_id => p_stat_situation_rule_id
68     );
69   --
70   -- Call API
71   --
72   pqh_fr_stat_sit_rules_api.create_stat_situation_rule
73     (p_validate                     => l_validate
74     ,p_effective_date               => p_effective_date
75     ,p_statutory_situation_id       => p_statutory_situation_id
76     ,p_processing_sequence          => p_processing_sequence
77     ,p_txn_category_attribute_id    => p_txn_category_attribute_id
78     ,p_from_value                   => p_from_value
79     ,p_to_value                     => p_to_value
80     ,p_enabled_flag                 => p_enabled_flag
81     ,p_required_flag                => p_required_flag
82     ,p_exclude_flag                 => p_exclude_flag
83     ,p_stat_situation_rule_id       => l_stat_situation_rule_id
84     ,p_object_version_number        => p_object_version_number
85     );
86   --
87   -- Convert API warning boolean parameter values to specific
88   -- messages and add them to Multiple Message List
89   --
90   --
91   -- Convert API non-warning boolean parameter values
92   --
93   --
94   -- Derive the API return status value based on whether
95   -- messages of any type exist in the Multiple Message List.
96   -- Also disable Multiple Message Detection.
97   --
98 
99   p_stat_situation_rule_id := l_stat_situation_rule_id;
100 
101   p_return_status := hr_multi_message.get_return_status_disable;
102 
103   if g_debug then
104   --
105   hr_utility.set_location(' Leaving:' || l_proc,20);
106   --
107   End if;
108   --
109 exception
110   when hr_multi_message.error_message_exist then
111     --
112     -- Catch the Multiple Message List exception which
113     -- indicates API processing has been aborted because
114     -- at least one message exists in the list.
115     --
116     rollback to create_stat_situation_rule_swi;
117     --
118     -- Reset IN OUT parameters and set OUT parameters
119     --
120     p_object_version_number        := null;
121     p_return_status := hr_multi_message.get_return_status_disable;
122 
123     if g_debug then
124       --
125     hr_utility.set_location(' Leaving:' || l_proc, 30);
126     --
127     End if;
128 
129   when others then
130     --
131     -- When Multiple Message Detection is enabled catch
132     -- any Application specific or other unexpected
133     -- exceptions.  Adding appropriate details to the
134     -- Multiple Message List.  Otherwise re-raise the
135     -- error.
136     --
137     rollback to create_stat_situation_rule_swi;
138     if hr_multi_message.unexpected_error_add(l_proc) then
139 
140       if g_debug then
141        --
142       hr_utility.set_location(' Leaving:' || l_proc,40);
143       --
144       End if;
145 
146       raise;
147     end if;
148     --
149     -- Reset IN OUT and set OUT parameters
150     --
151     p_object_version_number        := null;
152     p_return_status := hr_multi_message.get_return_status_disable;
153 
154        if g_debug then
155        --
156         hr_utility.set_location(' Leaving:' || l_proc,50);
157       --
158       End if;
159 
160 end create_stat_situation_rule;
161 -- ----------------------------------------------------------------------------
162 -- |----------------------< delete_stat_situation_rule >----------------------|
163 -- ----------------------------------------------------------------------------
164 PROCEDURE delete_stat_situation_rule
165   (p_validate                     in     number    default hr_api.g_false_num
166   ,p_stat_situation_rule_id       in     number
167   ,p_object_version_number        in     number
168   ,p_return_status                   out nocopy varchar2
169   ) is
170   --
171   -- Variables for API Boolean parameters
172   l_validate                      boolean;
173   --
174   -- Variables for IN/OUT parameters
175   --
176   -- Other variables
177   l_proc    varchar2(72) := g_package ||'delete_stat_situation_rule';
178 Begin
179 
180   if g_debug then
181     --
182      hr_utility.set_location(' Entering:' || l_proc,10);
183    --
184    End if;
185 
186   --
187   -- Issue a savepoint
188   --
189   savepoint delete_stat_situation_rule_swi;
190   --
191   -- Initialise Multiple Message Detection
192   --
193   hr_multi_message.enable_message_list;
194   --
195   -- Remember IN OUT parameter IN values
196   --
197   --
198   -- Convert constant values to their corresponding boolean value
199   --
200   l_validate :=
201     hr_api.constant_to_boolean
202       (p_constant_value => p_validate);
203   --
204   -- Register Surrogate ID or user key values
205   --
206   --
207   -- Call API
208   --
209   pqh_fr_stat_sit_rules_api.delete_stat_situation_rule
210     (p_validate                     => l_validate
211     ,p_stat_situation_rule_id       => p_stat_situation_rule_id
212     ,p_object_version_number        => p_object_version_number
213     );
214   --
215   -- Convert API warning boolean parameter values to specific
216   -- messages and add them to Multiple Message List
217   --
218   --
219   -- Convert API non-warning boolean parameter values
220   --
221   --
222   -- Derive the API return status value based on whether
223   -- messages of any type exist in the Multiple Message List.
224   -- Also disable Multiple Message Detection.
225   --
226   p_return_status := hr_multi_message.get_return_status_disable;
227 
228   if g_debug then
229     --
230   hr_utility.set_location(' Leaving:' || l_proc,20);
231    --
232    End if;
233 
234   --
235 exception
236   when hr_multi_message.error_message_exist then
237     --
238     -- Catch the Multiple Message List exception which
239     -- indicates API processing has been aborted because
240     -- at least one message exists in the list.
241     --
242     rollback to delete_stat_situation_rule_swi;
243     --
244     -- Reset IN OUT parameters and set OUT parameters
245     --
246     p_return_status := hr_multi_message.get_return_status_disable;
247 
248     if g_debug then
249     --
250     hr_utility.set_location(' Leaving:' || l_proc, 30);
251     --
252     End if;
253 
254   when others then
255     --
256     -- When Multiple Message Detection is enabled catch
257     -- any Application specific or other unexpected
258     -- exceptions.  Adding appropriate details to the
259     -- Multiple Message List.  Otherwise re-raise the
260     -- error.
261     --
262     rollback to delete_stat_situation_rule_swi;
263     if hr_multi_message.unexpected_error_add(l_proc) then
264       if g_debug then
265       --
266        hr_utility.set_location(' Leaving:' || l_proc,40);
267        --
268        End if;
269 
270        raise;
271     end if;
272     --
273     -- Reset IN OUT and set OUT parameters
274     --
275     p_return_status := hr_multi_message.get_return_status_disable;
276 
277     if g_debug then
278     --
279     hr_utility.set_location(' Leaving:' || l_proc,50);
280     --
281     End if;
282 
283 end delete_stat_situation_rule;
284 -- ----------------------------------------------------------------------------
285 -- |----------------------< update_stat_situation_rule >----------------------|
286 -- ----------------------------------------------------------------------------
287 PROCEDURE update_stat_situation_rule
288   (p_validate                     in     number    default hr_api.g_false_num
289   ,p_effective_date               in     date      default hr_api.g_date
290   ,p_stat_situation_rule_id       in     number
291   ,p_object_version_number        in out nocopy number
292   ,p_statutory_situation_id       in     number    default hr_api.g_number
293   ,p_processing_sequence          in     number    default hr_api.g_number
294   ,p_txn_category_attribute_id    in     number    default hr_api.g_number
295   ,p_from_value                   in     varchar2  default hr_api.g_varchar2
296   ,p_to_value                     in     varchar2  default hr_api.g_varchar2
297   ,p_enabled_flag                 in     varchar2  default hr_api.g_varchar2
298   ,p_required_flag                in     varchar2  default hr_api.g_varchar2
299   ,p_exclude_flag                 in     varchar2  default hr_api.g_varchar2
300   ,p_return_status                   out nocopy varchar2
301   ) is
302   --
303   -- Variables for API Boolean parameters
304   l_validate                      boolean;
305   --
306   -- Variables for IN/OUT parameters
307   l_object_version_number         number;
308   --
309   -- Other variables
310   l_proc    varchar2(72) := g_package ||'update_stat_situation_rule';
311 Begin
312 
313   if g_debug then
314     --
315   hr_utility.set_location(' Entering:' || l_proc,10);
316    --
317    End if;
318 
319   --
320   -- Issue a savepoint
321   --
322   savepoint update_stat_situation_rule_swi;
323   --
324   -- Initialise Multiple Message Detection
325   --
326   hr_multi_message.enable_message_list;
327   --
328   -- Remember IN OUT parameter IN values
329   --
330   l_object_version_number         := p_object_version_number;
331   --
332   -- Convert constant values to their corresponding boolean value
333   --
334   l_validate :=
335     hr_api.constant_to_boolean
336       (p_constant_value => p_validate);
337   --
338   -- Register Surrogate ID or user key values
339   --
340   --
341   -- Call API
342   --
343   pqh_fr_stat_sit_rules_api.update_stat_situation_rule
344     (p_validate                     => l_validate
345     ,p_effective_date               => p_effective_date
346     ,p_stat_situation_rule_id       => p_stat_situation_rule_id
347     ,p_object_version_number        => p_object_version_number
348     ,p_statutory_situation_id       => p_statutory_situation_id
349     ,p_processing_sequence          => p_processing_sequence
350     ,p_txn_category_attribute_id    => p_txn_category_attribute_id
351     ,p_from_value                   => p_from_value
352     ,p_to_value                     => p_to_value
353     ,p_enabled_flag                 => p_enabled_flag
354     ,p_required_flag                => p_required_flag
355     ,p_exclude_flag                 => p_exclude_flag
356     );
357   --
358   -- Convert API warning boolean parameter values to specific
359   -- messages and add them to Multiple Message List
360   --
361   --
362   -- Convert API non-warning boolean parameter values
363   --
364   --
365   -- Derive the API return status value based on whether
366   -- messages of any type exist in the Multiple Message List.
367   -- Also disable Multiple Message Detection.
368   --
369   p_return_status := hr_multi_message.get_return_status_disable;
370 
371   if g_debug then
372     --
373   hr_utility.set_location(' Leaving:' || l_proc,20);
374     --
375     End if;
376 
377   --
378 exception
379   when hr_multi_message.error_message_exist then
380     --
381     -- Catch the Multiple Message List exception which
382     -- indicates API processing has been aborted because
383     -- at least one message exists in the list.
384     --
385     rollback to update_stat_situation_rule_swi;
386     --
387     -- Reset IN OUT parameters and set OUT parameters
388     --
389     p_object_version_number        := l_object_version_number;
390     p_return_status := hr_multi_message.get_return_status_disable;
391 
392     if g_debug then
393     --
394     hr_utility.set_location(' Leaving:' || l_proc, 30);
395     --
396     End if;
397 
398   when others then
399     --
400     -- When Multiple Message Detection is enabled catch
401     -- any Application specific or other unexpected
402     -- exceptions.  Adding appropriate details to the
403     -- Multiple Message List.  Otherwise re-raise the
404     -- error.
405     --
406     rollback to update_stat_situation_rule_swi;
407     if hr_multi_message.unexpected_error_add(l_proc) then
408 
409        if g_debug then
410        --
411        hr_utility.set_location(' Leaving:' || l_proc,40);
412        --
413        End if;
414 
415        raise;
416     end if;
417     --
418     -- Reset IN OUT and set OUT parameters
419     --
420     p_object_version_number        := l_object_version_number;
421     p_return_status := hr_multi_message.get_return_status_disable;
422 
423     if g_debug then
424     --
425     hr_utility.set_location(' Leaving:' || l_proc,50);
426     --
427     End if;
428 
429 end update_stat_situation_rule;
430 end pqh_fr_stat_sit_rules_swi;