[Home] [Help]
PACKAGE BODY: APPS.GHR_COMPLAINT_BASES_API
Source
1 Package Body ghr_complaint_bases_api as
2 /* $Header: ghcbaapi.pkb 115.1 2003/01/30 16:31:37 asubrahm noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' ghr_complaint_bases_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< create_compl_basis> >--------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_compl_basis
13 (p_validate in boolean default false
14 ,p_effective_date in date
15 ,p_compl_claim_id in number
16 ,p_basis in varchar2 default null
17 ,p_value in varchar2 default null
18 ,p_statute in varchar2 default null
19 ,p_agency_finding in varchar2 default null
20 ,p_aj_finding in varchar2 default null
21 ,p_compl_basis_id out nocopy number
22 ,p_object_version_number out nocopy number
23 ) is
24
25 --
26 -- Declare cursors and local variables
27 --
28
29 l_proc varchar2(72) := g_package||'create_compl_basis';
30 l_compl_basis_id number;
31 l_object_version_number number;
32 begin
33 hr_utility.set_location('Entering:'|| l_proc, 10);
34 --
35 -- Issue a savepoint
36 --
37 savepoint create_compl_basis;
38 hr_utility.set_location(l_proc, 20);
39 --
40 -- Truncate the time portion from all IN date parameters
41 --
42 -- Call Before Process User Hook
43 --
44 begin
45 ghr_complaint_bases_bk_1.create_compl_basis_b
46 (p_effective_date => trunc(p_effective_date)
47 ,p_compl_claim_id => p_compl_claim_id
48 ,p_basis => p_basis
49 ,p_value => p_value
50 ,p_statute => p_statute
51 ,p_agency_finding => p_agency_finding
52 ,p_aj_finding => p_aj_finding
53 );
54 exception
55 when hr_api.cannot_find_prog_unit then
56 hr_api.cannot_find_prog_unit_error
57 (p_module_name => 'create_compl_basis'
58 ,p_hook_type => 'BP'
59 );
60 end;
61 --
62 -- Validation in addition to Row Handlers
63 --
64
65 hr_utility.set_location(l_proc, 40);
66 --
67 -- Process Logic
68 --
69 ghr_cba_ins.ins
70 (p_effective_date => p_effective_date
71 ,p_compl_claim_id => p_compl_claim_id
72 ,p_basis => p_basis
73 ,p_value => p_value
74 ,p_statute => p_statute
75 ,p_agency_finding => p_agency_finding
76 ,p_aj_finding => p_aj_finding
77 ,p_compl_basis_id => l_compl_basis_id
78 ,p_object_version_number => l_object_version_number
79 );
80 hr_utility.set_location(l_proc, 50);
81 --
82 -- Call After Process User Hook
83 --
84 begin
85 ghr_complaint_bases_bk_1.create_compl_basis_a
86 (p_effective_date => trunc(p_effective_date)
87 ,p_compl_claim_id => p_compl_claim_id
88 ,p_basis => p_basis
89 ,p_value => p_value
90 ,p_statute => p_statute
91 ,p_agency_finding => p_agency_finding
92 ,p_aj_finding => p_aj_finding
93 ,p_compl_basis_id => l_compl_basis_id
94 ,p_object_version_number => l_object_version_number
95 );
96 exception
97 when hr_api.cannot_find_prog_unit then
98 hr_api.cannot_find_prog_unit_error
99 (p_module_name => 'create_compl_basis'
100 ,p_hook_type => 'AP'
101 );
102 end;
103 --
104 -- When in validation only mode raise the Validate_Enabled exception
105 --
106 if p_validate then
107 raise hr_api.validate_enabled;
108 end if;
109 --
110 -- Set all output arguments
111 --
112 p_compl_basis_id := l_compl_basis_id;
113 p_object_version_number := l_object_version_number;
114 --
115 hr_utility.set_location(' Leaving:'||l_proc, 70);
116 exception
117 when hr_api.validate_enabled then
118 --
119 -- As the Validate_Enabled exception has been raised
120 -- we must rollback to the savepoint
121 --
122 rollback to create_compl_basis;
123 --
124 -- Only set output warning arguments
125 -- (Any key or derived arguments must be set to null
126 -- when validation only mode is being used.)
127 --
128 p_compl_basis_id := null;
129 p_object_version_number := null;
130 hr_utility.set_location(' Leaving:'||l_proc, 80);
131 when others then
132 --
133 -- A validation or unexpected error has occured
134 --
135 rollback to create_compl_basis;
136 -- Reset In/Out Params and SET Out Params.
137 p_compl_basis_id := null;
138 p_object_version_number := null;
139 hr_utility.set_location(' Leaving:'||l_proc, 90);
140 raise;
141 end create_compl_basis;
142 --
143 -- ----------------------------------------------------------------------------
144 -- |--------------------------< update_compl_basis> >--------------------------|
145 -- ----------------------------------------------------------------------------
146 --
147 procedure update_compl_basis
148 (p_validate in boolean default false
149 ,p_effective_date in date
150 ,p_compl_basis_id in number
151 ,p_compl_claim_id in number default hr_api.g_number
152 ,p_basis in varchar2 default hr_api.g_varchar2
153 ,p_value in varchar2 default hr_api.g_varchar2
154 ,p_statute in varchar2 default hr_api.g_varchar2
155 ,p_agency_finding in varchar2 default hr_api.g_varchar2
156 ,p_aj_finding in varchar2 default hr_api.g_varchar2
157 ,p_object_version_number in out nocopy number
158 )
159
160 is
161 l_proc varchar2(72) := g_package||'update_compl_basis';
162 l_object_version_number number;
163 begin
164 hr_utility.set_location('Entering:'|| l_proc, 5);
165 --
166 savepoint update_compl_basis;
167 --
168 -- Initialise Local Variables
169 l_object_version_number:=p_object_version_number;
170 --
171 -- Truncate the time portion from all IN date parameters
172 --
173 -- Call Before Process User Hook
174 --
175 begin
176 ghr_complaint_bases_bk_2.update_compl_basis_b
177 (p_effective_date => trunc(p_effective_date)
178 ,p_compl_claim_id => p_compl_claim_id
179 ,p_basis => p_basis
180 ,p_value => p_value
181 ,p_statute => p_statute
182 ,p_agency_finding => p_agency_finding
183 ,p_aj_finding => p_aj_finding
184 ,p_compl_basis_id => p_compl_basis_id
185 ,p_object_version_number => p_object_version_number
186 );
187 exception
188 when hr_api.cannot_find_prog_unit then
189 hr_api.cannot_find_prog_unit_error
190 (p_module_name => 'update_compl_basis'
191 ,p_hook_type => 'BP'
192 );
193 end;
194 --
195 -- Validation in addition to Row Handlers
196 -- Store the original ovn in case we rollback when p_validate is true
197 --
198 l_object_version_number := p_object_version_number;
199
200 hr_utility.set_location(l_proc, 6);
201
202 ghr_cba_upd.upd
203 (p_effective_date => p_effective_date
204 ,p_compl_claim_id => p_compl_claim_id
205 ,p_basis => p_basis
206 ,p_value => p_value
207 ,p_statute => p_statute
208 ,p_agency_finding => p_agency_finding
209 ,p_aj_finding => p_aj_finding
210 ,p_compl_basis_id => p_compl_basis_id
211 ,p_object_version_number => l_object_version_number
212 );
213 --
214 -- Call After Process User Hook
215 --
216 begin
217 ghr_complaint_bases_bk_2.update_compl_basis_a
218 (p_effective_date => trunc(p_effective_date)
219 ,p_compl_claim_id => p_compl_claim_id
220 ,p_basis => p_basis
221 ,p_value => p_value
222 ,p_statute => p_statute
223 ,p_agency_finding => p_agency_finding
224 ,p_aj_finding => p_aj_finding
225 ,p_compl_basis_id => p_compl_basis_id
226 ,p_object_version_number => l_object_version_number
227 );
228 exception
229 when hr_api.cannot_find_prog_unit then
230 hr_api.cannot_find_prog_unit_error
231 (p_module_name => 'update_compl_basis'
232 ,p_hook_type => 'AP'
233 );
234 end;
235 --
236 -- When in validation only mode raise the Validate_Enabled exception
237 --
238 if p_validate then
239 raise hr_api.validate_enabled;
240 end if;
241 --
242 -- Set all output arguments
243 --
244 p_object_version_number := l_object_version_number;
245 --
246 hr_utility.set_location(' Leaving:'||l_proc, 70);
247 exception
248 when hr_api.validate_enabled then
249 --
250 -- As the Validate_Enabled exception has been raised
251 -- we must rollback to the savepoint
252 --
253 rollback to update_compl_basis;
254 --
255 -- Only set output warning arguments
256 -- (Any key or derived arguments must be set to null
257 -- when validation only mode is being used.)
258 --
259 -- Reset In/Out Params and SET Out Params
260 p_object_version_number := l_object_version_number;
261 hr_utility.set_location(' Leaving:'||l_proc, 80);
262 when others then
263 --
264 -- A validation or unexpected error has occured
265 --
266 rollback to update_compl_basis;
267 -- Reset In/Out Params and SET Out Params
268 p_object_version_number := l_object_version_number;
269 hr_utility.set_location(' Leaving:'||l_proc, 90);
270 raise;
271
272 end update_compl_basis;
273
274 -- ----------------------------------------------------------------------------
275 -- |-----------------------< delete_compl_basis >-----------------------|
276 -- ----------------------------------------------------------------------------
277 --
278 procedure delete_compl_basis
279 (p_validate in boolean default false
280 ,p_compl_basis_id in number
281 ,p_object_version_number in number
282 ) is
283 --
284 -- Declare cursors and local variables
285 --
286 l_proc varchar2(72) := g_package||'delete_compl_basis';
287 l_exists boolean := false;
288
289 begin
290 hr_utility.set_location('Entering:'|| l_proc, 5);
291 --
292 --
293 savepoint delete_compl_basis;
294 --
295 -- Truncate the time portion from all IN date parameters
296 --
297
298 --
299 -- Call Before Process User Hook
300 --
301 begin
302 ghr_complaint_bases_bk_3.delete_compl_basis_b
303 (p_compl_basis_id => p_compl_basis_id
304 ,p_object_version_number => p_object_version_number
305 );
306 exception
307 when hr_api.cannot_find_prog_unit then
308 hr_api.cannot_find_prog_unit_error
309 (p_module_name => 'delete_compl_basis'
310 ,p_hook_type => 'BP'
311 );
312 end;
313 --
314 -- Validation in addition to Row Handlers
315 -- Process Logic
316 ghr_cba_del.del
317 (p_compl_basis_id => p_compl_basis_id
318 ,p_object_version_number => p_object_version_number
319 );
320 --
321 hr_utility.set_location(l_proc, 8);
322 --
323 -- Call After Process User Hook
324 --
325 begin
326 ghr_complaint_bases_bk_3.delete_compl_basis_a
327 (p_compl_basis_id => p_compl_basis_id
328 ,p_object_version_number => p_object_version_number
329 );
330 exception
331 when hr_api.cannot_find_prog_unit then
332 hr_api.cannot_find_prog_unit_error
333 (p_module_name => 'delete_compl_basis'
334 ,p_hook_type => 'AP'
335 );
336 end;
337 --
338 -- When in validation only mode raise the Validate_Enabled exception
339 --
340 if p_validate then
341 raise hr_api.validate_enabled;
342 end if;
343 --
344 hr_utility.set_location(' Leaving:'||l_proc, 11);
345 exception
346 when hr_api.validate_enabled then
347 -- we must rollback to the savepoint
348 --
349 ROLLBACK TO delete_compl_basis;
350 --
351 When Others then
352 ROLLBACK TO delete_compl_basis;
353 raise;
354
355 hr_utility.set_location(' Leaving:'||l_proc, 12);
356 end delete_compl_basis;
357 end ghr_complaint_bases_api;