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