DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_SUCCESSION_PLAN_SWI

Source


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