DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_TKGQ_BUS

Source


1 Package body hxc_tkgq_bus as
2 /* $Header: hxctkgqrhi.pkb 120.2 2005/09/23 09:33:26 rchennur noship $ */
3 --
4 g_package  varchar2(33) := '  hxc_tkgq_bus.';  -- Global package name
5 g_debug boolean := hr_utility.debug_enabled;
6 -- ----------------------------------------------------------------------------
7 -- |-----------------------< chk_non_updateable_args >------------------------|
8 -- ----------------------------------------------------------------------------
9 --
10 -- Description:
11 --   This procedure is used to ensure that non updateable attributes have
12 --   not been updated. If an attribute has been updated an error is generated.
13 --
14 -- Pre Conditions:
15 --   g_old_rec has been populated with details of the values currently in
16 --   the database.
17 --
18 -- In Arguments:
19 --   p_rec has been populated with the updated values the user would like the
20 --   record set to.
21 --
22 -- Post Success:
23 --   Processing continues if all the non updateable attributes have not
24 --   changed.
25 --
26 -- Post Failure:
27 --   An application error is raised if any of the non updatable attributes
28 --   have been altered.
29 --
30 -- {End Of Comments}
31 -- ----------------------------------------------------------------------------
32 Procedure chk_non_updateable_args
33   (p_rec in hxc_tkgq_shd.g_rec_type
34   ) IS
35 --
36   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
37 --
38 Begin
39   --
40 
41   -- Only proceed with the validation if a row exists for the current
42   -- record in the HR Schema.
43   --
44   IF NOT hxc_tkgq_shd.api_updating
45       (p_tk_group_query_id                 => p_rec.tk_group_query_id
46       ,p_object_version_number             => p_rec.object_version_number
47       ) THEN
48      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
49      fnd_message.set_token('PROCEDURE ', l_proc);
50      fnd_message.set_token('STEP ', '5');
51      fnd_message.raise_error;
52   END IF;
53   --
54   -- EDIT_HERE: Add checks to ensure non-updateable args have
55   --            not been updated.
56   --
57 End chk_non_updateable_args;
58 --
59 -- ----------------------------------------------------------------------------
60 -- |---------------------------< insert_validate >----------------------------|
61 -- ----------------------------------------------------------------------------
62 --
63 -- Description:
64 --   This procedure controls the execution of all insert business rules
65 --   validation.
66 --
67 -- Prerequisites:
68 --   This private procedure is called from ins procedure.
69 --
70 -- In Parameters:
71 --   A Pl/Sql record structure.
72 --
73 -- Post Success:
74 --   Processing continues.
75 --
76 -- Post Failure:
77 --   If a business rules fails the error will not be handled by this procedure
78 --   unless explicity coded.
79 --
80 -- Developer Implementation Notes:
81 --   For insert, your business rules should be executed from this procedure and
82 --   should ideally (unless really necessary) just be straight procedure or
83 --   function calls. Try and avoid using conditional branching logic.
84 --
85 -- Access Status:
86 --   Internal Row Handler Use Only.
87 --
88 -- ----------------------------------------------------------------------------
89 Procedure insert_validate
90   (p_rec                          in hxc_tkgq_shd.g_rec_type
91   ) is
92 --
93   l_proc  varchar2(72) ;
94 --
95 Begin
96   g_debug :=hr_utility.debug_enabled;
97   if g_debug then
98   	l_proc := g_package||'insert_validate';
99   	hr_utility.set_location('Entering:'||l_proc, 5);
100   end if;
101   --
102   -- Call all supporting business operations
103   --
104   hr_api.mandatory_arg_error
105     (p_api_name           => l_proc
106     ,p_argument           => 'SYSTEM_USER'
107     ,p_argument_value     => p_rec.system_user
108     );
109 
110   hr_api.mandatory_arg_error
111     (p_api_name           => l_proc
112     ,p_argument           => 'INCLUDE_EXCLUDE'
113     ,p_argument_value     => p_rec.include_exclude
114     );
115 
116   --
117   if g_debug then
118   	hr_utility.set_location(' Leaving:'||l_proc, 10);
119   end if;
120 End insert_validate;
121 --
122 -- ----------------------------------------------------------------------------
123 -- |---------------------------< update_validate >----------------------------|
124 -- ----------------------------------------------------------------------------
125 --
126 -- Description:
127 --   This procedure controls the execution of all update business rules
128 --   validation.
129 --
130 -- Prerequisites:
131 --   This private procedure is called from upd procedure.
132 --
133 -- In Parameters:
134 --   A Pl/Sql record structure.
135 --
136 -- Post Success:
137 --   Processing continues.
138 --
139 -- Post Failure:
140 --   If a business rules fails the error will not be handled by this procedure
141 --   unless explicity coded.
142 --
143 -- Developer Implementation Notes:
144 --   For update, your business rules should be executed from this procedure and
145 --   should ideally (unless really necessary) just be straight procedure or
146 --   function calls. Try and avoid using conditional branching logic.
147 --
148 -- Access Status:
149 --   Internal Row Handler Use Only.
150 --
151 -- ----------------------------------------------------------------------------
152 Procedure update_validate
153   (p_rec                          in hxc_tkgq_shd.g_rec_type
154   ) is
155 --
156   l_proc  varchar2(72) ;
157 --
158 Begin
159   g_debug :=hr_utility.debug_enabled;
160 
161   if g_debug then
162   	l_proc := g_package||'update_validate';
163   	hr_utility.set_location('Entering:'||l_proc, 5);
164   end if;
165   --
166   -- Call all supporting business operations
167   --
168 
169   hr_api.mandatory_arg_error
170     (p_api_name           => l_proc
171     ,p_argument           => 'TK_GROUP_QUERY_ID'
172     ,p_argument_value     => p_rec.tk_group_query_id
173     );
174 
175   hr_api.mandatory_arg_error
176     (p_api_name           => l_proc
177     ,p_argument           => 'SYSTEM_USER'
178     ,p_argument_value     => p_rec.system_user
179     );
180 
181   hr_api.mandatory_arg_error
182     (p_api_name           => l_proc
183     ,p_argument           => 'INCLUDE_EXCLUDE'
184     ,p_argument_value     => p_rec.include_exclude
185     );
186 
187   chk_non_updateable_args
188     (p_rec              => p_rec
189     );
190   --
191   --
192   if g_debug then
193   	hr_utility.set_location(' Leaving:'||l_proc, 10);
194   end if;
195 End update_validate;
196 --
197 -- ----------------------------------------------------------------------------
198 -- |---------------------------< delete_validate >----------------------------|
199 -- ----------------------------------------------------------------------------
200 --
201 -- Description:
202 --   This procedure controls the execution of all delete business rules
203 --   validation.
204 --
205 -- Prerequisites:
206 --   This private procedure is called from del procedure.
207 --
208 -- In Parameters:
209 --   A Pl/Sql record structure.
210 --
211 -- Post Success:
212 --   Processing continues.
213 --
214 -- Post Failure:
215 --   If a business rules fails the error will not be handled by this procedure
216 --   unless explicity coded.
217 --
218 -- Developer Implementation Notes:
219 --   For delete, your business rules should be executed from this procedure and
220 --   should ideally (unless really necessary) just be straight procedure or
221 --   function calls. Try and avoid using conditional branching logic.
222 --
223 -- Access Status:
224 --   Internal Row Handler Use Only.
225 --
226 -- ----------------------------------------------------------------------------
227 Procedure delete_validate
228   (p_rec              in hxc_tkgq_shd.g_rec_type
229   ) is
230 --
231   l_proc  varchar2(72) ;
232 --
233 Begin
234   g_debug :=hr_utility.debug_enabled;
235   if g_debug then
236   	l_proc := g_package||'delete_validate';
237   	hr_utility.set_location('Entering:'||l_proc, 5);
238   end if;
239   --
240   -- Call all supporting business operations
241   --
242 null;
243   --
244   if g_debug then
245   	hr_utility.set_location(' Leaving:'||l_proc, 10);
246   end if;
247 End delete_validate;
248 --
249 end hxc_tkgq_bus;