DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_CHAT_OBJ_INCLUSION_API

Source


1 PACKAGE BODY ota_chat_obj_inclusion_api as
2 /*$Header: otcoiapi.pkb 120.1 2005/08/02 18:39 asud noship $*/
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  OTA_CHAT_OBJ_INCLUSION_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-------------------------< CREATE_CHAT_OBJ_INCLUSION >--------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_chat_obj_inclusion (
13    p_validate                     in  boolean          default false
14   ,p_effective_date               in  date
15   ,p_object_id                    in  number
16   ,p_object_type                  in  varchar2
17   ,p_primary_flag                 in  varchar2
18   ,p_start_date_active            in  date             default sysdate
19   ,p_end_date_active              in  date             default null
20   ,p_chat_id                      in  number
21   ,p_object_version_number        out nocopy number
22   ) is
23   --
24   -- Declare cursors and local variables
25   --
26   l_proc                    varchar2(72) := g_package||' create_chat_obj_inclusion';
27   l_object_version_number   number;
28   l_effective_date          date;
29   l_end_date date;
30 begin
31   hr_utility.set_location('Entering:'|| l_proc, 10);
32   --
33   -- Issue a savepoint
34   --
35   savepoint CREATE_CHAT_OBJ_INCLUSION;
36   --
37   -- Truncate the time portion from all IN date parameters
38   --
39   l_effective_date := trunc(p_effective_date);
40   --
41   -- Call Before Process User Hook
42   begin
43   ota_chat_obj_inclusion_bk1.create_chat_obj_inclusion_b
44   (  p_effective_date              => p_effective_date
45   ,p_chat_id                       => p_chat_id
46   ,p_object_id                     => p_object_id
47   ,p_object_type                   => p_object_type
48   ,p_start_date_active             => p_start_date_active
49   ,p_end_date_active               => p_end_date_active
50   ,p_primary_flag                  => p_primary_flag
51   ,p_object_version_number         => p_object_version_number
52     );
53   exception
54     when hr_api.cannot_find_prog_unit then
55       hr_api.cannot_find_prog_unit_error
56         (p_module_name => 'CREATE_CHAT_OBJ_INCLUSION'
57         ,p_hook_type   => 'BP'
58         );
59   end;
60 
61 
62   --
63 
64   -- Validation in addition to Row Handlers
65   --
66   --
67   -- Process Logic
68   --
69 
70   ota_coi_ins.ins
71   (  p_effective_date              => l_effective_date
72   ,p_chat_id                       => p_chat_id
73   ,p_object_id                     => p_object_id
74   ,p_object_type                   => p_object_type
75   ,p_start_date_active             => p_start_date_active
76   ,p_end_date_active               => p_end_date_active
77   ,p_primary_flag                  => p_primary_flag
78   ,p_object_version_number         => l_object_version_number
79   );
80 
81   --
82   -- Call After Process User Hook
83   --
84   begin
85   ota_chat_obj_inclusion_bk1.create_chat_obj_inclusion_a
86   (  p_effective_date              => p_effective_date
87   ,p_chat_id                       => p_chat_id
88   ,p_object_id                     => p_object_id
89   ,p_object_type                   => p_object_type
90   ,p_start_date_active             => p_start_date_active
91   ,p_end_date_active               => p_end_date_active
92   ,p_primary_flag                  => p_primary_flag
93   ,p_object_version_number         => p_object_version_number
94     );
95   exception
96     when hr_api.cannot_find_prog_unit then
97       hr_api.cannot_find_prog_unit_error
98         (p_module_name => 'CREATE_CHAT_OBJ_INCLUSION'
99         ,p_hook_type   => 'AP'
100         );
101   end;
102 
103 
104   --
105   -- When in validation only mode raise the Validate_Enabled exception
106   --
107   if p_validate then
108     raise hr_api.validate_enabled;
109   end if;
110   --
111   -- Set all output arguments
112   --
113   p_object_version_number   := l_object_version_number;
114 
115 
116   hr_utility.set_location(' Leaving:'||l_proc, 70);
117 exception
118   when hr_api.validate_enabled then
119     --
120     -- As the Validate_Enabled exception has been raised
121     -- we must rollback to the savepoint
122     --
123     rollback to CREATE_CHAT_OBJ_INCLUSION;
124     --
125     -- Only set output warning arguments
126     -- (Any key or derived arguments must be set to null
127     -- when validation only mode is being used.)
128     --
129     p_object_version_number   := null;
130     hr_utility.set_location(' Leaving:'||l_proc, 80);
131   when others then
132     --
133     -- A validation or unexpected error has occured
134     --
135     rollback to CREATE_CHAT_OBJ_INCLUSION;
136     p_object_version_number   := null;
137     hr_utility.set_location(' Leaving:'||l_proc, 90);
138     raise;
139 end create_chat_obj_inclusion;
140 
141 -- ----------------------------------------------------------------------------
142 -- |-------------------------< UPDATE_CHAT_OBJ_INCLUSION >--------------------|
143 -- ----------------------------------------------------------------------------
144 --
145 procedure update_chat_obj_inclusion (
146    p_validate                     in  boolean          default false
147   ,p_effective_date               in  date
148   ,p_object_id                    in  number
149   ,p_object_type                  in  varchar2
150   ,p_primary_flag                 in  varchar2         default hr_api.g_varchar2
151   ,p_start_date_active            in  date             default hr_api.g_date
152   ,p_end_date_active              in  date             default hr_api.g_date
153   ,p_chat_id                      in  number
154   ,p_object_version_number        in out nocopy number
155   ) is
156   --
157   -- Declare cursors and local variables
158   --
159   l_proc                    varchar2(72) := g_package||' update_chat_obj_inclusion';
160   l_object_version_number   number := p_object_version_number;
161   l_effective_date          date;
162   l_end_date date;
163 begin
164   hr_utility.set_location('Entering:'|| l_proc, 10);
165   --
166   -- Issue a savepoint
167   --
168   savepoint UPDATE_CHAT_OBJ_INCLUSION;
169   --
170   -- Truncate the time portion from all IN date parameters
171   --
172   l_effective_date := trunc(p_effective_date);
173   --
174   -- Call Before Process User Hook
175   begin
176   ota_chat_obj_inclusion_bk2.update_chat_obj_inclusion_b
177   (  p_effective_date              => l_effective_date
178   ,p_chat_id                       => p_chat_id
179   ,p_object_id                     => p_object_id
180   ,p_object_type                   => p_object_type
181   ,p_start_date_active             => p_start_date_active
182   ,p_end_date_active               => p_end_date_active
183   ,p_primary_flag                  => p_primary_flag
184   ,p_object_version_number         => l_object_version_number
185     );
186   exception
187     when hr_api.cannot_find_prog_unit then
188       hr_api.cannot_find_prog_unit_error
189         (p_module_name => 'UPDATE_CHAT_OBJ_INCLUSION'
190         ,p_hook_type   => 'BP'
191         );
192   end;
193 
194 
195   --
196 
197   -- Validation in addition to Row Handlers
198   --
199   --
200   -- Process Logic
201   --
202 
203   ota_coi_upd.upd
204   (  p_effective_date              => l_effective_date
205   ,p_chat_id                       => p_chat_id
206   ,p_object_id                     => p_object_id
207   ,p_object_type                   => p_object_type
208   ,p_start_date_active             => p_start_date_active
209   ,p_end_date_active               => p_end_date_active
210   ,p_primary_flag                  => p_primary_flag
211   ,p_object_version_number         => l_object_version_number
212   );
213 
214   --
215   -- Call After Process User Hook
216   --
217   begin
218   ota_chat_obj_inclusion_bk2.update_chat_obj_inclusion_a
219   (  p_effective_date              => l_effective_date
220   ,p_chat_id                       => p_chat_id
221   ,p_object_id                     => p_object_id
222   ,p_object_type                   => p_object_type
223   ,p_start_date_active             => p_start_date_active
224   ,p_end_date_active               => p_end_date_active
225   ,p_primary_flag                  => p_primary_flag
226   ,p_object_version_number         => l_object_version_number
227     );
228   exception
229     when hr_api.cannot_find_prog_unit then
230       hr_api.cannot_find_prog_unit_error
231         (p_module_name => 'UPDATE_CHAT_OBJ_INCLUSION'
232         ,p_hook_type   => 'AP'
233         );
234   end;
235 
236 
237   --
238   -- When in validation only mode raise the Validate_Enabled exception
239   --
240   if p_validate then
241     raise hr_api.validate_enabled;
242   end if;
243   --
244   -- Set all output arguments
245   --
246   hr_utility.set_location(' Leaving:'||l_proc, 70);
247 exception
248   when hr_api.validate_enabled then
249     --
250     -- As the Validate_Enabled exception has been raised
251     -- we must rollback to the savepoint
252     --
253     rollback to UPDATE_CHAT_OBJ_INCLUSION;
254     --
255     -- Only set output warning arguments
256     -- (Any key or derived arguments must be set to null
257     -- when validation only mode is being used.)
258     --
259     p_object_version_number   := null;
260     hr_utility.set_location(' Leaving:'||l_proc, 80);
261   when others then
262     --
263     -- A validation or unexpected error has occured
264     --
265     rollback to UPDATE_CHAT_OBJ_INCLUSION;
266     p_object_version_number   := l_object_version_number;
267     hr_utility.set_location(' Leaving:'||l_proc, 90);
268     raise;
269 end update_chat_obj_inclusion;
270 
271 -- ----------------------------------------------------------------------------
272 -- |-------------------------< DELETE_CHAT_OBJ_INCLUSION >----------------------------------|
273 -- ----------------------------------------------------------------------------
274 --
275 procedure delete_chat_obj_inclusion
276   (p_validate                      in     boolean  default false
277   ,p_chat_id               in     number
278   ,p_object_id                    in     number
279   ,p_object_type                  in     varchar2
280   ,p_object_version_number         in     number
281   ) is
282   --
283   -- Declare cursors and local variables
284   --
285   l_proc                    varchar2(72) := g_package||' delete_chat_obj_inclusion';
286   l_object_version_id       number;
287   --
288   --
289 begin
290   hr_utility.set_location('Entering:'|| l_proc, 10);
291   --
292   -- Issue a savepoint
293   --
294   savepoint DELETE_CHAT_OBJ_INCLUSION;
295   --
296   -- Truncate the time portion from all IN date parameters
297   --
298   --
299 
300   -- Call Before Process User Hook
301   begin
302   ota_chat_obj_inclusion_bk3.delete_chat_obj_inclusion_b
303   (p_chat_id        => p_chat_id
304   ,p_object_id      => p_object_id
305   ,p_object_type    => p_object_type
306   ,p_object_version_number   => p_object_version_number
307     );
308   exception
309     when hr_api.cannot_find_prog_unit then
310       hr_api.cannot_find_prog_unit_error
311         (p_module_name => 'DELETE_CHAT_OBJ_INCLUSION'
312         ,p_hook_type   => 'BP'
313         );
314   end;
315 
316   --
317   -- Validation in addition to Row Handlers
318   --
319   --
320   -- Process Logic
321   --
322 
323   ota_coi_del.del
324   (p_chat_id        => p_chat_id
325   ,p_object_id      => p_object_id
326   ,p_object_type    => p_object_type
327   ,p_object_version_number   => p_object_version_number
328   );
329 
330 
331   --
332   -- Call After Process User Hook
333   begin
334   ota_chat_obj_inclusion_bk3.delete_chat_obj_inclusion_a
335   (p_chat_id        => p_chat_id
336   ,p_object_id      => p_object_id
337   ,p_object_type    => p_object_type
338   ,p_object_version_number   => p_object_version_number
339     );
340   exception
341     when hr_api.cannot_find_prog_unit then
342       hr_api.cannot_find_prog_unit_error
343         (p_module_name => 'DELETE_CHAT_OBJ_INCLUSION'
344         ,p_hook_type   => 'AP'
345         );
346   end;
347   --
348   -- When in validation only mode raise the Validate_Enabled exception
349   --
350   if p_validate then
351     raise hr_api.validate_enabled;
352   end if;
353   --
354   -- Set all output arguments
355   --
356   --
357   hr_utility.set_location(' Leaving:'||l_proc, 170);
358 exception
359   when hr_api.validate_enabled then
360     --
361     -- As the Validate_Enabled exception has been raised
362     -- we must rollback to the savepoint
363     --
364     rollback to DELETE_CHAT_OBJ_INCLUSION;
365     --
366     -- Only set output warning arguments
367     -- (Any key or derived arguments must be set to null
368     -- when validation only mode is being used.)
369     --
370     hr_utility.set_location(' Leaving:'||l_proc, 180);
371   when others then
372     --
373     -- A validation or unexpected error has occured
374     --
375     rollback to DELETE_CHAT_OBJ_INCLUSION;
376     hr_utility.set_location(' Leaving:'||l_proc, 190);
377     raise;
378 end delete_chat_obj_inclusion;
379 --
380 end ota_chat_obj_inclusion_api;