DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_CHAT_USER_SWI

Source


1 Package Body ota_chat_user_swi As
2 /* $Header: otcusswi.pkb 120.1 2005/08/03 16:30 asud noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'ota_chat_user_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |---------------------------< create_chat_user >---------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_chat_user
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_effective_date               in     date
14   ,p_chat_id                      in     number
15   ,p_person_id                    in     number
16   ,p_contact_id                   in     number
17   ,p_login_date                   in     date
18   ,p_business_group_id            in     number
19   ,p_object_version_number           out nocopy number
20   ,p_return_status                   out nocopy varchar2
21   ) is
22   --
23   -- Variables for API Boolean parameters
24   l_validate                      boolean;
25   --
26   -- Variables for IN/OUT parameters
27   --
28   -- Other variables
29   l_chat_id                      number;
30   l_person_id                    number;
31   l_contact_id                   number;
32   l_proc    varchar2(72) := g_package ||'create_chat_user';
33 Begin
34   hr_utility.set_location(' Entering:' || l_proc,10);
35   --
36   -- Issue a savepoint
37   --
38   savepoint create_chat_user_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   ota_cus_ins.set_base_key_value
56     (p_chat_id => p_chat_id
57     ,p_person_id => p_person_id
58     ,p_contact_id => p_contact_id
59     );
60   --
61   -- Call API
62   --
63   ota_chat_user_api.create_chat_user
64     (p_validate                     => l_validate
65     ,p_effective_date               => p_effective_date
66     ,p_chat_id                      => p_chat_id
67     ,p_person_id                    => p_person_id
68     ,p_contact_id                   => p_contact_id
69     ,p_login_date                   => p_login_date
70     ,p_business_group_id            => p_business_group_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_chat_user_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_chat_user_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_chat_user;
122 --
123 -- ----------------------------------------------------------------------------
124 -- |---------------------------< update_chat_user >---------------------------|
125 -- ----------------------------------------------------------------------------
126 PROCEDURE update_chat_user
127   (p_validate                     in     number    default hr_api.g_false_num
128   ,p_effective_date               in     date
129   ,p_chat_id                      in     number
130   ,p_person_id                    in     number    default hr_api.g_number
131   ,p_contact_id                   in     number    default hr_api.g_number
132   ,p_login_date                   in     date
133   ,p_business_group_id            in     number
134   ,p_object_version_number        in out nocopy number
135   ,p_return_status                   out nocopy varchar2
136   ) is
137   --
138   -- Variables for API Boolean parameters
139   l_validate                      boolean;
140   --
141   -- Variables for IN/OUT parameters
142   --
143   -- Other variables
144   l_chat_id                      number;
145   l_person_id                    number;
146   l_contact_id                   number;
147   l_object_version_number        number := p_object_version_number;
148   l_effective_date               date := trunc(p_effective_date);
149   l_proc    varchar2(72) := g_package ||'update_chat_user';
150 Begin
151   hr_utility.set_location(' Entering:' || l_proc,10);
152   --
153   -- Issue a savepoint
154   --
155   savepoint update_chat_user_swi;
156   --
157   -- Initialise Multiple Message Detection
158   --
159   hr_multi_message.enable_message_list;
160   --
161   -- Remember IN OUT parameter IN values
162   --
163   --
164   -- Convert constant values to their corresponding boolean value
165   --
166   l_validate :=
167     hr_api.constant_to_boolean
168       (p_constant_value => p_validate);
169   --
170   -- Call API
171   --
172   ota_chat_user_api.update_chat_user
173     (p_validate                     => l_validate
174     ,p_effective_date               => l_effective_date
175     ,p_chat_id                      => p_chat_id
176     ,p_person_id                    => p_person_id
177     ,p_contact_id                   => p_contact_id
178     ,p_login_date                   => p_login_date
179     ,p_business_group_id            => p_business_group_id
180     ,p_object_version_number        => l_object_version_number
181     );
182   --
183   -- Convert API warning boolean parameter values to specific
184   -- messages and add them to Multiple Message List
185   --
186   --
187   -- Convert API non-warning boolean parameter values
188   --
189   --
190   -- Derive the API return status value based on whether
191   -- messages of any type exist in the Multiple Message List.
192   -- Also disable Multiple Message Detection.
193   --
194   p_return_status := hr_multi_message.get_return_status_disable;
195   hr_utility.set_location(' Leaving:' || l_proc,20);
196   --
197 exception
198   when hr_multi_message.error_message_exist then
199     --
200     -- Catch the Multiple Message List exception which
201     -- indicates API processing has been aborted because
202     -- at least one message exists in the list.
203     --
204     rollback to update_chat_user_swi;
205     --
206     -- Reset IN OUT parameters and set OUT parameters
207     --
208     p_object_version_number        := l_object_version_number;
209     p_return_status := hr_multi_message.get_return_status_disable;
210     hr_utility.set_location(' Leaving:' || l_proc, 30);
211   when others then
212     --
213     -- When Multiple Message Detection is enabled catch
214     -- any Application specific or other unexpected
215     -- exceptions.  Adding appropriate details to the
216     -- Multiple Message List.  Otherwise re-raise the
217     -- error.
218     --
219     rollback to update_chat_user_swi;
220     if hr_multi_message.unexpected_error_add(l_proc) then
221        hr_utility.set_location(' Leaving:' || l_proc,40);
222        raise;
223     end if;
224     --
225     -- Reset IN OUT and set OUT parameters
226     --
227     p_object_version_number        := l_object_version_number;
228     p_return_status := hr_multi_message.get_return_status_disable;
229     hr_utility.set_location(' Leaving:' || l_proc,50);
230 end update_chat_user;
231 -- ----------------------------------------------------------------------------
232 -- |---------------------------< delete_chat_user >---------------------------|
233 -- ----------------------------------------------------------------------------
234 PROCEDURE delete_chat_user
235   (p_validate                     in     number    default hr_api.g_false_num
236   ,p_chat_id                      in     number
237   ,p_person_id                    in     number
238   ,p_contact_id                   in     number
239   ,p_object_version_number        in     number
240   ,p_return_status                   out nocopy varchar2
241   ) is
242   --
243   -- Variables for API Boolean parameters
244   l_validate                      boolean;
245   --
246   -- Variables for IN/OUT parameters
247   --
248   -- Other variables
249   l_proc    varchar2(72) := g_package ||'delete_chat_user';
250 Begin
251   hr_utility.set_location(' Entering:' || l_proc,10);
252   --
253   -- Issue a savepoint
254   --
255   savepoint delete_chat_user_swi;
256   --
257   -- Initialise Multiple Message Detection
258   --
259   hr_multi_message.enable_message_list;
260   --
261   -- Remember IN OUT parameter IN values
262   --
263   --
264   -- Convert constant values to their corresponding boolean value
265   --
266   l_validate :=
267     hr_api.constant_to_boolean
268       (p_constant_value => p_validate);
269   --
270   -- Register Surrogate ID or user key values
271   --
272   --
273   -- Call API
274   --
275   ota_chat_user_api.delete_chat_user
276     (p_validate                     => l_validate
277     ,p_chat_id                      => p_chat_id
278     ,p_person_id                    => p_person_id
279     ,p_contact_id                   => p_contact_id
280     ,p_object_version_number        => p_object_version_number
281     );
282   --
283   -- Convert API warning boolean parameter values to specific
284   -- messages and add them to Multiple Message List
285   --
286   --
287   -- Convert API non-warning boolean parameter values
288   --
289   --
290   -- Derive the API return status value based on whether
291   -- messages of any type exist in the Multiple Message List.
292   -- Also disable Multiple Message Detection.
293   --
294   p_return_status := hr_multi_message.get_return_status_disable;
295   hr_utility.set_location(' Leaving:' || l_proc,20);
296   --
297 exception
298   when hr_multi_message.error_message_exist then
299     --
300     -- Catch the Multiple Message List exception which
301     -- indicates API processing has been aborted because
302     -- at least one message exists in the list.
303     --
304     rollback to delete_chat_user_swi;
305     --
306     -- Reset IN OUT parameters and set OUT parameters
307     --
308     p_return_status := hr_multi_message.get_return_status_disable;
309     hr_utility.set_location(' Leaving:' || l_proc, 30);
310   when others then
311     --
312     -- When Multiple Message Detection is enabled catch
313     -- any Application specific or other unexpected
314     -- exceptions.  Adding appropriate details to the
315     -- Multiple Message List.  Otherwise re-raise the
316     -- error.
317     --
318     rollback to delete_chat_user_swi;
319     if hr_multi_message.unexpected_error_add(l_proc) then
320        hr_utility.set_location(' Leaving:' || l_proc,40);
321        raise;
322     end if;
323     --
324     -- Reset IN OUT and set OUT parameters
325     --
326     p_return_status := hr_multi_message.get_return_status_disable;
327     hr_utility.set_location(' Leaving:' || l_proc,50);
328 end delete_chat_user;
329 end ota_chat_user_swi;