[Home] [Help]
PACKAGE BODY: APPS.PER_CKL_BUS
Source
1 Package Body per_ckl_bus as
2 /* $Header: pecklrhi.pkb 120.2 2005/11/15 09:02 lsilveir noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_ckl_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_checklist_id number default null;
16 --
17 -- ---------------------------------------------------------------------------
18 -- |----------------------< set_security_group_id >--------------------------|
19 -- ---------------------------------------------------------------------------
20 --
21 Procedure set_security_group_id
22 (p_checklist_id in number
23 ,p_associated_column1 in varchar2 default null
24 ) is
25 --
26 -- Declare cursor
27 --
28 cursor csr_sec_grp is
29 select pbg.security_group_id,
30 pbg.legislation_code
31 from per_business_groups_perf pbg
32 , per_checklists ckl
33 where ckl.checklist_id = p_checklist_id
34 and pbg.business_group_id (+) = ckl.business_group_id;
35 --
36 -- Declare local variables
37 --
38 l_security_group_id number;
39 l_proc varchar2(72) := g_package||'set_security_group_id';
40 l_legislation_code varchar2(150);
41 --
42 begin
43 --
44 hr_utility.set_location('Entering:'|| l_proc, 10);
45 --
46 -- Ensure that all the mandatory parameter are not null
47 --
48 hr_api.mandatory_arg_error
49 (p_api_name => l_proc
50 ,p_argument => 'checklist_id'
51 ,p_argument_value => p_checklist_id
52 );
53 --
54 open csr_sec_grp;
55 fetch csr_sec_grp into l_security_group_id
56 , l_legislation_code;
57 --
58 if csr_sec_grp%notfound then
59 --
60 close csr_sec_grp;
61 --
62 -- The primary key is invalid therefore we must error
63 --
64 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
65 hr_multi_message.add
66 (p_associated_column1
67 => nvl(p_associated_column1,'CHECKLIST_ID')
68 );
69 --
70 else
71 close csr_sec_grp;
72 --
73 -- Set the security_group_id in CLIENT_INFO
74 --
75 hr_api.set_security_group_id
76 (p_security_group_id => l_security_group_id
77 );
78 --
79 -- Set the sessions legislation context in HR_SESSION_DATA
80 --
81 hr_api.set_legislation_context(l_legislation_code);
82 end if;
83 --
84 hr_utility.set_location(' Leaving:'|| l_proc, 20);
85 --
86 end set_security_group_id;
87 --
88 -- ---------------------------------------------------------------------------
89 -- |---------------------< return_legislation_code >-------------------------|
90 -- ---------------------------------------------------------------------------
91 --
92 Function return_legislation_code
93 (p_checklist_id in number
94 )
95 Return Varchar2 Is
96 --
97 -- Declare cursor
98 --
99 cursor csr_leg_code is
100 select pbg.legislation_code
101 from per_business_groups_perf pbg
102 , per_checklists ckl
103 where ckl.checklist_id = p_checklist_id
104 and pbg.business_group_id (+) = ckl.business_group_id;
105 --
106 -- Declare local variables
107 --
108 l_legislation_code varchar2(150);
109 l_proc varchar2(72) := g_package||'return_legislation_code';
110 --
111 Begin
112 --
113 hr_utility.set_location('Entering:'|| l_proc, 10);
114 --
115 -- Ensure that all the mandatory parameter are not null
116 --
117 hr_api.mandatory_arg_error
118 (p_api_name => l_proc
119 ,p_argument => 'checklist_id'
120 ,p_argument_value => p_checklist_id
121 );
122 --
123 if ( nvl(per_ckl_bus.g_checklist_id, hr_api.g_number)
124 = p_checklist_id) then
125 --
126 -- The legislation code has already been found with a previous
127 -- call to this function. Just return the value in the global
128 -- variable.
129 --
130 l_legislation_code := per_ckl_bus.g_legislation_code;
131 hr_utility.set_location(l_proc, 20);
132 else
133 --
134 -- The ID is different to the last call to this function
135 -- or this is the first call to this function.
136 --
137 open csr_leg_code;
138 fetch csr_leg_code into l_legislation_code;
139 --
140 if csr_leg_code%notfound then
141 --
142 -- The primary key is invalid therefore we must error
143 --
144 close csr_leg_code;
145 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
146 fnd_message.raise_error;
147 end if;
148 hr_utility.set_location(l_proc,30);
149 --
150 -- Set the global variables so the values are
151 -- available for the next call to this function.
152 --
153 close csr_leg_code;
154 per_ckl_bus.g_checklist_id := p_checklist_id;
155 per_ckl_bus.g_legislation_code := l_legislation_code;
156 end if;
157 hr_utility.set_location(' Leaving:'|| l_proc, 40);
158 return l_legislation_code;
159 end return_legislation_code;
160 --
161 -- --------------------------------------------------------------------------
162 -- |------------------------< chk_name >------------------------------------|
163 -- --------------------------------------------------------------------------
164 --
165 Procedure chk_name
166 (p_name in per_checklists.name%TYPE
167 ,p_category IN per_checklists.checklist_category%TYPE
168 ,p_business_group_id in per_checklists.business_group_id%TYPE
169 ,p_checklist_id in per_checklists.checklist_id%type
170 ,p_object_version_number in per_checklists.object_version_number%type
171 )
172 is
173 --
174 -- Declare cursor to check name is unique.
175 --
176 cursor csr_unique_name is
177 select null
178 from per_checklists
179 where name = p_name
180 AND checklist_category = p_category
181 and business_group_id = p_business_group_id;
182 --
183 -- Declare local variables
184 --
185 l_exists varchar2(1);
186 l_proc varchar2(72) := g_package||'chk_name';
187 l_api_updating boolean;
188 --
189 begin
190 if g_debug then hr_utility.set_location('Entering:'||l_proc, 1); end if;
191 --
192 -- Only proceed with validation if:
193 -- a) The current g_old_rec is current and
194 -- b) The checklist name value has changed
195 -- c) a record is being inserted
196 --
197 l_api_updating := per_ckl_shd.api_updating
198 (p_checklist_id => p_checklist_id
199 ,p_object_version_number => p_object_version_number
200 );
201
202 IF (l_api_updating
203 and nvl(per_ckl_shd.g_old_rec.name, hr_api.g_varchar2) = nvl(p_name,hr_api.g_varchar2)
204 )
205 THEN
206 RETURN;
207 END IF;
208 --
209 if g_debug then hr_utility.set_location(l_proc, 40); end if;
210 --
211 hr_utility.set_location('Entering: '||l_proc,10);
212 --
213 if p_name is not null then
214 -- Check that name is unique
215 open csr_unique_name;
216 fetch csr_unique_name into l_exists;
217 --
218 if csr_unique_name%FOUND then
219 -- Name is not unique - raise error by calling constraint error
220 close csr_unique_name;
221 --
222 fnd_message.set_name('PER', 'PER_449664_CKL_CKL_NAME_UNQ');
223 fnd_message.set_token('CHECKLIST_NAME', p_name);
224 fnd_message.raise_error;
225 --
226 end if;
227 --
228 close csr_unique_name;
229 else
230 -- Name is null - raise error
231 fnd_message.set_name('PER','PER_449678_CKL_NAME_REQD');
232 fnd_message.raise_error;
233 end if;
234 --
235
236 if g_debug then hr_utility.set_location('Entering:'||l_proc, 50); end if;
237 --
238 exception when app_exception.application_exception then
239 if hr_multi_message.exception_add
240 (p_associated_column1 => 'PER_CHECKLISTS.NAME'
241 ) then
242 hr_utility.set_location(' Leaving:'|| l_proc, 60);
243 raise;
244 end if;
245 hr_utility.set_location(' Leaving:'|| l_proc, 70);
246 end chk_name;
247 --
248 -- ---------------------------------------------------------------------------
249 -- |-------------------------------< chk_ler_id >----------------------------|
250 -- ---------------------------------------------------------------------------
251 --
252 -- Desciption :
253 --
254 -- Validates that LIFE_EVENT_REASON_ID exists in ben_ler_f on the
255 -- effective_date.
256 --
257 --
258 -- Pre-conditions :
259 --
260 --
261 -- In Arguments :
262 -- p_ler_id
263 -- p_person_id
264 -- p_effective_date
265 --
266 -- Post Success :
267 -- Processing continues
268 --
269 -- Post Failure :
270 -- An application error will be raised and processing is
271 -- terminated
272 --
273 -- Access Status :
274 -- Internal Table Handler Use only.
275 --
276 -- {End of Comments}
277 --
278 -- ---------------------------------------------------------------------------
279 procedure chk_ler_id
280 (p_ler_id in per_checklists.event_reason_id%TYPE
281 ,p_business_group_id in per_checklists.business_group_id%TYPE
282 ,p_effective_date in date
283 ) is
284 --
285 -- Declare local variables
286 --
287 l_proc varchar2(72) := g_package||'chk_ler_id';
288 l_dummy number;
289 --
290 -- Declare cursor to check name is unique.
291 --
292 cursor csr_ler_id is
293 select null
294 from ben_ler_f ler
295 where ler.ler_id = p_ler_id
296 and ler.business_group_id = p_business_group_id
297 and p_effective_date between ler.effective_start_date
298 and ler.effective_end_date;
299 --
300 begin
301 hr_utility.set_location('Entering:'||l_proc, 1);
302 --
303 -- Check mandatory ler_id exists if not null
304 --
305 if p_ler_id is not null then
306 open csr_ler_id;
307 fetch csr_ler_id into l_dummy;
308 if csr_ler_id%notfound then
309 close csr_ler_id;
310 fnd_message.set_name('PER','PER_449681_CKL_INV_LIFE_EV_RSN');
311 fnd_message.raise_error;
312 end if;
313 close csr_ler_id;
314
315 end if;
316 --
317 hr_utility.set_location(l_proc, 5);
318 --
319 exception when app_exception.application_exception then
320 if hr_multi_message.exception_add
321 (p_associated_column1 => 'PER_CHECKLISTS.EVENT_REASON_ID'
322 ) then
323 hr_utility.set_location(' Leaving:'|| l_proc, 60);
324 raise;
325 end if;
326 hr_utility.set_location(' Leaving:'|| l_proc, 70);
327 end chk_ler_id;
328 --
329 --
330 -- ---------------------------------------------------------------------------
331 -- |--------------------------< chk_ckl_category >--------------------------|
332 -- ---------------------------------------------------------------------------
333 --
334 procedure chk_ckl_category
335 (p_checklist_id in per_checklists.checklist_id%TYPE,
336 p_ckl_category in per_checklists.checklist_category%TYPE,
337 p_effective_date in date) is
338 --
339 -- Declare local variables
340 --
341 l_proc varchar2(72) := g_package||'chk_ckl_category';
342 --
343 begin
344 hr_utility.set_location('Entering:'|| l_proc, 1);
345 --
346 -- Check mandatory parameters have been set
347 --
348 hr_api.mandatory_arg_error
349 (p_api_name => l_proc
350 ,p_argument => 'effective_date'
351 ,p_argument_value => p_effective_date
352 );
353 --
354 if p_ckl_category is not null then
355 --
356 hr_utility.set_location(l_proc, 5);
357 --
358 -- Only proceed with validation if :
359 -- a) Inserting or
360 -- b) The value for category has changed
361 --
362 if ((p_checklist_id is null) or
363 ((p_checklist_id is not null) and
364 (nvl(per_ckl_shd.g_old_rec.checklist_category,hr_api.g_varchar2) <> nvl(p_ckl_category,hr_api.g_varchar2)))) then
365 --
366 if hr_api.not_exists_in_leg_lookups
367 (p_effective_date => p_effective_date
368 ,p_lookup_type => 'CHECKLIST_CATEGORY'
369 ,p_lookup_code => p_ckl_category
370 )
371 then
372 --
373 fnd_message.set_name('PER','PER_449673_CKL_INV_CKL_CATGRY');
374 fnd_message.raise_error;
375 --
376 end if;
377 end if;
378 end if;
379 --
380 hr_utility.set_location(' Leaving:'|| l_proc, 20);
381
382 exception when app_exception.application_exception then
383 if hr_multi_message.exception_add
384 (p_associated_column1 => 'PER_CHECKLISTS.CHECKLIST_CATEGORY'
385 ) then
386 hr_utility.set_location(' Leaving:'|| l_proc, 60);
387 raise;
388 end if;
389 hr_utility.set_location(' Leaving:'|| l_proc, 70);
390 --
391 end chk_ckl_category;
392 --
393 -- ----------------------------------------------------------------------------
394 -- |-----------------------------< chk_ddf >----------------------------------|
395 -- ----------------------------------------------------------------------------
396 --
397 -- Description:
398 -- Validates all the Developer Descriptive Flexfield values.
399 --
400 -- Prerequisites:
401 -- All other columns have been validated. Must be called as the
402 -- last step from insert_validate and update_validate.
403 --
404 -- In Arguments:
405 -- p_rec
406 --
407 -- Post Success:
408 -- If the Developer Descriptive Flexfield structure column and data values
409 -- are all valid this procedure will end normally and processing will
410 -- continue.
411 --
412 -- Post Failure:
413 -- If the Developer Descriptive Flexfield structure column value or any of
414 -- the data values are invalid then an application error is raised as
415 -- a PL/SQL exception.
416 --
417 -- Access Status:
418 -- Internal Row Handler Use Only.
419 --
420 -- ----------------------------------------------------------------------------
421 procedure chk_ddf
422 (p_rec in per_ckl_shd.g_rec_type
423 ) is
424 --
425 l_proc varchar2(72) := g_package || 'chk_ddf';
426 --
427 begin
428 hr_utility.set_location('Entering:'||l_proc,10);
429 --
430 if ((p_rec.checklist_id is not null) and (
431 nvl(per_ckl_shd.g_old_rec.information_category, hr_api.g_varchar2) <>
432 nvl(p_rec.information_category, hr_api.g_varchar2) or
433 nvl(per_ckl_shd.g_old_rec.information1, hr_api.g_varchar2) <>
434 nvl(p_rec.information1, hr_api.g_varchar2) or
435 nvl(per_ckl_shd.g_old_rec.information2, hr_api.g_varchar2) <>
436 nvl(p_rec.information2, hr_api.g_varchar2) or
437 nvl(per_ckl_shd.g_old_rec.information3, hr_api.g_varchar2) <>
438 nvl(p_rec.information3, hr_api.g_varchar2) or
439 nvl(per_ckl_shd.g_old_rec.information4, hr_api.g_varchar2) <>
440 nvl(p_rec.information4, hr_api.g_varchar2) or
441 nvl(per_ckl_shd.g_old_rec.information5, hr_api.g_varchar2) <>
442 nvl(p_rec.information5, hr_api.g_varchar2) or
443 nvl(per_ckl_shd.g_old_rec.information6, hr_api.g_varchar2) <>
444 nvl(p_rec.information6, hr_api.g_varchar2) or
445 nvl(per_ckl_shd.g_old_rec.information7, hr_api.g_varchar2) <>
446 nvl(p_rec.information7, hr_api.g_varchar2) or
447 nvl(per_ckl_shd.g_old_rec.information8, hr_api.g_varchar2) <>
448 nvl(p_rec.information8, hr_api.g_varchar2) or
449 nvl(per_ckl_shd.g_old_rec.information9, hr_api.g_varchar2) <>
450 nvl(p_rec.information9, hr_api.g_varchar2) or
451 nvl(per_ckl_shd.g_old_rec.information10, hr_api.g_varchar2) <>
452 nvl(p_rec.information10, hr_api.g_varchar2) or
453 nvl(per_ckl_shd.g_old_rec.information11, hr_api.g_varchar2) <>
454 nvl(p_rec.information11, hr_api.g_varchar2) or
455 nvl(per_ckl_shd.g_old_rec.information12, hr_api.g_varchar2) <>
456 nvl(p_rec.information12, hr_api.g_varchar2) or
457 nvl(per_ckl_shd.g_old_rec.information13, hr_api.g_varchar2) <>
458 nvl(p_rec.information13, hr_api.g_varchar2) or
459 nvl(per_ckl_shd.g_old_rec.information14, hr_api.g_varchar2) <>
460 nvl(p_rec.information14, hr_api.g_varchar2) or
461 nvl(per_ckl_shd.g_old_rec.information15, hr_api.g_varchar2) <>
462 nvl(p_rec.information15, hr_api.g_varchar2) or
463 nvl(per_ckl_shd.g_old_rec.information16, hr_api.g_varchar2) <>
464 nvl(p_rec.information16, hr_api.g_varchar2) or
465 nvl(per_ckl_shd.g_old_rec.information17, hr_api.g_varchar2) <>
466 nvl(p_rec.information17, hr_api.g_varchar2) or
467 nvl(per_ckl_shd.g_old_rec.information18, hr_api.g_varchar2) <>
468 nvl(p_rec.information18, hr_api.g_varchar2) or
469 nvl(per_ckl_shd.g_old_rec.information19, hr_api.g_varchar2) <>
470 nvl(p_rec.information19, hr_api.g_varchar2) or
471 nvl(per_ckl_shd.g_old_rec.information20, hr_api.g_varchar2) <>
472 nvl(p_rec.information20, hr_api.g_varchar2) ))
473 or (p_rec.checklist_id is null) then
474 --
475 -- Only execute the validation if absolutely necessary:
476 -- a) During update, the structure column value or any
477 -- of the attribute values have actually changed.
478 -- b) During insert.
479 --
480 hr_dflex_utility.ins_or_upd_descflex_attribs
481 (p_appl_short_name => 'PER'
482 ,p_descflex_name => 'EDIT_HERE: Enter descflex name'
483 ,p_attribute_category => p_rec.information_category
484 ,p_attribute1_name => 'INFORMATION1'
485 ,p_attribute1_value => p_rec.information1
486 ,p_attribute2_name => 'INFORMATION2'
487 ,p_attribute2_value => p_rec.information2
488 ,p_attribute3_name => 'INFORMATION3'
489 ,p_attribute3_value => p_rec.information3
490 ,p_attribute4_name => 'INFORMATION4'
491 ,p_attribute4_value => p_rec.information4
492 ,p_attribute5_name => 'INFORMATION5'
493 ,p_attribute5_value => p_rec.information5
494 ,p_attribute6_name => 'INFORMATION6'
495 ,p_attribute6_value => p_rec.information6
496 ,p_attribute7_name => 'INFORMATION7'
497 ,p_attribute7_value => p_rec.information7
498 ,p_attribute8_name => 'INFORMATION8'
499 ,p_attribute8_value => p_rec.information8
500 ,p_attribute9_name => 'INFORMATION9'
501 ,p_attribute9_value => p_rec.information9
502 ,p_attribute10_name => 'INFORMATION10'
503 ,p_attribute10_value => p_rec.information10
504 ,p_attribute11_name => 'INFORMATION11'
505 ,p_attribute11_value => p_rec.information11
506 ,p_attribute12_name => 'INFORMATION12'
507 ,p_attribute12_value => p_rec.information12
508 ,p_attribute13_name => 'INFORMATION13'
509 ,p_attribute13_value => p_rec.information13
510 ,p_attribute14_name => 'INFORMATION14'
511 ,p_attribute14_value => p_rec.information14
512 ,p_attribute15_name => 'INFORMATION15'
513 ,p_attribute15_value => p_rec.information15
514 ,p_attribute16_name => 'INFORMATION16'
515 ,p_attribute16_value => p_rec.information16
516 ,p_attribute17_name => 'INFORMATION17'
517 ,p_attribute17_value => p_rec.information17
518 ,p_attribute18_name => 'INFORMATION18'
519 ,p_attribute18_value => p_rec.information18
520 ,p_attribute19_name => 'INFORMATION19'
521 ,p_attribute19_value => p_rec.information19
522 ,p_attribute20_name => 'INFORMATION20'
523 ,p_attribute20_value => p_rec.information20
524 );
525 end if;
526 --
527 hr_utility.set_location(' Leaving:'||l_proc,20);
528 end chk_ddf;
529 --
530 -- ----------------------------------------------------------------------------
531 -- |------------------------------< chk_df >----------------------------------|
532 -- ----------------------------------------------------------------------------
533 --
534 -- Description:
535 -- Validates all the Descriptive Flexfield values.
536 --
537 -- Prerequisites:
538 -- All other columns have been validated. Must be called as the
539 -- last step from insert_validate and update_validate.
540 --
541 -- In Arguments:
542 -- p_rec
543 --
544 -- Post Success:
545 -- If the Descriptive Flexfield structure column and data values are
546 -- all valid this procedure will end normally and processing will
547 -- continue.
548 --
549 -- Post Failure:
550 -- If the Descriptive Flexfield structure column value or any of
551 -- the data values are invalid then an application error is raised as
552 -- a PL/SQL exception.
553 --
554 -- Access Status:
555 -- Internal Row Handler Use Only.
556 --
557 -- ----------------------------------------------------------------------------
558 procedure chk_df
559 (p_rec in per_ckl_shd.g_rec_type
560 ) is
561 --
562 l_proc varchar2(72) := g_package || 'chk_df';
563 --
564 begin
565 hr_utility.set_location('Entering:'||l_proc,10);
566 --
567 if ((p_rec.checklist_id is not null) and (
568 nvl(per_ckl_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
569 nvl(p_rec.attribute_category, hr_api.g_varchar2) or
570 nvl(per_ckl_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
571 nvl(p_rec.attribute1, hr_api.g_varchar2) or
572 nvl(per_ckl_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
573 nvl(p_rec.attribute2, hr_api.g_varchar2) or
574 nvl(per_ckl_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
575 nvl(p_rec.attribute3, hr_api.g_varchar2) or
576 nvl(per_ckl_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
577 nvl(p_rec.attribute4, hr_api.g_varchar2) or
578 nvl(per_ckl_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
579 nvl(p_rec.attribute5, hr_api.g_varchar2) or
580 nvl(per_ckl_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
581 nvl(p_rec.attribute6, hr_api.g_varchar2) or
582 nvl(per_ckl_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
583 nvl(p_rec.attribute7, hr_api.g_varchar2) or
584 nvl(per_ckl_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
585 nvl(p_rec.attribute8, hr_api.g_varchar2) or
586 nvl(per_ckl_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
587 nvl(p_rec.attribute9, hr_api.g_varchar2) or
588 nvl(per_ckl_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
589 nvl(p_rec.attribute10, hr_api.g_varchar2) or
590 nvl(per_ckl_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
591 nvl(p_rec.attribute11, hr_api.g_varchar2) or
592 nvl(per_ckl_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
593 nvl(p_rec.attribute12, hr_api.g_varchar2) or
594 nvl(per_ckl_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
595 nvl(p_rec.attribute13, hr_api.g_varchar2) or
596 nvl(per_ckl_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
597 nvl(p_rec.attribute14, hr_api.g_varchar2) or
598 nvl(per_ckl_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
599 nvl(p_rec.attribute15, hr_api.g_varchar2) or
600 nvl(per_ckl_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
601 nvl(p_rec.attribute16, hr_api.g_varchar2) or
602 nvl(per_ckl_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
603 nvl(p_rec.attribute17, hr_api.g_varchar2) or
604 nvl(per_ckl_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
605 nvl(p_rec.attribute18, hr_api.g_varchar2) or
606 nvl(per_ckl_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
607 nvl(p_rec.attribute19, hr_api.g_varchar2) or
608 nvl(per_ckl_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
609 nvl(p_rec.attribute20, hr_api.g_varchar2) ))
610 or (p_rec.checklist_id is null) then
611 --
612 -- Only execute the validation if absolutely necessary:
613 -- a) During update, the structure column value or any
614 -- of the attribute values have actually changed.
615 -- b) During insert.
616 --
617 hr_dflex_utility.ins_or_upd_descflex_attribs
618 (p_appl_short_name => 'PER'
619 ,p_descflex_name => 'EDIT_HERE: Enter descflex name'
620 ,p_attribute_category => p_rec.attribute_category
621 ,p_attribute1_name => 'ATTRIBUTE1'
622 ,p_attribute1_value => p_rec.attribute1
623 ,p_attribute2_name => 'ATTRIBUTE2'
624 ,p_attribute2_value => p_rec.attribute2
625 ,p_attribute3_name => 'ATTRIBUTE3'
626 ,p_attribute3_value => p_rec.attribute3
627 ,p_attribute4_name => 'ATTRIBUTE4'
628 ,p_attribute4_value => p_rec.attribute4
629 ,p_attribute5_name => 'ATTRIBUTE5'
630 ,p_attribute5_value => p_rec.attribute5
631 ,p_attribute6_name => 'ATTRIBUTE6'
632 ,p_attribute6_value => p_rec.attribute6
633 ,p_attribute7_name => 'ATTRIBUTE7'
634 ,p_attribute7_value => p_rec.attribute7
635 ,p_attribute8_name => 'ATTRIBUTE8'
636 ,p_attribute8_value => p_rec.attribute8
637 ,p_attribute9_name => 'ATTRIBUTE9'
638 ,p_attribute9_value => p_rec.attribute9
639 ,p_attribute10_name => 'ATTRIBUTE10'
640 ,p_attribute10_value => p_rec.attribute10
641 ,p_attribute11_name => 'ATTRIBUTE11'
642 ,p_attribute11_value => p_rec.attribute11
643 ,p_attribute12_name => 'ATTRIBUTE12'
644 ,p_attribute12_value => p_rec.attribute12
645 ,p_attribute13_name => 'ATTRIBUTE13'
646 ,p_attribute13_value => p_rec.attribute13
647 ,p_attribute14_name => 'ATTRIBUTE14'
648 ,p_attribute14_value => p_rec.attribute14
649 ,p_attribute15_name => 'ATTRIBUTE15'
650 ,p_attribute15_value => p_rec.attribute15
651 ,p_attribute16_name => 'ATTRIBUTE16'
652 ,p_attribute16_value => p_rec.attribute16
653 ,p_attribute17_name => 'ATTRIBUTE17'
654 ,p_attribute17_value => p_rec.attribute17
655 ,p_attribute18_name => 'ATTRIBUTE18'
656 ,p_attribute18_value => p_rec.attribute18
657 ,p_attribute19_name => 'ATTRIBUTE19'
658 ,p_attribute19_value => p_rec.attribute19
659 ,p_attribute20_name => 'ATTRIBUTE20'
660 ,p_attribute20_value => p_rec.attribute20
661 );
662 end if;
663 --
664 hr_utility.set_location(' Leaving:'||l_proc,20);
665 end chk_df;
666 --
667 -- ----------------------------------------------------------------------------
668 -- |-----------------------< chk_non_updateable_args >------------------------|
669 -- ----------------------------------------------------------------------------
670 -- {Start Of Comments}
671 --
672 -- Description:
673 -- This procedure is used to ensure that non updateable attributes have
674 -- not been updated. If an attribute has been updated an error is generated.
675 --
676 -- Pre Conditions:
677 -- g_old_rec has been populated with details of the values currently in
678 -- the database.
679 --
680 -- In Arguments:
681 -- p_rec has been populated with the updated values the user would like the
682 -- record set to.
683 --
684 -- Post Success:
685 -- Processing continues if all the non updateable attributes have not
686 -- changed.
687 --
688 -- Post Failure:
689 -- An application error is raised if any of the non updatable attributes
690 -- have been altered.
691 --
692 -- {End Of Comments}
693 -- ----------------------------------------------------------------------------
694 Procedure chk_non_updateable_args
695 (p_effective_date in date
696 ,p_rec in per_ckl_shd.g_rec_type
697 ) IS
698 --
699 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
700 --
701 Begin
702 --
703 -- Only proceed with the validation if a row exists for the current
704 -- record in the HR Schema.
705 --
706 IF NOT per_ckl_shd.api_updating
707 (p_checklist_id => p_rec.checklist_id
708 ,p_object_version_number => p_rec.object_version_number
709 ) THEN
710 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
711 fnd_message.set_token('PROCEDURE ', l_proc);
712 fnd_message.set_token('STEP ', '5');
713 fnd_message.raise_error;
714 END IF;
715 --
716 -- EDIT_HERE: Add checks to ensure non-updateable args have
717 -- not been updated.
718 --
719 End chk_non_updateable_args;
720 --
721 -- ----------------------------------------------------------------------------
722 -- |---------------------------< insert_validate >----------------------------|
723 -- ----------------------------------------------------------------------------
724 Procedure insert_validate
725 (p_effective_date in date
726 ,p_rec in per_ckl_shd.g_rec_type
727 ) is
728 --
729 l_proc varchar2(72) := g_package||'insert_validate';
730 --
731 Begin
732 hr_utility.set_location('Entering:'||l_proc, 5);
733 --
734 -- Call all supporting business operations
735 --
736 hr_api.validate_bus_grp_id
737 (p_business_group_id => p_rec.business_group_id
738 ,p_associated_column1 => per_ckl_shd.g_tab_nam
739 || '.BUSINESS_GROUP_ID');
740 --
741 per_ckl_bus.chk_name
742 (p_name => p_rec.name
743 ,p_category => p_rec.checklist_category
744 ,p_business_group_id => p_rec.business_group_id
745 ,p_checklist_id => p_rec.checklist_id
746 ,p_object_version_number => p_rec.object_version_number
747 );
748 --
749 per_ckl_bus.chk_ler_id
750 (p_ler_id => p_rec.event_reason_id
751 ,p_business_group_id => p_rec.business_group_id
752 ,p_effective_date => p_effective_date
753 );
754 --
755 per_ckl_bus.chk_ckl_category
756 (p_checklist_id => p_rec.checklist_id,
757 p_ckl_category => p_rec.checklist_category,
758 p_effective_date => p_effective_date
759 );
760 --
761 -- After validating the set of important attributes,
762 -- if Multiple Message detection is enabled and at least
763 -- one error has been found then abort further validation.
764 --
765 hr_multi_message.end_validation_set;
766 --
767 -- Validate Dependent Attributes
768 --
769 --
770 /* per_ckl_bus.chk_ddf(p_rec);
771 --
772 per_ckl_bus.chk_df(p_rec);
773 */ --
774 hr_utility.set_location(' Leaving:'||l_proc, 10);
775 End insert_validate;
776 --
777 -- ----------------------------------------------------------------------------
778 -- |---------------------------< update_validate >----------------------------|
779 -- ----------------------------------------------------------------------------
780 Procedure update_validate
781 (p_effective_date in date
782 ,p_rec in per_ckl_shd.g_rec_type
783 ) is
784 --
785 l_proc varchar2(72) := g_package||'update_validate';
786 --
787 Begin
788 hr_utility.set_location('Entering:'||l_proc, 5);
789 --
790 -- Call all supporting business operations
791 --
792 hr_api.validate_bus_grp_id
793 (p_business_group_id => p_rec.business_group_id
794 ,p_associated_column1 => per_ckl_shd.g_tab_nam
795 || '.BUSINESS_GROUP_ID');
796 --
797 --
798 per_ckl_bus.chk_name
799 (p_name => p_rec.name
800 ,p_category => p_rec.checklist_category
801 ,p_business_group_id => p_rec.business_group_id
802 ,p_checklist_id => p_rec.checklist_id
803 ,p_object_version_number => p_rec.object_version_number
804 );
805 --
806 per_ckl_bus.chk_ler_id
807 (p_ler_id => p_rec.event_reason_id
808 ,p_business_group_id => p_rec.business_group_id
809 ,p_effective_date => p_effective_date
810 );
811 --
812 per_ckl_bus.chk_ckl_category
813 (p_checklist_id => p_rec.checklist_id,
814 p_ckl_category => p_rec.checklist_category,
815 p_effective_date => p_effective_date
816 );
817 --
818 -- After validating the set of important attributes,
819 -- if Multiple Message detection is enabled and at least
820 -- one error has been found then abort further validation.
821 --
822 hr_multi_message.end_validation_set;
823 --
824 -- Validate Dependent Attributes
825 --
826 chk_non_updateable_args
827 (p_effective_date => p_effective_date
828 ,p_rec => p_rec
829 );
830 --
831 --
832 /*
833 per_ckl_bus.chk_ddf(p_rec);
834 --
835 per_ckl_bus.chk_df(p_rec);
836 */
837 --
838 hr_utility.set_location(' Leaving:'||l_proc, 10);
839 End update_validate;
840 --
841 -- ----------------------------------------------------------------------------
842 -- |---------------------------< delete_validate >----------------------------|
843 -- ----------------------------------------------------------------------------
844 Procedure delete_validate
845 (p_rec in per_ckl_shd.g_rec_type
846 ) is
847 --
848 l_proc varchar2(72) := g_package||'delete_validate';
849 --
850 Begin
851 hr_utility.set_location('Entering:'||l_proc, 5);
852 --
853 -- Call all supporting business operations
854 --
855 hr_utility.set_location(' Leaving:'||l_proc, 10);
856 End delete_validate;
857 --
858 end per_ckl_bus;