[Home] [Help]
PACKAGE BODY: APPS.IRC_IID_BUS
Source
1 Package Body irc_iid_bus as
2 /* $Header: iriidrhi.pkb 120.3.12010000.2 2008/11/06 13:49:47 mkjayara ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' irc_iid_bus.'; -- Global package name
9 --
10 -- ---------------------------------------------------------------------------
11 -- |----------------------< chk_delete >--------------------------|
12 -- ---------------------------------------------------------------------------
13 --
14 -- {sTARt Of Comments}
15 --
16 -- Description:
17 -- check that 1. No attribute Usages exist
18 -- 2. Attribute is not an existing Mandatory or Required attribute
19 --
20 -- Prerequisites:
21 -- None.
22 --
23 -- In Parameters:
24 -- p_interview_details_id
25 -- p_object_version_number
26 -- p_effective_date
27 --
28 -- Post Success:
29 -- Processing continues.
30 --
31 -- Post Failure:
32 -- Log the error message.
33 --
34 -- Developer Implementation Notes:
35 -- None.
36 --
37 -- Access Status:
38 -- Internal Row Handler Use Only.
39 --
40 -- {End Of Comments}
41 -- ----------------------------------------------------------------------------
42 procedure chk_delete
43 (p_interview_details_id in number,
44 p_object_version_number in number,
45 p_effective_date in date) is
46 l_proc varchar2(72) := g_package||'chk_delete';
47 begin
48 null;
49 exception
50 when app_exception.application_exception then
51 if hr_multi_message.exception_add
52 (p_associated_column1 => 'ATTRIBUTE_ID') then
53 hr_utility.set_location(' Leaving:'|| l_proc, 50);
54 raise;
55 end if;
56 hr_utility.set_location(' Leaving:'|| l_proc, 60);
57 end chk_delete;
58 --
59 -- ----------------------------------------------------------------------------
60 -- |------------------------------< chk_ddf >----------------------------------|
61 -- ----------------------------------------------------------------------------
62 --
63 -- Description:
64 -- Validates all the Descriptive Flexfield values.
65 --
66 -- Prerequisites:
67 -- All other columns have been validated. Must be called as the
68 -- last step from insert_validate and update_validate.
69 --
70 -- In Arguments:
71 -- p_rec
72 --
73 -- Post Success:
74 -- If the Descriptive Flexfield structure column and data values are
75 -- all valid this procedure will end normally and processing will
76 -- continue.
77 --
78 -- Post Failure:
79 -- If the Descriptive Flexfield structure column value or any of
80 -- the data values are invalid then an application error is raised as
81 -- a PL/SQL exception.
82 --
83 -- Access Status:
84 -- Internal Row Handler Use Only.
85 --
86 -- ----------------------------------------------------------------------------
87 procedure chk_ddf
88 (p_rec in irc_iid_shd.g_rec_type
89 ) is
90 --
91 l_proc varchar2(72) := g_package || 'chk_ddf';
92 --
93 begin
94 hr_utility.set_location('Entering:'||l_proc,10);
95 --
96 if ((p_rec.interview_details_id is not null) and (
97 nvl(irc_iid_shd.g_old_rec.iid_information_category, hr_api.g_varchar2) <>
98 nvl(p_rec.iid_information_category, hr_api.g_varchar2) or
99 nvl(irc_iid_shd.g_old_rec.iid_information1, hr_api.g_varchar2) <>
100 nvl(p_rec.iid_information1, hr_api.g_varchar2) or
101 nvl(irc_iid_shd.g_old_rec.iid_information2, hr_api.g_varchar2) <>
102 nvl(p_rec.iid_information2, hr_api.g_varchar2) or
103 nvl(irc_iid_shd.g_old_rec.iid_information3, hr_api.g_varchar2) <>
104 nvl(p_rec.iid_information3, hr_api.g_varchar2) or
105 nvl(irc_iid_shd.g_old_rec.iid_information4, hr_api.g_varchar2) <>
106 nvl(p_rec.iid_information4, hr_api.g_varchar2) or
107 nvl(irc_iid_shd.g_old_rec.iid_information5, hr_api.g_varchar2) <>
108 nvl(p_rec.iid_information5, hr_api.g_varchar2) or
109 nvl(irc_iid_shd.g_old_rec.iid_information6, hr_api.g_varchar2) <>
110 nvl(p_rec.iid_information6, hr_api.g_varchar2) or
111 nvl(irc_iid_shd.g_old_rec.iid_information7, hr_api.g_varchar2) <>
112 nvl(p_rec.iid_information7, hr_api.g_varchar2) or
113 nvl(irc_iid_shd.g_old_rec.iid_information8, hr_api.g_varchar2) <>
114 nvl(p_rec.iid_information8, hr_api.g_varchar2) or
115 nvl(irc_iid_shd.g_old_rec.iid_information9, hr_api.g_varchar2) <>
116 nvl(p_rec.iid_information9, hr_api.g_varchar2) or
117 nvl(irc_iid_shd.g_old_rec.iid_information10, hr_api.g_varchar2) <>
118 nvl(p_rec.iid_information10, hr_api.g_varchar2) or
119 nvl(irc_iid_shd.g_old_rec.iid_information11, hr_api.g_varchar2) <>
120 nvl(p_rec.iid_information11, hr_api.g_varchar2) or
121 nvl(irc_iid_shd.g_old_rec.iid_information12, hr_api.g_varchar2) <>
122 nvl(p_rec.iid_information12, hr_api.g_varchar2) or
123 nvl(irc_iid_shd.g_old_rec.iid_information13, hr_api.g_varchar2) <>
124 nvl(p_rec.iid_information13, hr_api.g_varchar2) or
125 nvl(irc_iid_shd.g_old_rec.iid_information14, hr_api.g_varchar2) <>
126 nvl(p_rec.iid_information14, hr_api.g_varchar2) or
127 nvl(irc_iid_shd.g_old_rec.iid_information15, hr_api.g_varchar2) <>
128 nvl(p_rec.iid_information15, hr_api.g_varchar2) or
129 nvl(irc_iid_shd.g_old_rec.iid_information16, hr_api.g_varchar2) <>
130 nvl(p_rec.iid_information16, hr_api.g_varchar2) or
131 nvl(irc_iid_shd.g_old_rec.iid_information17, hr_api.g_varchar2) <>
132 nvl(p_rec.iid_information17, hr_api.g_varchar2) or
133 nvl(irc_iid_shd.g_old_rec.iid_information18, hr_api.g_varchar2) <>
134 nvl(p_rec.iid_information18, hr_api.g_varchar2) or
135 nvl(irc_iid_shd.g_old_rec.iid_information19, hr_api.g_varchar2) <>
136 nvl(p_rec.iid_information19, hr_api.g_varchar2) or
137 nvl(irc_iid_shd.g_old_rec.iid_information20, hr_api.g_varchar2) <>
138 nvl(p_rec.iid_information20, hr_api.g_varchar2) ))
139 or (p_rec.event_id is null) then
140 --
141 -- Only execute the validation if absolutely necessary:
142 -- a) During update, the structure column value or any
143 -- of the iid_information values have actually changed.
144 -- b) During insert.
145 --
146 hr_dflex_utility.ins_or_upd_descflex_attribs
147 (p_appl_short_name => 'PER'
148 ,p_descflex_name => 'PER_EVENTS'
149 ,p_attribute_category => p_rec.iid_information_category
150 ,p_attribute1_name => 'iid_information1'
151 ,p_attribute1_value => p_rec.iid_information1
152 ,p_attribute2_name => 'iid_information2'
153 ,p_attribute2_value => p_rec.iid_information2
154 ,p_attribute3_name => 'iid_information3'
155 ,p_attribute3_value => p_rec.iid_information3
156 ,p_attribute4_name => 'iid_information4'
157 ,p_attribute4_value => p_rec.iid_information4
158 ,p_attribute5_name => 'iid_information5'
159 ,p_attribute5_value => p_rec.iid_information5
160 ,p_attribute6_name => 'iid_information6'
161 ,p_attribute6_value => p_rec.iid_information6
162 ,p_attribute7_name => 'iid_information7'
163 ,p_attribute7_value => p_rec.iid_information7
164 ,p_attribute8_name => 'iid_information8'
165 ,p_attribute8_value => p_rec.iid_information8
166 ,p_attribute9_name => 'iid_information9'
167 ,p_attribute9_value => p_rec.iid_information9
168 ,p_attribute10_name => 'iid_information10'
169 ,p_attribute10_value => p_rec.iid_information10
170 ,p_attribute11_name => 'iid_information11'
171 ,p_attribute11_value => p_rec.iid_information11
172 ,p_attribute12_name => 'iid_information12'
173 ,p_attribute12_value => p_rec.iid_information12
174 ,p_attribute13_name => 'iid_information13'
175 ,p_attribute13_value => p_rec.iid_information13
176 ,p_attribute14_name => 'iid_information14'
177 ,p_attribute14_value => p_rec.iid_information14
178 ,p_attribute15_name => 'iid_information15'
179 ,p_attribute15_value => p_rec.iid_information15
180 ,p_attribute16_name => 'iid_information16'
181 ,p_attribute16_value => p_rec.iid_information16
182 ,p_attribute17_name => 'iid_information17'
183 ,p_attribute17_value => p_rec.iid_information17
184 ,p_attribute18_name => 'iid_information18'
185 ,p_attribute18_value => p_rec.iid_information18
186 ,p_attribute19_name => 'iid_information19'
187 ,p_attribute19_value => p_rec.iid_information19
188 ,p_attribute20_name => 'iid_information20'
189 ,p_attribute20_value => p_rec.iid_information20
190 );
191 end if;
192 --
193 hr_utility.set_location(' Leaving:'||l_proc,20);
194 end chk_ddf;
195 --
196 -- ----------------------------------------------------------------------------
197 -- |-----------------------< chk_non_updateable_args >------------------------|
198 -- ----------------------------------------------------------------------------
199 -- {Start Of Comments}
200 --
201 -- Description:
202 -- This procedure is used to ensure that non updateable attributes have
203 -- not been updated. If an attribute has been updated an error is generated.
204 --
205 -- Pre Conditions:
206 -- g_old_rec has been populated with details of the values currently in
207 -- the database.
208 --
209 -- In Arguments:
210 -- p_rec has been populated with the updated values the user would like the
211 -- record set to.
212 --
213 -- Post Success:
214 -- Processing continues if all the non updateable attributes have not
215 -- changed.
216 --
217 -- Post Failure:
218 -- An application error is raised if any of the non updatable attributes
219 -- have been altered.
220 --
221 -- {End Of Comments}
222 -- ----------------------------------------------------------------------------
223 Procedure chk_non_updateable_args
224 (p_effective_date in date
225 ,p_rec in irc_iid_shd.g_rec_type
226 ) IS
227 --
228 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
229 --
230 Begin
231 --
232 hr_utility.set_location(' Leaving:'||l_proc,10);
233 --
234 -- Only proceed with the validation if a row exists for the current
235 -- record in the HR Schema.
236 --
237 IF NOT irc_iid_shd.api_updating
238 (p_effective_date => p_effective_date
239 ,p_interview_details_id => p_rec.interview_details_id
240 ,p_object_version_number => p_rec.object_version_number
241 ) THEN
242 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
243 fnd_message.set_token('PROCEDURE ', l_proc);
244 fnd_message.set_token('STEP ', '5');
245 fnd_message.raise_error;
246 END IF;
247 --
248 -- Add checks to ensure non-updateable args have
249 -- not been updated.
250 --
251 if p_rec.event_id <> irc_iid_shd.g_old_rec.event_id
252 then
253 hr_api.argument_changed_error
254 (p_api_name => l_proc
255 ,p_argument => 'EVENT_ID'
256 ,p_base_table => irc_iid_shd.g_tab_name
257 );
258 end if;
259 --
260 hr_utility.set_location(' Leaving:'||l_proc,20);
261 End chk_non_updateable_args;
262 --
263 -- ----------------------------------------------------------------------------
264 -- |--------------------------< dt_update_validate >--------------------------|
265 -- ----------------------------------------------------------------------------
266 -- {Start Of Comments}
267 --
268 -- Description:
269 -- This procedure is used for referential integrity of datetracked
270 -- parent entities when a datetrack update operation is taking place
271 -- and where there is no cascading of update defined for this entity.
272 --
273 -- Prerequisites:
274 -- This procedure is called from the update_validate.
275 --
276 -- In Parameters:
277 --
278 -- Post Success:
279 -- Processing continues.
280 --
281 -- Post Failure:
282 --
283 -- Developer Implementation Notes:
284 -- This procedure should not need maintenance unless the HR Schema model
285 -- changes.
286 --
287 -- Access Status:
288 -- Internal Row Handler Use Only.
289 --
290 -- {End Of Comments}
291 -- ----------------------------------------------------------------------------
292 Procedure dt_update_validate
293 (p_datetrack_mode in varchar2
294 ,p_validation_start_date in date
295 ,p_validation_end_date in date
296 ) Is
297 --
298 l_proc varchar2(72) := g_package||'dt_update_validate';
299 --
300 Begin
301 --
302 -- Ensure that the p_datetrack_mode argument is not null
303 --
304 hr_api.mandatory_arg_error
305 (p_api_name => l_proc
306 ,p_argument => 'datetrack_mode'
307 ,p_argument_value => p_datetrack_mode
308 );
309 --
310 -- Mode will be valid, as this is checked at the start of the upd.
311 --
312 -- Ensure the arguments are not null
313 --
314 hr_api.mandatory_arg_error
315 (p_api_name => l_proc
316 ,p_argument => 'validation_start_date'
317 ,p_argument_value => p_validation_start_date
318 );
319 --
320 /*hr_api.mandatory_arg_error
321 (p_api_name => l_proc
322 ,p_argument => 'validation_end_date'
323 ,p_argument_value => p_validation_end_date
324 );*/
325 --
326 Exception
327 When Others Then
328 --
329 -- An unhandled or unexpected error has occurred which
330 -- we must report
331 --
332 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
333 fnd_message.set_token('PROCEDURE', l_proc);
334 fnd_message.set_token('STEP','15');
335 fnd_message.raise_error;
336 End dt_update_validate;
337 --
338 -- ----------------------------------------------------------------------------
339 -- |--------------------------< dt_delete_validate >--------------------------|
340 -- ----------------------------------------------------------------------------
341 -- {Start Of Comments}
342 --
343 -- Description:
344 -- This procedure is used for referential integrity of datetracked
345 -- child entities when either a datetrack DELETE or ZAP is in operation
346 -- and where there is no cascading of delete defined for this entity.
347 -- For the datetrack mode of DELETE or ZAP we must ensure that no
348 -- datetracked child rows exist between the validation start and end
349 -- dates.
350 --
351 -- Prerequisites:
352 -- This procedure is called from the delete_validate.
353 --
354 -- In Parameters:
355 --
356 -- Post Success:
357 -- Processing continues.
358 --
359 -- Post Failure:
360 -- If a row exists by determining the returning Boolean value from the
361 -- generic dt_api.rows_exist function then we must supply an error via
362 -- the use of the local exception handler l_rows_exist.
363 --
364 -- Developer Implementation Notes:
365 -- This procedure should not need maintenance unless the HR Schema model
366 -- changes.
367 --
368 -- Access Status:
369 -- Internal Row Handler Use Only.
370 --
371 -- {End Of Comments}
372 -- ----------------------------------------------------------------------------
373 Procedure dt_delete_validate
374 (p_interview_details_id in number
375 ,p_datetrack_mode in varchar2
376 ,p_validation_start_date in date
377 ,p_validation_end_date in date
378 ) Is
379 --
380 l_proc varchar2(72) := g_package||'dt_delete_validate';
381 --
382 Begin
383 --
384 -- Ensure that the p_datetrack_mode argument is not null
385 --
386 hr_api.mandatory_arg_error
387 (p_api_name => l_proc
388 ,p_argument => 'datetrack_mode'
389 ,p_argument_value => p_datetrack_mode
390 );
391 --
392 -- Only perform the validation if the datetrack mode is either
393 -- DELETE or ZAP
394 --
395 If (p_datetrack_mode = hr_api.g_delete or
396 p_datetrack_mode = hr_api.g_zap) then
397 --
398 --
399 -- Ensure the arguments are not null
400 --
401 hr_api.mandatory_arg_error
402 (p_api_name => l_proc
403 ,p_argument => 'validation_start_date'
404 ,p_argument_value => p_validation_start_date
405 );
406 --
407 /*hr_api.mandatory_arg_error
408 (p_api_name => l_proc
409 ,p_argument => 'validation_end_date'
410 ,p_argument_value => p_validation_end_date
411 );*/
412 --
413 hr_api.mandatory_arg_error
414 (p_api_name => l_proc
415 ,p_argument => 'interview_details_id'
416 ,p_argument_value => p_interview_details_id
417 );
418 --
419 --
420 --
421 End If;
422 --
423 Exception
424 When Others Then
425 --
426 -- An unhandled or unexpected error has occurred which
427 -- we must report
428 --
429 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
430 fnd_message.set_token('PROCEDURE', l_proc);
431 fnd_message.set_token('STEP','15');
432 fnd_message.raise_error;
433 --
434 End dt_delete_validate;
435
436 --
437 -- ----------------------------------------------------------------------------
438 -- |---------------------------< chk_status >---------------------------------|
439 -- ----------------------------------------------------------------------------
440 Procedure chk_status
441 (p_rec in irc_iid_shd.g_rec_type
442 ,p_effective_date in date
443 ) is
444 --
445 l_proc varchar2(72) := g_package||'chk_status';
446 l_not_exists boolean;
447 Begin
448 hr_utility.set_location('Entering:'||l_proc, 5);
449 --
450 l_not_exists := hr_api.not_exists_in_hr_lookups
451 (p_effective_date
452 ,'IRC_INTERVIEW_STATUS'
453 ,p_rec.status
454 );
455 hr_utility.set_location(l_proc, 10);
456 if (l_not_exists = true) then
457 -- RAISE ERROR SAYING THAT THE STATUS IS INVALID
458 fnd_message.set_name('PER','IRC_412471_INV_INT_STATUS');
459 fnd_message.raise_error;
460 end if;
461 hr_utility.set_location('leaving:'||l_proc, 15);
465 -- ----------------------------------------------------------------------------
462 end chk_status;
463 --
464 --
466 -- |---------------------------< chk_result >---------------------------------|
467 -- ----------------------------------------------------------------------------
468 Procedure chk_result
469 (p_rec in irc_iid_shd.g_rec_type
470 ,p_effective_date in date
471 ) is
472 --
473 l_proc varchar2(72) := g_package||'chk_result';
474 l_not_exists boolean;
475 --
476 Begin
477 hr_utility.set_location('Entering:'||l_proc, 5);
478 --
479 l_not_exists := hr_api.not_exists_in_hr_lookups
480 (p_effective_date
481 ,'IRC_INTERVIEW_RESULTS'
482 ,p_rec.result
483 );
484 hr_utility.set_location(l_proc, 10);
485 if (l_not_exists = true) then
486 -- RAISE ERROR SAYING INVALID RESULT
487 fnd_message.set_name('PER','IRC_412472_INV_INT_RESULT');
488 fnd_message.raise_error;
489 end if;
490 hr_utility.set_location('leaving:'||l_proc, 15);
491 end chk_result;
492 --
493 ---- ----------------------------------------------------------------------------
494 -- |---------------------------< chk_completed >--------------------------------|
495 -- ----------------------------------------------------------------------------
496 Procedure chk_completed
497 (p_rec in irc_iid_shd.g_rec_type
498 ,p_effective_date in date
499 ) is
500 --
501 l_proc varchar2(72) := g_package||'chk_completed';
502 l_result_not_eists boolean;
503 --
504 Begin
505 hr_utility.set_location('Entering:'||l_proc, 5);
506 --
507 if p_rec.status = 'COMPLETED' then
508 if p_rec.feedback is null then
509 -- raise error saying feedback is mandatory when status is complete
510 fnd_message.set_name('PER','IRC_412473_INT_FDBK_MANDATORY');
511 fnd_message.raise_error;
512 end if;
513 if p_rec.result is null then
514 -- raise error saying result is mandatory when status is complete
515 fnd_message.set_name('PER','IRC_412474_INT_RSLT_MANDATORY');
516 fnd_message.raise_error;
517 else
518 irc_iid_bus.chk_result(p_rec => p_rec
519 ,p_effective_date => p_effective_date
520 );
521 end if;
522 else
523 if p_rec.result is not null then
524 --
525 -- RESULT SHOULD BE NULL FOR INCOMPLET INTERVIEWS
526 --
527 fnd_message.set_name('PER','IRC_412475_RESULT_NOT_NULL');
528 fnd_message.raise_error;
529 --
530 end if;
531 if p_rec.feedback is not null then
532 --
533 -- FEEDBACK SHOULD BE NULL FOR INCOMPLET INTERVIEWS
534 --
535 fnd_message.set_name('PER','IRC_412476_FEEDBACK_NOT_NULL');
536 fnd_message.raise_error;
537 end if;
538 end if;
539 hr_utility.set_location('leaving:'||l_proc, 10);
540 end chk_completed;
541 ---
542 ----------------------------------------------------------------------------
543 -- |---------------------------< chk_updated_status >--------------------------------|
544 -- ----------------------------------------------------------------------------
545 Procedure chk_updated_status
546 (p_old_status in varchar2
547 ,p_new_status in varchar2
548 ) is
549 --
550 l_proc varchar2(72) := g_package||'chk_updated_status';
551 --
552 Begin
553 hr_utility.set_location('Entering:'||l_proc, 5);
554 --
555 if (p_old_status <> p_new_status) then
556 if p_old_status = 'PLANNED' then
557 if (p_new_status = 'RESCHEDULED' or p_new_status = 'COMPLETED') then
558 -- raise error saying that status can not change to RESCHEDULED or COMPLETED
559 fnd_message.set_name('PER','IRC_412477_PLND_ST_CANT_CHNG');
560 fnd_message.raise_error;
561 end if;
562 elsif p_old_status = 'CONFIRMED' then
563 if (p_new_status = 'PLANNED') then
564 -- raise error saying that status can not change to PLANNED.
565 fnd_message.set_name('PER','IRC_412478_CNFRM_ST_CANT_CHNG');
566 fnd_message.raise_error;
567 end if;
568 elsif p_old_status = 'CANCELLED' then
569 -- raise error saying that status can not change for CANCELLED interview
570 fnd_message.set_name('PER','IRC_412479_CNCLD_ST_CANT_CHNG');
571 fnd_message.raise_error;
572 elsif p_old_status = 'RESCHEDULED' then
573 if (p_new_status = 'PLANNED') then
574 -- raise error saying that status can not change to PLANNED or COMPLETED
575 fnd_message.set_name('PER','IRC_412480_RSCHL_ST_CANT_CHNG');
576 fnd_message.raise_error;
577 end if;
578 elsif p_old_status = 'HOLD' then
579 if (p_new_status = 'PLANNED') then
580 -- raise error saying that status can not change to PLANNED or HOLD
581 fnd_message.set_name('PER','IRC_412481_HOLD_ST_CANT_CHNG');
582 fnd_message.raise_error;
583 end if;
584 elsif p_old_status = 'COMPLETED' then
585 if (p_new_status <> 'COMPLETED') then
586 -- raise error saying that status can not change for COMPLETED interview
587 fnd_message.set_name('PER','IRC_412482_CMPLT_ST_CANT_CHNG');
588 fnd_message.raise_error;
589 end if;
590 end if;
591 end if;
592 --
593 hr_utility.set_location('leaving:'||l_proc, 10);
594 end chk_updated_status;
595 --
596 -- ----------------------------------------------------------------------------
597 -- |---------------------------< chk_event_id >-------------------------------|
598 -- ----------------------------------------------------------------------------
599 Procedure chk_event_id
600 (p_rec in irc_iid_shd.g_rec_type
601 ) is
602 l_rec_exists number;
603 cursor csr_event_exists is
604 select 1
605 from per_events
606 where event_id = p_rec.event_id;
607 Begin
608 open csr_event_exists;
609 fetch csr_event_exists into l_rec_exists;
610 if (csr_event_exists%notfound) then
611 -- raise an error saying the event does not exist
612 fnd_message.set_name('PER','IRC_412483_INV_EVENT_ID');
613 fnd_message.raise_error;
614 end if;
615 close csr_event_exists;
616
617 end chk_event_id;
618 --
619 -- ----------------------------------------------------------------------------
620 -- |---------------------------< insert_validate >----------------------------|
621 -- ----------------------------------------------------------------------------
622 Procedure insert_validate
623 (p_rec in irc_iid_shd.g_rec_type
624 ,p_effective_date in date
625 ,p_datetrack_mode in varchar2
626 ,p_validation_start_date in date
627 ,p_validation_end_date in date
628 ) is
629 --
630 l_proc varchar2(72) := g_package||'insert_validate';
631 --
632 Begin
633 hr_utility.set_location('Entering:'||l_proc, 5);
634 --
635 -- irc_iid_bus.chk_event_id (p_rec => p_rec); -- commented for fixing the issue
636 irc_iid_bus.chk_status(p_rec => p_rec
637 ,p_effective_date => p_effective_date);
638 irc_iid_bus.chk_completed(p_rec => p_rec
639 ,p_effective_date => p_effective_date
640 );
641 irc_iid_bus.chk_ddf(p_rec);
642 --
643 hr_utility.set_location(' Leaving:'||l_proc, 10);
644 End insert_validate;
645 --
646 -- ----------------------------------------------------------------------------
647 -- |---------------------------< update_validate >----------------------------|
648 -- ----------------------------------------------------------------------------
649 Procedure update_validate
650 (p_rec in irc_iid_shd.g_rec_type
651 ,p_effective_date in date
652 ,p_datetrack_mode in varchar2
653 ,p_validation_start_date in date
654 ,p_validation_end_date in date
655 ) is
656 --
657 l_proc varchar2(72) := g_package||'update_validate';
658 l_old_status varchar2(30);
659 cursor csr_old_status is
660 select status
661 from irc_interview_details
662 where interview_details_id = p_rec.interview_details_id
663 and sysdate between start_date and nvl(end_date,hr_general.end_of_time);
664 --
665 Begin
666 hr_utility.set_location('Entering:'||l_proc, 5);
667 --
668 irc_iid_bus.chk_event_id (p_rec => p_rec);
669 irc_iid_bus.chk_status(p_rec => p_rec
670 ,p_effective_date => p_effective_date);
671 --
672 --
673 open csr_old_status;
674 fetch csr_old_status into l_old_status;
675 --
676 if csr_old_status%found then
677 if (l_old_status <> p_rec.status) then
678 irc_iid_bus.chk_updated_status(p_old_status => l_old_status
679 ,p_new_status => p_rec.status);
680 end if;
681 else
682 -- raise error saying that record does not exist
683 fnd_message.set_name('PER','IRC_412484_INV_INT_DETAILS_ID');
684 fnd_message.raise_error;
685 end if;
686 close csr_old_status;
687 irc_iid_bus.chk_completed(p_rec => p_rec
688 ,p_effective_date => p_effective_date
689 );
690 --
691 -- Call the datetrack update integrity operation
692 --
693 dt_update_validate
694 (p_datetrack_mode => p_datetrack_mode
695 ,p_validation_start_date => p_validation_start_date
696 ,p_validation_end_date => p_validation_end_date
697 );
698 --
699 chk_non_updateable_args
700 (p_effective_date => p_effective_date
701 ,p_rec => p_rec
702 );
703 --
704 irc_iid_bus.chk_ddf(p_rec);
705 --
706 hr_utility.set_location(' Leaving:'||l_proc, 10);
707 End update_validate;
708 --
709 end irc_iid_bus;