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