DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_VTL_BUS

Source


1 Package Body hxc_vtl_bus as
2 /* $Header: hxcvtlrhi.pkb 120.2 2005/09/23 06:39:43 rchennur noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  hxc_vtl_bus.';  -- Global package name
9 g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- The following two global variables are only to be
12 -- used by the return_legislation_code function.
13 --
14 g_legislation_code            varchar2(150)  default null;
15 g_alias_value_id              number         default null;
16 g_language                    varchar2(4)    default null;
17 --
18 -- ----------------------------------------------------------------------------
19 -- |-----------------------< chk_non_updateable_args >------------------------|
20 -- ----------------------------------------------------------------------------
21 -- {Start Of Comments}
22 --
23 -- Description:
24 --   This procedure is used to ensure that non updateable attributes have
25 --   not been updated. If an attribute has been updated an error is generated.
26 --
27 -- Pre Conditions:
28 --   g_old_rec has been populated with details of the values currently in
29 --   the database.
30 --
31 -- In Arguments:
32 --   p_rec has been populated with the updated values the user would like the
33 --   record set to.
34 --
35 -- Post Success:
36 --   Processing continues if all the non updateable attributes have not
37 --   changed.
38 --
39 -- Post Failure:
40 --   An application error is raised if any of the non updatable attributes
41 --   have been altered.
42 --
43 -- {End Of Comments}
44 -- ----------------------------------------------------------------------------
45 Procedure chk_non_updateable_args
46   (p_rec in hxc_vtl_shd.g_rec_type
47   ) IS
48 --
49   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
50   l_error    EXCEPTION;
51   l_argument varchar2(30);
52 --
53 Begin
54   --
55   -- Only proceed with the validation if a row exists for the current
56   -- record in the HR Schema.
57   --
58   IF NOT hxc_vtl_shd.api_updating
59       (p_alias_value_id                       => p_rec.alias_value_id
60       ,p_language                             => p_rec.language
61       ) THEN
62      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
63      fnd_message.set_token('PROCEDURE ', l_proc);
64      fnd_message.set_token('STEP ', '5');
65      fnd_message.raise_error;
66   END IF;
67   --
68   -- EDIT_HERE: Add checks to ensure non-updateable args have
69   --            not been updated.
70   --
71   EXCEPTION
72     WHEN l_error THEN
73        hr_api.argument_changed_error
74          (p_api_name => l_proc
75          ,p_argument => l_argument);
76     WHEN OTHERS THEN
77        RAISE;
78 End chk_non_updateable_args;
79 --
80 -- ----------------------------------------------------------------------------
81 -- |---------------------------< insert_validate >----------------------------|
82 -- ----------------------------------------------------------------------------
83 Procedure insert_validate
84   (p_rec                          in hxc_vtl_shd.g_rec_type
85   ) is
86 --
87   l_proc  varchar2(72) ;
88 --
89 Begin
90   g_debug :=hr_utility.debug_enabled;
91   if g_debug then
92   	l_proc := g_package||'insert_validate';
93   	hr_utility.set_location('Entering:'||l_proc, 5);
94   end if;
95   --
96   -- Call all supporting business operations
97   --
98   --
99   -- EDIT_HERE: As this table does not have a mandatory business_group_id
100   -- column, ensure client_info is populated by calling a suitable
101   -- ???_???_bus.set_security_group_id procedure, or add one of the following
102   -- comments:
103   -- "-- No business group context.  HR_STANDARD_LOOKUPS used for validation."
104   -- "-- CLIENT_INFO not set.  No lookup validation or joins to HR_LOOKUPS."
105   --
106   --
107   if g_debug then
108   	hr_utility.set_location(' Leaving:'||l_proc, 10);
109   end if;
110 End insert_validate;
111 --
112 -- ----------------------------------------------------------------------------
113 -- |---------------------------< update_validate >----------------------------|
114 -- ----------------------------------------------------------------------------
115 Procedure update_validate
116   (p_rec                          in hxc_vtl_shd.g_rec_type
117   ) is
118 --
119   l_proc  varchar2(72) ;
120 --
121 Begin
122   g_debug :=hr_utility.debug_enabled;
123   if g_debug then
124   	l_proc := g_package||'update_validate';
125   	hr_utility.set_location('Entering:'||l_proc, 5);
126   end if;
127   --
128   -- Call all supporting business operations
129   --
130   --
131   -- EDIT_HERE: As this table does not have a mandatory business_group_id
132   -- column, ensure client_info is populated by calling a suitable
133   -- ???_???_bus.set_security_group_id procedure, or add one of the following
134   -- comments:
135   -- "-- No business group context.  HR_STANDARD_LOOKUPS used for validation."
136   -- "-- CLIENT_INFO not set.  No lookup validation or joins to HR_LOOKUPS."
137   --
138   chk_non_updateable_args
139     (p_rec              => p_rec
140     );
141   --
142   --
143   if g_debug then
144   	hr_utility.set_location(' Leaving:'||l_proc, 10);
145   end if;
146 End update_validate;
147 --
148 -- ----------------------------------------------------------------------------
149 -- |---------------------------< delete_validate >----------------------------|
150 -- ----------------------------------------------------------------------------
151 Procedure delete_validate
152   (p_rec                          in hxc_vtl_shd.g_rec_type
153   ) is
154 --
155   l_proc  varchar2(72) ;
156 --
157 Begin
158   g_debug :=hr_utility.debug_enabled;
159   if g_debug then
160   	l_proc := g_package||'delete_validate';
161   	hr_utility.set_location('Entering:'||l_proc, 5);
162   end if;
163   --
164   -- Call all supporting business operations
165   --
166   if g_debug then
167   	hr_utility.set_location(' Leaving:'||l_proc, 10);
168   end if;
169 End delete_validate;
170 --
171 end hxc_vtl_bus;