DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_TRANSACTION_TEMPLATES_API

Source


1 Package Body pqh_transaction_templates_api as
2 /* $Header: pqttmapi.pkb 115.4 2002/12/06 23:49:23 rpasapul noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  pqh_transaction_templates_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_transaction_template >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_transaction_template
13   (p_validate                       in  boolean   default false
14   ,p_transaction_template_id        out nocopy number
15   ,p_enable_flag                    in  varchar2  default null
16   ,p_template_id                    in  number    default null
17   ,p_transaction_id                 in  number    default null
18   ,p_transaction_category_id        in  number    default null
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_transaction_template_id pqh_transaction_templates.transaction_template_id%TYPE;
26   l_proc varchar2(72) := g_package||'create_transaction_template';
27   l_object_version_number pqh_transaction_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_transaction_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_transaction_template
44     --
45     pqh_transaction_templates_bk1.create_transaction_template_b
46       (
47        p_enable_flag                    =>  p_enable_flag
48       ,p_template_id                    =>  p_template_id
49       ,p_transaction_id                 =>  p_transaction_id
50       ,p_transaction_category_id        =>  p_transaction_category_id
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_TRANSACTION_TEMPLATE'
58         ,p_hook_type   => 'BP'
59         );
60     --
61     -- End of API User Hook for the before hook of create_transaction_template
62     --
63   end;
64   --
65   pqh_ttm_ins.ins
66     (
67      p_transaction_template_id       => l_transaction_template_id
68     ,p_enable_flag                   => p_enable_flag
69     ,p_template_id                   => p_template_id
70     ,p_transaction_id                => p_transaction_id
71     ,p_transaction_category_id       => p_transaction_category_id
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_transaction_template
79     --
80     pqh_transaction_templates_bk1.create_transaction_template_a
81       (
82        p_transaction_template_id        =>  l_transaction_template_id
83       ,p_enable_flag                    =>  p_enable_flag
84       ,p_template_id                    =>  p_template_id
85       ,p_transaction_id                 =>  p_transaction_id
86       ,p_transaction_category_id        =>  p_transaction_category_id
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_TRANSACTION_TEMPLATE'
94         ,p_hook_type   => 'AP'
95         );
96     --
97     -- End of API User Hook for the after hook of create_transaction_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_transaction_template_id := l_transaction_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_transaction_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_transaction_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_transaction_template_id := null;
135     p_object_version_number  := null;
136     --
137     -- A validation or unexpected error has occured
138     --
139     ROLLBACK TO create_transaction_template;
140     raise;
141     --
142 end create_transaction_template;
143 -- ----------------------------------------------------------------------------
144 -- |------------------------< update_transaction_template >--- ------------------|
145 -- ----------------------------------------------------------------------------
146 --
147 procedure update_transaction_template
148   (p_validate                       in  boolean   default false
149   ,p_transaction_template_id        in  number
150   ,p_enable_flag                    in  varchar2  default hr_api.g_varchar2
151   ,p_template_id                    in  number    default hr_api.g_number
152   ,p_transaction_id                 in  number    default hr_api.g_number
153   ,p_transaction_category_id        in  number    default hr_api.g_number
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_transaction_template';
161   l_object_version_number pqh_transaction_templates.object_version_number%TYPE;
162   --
163 begin
164   --
165   hr_utility.set_location('Entering:'|| l_proc, 10);
166   --
167   -- Issue a savepoint if operating in validation only mode
168   --
169   savepoint update_transaction_template;
170   --
171   hr_utility.set_location(l_proc, 20);
172   --
173   -- Process Logic
174   --
175   l_object_version_number := p_object_version_number;
176   --
177   begin
178     --
179     -- Start of API User Hook for the before hook of update_transaction_template
180     --
181     pqh_transaction_templates_bk2.update_transaction_template_b
182       (
183        p_transaction_template_id        =>  p_transaction_template_id
184       ,p_enable_flag                    =>  p_enable_flag
185       ,p_template_id                    =>  p_template_id
186       ,p_transaction_id                 =>  p_transaction_id
187       ,p_transaction_category_id        =>  p_transaction_category_id
188       ,p_object_version_number          =>  p_object_version_number
189     ,p_effective_date                 => trunc(p_effective_date)
190       );
191   exception
192     when hr_api.cannot_find_prog_unit then
193       hr_api.cannot_find_prog_unit_error
194         (p_module_name => 'UPDATE_TRANSACTION_TEMPLATE'
195         ,p_hook_type   => 'BP'
196         );
197     --
198     -- End of API User Hook for the before hook of update_transaction_template
199     --
200   end;
201   --
202   pqh_ttm_upd.upd
203     (
204      p_transaction_template_id       => p_transaction_template_id
205     ,p_enable_flag                   => p_enable_flag
206     ,p_template_id                   => p_template_id
207     ,p_transaction_id                => p_transaction_id
208     ,p_transaction_category_id       => p_transaction_category_id
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_transaction_template
216     --
217     pqh_transaction_templates_bk2.update_transaction_template_a
218       (
219        p_transaction_template_id        =>  p_transaction_template_id
220       ,p_enable_flag                    =>  p_enable_flag
221       ,p_template_id                    =>  p_template_id
222       ,p_transaction_id                 =>  p_transaction_id
223       ,p_transaction_category_id        =>  p_transaction_category_id
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_TRANSACTION_TEMPLATE'
231         ,p_hook_type   => 'AP'
232         );
233     --
234     -- End of API User Hook for the after hook of update_transaction_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_transaction_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_transaction_template;
273     raise;
274     --
275 end update_transaction_template;
276 -- ----------------------------------------------------------------------------
277 -- |------------------------< delete_transaction_template >----------------------|
278 -- ----------------------------------------------------------------------------
279 --
280 procedure delete_transaction_template
281   (p_validate                       in  boolean  default false
282   ,p_transaction_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||'update_transaction_template';
290   l_object_version_number pqh_transaction_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_transaction_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_transaction_template
310     --
311     pqh_transaction_templates_bk3.delete_transaction_template_b
312       (
313        p_transaction_template_id        =>  p_transaction_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_TRANSACTION_TEMPLATE'
321         ,p_hook_type   => 'BP'
322         );
323     --
324     -- End of API User Hook for the before hook of delete_transaction_template
325     --
326   end;
327   --
328   pqh_ttm_del.del
329     (
330      p_transaction_template_id       => p_transaction_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_transaction_template
338     --
339     pqh_transaction_templates_bk3.delete_transaction_template_a
340       (
341        p_transaction_template_id        =>  p_transaction_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_TRANSACTION_TEMPLATE'
349         ,p_hook_type   => 'AP'
350         );
351     --
352     -- End of API User Hook for the after hook of delete_transaction_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_transaction_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_transaction_template;
385     raise;
386     --
387 end delete_transaction_template;
388 --
389 -- ----------------------------------------------------------------------------
390 -- |-------------------------------< lck >------------------------------------|
391 -- ----------------------------------------------------------------------------
392 --
393 procedure lck
394   (
395    p_transaction_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_ttm_shd.lck
409     (
410       p_transaction_template_id                 => p_transaction_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_transaction_templates_api;