DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_ROLE_TEMPLATES_API

Source


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