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