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