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