DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_RI_CONFIGURATION_SWI

Source


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