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