DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_ALIAS_TYPE_COMP_API

Source


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