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