DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_ROUTING_LISTS_API

Source


1 Package Body PQH_ROUTING_LISTS_api as
2 /* $Header: pqrltapi.pkb 115.6 2002/12/06 18:08:13 rpasapul noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  PQH_ROUTING_LISTS_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_routing_list >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_routing_list
13   (p_validate                       in  boolean   default false
14   ,p_routing_list_id                out nocopy number
15   ,p_routing_list_name              in  varchar2
16   ,p_enable_flag	            in  varchar2	default 'Y'
17   ,p_object_version_number          out nocopy number
18   ) is
19   --
20   -- Declare cursors and local variables
21   --
22   l_routing_list_id pqh_routing_lists.routing_list_id%TYPE;
23   l_proc varchar2(72) := g_package||'create_routing_list';
24   l_object_version_number pqh_routing_lists.object_version_number%TYPE;
25   --
26 begin
27   --
28   hr_utility.set_location('Entering:'|| l_proc, 10);
29   --
30   -- Issue a savepoint if operating in validation only mode
31   --
32   savepoint create_routing_list;
33   --
34   hr_utility.set_location(l_proc, 20);
35   --
36   -- Process Logic
37   --
38   begin
39     --
40     -- Start of API User Hook for the before hook of create_routing_list
41     --
42     PQH_ROUTING_LISTS_bk1.create_routing_list_b
43       (
44        p_routing_list_name              =>  p_routing_list_name ,
45        p_enable_flag			=>  p_enable_flag
46       );
47   exception
48     when hr_api.cannot_find_prog_unit then
49       hr_api.cannot_find_prog_unit_error
50         (
51          p_module_name => 'CREATE_ROUTING_LIST'
52         ,p_hook_type   => 'BP'
53         );
54     --
55     -- End of API User Hook for the before hook of create_routing_list
56     --
57   end;
58   --
59   pqh_rlt_ins.ins
60     (
61      p_routing_list_id               => l_routing_list_id
62     ,p_routing_list_name             => p_routing_list_name
63     ,p_enable_flag		     => p_enable_flag
64     ,p_object_version_number         => l_object_version_number
65     );
66   --
67   begin
68     --
69     -- Start of API User Hook for the after hook of create_routing_list
70     --
71     PQH_ROUTING_LISTS_bk1.create_routing_list_a
72       (
73        p_routing_list_id                =>  l_routing_list_id
74       ,p_routing_list_name              =>  p_routing_list_name
75       ,p_enable_flag			=>  p_enable_flag
76       ,p_object_version_number          =>  l_object_version_number
77       );
78   exception
79     when hr_api.cannot_find_prog_unit then
80       hr_api.cannot_find_prog_unit_error
81         (p_module_name => 'CREATE_ROUTING_LIST'
82         ,p_hook_type   => 'AP'
83         );
84     --
85     -- End of API User Hook for the after hook of create_routing_list
86     --
87   end;
88   --
89   hr_utility.set_location(l_proc, 60);
90   --
91   -- When in validation only mode raise the Validate_Enabled exception
92   --
93   if p_validate then
94     raise hr_api.validate_enabled;
95   end if;
96   --
97   -- Set all output arguments
98   --
99   p_routing_list_id := l_routing_list_id;
100   p_object_version_number := l_object_version_number;
101   --
102   hr_utility.set_location(' Leaving:'||l_proc, 70);
103   --
104 exception
105   --
106   when hr_api.validate_enabled then
107     --
108     -- As the Validate_Enabled exception has been raised
109     -- we must rollback to the savepoint
110     --
111     ROLLBACK TO create_routing_list;
112     --
113     -- Only set output warning arguments
114     -- (Any key or derived arguments must be set to null
115     -- when validation only mode is being used.)
116     --
117     p_routing_list_id := null;
118     p_object_version_number  := null;
119     hr_utility.set_location(' Leaving:'||l_proc, 80);
120     --
121   when others then
122        p_routing_list_id := null;
123     p_object_version_number  := null;
124     --
125     -- A validation or unexpected error has occured
126     --
127     ROLLBACK TO create_routing_list;
128     raise;
129     --
130 end create_routing_list;
131 -- ----------------------------------------------------------------------------
132 -- |------------------------< update_routing_list >--- ------------------|
133 -- ----------------------------------------------------------------------------
134 --
135 procedure update_routing_list
136   (p_validate                       in  boolean   default false
137   ,p_routing_list_id                in  number
138   ,p_routing_list_name              in  varchar2  default hr_api.g_varchar2
139   ,p_enable_flag		    in  varchar2  default hr_api.g_varchar2
140   ,p_object_version_number          in out nocopy number
141   ) is
142   --
143   -- Declare cursors and local variables
144   --
145   l_proc varchar2(72) := g_package||'update_routing_list';
146   l_object_version_number pqh_routing_lists.object_version_number%TYPE;
147   --
148 begin
149   --
150   hr_utility.set_location('Entering:'|| l_proc, 10);
151   --
152   -- Issue a savepoint if operating in validation only mode
153   --
154   savepoint update_routing_list;
155   --
156   hr_utility.set_location(l_proc, 20);
157   --
158   -- Process Logic
159   --
160   l_object_version_number := p_object_version_number;
161   --
162   begin
163     --
164     -- Start of API User Hook for the before hook of update_routing_list
165     --
166     PQH_ROUTING_LISTS_bk2.update_routing_list_b
167       (
168        p_routing_list_id                =>  p_routing_list_id
169       ,p_routing_list_name              =>  p_routing_list_name
170       ,p_enable_flag			=>  p_enable_flag
171       ,p_object_version_number          =>  p_object_version_number
172       );
173   exception
174     when hr_api.cannot_find_prog_unit then
175       hr_api.cannot_find_prog_unit_error
176         (p_module_name => 'UPDATE_ROUTING_LIST'
177         ,p_hook_type   => 'BP'
178         );
179     --
180     -- End of API User Hook for the before hook of update_routing_list
181     --
182   end;
183   --
184   pqh_rlt_upd.upd
185     (
186      p_routing_list_id               => p_routing_list_id
187     ,p_routing_list_name             => p_routing_list_name
188     ,p_enable_flag		     => p_enable_flag
189     ,p_object_version_number         => l_object_version_number
190     );
191   --
192   begin
193     --
194     -- Start of API User Hook for the after hook of update_routing_list
195     --
196     PQH_ROUTING_LISTS_bk2.update_routing_list_a
197       (
198        p_routing_list_id                =>  p_routing_list_id
199       ,p_routing_list_name              =>  p_routing_list_name
200       ,p_enable_flag			=>  p_enable_flag
201       ,p_object_version_number          =>  l_object_version_number
202       );
203   exception
204     when hr_api.cannot_find_prog_unit then
205       hr_api.cannot_find_prog_unit_error
206         (p_module_name => 'UPDATE_ROUTING_LIST'
207         ,p_hook_type   => 'AP'
208         );
209     --
210     -- End of API User Hook for the after hook of update_routing_list
211     --
212   end;
213   --
214   hr_utility.set_location(l_proc, 60);
215   --
216   -- When in validation only mode raise the Validate_Enabled exception
217   --
218   if p_validate then
219     raise hr_api.validate_enabled;
220   end if;
221   --
222   -- Set all output arguments
223   --
224   p_object_version_number := l_object_version_number;
225   --
226   hr_utility.set_location(' Leaving:'||l_proc, 70);
227   --
228 exception
229   --
230   when hr_api.validate_enabled then
231     --
232     -- As the Validate_Enabled exception has been raised
233     -- we must rollback to the savepoint
234     --
235     ROLLBACK TO update_routing_list;
236     --
237     -- Only set output warning arguments
238     -- (Any key or derived arguments must be set to null
239     -- when validation only mode is being used.)
240     --
241     hr_utility.set_location(' Leaving:'||l_proc, 80);
242     --
243   when others then
244     p_object_version_number := l_object_version_number;
245     --
246     -- A validation or unexpected error has occured
247     --
248     ROLLBACK TO update_routing_list;
249     raise;
250     --
251 end update_routing_list;
252 -- ----------------------------------------------------------------------------
253 -- |------------------------< delete_routing_list >----------------------|
254 -- ----------------------------------------------------------------------------
255 --
256 procedure delete_routing_list
257   (p_validate                       in  boolean  default false
258   ,p_routing_list_id                in  number
259   ,p_object_version_number          in out nocopy number
260   ) is
261   --
262   -- Declare cursors and local variables
263   --
264   l_proc varchar2(72) := g_package||'delete_routing_list';
265   l_object_version_number pqh_routing_lists.object_version_number%TYPE;
266   --
267   cursor c1 is
268    select routing_list_member_id,object_version_number
269    from pqh_routing_list_members
270    where routing_list_id = p_routing_list_id;
271   --
272 begin
273   --
274   hr_utility.set_location('Entering:'|| l_proc, 10);
275   --
276   -- Issue a savepoint if operating in validation only mode
277   --
278   savepoint delete_routing_list;
279   --
280   hr_utility.set_location(l_proc, 20);
281   --
282   -- Process Logic
283   --
284   l_object_version_number := p_object_version_number;
285   --
286   --
287   begin
288     --
289     -- Start of API User Hook for the before hook of delete_routing_list
290     --
291     PQH_ROUTING_LISTS_bk3.delete_routing_list_b
292       (
293        p_routing_list_id                =>  p_routing_list_id
294       ,p_object_version_number          =>  p_object_version_number
295       );
296   exception
297     when hr_api.cannot_find_prog_unit then
298       hr_api.cannot_find_prog_unit_error
299         (p_module_name => 'DELETE_ROUTING_LIST'
300         ,p_hook_type   => 'BP'
301         );
302     --
303     -- End of API User Hook for the before hook of delete_routing_list
304     --
305   end;
306   --
307   for r_routing_list_members in c1 loop
308   pqh_routing_list_members_api.delete_routing_list_member
309     (
310      p_validate                => false
311     ,p_routing_list_member_id  => r_routing_list_members.routing_list_member_id
312     ,p_object_version_number   => r_routing_list_members.object_version_number
313     ,p_effective_date          => sysdate
314     );
315   end loop;
316   --
317   pqh_rlt_del.del
318     (
319      p_routing_list_id               => p_routing_list_id
320     ,p_object_version_number         => l_object_version_number
321     );
322   --
323   begin
324     --
325     -- Start of API User Hook for the after hook of delete_routing_list
326     --
327     PQH_ROUTING_LISTS_bk3.delete_routing_list_a
328       (
329        p_routing_list_id                =>  p_routing_list_id
330       ,p_object_version_number          =>  l_object_version_number
331       );
332   exception
333     when hr_api.cannot_find_prog_unit then
334       hr_api.cannot_find_prog_unit_error
335         (p_module_name => 'DELETE_ROUTING_LIST'
336         ,p_hook_type   => 'AP'
337         );
338     --
339     -- End of API User Hook for the after hook of delete_routing_list
340     --
341   end;
342   --
343   hr_utility.set_location(l_proc, 60);
344   --
345   -- When in validation only mode raise the Validate_Enabled exception
346   --
347   if p_validate then
348     raise hr_api.validate_enabled;
349   end if;
350   --
351   hr_utility.set_location(' Leaving:'||l_proc, 70);
352   --
353 exception
354   --
355   when hr_api.validate_enabled then
356     --
357     -- As the Validate_Enabled exception has been raised
358     -- we must rollback to the savepoint
359     --
360     ROLLBACK TO delete_routing_list;
361     --
362     -- Only set output warning arguments
363     -- (Any key or derived arguments must be set to null
364     -- when validation only mode is being used.)
365     --
366     --
367   when others then
368     --
369     -- A validation or unexpected error has occured
370     --
371     ROLLBACK TO delete_routing_list;
372     raise;
373     --
374 end delete_routing_list;
375 --
376 -- ----------------------------------------------------------------------------
377 -- |-------------------------------< lck >------------------------------------|
378 -- ----------------------------------------------------------------------------
379 --
380 procedure lck
381   (
382    p_routing_list_id                   in     number
383   ,p_object_version_number          in     number
384   ) is
385   --
386   --
387   -- Declare cursors and local variables
388   --
389   l_proc varchar2(72) := g_package||'lck';
390   --
391 begin
392   --
393   hr_utility.set_location('Entering:'|| l_proc, 10);
394   --
395   pqh_rlt_shd.lck
396     (
397       p_routing_list_id                 => p_routing_list_id
398      ,p_object_version_number      => p_object_version_number
399     );
400   --
401   hr_utility.set_location(' Leaving:'||l_proc, 70);
402   --
403 end lck;
404 --
405 end PQH_ROUTING_LISTS_api;