DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_AUTHORIA_MAPPING_API

Source


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