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