DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_AVM_BUS

Source


1 Package Body hr_avm_bus as
2 /* $Header: hravmrhi.pkb 115.1 2002/12/02 15:47:59 apholt noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  hr_avm_bus.';  -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code            varchar2(150)  default null;
14 g_ath_variablemap_id          number         default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |----------------------< set_security_group_id >--------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21   (p_ath_variablemap_id                   in number
22   ,p_associated_column1                   in varchar2 default null
23   ) is
24   --
25   --
26   -- Declare local variables
27   --
28   l_security_group_id number;
29   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
30   --
31 begin
32   --
33   hr_utility.set_location('Entering:'|| l_proc, 10);
34   --
35   -- Ensure that all the mandatory parameter are not null
36   --
37   hr_api.mandatory_arg_error
38     (p_api_name           => l_proc
39     ,p_argument           => 'ath_variablemap_id'
40     ,p_argument_value     => p_ath_variablemap_id
41     );
42   --
43   -- CLIENT_INFO not set. No lookup validation or joins to HR_LOOKUPS.
44   --
45   hr_utility.set_location(' Leaving:'|| l_proc, 20);
46   --
47 end set_security_group_id;
48 --
49 --
50 -- ----------------------------------------------------------------------------
51 -- |-----------------------< chk_non_updateable_args >------------------------|
52 -- ----------------------------------------------------------------------------
53 -- {Start Of Comments}
54 --
55 -- Description:
56 --   This procedure is used to ensure that non updateable attributes have
57 --   not been updated. If an attribute has been updated an error is generated.
58 --
59 -- Pre Conditions:
60 --   g_old_rec has been populated with details of the values currently in
61 --   the database.
62 --
63 -- In Arguments:
64 --   p_rec has been populated with the updated values the user would like the
65 --   record set to.
66 --
67 -- Post Success:
68 --   Processing continues if all the non updateable attributes have not
69 --   changed.
70 --
71 -- Post Failure:
72 --   An application error is raised if any of the non updatable attributes
73 --   have been altered.
74 --
75 -- {End Of Comments}
76 -- ----------------------------------------------------------------------------
77 Procedure chk_non_updateable_args
78   (p_rec in hr_avm_shd.g_rec_type
79   ) IS
80 --
81   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
82 --
83 Begin
84   --
85   -- Only proceed with the validation if a row exists for the current
86   -- record in the HR Schema.
87   --
88   IF NOT hr_avm_shd.api_updating
89       (p_ath_variablemap_id                => p_rec.ath_variablemap_id
90       ,p_object_version_number             => p_rec.object_version_number
91       ) THEN
92      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
93      fnd_message.set_token('PROCEDURE ', l_proc);
94      fnd_message.set_token('STEP ', '5');
95      fnd_message.raise_error;
96   END IF;
97   --
98   -- Add checks to ensure non-updateable args have not been updated.
99   --
100   -- all columns are updateable.
101   --
102 End chk_non_updateable_args;
103 
104 --
105 -- ----------------------------------------------------------------------------
106 -- |---------------------------< chk_ath_dsn >----------------------------|
107 -- ----------------------------------------------------------------------------
108 --
109 --  Description :
110 --      Validates that the ath_dsn is not null
111 --
112 --  Pre-conditions:
113 --     None
114 --
115 --   In Arguments :
116 --      p_ath_dsn
117 --
118 --  Post Success :
119 --     If the ath_dsn is non-null then
120 --     processing continues
121 --
122 --  Post Failure :
123 --       If the ath_dsn is null then
124 --       an application error will be raised and processing is terminated
125 --
126 --   Access Status :
127 --      Internal Table Handler Use only.
128 --
129 --    {End of Comments}
130 --  ---------------------------------------------------------------------------
131 procedure chk_ath_dsn
132     (p_ath_dsn in varchar2) is
133 --
134     l_exists	varchar2(1);
135     l_proc	varchar2(72) := g_package||'chk_ath_dsn';
136 --
137 begin
138   hr_utility.set_location('Entering: '|| l_proc, 1);
139   --
140   -- Check mandatory parameters have been set
141   --
142   hr_api.mandatory_arg_error
143       (p_api_name	=> l_proc,
144        p_argument	=> 'ath_dsn',
145        p_argument_value => p_ath_dsn
146       );
147   --
148   hr_utility.set_location(l_proc, 2);
149   --
150   --
151   hr_utility.set_location(l_proc, 3);
152   --
153   hr_utility.set_location(' Leaving: '|| l_proc, 4);
154 end chk_ath_dsn;
155 --
156 
157 --
158 -- ----------------------------------------------------------------------------
159 -- |---------------------------< chk_ath_tablename >--------------------------|
160 -- ----------------------------------------------------------------------------
161 --
162 --  Description :
163 --      Validates that the ath_tablename is not null
164 --
165 --  Pre-conditions:
166 --     None
167 --
168 --   In Arguments :
169 --      p_ath_tablename
170 --
171 --  Post Success :
172 --     If the ath_tablename is non-null then
173 --     processing continues
174 --
175 --  Post Failure :
176 --       If the ath_tablename is null then
177 --       an application error will be raised and processing is terminated
178 --
179 --   Access Status :
180 --      Internal Table Handler Use only.
181 --
182 --    {End of Comments}
183 --  ---------------------------------------------------------------------------
184 procedure chk_ath_tablename
185     (p_ath_tablename in varchar2) is
186 --
187     l_exists	varchar2(1);
188     l_proc	varchar2(72) := g_package||'chk_ath_tablename';
189 --
190 begin
191   hr_utility.set_location('Entering: '|| l_proc, 1);
192   --
193   -- Check mandatory parameters have been set
194   --
195   hr_api.mandatory_arg_error
196       (p_api_name	=> l_proc,
197        p_argument	=> 'ath_tablename',
198        p_argument_value => p_ath_tablename
199       );
200   --
201   hr_utility.set_location(l_proc, 2);
202   --
203   --
204   hr_utility.set_location(l_proc, 3);
205   --
206   hr_utility.set_location(' Leaving: '|| l_proc, 4);
207 end chk_ath_tablename;
208 --
209 
210 --
211 -- ----------------------------------------------------------------------------
212 -- |---------------------------< chk_ath_columnname >--------------------------|
213 -- ----------------------------------------------------------------------------
214 --
215 --  Description :
216 --      Validates that the ath_columnname is not null
217 --
218 --  Pre-conditions:
219 --     None
220 --
221 --   In Arguments :
222 --      p_ath_columnname
223 --
224 --  Post Success :
225 --     If the ath_columnname is non-null then
226 --     processing continues
227 --
228 --  Post Failure :
229 --       If the ath_columnname is null then
230 --       an application error will be raised and processing is terminated
231 --
232 --   Access Status :
233 --      Internal Table Handler Use only.
234 --
235 --    {End of Comments}
236 --  ---------------------------------------------------------------------------
237 procedure chk_ath_columnname
238     (p_ath_columnname in varchar2) is
239 --
240     l_exists	varchar2(1);
241     l_proc	varchar2(72) := g_package||'chk_ath_columnname';
242 --
243 begin
244   hr_utility.set_location('Entering: '|| l_proc, 1);
245   --
246   -- Check mandatory parameters have been set
247   --
248   hr_api.mandatory_arg_error
249       (p_api_name	=> l_proc,
250        p_argument	=> 'ath_columnname',
251        p_argument_value => p_ath_columnname
252       );
253   --
254   hr_utility.set_location(l_proc, 2);
255   --
256   --
257   hr_utility.set_location(l_proc, 3);
258   --
259   hr_utility.set_location(' Leaving: '|| l_proc, 4);
260 end chk_ath_columnname;
261 --
262 
263 --
264 -- ----------------------------------------------------------------------------
265 -- |---------------------------< chk_ath_varname >--------------------------|
266 -- ----------------------------------------------------------------------------
267 --
268 --  Description :
269 --      Validates that the ath_varname is not null
270 --
271 --  Pre-conditions:
272 --     None
273 --
274 --   In Arguments :
275 --      p_ath_varname
276 --      p_ath_dsn
277 --      p_ath_tablename
278 --      p_ath_columnname
279 --
280 --  Post Success :
281 --     If the ath_varname is non-null then
282 --     processing continues
283 --
284 --  Post Failure :
285 --       If the ath_varname is null then
286 --       an application error will be raised and processing is terminated
287 --
288 --   Access Status :
289 --      Internal Table Handler Use only.
290 --
291 --    {End of Comments}
292 --  ---------------------------------------------------------------------------
293 procedure  chk_ath_varname
294     (p_ath_varname in varchar2
295     ,p_ath_dsn in varchar2
296     ,p_ath_tablename in varchar2
297     ,p_ath_columnname in varchar2) is
298 --
299     l_exists	varchar2(1);
300     l_proc	varchar2(72) := g_package||'chk_ath_varname';
301 --
302 begin
303   hr_utility.set_location('Entering: '|| l_proc, 1);
304   --
305   -- Check mandatory parameters have been set
306   --
307   hr_api.mandatory_arg_error
308       (p_api_name	=> l_proc,
309        p_argument	=> 'ath_varname',
310        p_argument_value => p_ath_varname
311       );
312   --
313   hr_utility.set_location(l_proc, 2);
314   --
315   hr_utility.set_location(l_proc, 3);
316   --
317   hr_utility.set_location(' Leaving: '|| l_proc, 4);
318 end chk_ath_varname;
319 --
320 
321 --
322 -- ----------------------------------------------------------------------------
323 -- |---------------------------< insert_validate >----------------------------|
324 -- ----------------------------------------------------------------------------
325 Procedure insert_validate
326   (p_rec                          in hr_avm_shd.g_rec_type
327   ) is
328 --
329   l_proc  varchar2(72) := g_package||'insert_validate';
330 --
331 Begin
332   hr_utility.set_location('Entering:'||l_proc, 5);
333   --
334   -- Call all supporting business operations
335 
336   -- validate ath_dsn
337   --
338   chk_ath_dsn (p_ath_dsn => p_rec.ath_dsn);
339 
340   -- validate ath_tablename
341   --
342   chk_ath_tablename (p_ath_tablename => p_rec.ath_tablename);
343 
344   -- validate ath_columnname
345   --
346   chk_ath_columnname (p_ath_columnname => p_rec.ath_columnname);
347 
348   -- validate ath_varname
349   --
350   chk_ath_varname (p_ath_varname => p_rec.ath_varname
351                   ,p_ath_dsn => p_rec.ath_dsn
352                   ,p_ath_tablename => p_rec.ath_tablename
353                   ,p_ath_columnname => p_rec.ath_columnname);
354 
355   --
356   -- CLIENT_INFO not set.  No lookup validation or joins to HR_LOOKUPS.
357   --
358   --
359   hr_utility.set_location(' Leaving:'||l_proc, 10);
360 End insert_validate;
361 --
362 -- ----------------------------------------------------------------------------
363 -- |---------------------------< update_validate >----------------------------|
364 -- ----------------------------------------------------------------------------
365 Procedure update_validate
366   (p_rec                          in hr_avm_shd.g_rec_type
367   ) is
368 --
369   l_proc  varchar2(72) := g_package||'update_validate';
370 --
371 Begin
372   hr_utility.set_location('Entering:'||l_proc, 5);
373   --
374   -- Call all supporting business operations
375 
376   -- validate ath_dsn
377   --
378   chk_ath_dsn (p_ath_dsn => p_rec.ath_dsn);
379 
380   -- validate ath_tablename
381   --
382   chk_ath_tablename (p_ath_tablename => p_rec.ath_tablename);
383 
384   -- validate ath_columnname
385   --
386   chk_ath_columnname (p_ath_columnname => p_rec.ath_columnname);
387 
388   -- validate ath_varname
389   --
390   chk_ath_varname (p_ath_varname => p_rec.ath_varname
391                   ,p_ath_dsn => p_rec.ath_dsn
392                   ,p_ath_tablename => p_rec.ath_tablename
393                   ,p_ath_columnname => p_rec.ath_columnname);
394 
395 
396   --
397   -- CLIENT_INFO not set.  No lookup validation or joins to HR_LOOKUPS.
398   --
399   -- Validate Dependent Attributes
400   --
401   chk_non_updateable_args
402     (p_rec              => p_rec
403     );
404   --
405   --
406   hr_utility.set_location(' Leaving:'||l_proc, 10);
407 End update_validate;
408 --
409 -- ----------------------------------------------------------------------------
410 -- |---------------------------< delete_validate >----------------------------|
411 -- ----------------------------------------------------------------------------
412 Procedure delete_validate
413   (p_rec                          in hr_avm_shd.g_rec_type
414   ) is
415 --
416   l_proc  varchar2(72) := g_package||'delete_validate';
417 --
418 Begin
419   hr_utility.set_location('Entering:'||l_proc, 5);
420   --
421   -- Call all supporting business operations
422   --
423   hr_utility.set_location(' Leaving:'||l_proc, 10);
424 End delete_validate;
425 --
426 end hr_avm_bus;