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