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