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