DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_FRM_NOTIF_SUBSCRIBER_API

Source


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