[Home] [Help]
PACKAGE BODY: APPS.PQH_FR_VALIDATIONS_SWI
Source
1 Package Body pqh_fr_validations_swi As
2 /* $Header: pqvldswi.pkb 115.1 2002/12/05 00:31:04 rpasapul noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'pqh_fr_validations_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |---------------------------< delete_validation >--------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE delete_validation
12 (p_validation_id in number
13 ,p_object_version_number in number
14 ,p_return_status out nocopy varchar2
15 ) is
16
17 cursor c_vp is
18 select validation_period_id, object_version_number from pqh_fr_validation_periods
19 where validation_id = p_validation_id;
20
21 cursor c_ve is
22 select validation_event_id, object_version_number from pqh_fr_validation_events
23 where validation_id = p_validation_id;
24
25
26 --
27 -- Variables for API Boolean parameters
28 --
29 -- Variables for IN/OUT parameters
30 --
31 -- Other variables
32 l_proc varchar2(72) := g_package ||'delete_validation';
33 Begin
34 hr_utility.set_location(' Entering:' || l_proc,10);
35 --
36 -- Issue a savepoint
37 --
38 savepoint delete_validation_swi;
39 --
40 -- Initialise Multiple Message Detection
41 --
42 hr_multi_message.enable_message_list;
43 --
44 -- Remember IN OUT parameter IN values
45 --
46 --
47 -- Convert constant values to their corresponding boolean value
48 --
49 --
50 -- Register Surrogate ID or user key values
51 --
52 --
53 -- Call API
54 --
55 for vlp in c_vp loop
56 pqh_fr_validation_periods_api.delete_validation_period
57 (p_validation_period_id => vlp.validation_period_id
58 ,p_object_version_number => vlp.object_version_number);
59 end loop;
60
61 for vle in c_ve loop
62 pqh_fr_validation_events_api.delete_validation_event
63 (p_validation_event_id => vle.validation_event_id
64 ,p_object_version_number => vle.object_version_number);
65 end loop;
66
67 pqh_fr_validations_api.delete_validation
68 (p_validation_id => p_validation_id
69 ,p_object_version_number => p_object_version_number
70 );
71 --
72 -- Convert API warning boolean parameter values to specific
73 -- messages and add them to Multiple Message List
74 --
75 --
76 -- Convert API non-warning boolean parameter values
77 --
78 --
79 -- Derive the API return status value based on whether
80 -- messages of any type exist in the Multiple Message List.
81 -- Also disable Multiple Message Detection.
82 --
83 p_return_status := hr_multi_message.get_return_status_disable;
84 hr_utility.set_location(' Leaving:' || l_proc,20);
85 --
86 exception
87 when hr_multi_message.error_message_exist then
88 --
89 -- Catch the Multiple Message List exception which
90 -- indicates API processing has been aborted because
91 -- at least one message exists in the list.
92 --
93 rollback to delete_validation_swi;
94 --
95 -- Reset IN OUT parameters and set OUT parameters
96 --
97 p_return_status := hr_multi_message.get_return_status_disable;
98 hr_utility.set_location(' Leaving:' || l_proc, 30);
99 when others then
100 --
101 -- When Multiple Message Detection is enabled catch
102 -- any Application specific or other unexpected
103 -- exceptions. Adding appropriate details to the
104 -- Multiple Message List. Otherwise re-raise the
105 -- error.
106 --
107 rollback to delete_validation_swi;
108 if hr_multi_message.unexpected_error_add(l_proc) then
109 hr_utility.set_location(' Leaving:' || l_proc,40);
110 raise;
111 end if;
112 --
113 -- Reset IN OUT and set OUT parameters
114 --
115 p_return_status := hr_multi_message.get_return_status_disable;
116 hr_utility.set_location(' Leaving:' || l_proc,50);
117 end delete_validation;
118 -- ----------------------------------------------------------------------------
119 -- |---------------------------< insert_validation >--------------------------|
120 -- ----------------------------------------------------------------------------
121 PROCEDURE insert_validation
122 (p_effective_date in date
123 ,p_pension_fund_type_code in varchar2
124 ,p_pension_fund_id in number
125 ,p_business_group_id in number
126 ,p_person_id in number
127 ,p_previously_validated_flag in varchar2
128 ,p_request_date in date default null
129 ,p_completion_date in date default null
130 ,p_previous_employer_id in number default null
131 ,p_status in varchar2 default null
132 ,p_employer_amount in number default null
133 ,p_employer_currency_code in varchar2 default null
134 ,p_employee_amount in number default null
135 ,p_employee_currency_code in varchar2 default null
136 ,p_deduction_per_period in number default null
137 ,p_deduction_currency_code in varchar2 default null
138 ,p_percent_of_salary in number default null
139 ,p_validation_id out nocopy number
140 ,p_object_version_number out nocopy number
141 ,p_return_status out nocopy varchar2
142 ) is
143 --
144 -- Variables for API Boolean parameters
145 --
146 -- Variables for IN/OUT parameters
147 --
148 -- Other variables
149 l_proc varchar2(72) := g_package ||'insert_validation';
150 Begin
151 hr_utility.set_location(' Entering:' || l_proc,10);
152 --
153 -- Issue a savepoint
154 --
155 savepoint insert_validation_swi;
156 --
157 -- Initialise Multiple Message Detection
158 --
159 hr_multi_message.enable_message_list;
160 --
161 -- Remember IN OUT parameter IN values
162 --
163 --
164 -- Convert constant values to their corresponding boolean value
165 --
166 --
167 -- Register Surrogate ID or user key values
168 --
169 pqh_vld_ins.set_base_key_value
170 (p_validation_id => p_validation_id
171 );
172 --
173 -- Call API
174 --
175 pqh_fr_validations_api.insert_validation
176 (p_effective_date => p_effective_date
177 ,p_pension_fund_type_code => p_pension_fund_type_code
178 ,p_pension_fund_id => p_pension_fund_id
179 ,p_business_group_id => p_business_group_id
180 ,p_person_id => p_person_id
181 ,p_previously_validated_flag => p_previously_validated_flag
182 ,p_request_date => p_request_date
183 ,p_completion_date => p_completion_date
184 ,p_previous_employer_id => p_previous_employer_id
185 ,p_status => p_status
186 ,p_employer_amount => p_employer_amount
187 ,p_employer_currency_code => p_employer_currency_code
188 ,p_employee_amount => p_employee_amount
189 ,p_employee_currency_code => p_employee_currency_code
190 ,p_deduction_per_period => p_deduction_per_period
191 ,p_deduction_currency_code => p_deduction_currency_code
192 ,p_percent_of_salary => p_percent_of_salary
193 ,p_validation_id => p_validation_id
194 ,p_object_version_number => p_object_version_number
195 );
196 --
197 -- Convert API warning boolean parameter values to specific
198 -- messages and add them to Multiple Message List
199 --
200 --
201 -- Convert API non-warning boolean parameter values
202 --
203 --
204 -- Derive the API return status value based on whether
205 -- messages of any type exist in the Multiple Message List.
206 -- Also disable Multiple Message Detection.
207 --
208 p_return_status := hr_multi_message.get_return_status_disable;
209 hr_utility.set_location(' Leaving:' || l_proc,20);
210 --
211 exception
212 when hr_multi_message.error_message_exist then
213 --
214 -- Catch the Multiple Message List exception which
215 -- indicates API processing has been aborted because
216 -- at least one message exists in the list.
217 --
218 rollback to insert_validation_swi;
219 --
220 -- Reset IN OUT parameters and set OUT parameters
221 --
222 p_validation_id := null;
223 p_object_version_number := null;
224 p_return_status := hr_multi_message.get_return_status_disable;
225 hr_utility.set_location(' Leaving:' || l_proc, 30);
226 when others then
227 --
228 -- When Multiple Message Detection is enabled catch
229 -- any Application specific or other unexpected
230 -- exceptions. Adding appropriate details to the
231 -- Multiple Message List. Otherwise re-raise the
232 -- error.
233 --
234 rollback to insert_validation_swi;
235 if hr_multi_message.unexpected_error_add(l_proc) then
236 hr_utility.set_location(' Leaving:' || l_proc,40);
237 raise;
238 end if;
239 --
240 -- Reset IN OUT and set OUT parameters
241 --
242 p_validation_id := null;
243 p_object_version_number := null;
247 -- ----------------------------------------------------------------------------
244 p_return_status := hr_multi_message.get_return_status_disable;
245 hr_utility.set_location(' Leaving:' || l_proc,50);
246 end insert_validation;
248 -- |---------------------------< update_validation >--------------------------|
249 -- ----------------------------------------------------------------------------
250 PROCEDURE update_validation
251 (p_effective_date in date
252 ,p_validation_id in number
253 ,p_object_version_number in out nocopy number
254 ,p_pension_fund_type_code in varchar2 default hr_api.g_varchar2
255 ,p_pension_fund_id in number default hr_api.g_number
256 ,p_business_group_id in number default hr_api.g_number
257 ,p_person_id in number default hr_api.g_number
258 ,p_previously_validated_flag in varchar2 default hr_api.g_varchar2
259 ,p_request_date in date default hr_api.g_date
260 ,p_completion_date in date default hr_api.g_date
261 ,p_previous_employer_id in number default hr_api.g_number
262 ,p_status in varchar2 default hr_api.g_varchar2
263 ,p_employer_amount in number default hr_api.g_number
264 ,p_employer_currency_code in varchar2 default hr_api.g_varchar2
265 ,p_employee_amount in number default hr_api.g_number
266 ,p_employee_currency_code in varchar2 default hr_api.g_varchar2
267 ,p_deduction_per_period in number default hr_api.g_number
268 ,p_deduction_currency_code in varchar2 default hr_api.g_varchar2
269 ,p_percent_of_salary in number default hr_api.g_number
270 ,p_return_status out nocopy varchar2
271 ) is
272 --
273 -- Variables for API Boolean parameters
274 --
275 -- Variables for IN/OUT parameters
276 l_object_version_number number;
277 --
278 -- Other variables
279 l_proc varchar2(72) := g_package ||'update_validation';
280 Begin
281 hr_utility.set_location(' Entering:' || l_proc,10);
282 --
283 -- Issue a savepoint
284 --
285 savepoint update_validation_swi;
286 --
287 -- Initialise Multiple Message Detection
288 --
289 hr_multi_message.enable_message_list;
290 --
291 -- Remember IN OUT parameter IN values
292 --
293 l_object_version_number := p_object_version_number;
294 --
295 -- Convert constant values to their corresponding boolean value
296 --
297 --
298 -- Register Surrogate ID or user key values
299 --
300 --
301 -- Call API
302 --
303 pqh_fr_validations_api.update_validation
304 (p_effective_date => p_effective_date
305 ,p_validation_id => p_validation_id
306 ,p_object_version_number => p_object_version_number
307 ,p_pension_fund_type_code => p_pension_fund_type_code
308 ,p_pension_fund_id => p_pension_fund_id
309 ,p_business_group_id => p_business_group_id
310 ,p_person_id => p_person_id
311 ,p_previously_validated_flag => p_previously_validated_flag
312 ,p_request_date => p_request_date
313 ,p_completion_date => p_completion_date
314 ,p_previous_employer_id => p_previous_employer_id
315 ,p_status => p_status
316 ,p_employer_amount => p_employer_amount
317 ,p_employer_currency_code => p_employer_currency_code
318 ,p_employee_amount => p_employee_amount
319 ,p_employee_currency_code => p_employee_currency_code
320 ,p_deduction_per_period => p_deduction_per_period
321 ,p_deduction_currency_code => p_deduction_currency_code
322 ,p_percent_of_salary => p_percent_of_salary
323 );
324 --
325 -- Convert API warning boolean parameter values to specific
326 -- messages and add them to Multiple Message List
327 --
328 --
329 -- Convert API non-warning boolean parameter values
330 --
331 --
332 -- Derive the API return status value based on whether
333 -- messages of any type exist in the Multiple Message List.
334 -- Also disable Multiple Message Detection.
335 --
336 p_return_status := hr_multi_message.get_return_status_disable;
337 hr_utility.set_location(' Leaving:' || l_proc,20);
338 --
339 exception
340 when hr_multi_message.error_message_exist then
344 -- at least one message exists in the list.
341 --
342 -- Catch the Multiple Message List exception which
343 -- indicates API processing has been aborted because
345 --
346 rollback to update_validation_swi;
347 --
348 -- Reset IN OUT parameters and set OUT parameters
349 --
350 p_object_version_number := l_object_version_number;
351 p_return_status := hr_multi_message.get_return_status_disable;
352 hr_utility.set_location(' Leaving:' || l_proc, 30);
353 when others then
354 --
355 -- When Multiple Message Detection is enabled catch
356 -- any Application specific or other unexpected
357 -- exceptions. Adding appropriate details to the
358 -- Multiple Message List. Otherwise re-raise the
359 -- error.
360 --
361 rollback to update_validation_swi;
362 if hr_multi_message.unexpected_error_add(l_proc) then
363 hr_utility.set_location(' Leaving:' || l_proc,40);
364 raise;
365 end if;
366 --
367 -- Reset IN OUT and set OUT parameters
368 --
369 p_object_version_number := l_object_version_number;
370 p_return_status := hr_multi_message.get_return_status_disable;
371 hr_utility.set_location(' Leaving:' || l_proc,50);
372 end update_validation;
373 end pqh_fr_validations_swi;