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