DBA Data[Home] [Help]

PACKAGE BODY: APPS.PE_AEI_BUS

Source


1 Package Body pe_aei_bus as
2 /* $Header: peaeirhi.pkb 115.8 2002/12/03 15:36:45 raranjan ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pe_aei_bus.';  -- Global package name
9 g_legislation_code               varchar2(150) default null;
10 g_assignment_extra_info_id      number default null;
11 --
12 --
13 --  |----------------------< set_security_group_id >--------------------------|
14 --  ---------------------------------------------------------------------------
15 --
16 /*
17 Procedure set_security_group_id
18   (p_assignment_extra_info_id             in number
19   ) is
20   --
21   -- Declare cursor
22   --
23   cursor csr_sec_grp is
24     select pbg.security_group_id
25       from per_business_groups pbg
26          , per_assignment_extra_info aei
27          , per_all_assignments_f aaf
28      where aei.assignment_extra_info_id = p_assignment_extra_info_id
29       and aaf.assignment_id = aei.assignment_id
30       and pbg.business_group_id = aaf.business_group_id;
31   --
32   -- Declare local variables
33   --
34   l_security_group_id number;
35   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
36   --
37 begin
38   --
39   hr_utility.set_location('Entering:'|| l_proc, 10);
40   --
41   -- Ensure that all the mandatory parameter are not null
42   --
43   hr_api.mandatory_arg_error
44     (p_api_name           => l_proc
45     ,p_argument           => 'assignment_extra_info_id'
46     ,p_argument_value     => p_assignment_extra_info_id
47     );
48   --
49   --
50   open csr_sec_grp;
51   fetch csr_sec_grp into l_security_group_id;
52   --
53   if csr_sec_grp%notfound then
54      --
55      close csr_sec_grp;
56      --
57      -- The primary key is invalid therefore we must error
58      --
59      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
60      fnd_message.raise_error;
61      --
62   end if;
63   close csr_sec_grp;
64   --
65   -- Set the security_group_id in CLIENT_INFO
66   --
67   hr_api.set_security_group_id
68     (p_security_group_id => l_security_group_id
69     );
70   --
71   hr_utility.set_location(' Leaving:'|| l_proc, 20);
72   --
73 end set_security_group_id;
74 --
75 */
76 
77 -- ----------------------------------------------------------------------------
78 -- |------------------------< return_legislation_code >-----------------------|
79 -- ----------------------------------------------------------------------------
80 Function return_legislation_code(p_assignment_extra_info_id in NUMBER)
81                                 return varchar2 is
82 --
83         -- Cursor to find legislation code
84         --
85         cursor csr_leg_code is
86                 select pbg.legislation_code
87                 from per_business_groups pbg,
88                      per_assignment_extra_info aei,
89                      per_all_assignments_f aaf
90                 where aei.assignment_extra_info_id = p_assignment_extra_info_id
91                 and   aaf.assignment_id = aei.assignment_id
92                 and   pbg.business_group_id = aaf.business_group_id;
93   --
94   -- Declare local variables
95   --
96   l_legislation_code varchar2(150);
97   l_proc             varchar2(72) := g_package||'return_legislation_code';
98 Begin
99   --
100   hr_utility.set_location('Entering:'||l_proc, 5);
101   hr_api.mandatory_arg_error(p_api_name         => l_proc
102                             ,p_argument        => 'assignment_extra_info_id'
103                             ,p_argument_value   => p_assignment_extra_info_id
104                             );
105 
106 --
107   if ( nvl(pe_aei_bus.g_assignment_extra_info_id, hr_api.g_number)
108        = p_assignment_extra_info_id) then
109     --
110     -- The legislation code has already been found with a previous
111     -- call to this function. Just return the value in the global
112     -- variable.
113     --
114     l_legislation_code := pe_aei_bus.g_legislation_code;
115     hr_utility.set_location(l_proc, 20);
116   else
117     --
118     -- The ID is different to the last call to this function
119     -- or this is the first call to this function.
120     --
121     open csr_leg_code;
122     fetch csr_leg_code into l_legislation_code;
123     --
124     if csr_leg_code%notfound then
125       --
126       -- The primary key is invalid therefore we must error
127       --
128       close csr_leg_code;
129       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
130       fnd_message.raise_error;
131     end if;
132     hr_utility.set_location(l_proc,30);
133     --
134     -- Set the global variables so the values are
135     -- available for the next call to this function.
136     --
137     close csr_leg_code;
138     pe_aei_bus.g_assignment_extra_info_id := p_assignment_extra_info_id;
139     pe_aei_bus.g_legislation_code  := l_legislation_code;
140   end if;
141   hr_utility.set_location(' Leaving:'|| l_proc, 40);
142   return l_legislation_code;
143 end return_legislation_code;
144 --
145 --
146 --
147 --
148 -- ----------------------------------------------------------------------------
149 -- |-------------------------<chk_assignment_info_type >----------------------|
150 -- ----------------------------------------------------------------------------
151 -- {Start Of Comments}
152 --
153 -- Description:
154 --   Validates that the assignment information type exists in table
155 --   per_assignment_info_types where active_inactive_flag is 'Y'.
156 --
157 -- Pre Conditions:
158 --   Data must be existed in table per_assignment_info_types.
159 --
160 -- In Parameters:
161 --   p_information_type
162 --
163 -- Post Success:
164 --   Processing continues.
165 --
166 -- Post Failure:
167 --   An application error will be raised and processing is terminated.
168 --
169 -- Developer Implementation Notes:
170 --   For insert, your business rules should be executed from this procedure and
171 --   should ideally (unless really necessary) just be straight procedure or
172 --   function calls. Try and avoid using conditional branching logic.
173 --
174 -- Access Status:
175 --   Internal Table Handler Use Only.
176 --
177 -- {End Of Comments}
178 -- ----------------------------------------------------------------------------
179 Procedure chk_assignment_info_type
180   (
181    p_information_type   in    per_assignment_extra_info.information_type%type
182   ) is
183 --
184   l_proc  varchar2(72) := g_package||'chk_assignment_info_type';
185   l_flag  per_assignment_info_types.active_inactive_flag%type;
186 --
187   cursor c_asg_info_type (code varchar2) is
188       select aeit.active_inactive_flag
189         from per_assignment_info_types aeit
190        where aeit.information_type = code;
191 --
192 Begin
193   hr_utility.set_location('Entering:'||l_proc, 1);
194   --
195   -- Check mandatory parameters have been set
196   --
197   hr_api.mandatory_arg_error
198     (
199      p_api_name         => l_proc,
200      p_argument         => 'information_type',
201      p_argument_value   => p_information_type
202     );
203   --
204   hr_utility.set_location(l_proc, 2);
205   hr_utility.set_location('p_inf_type: '||p_information_type||' '||l_proc, 2);
206   --
207   -- Check that the ACTIVE_INACTIVE_FLAG of assignment
208   -- Information type is active.
209   --
210   open c_asg_info_type (p_information_type);
211   fetch c_asg_info_type into l_flag;
212   if c_asg_info_type%notfound then
213     close c_asg_info_type;
214     hr_utility.set_message(800, 'HR_INV_INFO_TYPE 2');
215     hr_utility.raise_error;
216   end if;
217   close c_asg_info_type;
218   --
219   if l_flag = 'N' then
220     hr_utility.set_message(800, 'HR_INACTIVE_INFO_TYPE');
221     hr_utility.raise_error;
222   end if;
223   --
224   hr_utility.set_location(' Leaving:'||l_proc, 4);
225   --
226 End chk_assignment_info_type;
227 --
228 -- ----------------------------------------------------------------------------
229 -- |---------------------------< chk_assignment_id >----------------------------|
230 -- ----------------------------------------------------------------------------
231 -- {Start Of Comments}
232 --
233 -- Description:
234 --   Verify that the value in assignment_ID is in the per_assignments table.
235 --
236 -- Pre Conditions:
237 --
238 --
239 -- In Parameters:
240 --   p_assignment_extra_info_id
241 --   p_assignment_id
242 --   p_object_version_number
243 --
244 -- Post Success:
245 --   Processing continues.
246 --
247 -- Post Failure:
248 --   An application error will be raised and processing is terminated.
249 --
250 -- Developer Implementation Notes:
251 --   For insert, your business rules should be executed from this procedure and
252 --   should ideally (unless really necessary) just be straight procedure or
253 --   function calls. Try and avoid using conditional branching logic.
254 --
255 -- Access Status:
256 --   Internal Table Handler Use Only.
257 --
258 -- {End Of Comments}
259 -- ----------------------------------------------------------------------------
260 Procedure chk_assignment_id
261   (
262    p_assignment_id      in      per_assignment_extra_info.assignment_id%type
263   ) is
264 --
265   l_proc  varchar2(72) := g_package||'chk_assignment_id';
266   l_dummy varchar2(1);
267 --
268   cursor c_valid_asg (id number) is
269       select 'x'
270         from per_all_assignments_f asg
271        where asg.assignment_id = id;
272 --
273 Begin
274   hr_utility.set_location('Entering:'||l_proc, 1);
275   --
276   -- Check mandatory parameters have been set
277   --
278   hr_api.mandatory_arg_error
279     (
280      p_api_name         => l_proc,
281      p_argument         => 'assignment_id',
282      p_argument_value   => p_assignment_id
283     );
284   --
285   hr_utility.set_location(l_proc, 2);
286   --
287   -- Check that the assignment_id is in the per_assignments table.
288   --
289   open c_valid_asg (p_assignment_id);
290   fetch c_valid_asg into l_dummy;
291   if c_valid_asg%notfound then
292     close c_valid_asg;
293     hr_utility.set_message(800, 'HR_INV_ASG_ID');
294     hr_utility.raise_error;
295   end if;
296   close c_valid_asg;
297   --
298   hr_utility.set_location(' Leaving:'||l_proc, 3);
299   --
300 End chk_assignment_id;
301 --
302 -- ----------------------------------------------------------------------------
303 -- |--------------------< chk_multiple_occurences_flag >----------------------|
304 -- ----------------------------------------------------------------------------
305 -- {Start Of Comments}
306 --
307 -- Description:
308 --   Verify that the number of rows should not exceed one when
309 --   multiple_occurences_flag = 'N'.
310 --
311 -- Pre Conditions:
312 --   This procedure should execute after procedure chk_information_type.
313 --
314 -- In Parameters:
315 --   p_information_type
316 --   p_assignment_id
317 --
318 -- Post Success:
319 --   Processing continues.
320 --
321 -- Post Failure:
322 --   An application error will be raised and processing is terminated.
323 --
324 -- Developer Implementation Notes:
325 --   For insert, your business rules should be executed from this procedure and
326 --   should ideally (unless really necessary) just be straight procedure or
327 --   function calls. Try and avoid using conditional branching logic.
328 --
329 -- Access Status:
330 --   Internal Table Handler Use Only.
331 --
332 -- {End Of Comments}
333 -- ----------------------------------------------------------------------------
334 Procedure chk_multiple_occurences_flag
335   (p_information_type   in per_assignment_extra_info.information_type%type
336   ,p_assignment_id      in per_assignment_extra_info.assignment_id%type
337   ) is
338 --
339   l_proc                varchar2(72) := g_package||'chk_multiple_occurences_flag';
340   l_multi_occur_flag    per_assignment_info_types.multiple_occurences_flag%type;
341   l_dummy               varchar2(1);
342   l_found_poi           boolean;
343 --
344   cursor c_multi_occur_flag (code varchar2) is
345      select multiple_occurences_flag
346        from per_assignment_info_types
347       where information_type = code;
348 --
349   cursor c_get_row (code varchar2, id number) is
350      select 'x'
351        from per_assignment_extra_info
352       where information_type = code
353         and assignment_id = id;
354 --
355 Begin
356   hr_utility.set_location('Entering:'||l_proc, 5);
357   --
358   open c_multi_occur_flag (p_information_type);
359   fetch c_multi_occur_flag into l_multi_occur_flag;
360   --
361   -- The following case should not happen since procedure
362   -- chk_information_type should capture this error.
363   --
364   if c_multi_occur_flag%notfound then
365     close c_multi_occur_flag;
366     hr_utility.set_message(800, 'HR_INV_INFO_TYPE 3');
367     hr_utility.raise_error;
368   end if;
369   --
370   close c_multi_occur_flag;
371   --
372   hr_utility.set_location(l_proc, 10);
373   --
374   open c_get_row(p_information_type, p_assignment_id);
375   fetch c_get_row into l_dummy;
376   if c_get_row%notfound then
377     l_found_poi := FALSE;
378   else
379     l_found_poi := TRUE;
380   end if;
381   close c_get_row;
382   --
383   if l_found_poi and l_multi_occur_flag = 'N' then
384     hr_utility.set_message(800, 'HR_MORE_THAN_1_EXTRA_INFO');
385     hr_utility.raise_error;
386   end if;
387   --
388   hr_utility.set_location(' Leaving:'||l_proc, 15);
389 --
390 End chk_multiple_occurences_flag;
391 --
392 -- ----------------------------------------------------------------------------
393 -- |-----------------------< chk_non_updateable_args >------------------------|
394 -- ----------------------------------------------------------------------------
395 -- {Start Of Comments}
396 --
397 -- Description:
398 --   Verify that the non updateable arguments not changed.
399 --
400 -- Pre Conditions:
401 --
402 --
403 -- In Parameters:
404 --   p_rec
405 --
406 -- Post Success:
407 --   Processing continues.
408 --
409 -- Post Failure:
410 --   An application error will be raised and processing is terminated.
411 --
412 -- Developer Implementation Notes:
413 --   For insert, your business rules should be executed from this procedure and
414 --   should ideally (unless really necessary) just be straight procedure or
415 --   function calls. Try and avoid using conditional branching logic.
416 --
417 -- Access Status:
418 --   Internal Table Handler Use Only.
419 --
420 -- {End Of Comments}
421 -- ----------------------------------------------------------------------------
422 Procedure chk_non_updateable_args (p_rec in pe_aei_shd.g_rec_type) is
423 --
424   l_proc		varchar2(72) := g_package||'chk_non_updateable_args';
425   l_error		exception;
426   l_argument            varchar2(30);
427 --
428 Begin
429   hr_utility.set_location('Entering:'||l_proc, 10);
430   --
431   -- Only proceed with validation if a row exists for
432   -- the current record in the HR Schema
433   --
434   if not pe_aei_shd.api_updating
435         (p_assignment_extra_info_id     => p_rec.assignment_extra_info_id
436 	,p_object_version_number	=> p_rec.object_version_number) then
437     hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
438     hr_utility.set_message_token('PROCEDURE', l_proc);
439     hr_utility.set_message_token('STEP', '20');
440   end if;
441   --
442   hr_utility.set_location(l_proc, 30);
443   --
444   if nvl(p_rec.information_type, hr_api.g_varchar2) <>
445      nvl(pe_aei_shd.g_old_rec.information_type, hr_api.g_varchar2) then
446     l_argument := 'information_type';
447     raise l_error;
448   end if;
449   --
450   hr_utility.set_location(l_proc, 40);
451   --
452   if nvl(p_rec.assignment_id, hr_api.g_number) <>
453      nvl(pe_aei_shd.g_old_rec.assignment_id, hr_api.g_number) then
454     l_argument := 'assignment_id';
455     raise l_error;
456   end if;
457   --
458   hr_utility.set_location(' Leaving:'||l_proc, 50);
459 exception
460   when l_error then
461     hr_api.argument_changed_error
462 	(p_api_name => l_proc
463 	,p_argument => l_argument
464 	);
465     hr_utility.set_location(l_proc, 60);
466   when others then
467     hr_utility.set_location(l_proc, 70);
468     raise;
469 end chk_non_updateable_args;
470 --
471 -- -----------------------------------------------------------------------
472 -- |------------------------------< chk_df >-----------------------------|
473 -- -----------------------------------------------------------------------
474 --
475 -- Description:
476 --   Validates the all Descriptive Flexfield values.
477 --
478 -- Pre-conditions:
479 --   All other columns have been validated. Must be called as the
480 --   last step from insert_validate and update_validate.
481 --
482 -- In Arguments:
483 --   p_rec
484 --
485 -- Post Success:
486 --   If the Descriptive Flexfield structure column and data values are
487 --   all valid this procedure will end normally and processing will
488 --   continue.
489 --
490 -- Post Failure:
491 --   If the Descriptive Flexfield structure column value or any of
492 --   the data values are invalid then an application error is raised as
493 --   a PL/SQL exception.
494 --
495 -- Access Status:
496 --   Internal Row Handler Use Only.
497 --
498 -- {End Of Comments}
499 -- ----------------------------------------------------------------------------
500 --
501 procedure chk_df
502   (p_rec in pe_aei_shd.g_rec_type) is
503 --
504   l_proc    varchar2(72) := g_package||'chk_df';
505 --
506 begin
507   hr_utility.set_location('Entering:'||l_proc, 10);
508   --
509   if ((p_rec.assignment_extra_info_id is not null) and (
510      nvl(pe_aei_shd.g_old_rec.aei_attribute_category, hr_api.g_varchar2) <>
511      nvl(p_rec.aei_attribute_category, hr_api.g_varchar2) or
512      nvl(pe_aei_shd.g_old_rec.aei_attribute1, hr_api.g_varchar2) <>
513      nvl(p_rec.aei_attribute1, hr_api.g_varchar2) or
514      nvl(pe_aei_shd.g_old_rec.aei_attribute2, hr_api.g_varchar2) <>
515      nvl(p_rec.aei_attribute2, hr_api.g_varchar2) or
516      nvl(pe_aei_shd.g_old_rec.aei_attribute3, hr_api.g_varchar2) <>
517      nvl(p_rec.aei_attribute3, hr_api.g_varchar2) or
518      nvl(pe_aei_shd.g_old_rec.aei_attribute4, hr_api.g_varchar2) <>
519      nvl(p_rec.aei_attribute4, hr_api.g_varchar2) or
520      nvl(pe_aei_shd.g_old_rec.aei_attribute5, hr_api.g_varchar2) <>
521      nvl(p_rec.aei_attribute5, hr_api.g_varchar2) or
522      nvl(pe_aei_shd.g_old_rec.aei_attribute6, hr_api.g_varchar2) <>
523      nvl(p_rec.aei_attribute6, hr_api.g_varchar2) or
524      nvl(pe_aei_shd.g_old_rec.aei_attribute7, hr_api.g_varchar2) <>
525      nvl(p_rec.aei_attribute7, hr_api.g_varchar2) or
526      nvl(pe_aei_shd.g_old_rec.aei_attribute8, hr_api.g_varchar2) <>
527      nvl(p_rec.aei_attribute8, hr_api.g_varchar2) or
528      nvl(pe_aei_shd.g_old_rec.aei_attribute9, hr_api.g_varchar2) <>
529      nvl(p_rec.aei_attribute9, hr_api.g_varchar2) or
530      nvl(pe_aei_shd.g_old_rec.aei_attribute10, hr_api.g_varchar2) <>
531      nvl(p_rec.aei_attribute10, hr_api.g_varchar2) or
532      nvl(pe_aei_shd.g_old_rec.aei_attribute11, hr_api.g_varchar2) <>
533      nvl(p_rec.aei_attribute11, hr_api.g_varchar2) or
534      nvl(pe_aei_shd.g_old_rec.aei_attribute12, hr_api.g_varchar2) <>
535      nvl(p_rec.aei_attribute12, hr_api.g_varchar2) or
536      nvl(pe_aei_shd.g_old_rec.aei_attribute13, hr_api.g_varchar2) <>
537      nvl(p_rec.aei_attribute13, hr_api.g_varchar2) or
538      nvl(pe_aei_shd.g_old_rec.aei_attribute14, hr_api.g_varchar2) <>
539      nvl(p_rec.aei_attribute14, hr_api.g_varchar2) or
540      nvl(pe_aei_shd.g_old_rec.aei_attribute15, hr_api.g_varchar2) <>
541      nvl(p_rec.aei_attribute15, hr_api.g_varchar2) or
542      nvl(pe_aei_shd.g_old_rec.aei_attribute16, hr_api.g_varchar2) <>
543      nvl(p_rec.aei_attribute16, hr_api.g_varchar2) or
544      nvl(pe_aei_shd.g_old_rec.aei_attribute17, hr_api.g_varchar2) <>
545      nvl(p_rec.aei_attribute17, hr_api.g_varchar2) or
546      nvl(pe_aei_shd.g_old_rec.aei_attribute18, hr_api.g_varchar2) <>
547      nvl(p_rec.aei_attribute18, hr_api.g_varchar2) or
548      nvl(pe_aei_shd.g_old_rec.aei_attribute19, hr_api.g_varchar2) <>
549      nvl(p_rec.aei_attribute19, hr_api.g_varchar2) or
550      nvl(pe_aei_shd.g_old_rec.aei_attribute20, hr_api.g_varchar2) <>
551      nvl(p_rec.aei_attribute20, hr_api.g_varchar2)))
552      or
553      (p_rec.assignment_extra_info_id is null) then
554     --
555     -- Only execute the validation if absolutely necessary:
556     -- a) During update, the structure column value or any
557     --    of the attribute values have actually changed.
558     -- b) During insert.
559     --
560     hr_dflex_utility.ins_or_upd_descflex_attribs
561       (p_appl_short_name    => 'PER'
562       ,p_descflex_name      => 'PER_ASSIGNMENT_EXTRA_INFO'
563       ,p_attribute_category => p_rec.aei_attribute_category
564       ,p_attribute1_name    => 'AEI_ATTRIBUTE1'
565       ,p_attribute1_value   => p_rec.aei_attribute1
566       ,p_attribute2_name    => 'AEI_ATTRIBUTE2'
567       ,p_attribute2_value   => p_rec.aei_attribute2
568       ,p_attribute3_name    => 'AEI_ATTRIBUTE3'
569       ,p_attribute3_value   => p_rec.aei_attribute3
570       ,p_attribute4_name    => 'AEI_ATTRIBUTE4'
571       ,p_attribute4_value   => p_rec.aei_attribute4
572       ,p_attribute5_name    => 'AEI_ATTRIBUTE5'
573       ,p_attribute5_value   => p_rec.aei_attribute5
574       ,p_attribute6_name    => 'AEI_ATTRIBUTE6'
575       ,p_attribute6_value   => p_rec.aei_attribute6
576       ,p_attribute7_name    => 'AEI_ATTRIBUTE7'
577       ,p_attribute7_value   => p_rec.aei_attribute7
578       ,p_attribute8_name    => 'AEI_ATTRIBUTE8'
579       ,p_attribute8_value   => p_rec.aei_attribute8
580       ,p_attribute9_name    => 'AEI_ATTRIBUTE9'
581       ,p_attribute9_value   => p_rec.aei_attribute9
582       ,p_attribute10_name   => 'AEI_ATTRIBUTE10'
583       ,p_attribute10_value  => p_rec.aei_attribute10
584       ,p_attribute11_name   => 'AEI_ATTRIBUTE11'
585       ,p_attribute11_value  => p_rec.aei_attribute11
586       ,p_attribute12_name   => 'AEI_ATTRIBUTE12'
587       ,p_attribute12_value  => p_rec.aei_attribute12
588       ,p_attribute13_name   => 'AEI_ATTRIBUTE13'
589       ,p_attribute13_value  => p_rec.aei_attribute13
590       ,p_attribute14_name   => 'AEI_ATTRIBUTE14'
591       ,p_attribute14_value  => p_rec.aei_attribute14
592       ,p_attribute15_name   => 'AEI_ATTRIBUTE15'
593       ,p_attribute15_value  => p_rec.aei_attribute15
594       ,p_attribute16_name   => 'AEI_ATTRIBUTE16'
595       ,p_attribute16_value  => p_rec.aei_attribute16
596       ,p_attribute17_name   => 'AEI_ATTRIBUTE17'
597       ,p_attribute17_value  => p_rec.aei_attribute17
598       ,p_attribute18_name   => 'AEI_ATTRIBUTE18'
599       ,p_attribute18_value  => p_rec.aei_attribute18
600       ,p_attribute19_name   => 'AEI_ATTRIBUTE19'
601       ,p_attribute19_value  => p_rec.aei_attribute19
602       ,p_attribute20_name   => 'AEI_ATTRIBUTE20'
603       ,p_attribute20_value  => p_rec.aei_attribute20);
604   end if;
605   --
606   hr_utility.set_location(' Leaving:'||l_proc, 20);
607 end chk_df;
608 --
609 -- -----------------------------------------------------------------------
610 -- |------------------------------< chk_ddf >----------------------------|
611 -- -----------------------------------------------------------------------
612 --
613 -- Description:
614 --   Validates the all Developer Descriptive Flexfield values.
615 --
616 -- Pre-conditions:
617 --   All other columns have been validated. Must be called as the
618 --   second last step from insert_validate and update_validate.
619 --   Before any Descriptive Flexfield (chk_df) calls.
620 --
621 -- In Arguments:
622 --   p_rec
623 --
624 -- Post Success:
625 --   If the Developer Descriptive Flexfield structure column and data
626 --   values are all valid this procedure will end normally and
627 --   processing will continue.
628 --
629 -- Post Failure:
630 --   If the DDF structure column value or any of the data values
631 --   are invalid then an application error is raised as
632 --   a PL/SQL exception.
633 --
634 -- Access Status:
635 --   Internal Row Handler Use Only.
636 --
637 -- {End Of Comments}
638 -- ----------------------------------------------------------------------------
639 --
640 procedure chk_ddf
641   (p_rec   in pe_aei_shd.g_rec_type) is
642 --
643   l_proc       varchar2(72) := g_package||'chk_ddf';
644   l_error      exception;
645 --
646 Begin
647   hr_utility.set_location('Entering:'||l_proc, 5);
648   --
649   -- Check if the row is being inserted or updated and a
650   -- value has changed
651   --
652   if (p_rec.assignment_extra_info_id is null)
653     or ((p_rec.assignment_extra_info_id is not null)
654     and
655     nvl(pe_aei_shd.g_old_rec.aei_attribute_category, hr_api.g_varchar2) <>
656     nvl(p_rec.aei_information_category, hr_api.g_varchar2) or
657     nvl(pe_aei_shd.g_old_rec.aei_information1, hr_api.g_varchar2) <>
658     nvl(p_rec.aei_information1, hr_api.g_varchar2) or
659     nvl(pe_aei_shd.g_old_rec.aei_information2, hr_api.g_varchar2) <>
660     nvl(p_rec.aei_information2, hr_api.g_varchar2) or
661     nvl(pe_aei_shd.g_old_rec.aei_information3, hr_api.g_varchar2) <>
662     nvl(p_rec.aei_information3, hr_api.g_varchar2) or
663     nvl(pe_aei_shd.g_old_rec.aei_information4, hr_api.g_varchar2) <>
664     nvl(p_rec.aei_information4, hr_api.g_varchar2) or
665     nvl(pe_aei_shd.g_old_rec.aei_information5, hr_api.g_varchar2) <>
666     nvl(p_rec.aei_information5, hr_api.g_varchar2) or
667     nvl(pe_aei_shd.g_old_rec.aei_information6, hr_api.g_varchar2) <>
668     nvl(p_rec.aei_information6, hr_api.g_varchar2) or
669     nvl(pe_aei_shd.g_old_rec.aei_information7, hr_api.g_varchar2) <>
670     nvl(p_rec.aei_information7, hr_api.g_varchar2) or
671     nvl(pe_aei_shd.g_old_rec.aei_information8, hr_api.g_varchar2) <>
672     nvl(p_rec.aei_information8, hr_api.g_varchar2) or
673     nvl(pe_aei_shd.g_old_rec.aei_information9, hr_api.g_varchar2) <>
674     nvl(p_rec.aei_information9, hr_api.g_varchar2) or
675     nvl(pe_aei_shd.g_old_rec.aei_information10, hr_api.g_varchar2) <>
676     nvl(p_rec.aei_information10, hr_api.g_varchar2) or
677     nvl(pe_aei_shd.g_old_rec.aei_information11, hr_api.g_varchar2) <>
678     nvl(p_rec.aei_information11, hr_api.g_varchar2) or
679     nvl(pe_aei_shd.g_old_rec.aei_information12, hr_api.g_varchar2) <>
680     nvl(p_rec.aei_information12, hr_api.g_varchar2) or
681     nvl(pe_aei_shd.g_old_rec.aei_information13, hr_api.g_varchar2) <>
682     nvl(p_rec.aei_information13, hr_api.g_varchar2) or
683     nvl(pe_aei_shd.g_old_rec.aei_information14, hr_api.g_varchar2) <>
684     nvl(p_rec.aei_information14, hr_api.g_varchar2) or
685     nvl(pe_aei_shd.g_old_rec.aei_information15, hr_api.g_varchar2) <>
686     nvl(p_rec.aei_information15, hr_api.g_varchar2) or
687     nvl(pe_aei_shd.g_old_rec.aei_information16, hr_api.g_varchar2) <>
688     nvl(p_rec.aei_information16, hr_api.g_varchar2) or
689     nvl(pe_aei_shd.g_old_rec.aei_information17, hr_api.g_varchar2) <>
690     nvl(p_rec.aei_information17, hr_api.g_varchar2) or
691     nvl(pe_aei_shd.g_old_rec.aei_information18, hr_api.g_varchar2) <>
692     nvl(p_rec.aei_information18, hr_api.g_varchar2) or
693     nvl(pe_aei_shd.g_old_rec.aei_information19, hr_api.g_varchar2) <>
694     nvl(p_rec.aei_information19, hr_api.g_varchar2) or
695     nvl(pe_aei_shd.g_old_rec.aei_information20, hr_api.g_varchar2) <>
696     nvl(p_rec.aei_information20, hr_api.g_varchar2) or
697     nvl(pe_aei_shd.g_old_rec.aei_information21, hr_api.g_varchar2) <>
698     nvl(p_rec.aei_information21, hr_api.g_varchar2) or
699     nvl(pe_aei_shd.g_old_rec.aei_information22, hr_api.g_varchar2) <>
700     nvl(p_rec.aei_information22, hr_api.g_varchar2) or
701     nvl(pe_aei_shd.g_old_rec.aei_information23, hr_api.g_varchar2) <>
702     nvl(p_rec.aei_information23, hr_api.g_varchar2) or
703     nvl(pe_aei_shd.g_old_rec.aei_information24, hr_api.g_varchar2) <>
704     nvl(p_rec.aei_information24, hr_api.g_varchar2) or
705     nvl(pe_aei_shd.g_old_rec.aei_information25, hr_api.g_varchar2) <>
706     nvl(p_rec.aei_information25, hr_api.g_varchar2) or
707     nvl(pe_aei_shd.g_old_rec.aei_information26, hr_api.g_varchar2) <>
708     nvl(p_rec.aei_information26, hr_api.g_varchar2) or
709     nvl(pe_aei_shd.g_old_rec.aei_information27, hr_api.g_varchar2) <>
710     nvl(p_rec.aei_information27, hr_api.g_varchar2) or
711     nvl(pe_aei_shd.g_old_rec.aei_information28, hr_api.g_varchar2) <>
712     nvl(p_rec.aei_information28, hr_api.g_varchar2) or
713     nvl(pe_aei_shd.g_old_rec.aei_information29, hr_api.g_varchar2) <>
714     nvl(p_rec.aei_information29, hr_api.g_varchar2) or
715     nvl(pe_aei_shd.g_old_rec.aei_information30, hr_api.g_varchar2) <>
716     nvl(p_rec.aei_information30, hr_api.g_varchar2))
717   then
718     --
719     hr_dflex_utility.ins_or_upd_descflex_attribs
720       (p_appl_short_name    => 'PER'
721       ,p_descflex_name      => 'Assignment Developer DF'
722       ,p_attribute_category => p_rec.aei_information_category
723       ,p_attribute1_name    => 'AEI_INFORMATION1'
724       ,p_attribute1_value   => p_rec.aei_information1
725       ,p_attribute2_name    => 'AEI_INFORMATION2'
726       ,p_attribute2_value   => p_rec.aei_information2
727       ,p_attribute3_name    => 'AEI_INFORMATION3'
728       ,p_attribute3_value   => p_rec.aei_information3
729       ,p_attribute4_name    => 'AEI_INFORMATION4'
730       ,p_attribute4_value   => p_rec.aei_information4
731       ,p_attribute5_name    => 'AEI_INFORMATION5'
732       ,p_attribute5_value   => p_rec.aei_information5
733       ,p_attribute6_name    => 'AEI_INFORMATION6'
734       ,p_attribute6_value   => p_rec.aei_information6
735       ,p_attribute7_name    => 'AEI_INFORMATION7'
736       ,p_attribute7_value   => p_rec.aei_information7
737       ,p_attribute8_name    => 'AEI_INFORMATION8'
738       ,p_attribute8_value   => p_rec.aei_information8
739       ,p_attribute9_name    => 'AEI_INFORMATION9'
740       ,p_attribute9_value   => p_rec.aei_information9
741       ,p_attribute10_name   => 'AEI_INFORMATION10'
742       ,p_attribute10_value  => p_rec.aei_information10
743       ,p_attribute11_name   => 'AEI_INFORMATION11'
744       ,p_attribute11_value  => p_rec.aei_information11
745       ,p_attribute12_name   => 'AEI_INFORMATION12'
746       ,p_attribute12_value  => p_rec.aei_information12
747       ,p_attribute13_name   => 'AEI_INFORMATION13'
748       ,p_attribute13_value  => p_rec.aei_information13
749       ,p_attribute14_name   => 'AEI_INFORMATION14'
750       ,p_attribute14_value  => p_rec.aei_information14
751       ,p_attribute15_name   => 'AEI_INFORMATION15'
752       ,p_attribute15_value  => p_rec.aei_information15
753       ,p_attribute16_name   => 'AEI_INFORMATION16'
754       ,p_attribute16_value  => p_rec.aei_information16
755       ,p_attribute17_name   => 'AEI_INFORMATION17'
756       ,p_attribute17_value  => p_rec.aei_information17
757       ,p_attribute18_name   => 'AEI_INFORMATION18'
758       ,p_attribute18_value  => p_rec.aei_information18
759       ,p_attribute19_name   => 'AEI_INFORMATION19'
760       ,p_attribute19_value  => p_rec.aei_information19
761       ,p_attribute20_name   => 'AEI_INFORMATION20'
762       ,p_attribute20_value  => p_rec.aei_information20
763       ,p_attribute21_name   => 'AEI_INFORMATION21'
764       ,p_attribute21_value  => p_rec.aei_information21
765       ,p_attribute22_name   => 'AEI_INFORMATION22'
766       ,p_attribute22_value  => p_rec.aei_information22
767       ,p_attribute23_name   => 'AEI_INFORMATION23'
768       ,p_attribute23_value  => p_rec.aei_information23
769       ,p_attribute24_name   => 'AEI_INFORMATION24'
770       ,p_attribute24_value  => p_rec.aei_information24
771       ,p_attribute25_name   => 'AEI_INFORMATION25'
772       ,p_attribute25_value  => p_rec.aei_information25
773       ,p_attribute26_name   => 'AEI_INFORMATION26'
774       ,p_attribute26_value  => p_rec.aei_information26
775       ,p_attribute27_name   => 'AEI_INFORMATION27'
776       ,p_attribute27_value  => p_rec.aei_information27
777       ,p_attribute28_name   => 'AEI_INFORMATION28'
778       ,p_attribute28_value  => p_rec.aei_information28
779       ,p_attribute29_name   => 'AEI_INFORMATION29'
780       ,p_attribute29_value  => p_rec.aei_information29
781       ,p_attribute30_name   => 'AEI_INFORMATION30'
782       ,p_attribute30_value  => p_rec.aei_information30
783       );
784     --
785   end if;
786   --
787   hr_utility.set_location(' Leaving:'||l_proc, 10);
788 end chk_ddf;
789 --
790 -- ----------------------------------------------------------------------------
791 -- |---------------------------< insert_validate >----------------------------|
792 -- ----------------------------------------------------------------------------
793 Procedure insert_validate(p_rec in pe_aei_shd.g_rec_type) is
794 --
795   l_proc  varchar2(72) := g_package||'insert_validate';
796 --
797 Begin
798   hr_utility.set_location('Entering:'||l_proc, 5);
799   --
800   per_asg_bus1.set_security_group_id
801    (
802     p_assignment_id             => p_rec.assignment_id
803    );
804   --
805   hr_utility.set_location('Entering:'||l_proc, 7);
806   --
807   -- Validate Assignment Info Type
808   --
809   chk_assignment_info_type
810         (p_information_type     => p_rec.information_type
811         );
812   --
813   -- Validate Assignment ID
814   --
815   chk_assignment_id (p_assignment_id  => p_rec.assignment_id);
816   --
817   -- Validate Multiple Occurence Flag
818   --
819   chk_multiple_occurences_flag
820         (p_information_type     => p_rec.information_type
821         ,p_assignment_id        => p_rec.assignment_id
822         );
823   --
824   if pe_aei_shd.g_called_from_form = FALSE then
825     --
826     hr_utility.set_location(l_proc, 10);
827     --
828     -- Call ddf procedure to validation Developer Descriptive Flexfields
829     --
830     pe_aei_bus.chk_ddf(p_rec => p_rec);
831     --
832     -- Call df procedure to validation Descriptive Flexfields
833     --
834     pe_aei_bus.chk_df(p_rec => p_rec);
835     --
836     hr_utility.set_location(l_proc, 15);
837   end if;
838   --
839   hr_utility.set_location(' Leaving:'||l_proc, 20);
840   --
841 End insert_validate;
842 --
843 -- ----------------------------------------------------------------------------
844 -- |---------------------------< update_validate >----------------------------|
845 -- ----------------------------------------------------------------------------
846 Procedure update_validate(p_rec in pe_aei_shd.g_rec_type) is
847 --
848   l_proc  varchar2(72) := g_package||'update_validate';
849 --
850 Begin
851   hr_utility.set_location('Entering:'||l_proc, 5);
852   --
853   per_asg_bus1.set_security_group_id
854    (
855     p_assignment_id             => p_rec.assignment_id
856    );
857   --
858   hr_utility.set_location('Entering:'||l_proc, 7);
859   -- Validate Non-Updateable Fields
860   --
861   chk_non_updateable_args (p_rec => p_rec);
862   --
863   hr_utility.set_location(l_proc, 15);
864   --
865   if pe_aei_shd.g_called_from_form = FALSE then
866     --
867     hr_utility.set_location(l_proc, 20);
868     --
869     -- Call ddf procedure to validate Developer Descriptive Flexfields
870     --
871     pe_aei_bus.chk_ddf(p_rec => p_rec);
872     --
873     -- Call df procedure to validate Descriptive Flexfields
874     --
875     pe_aei_bus.chk_df(p_rec => p_rec);
876     --
877     hr_utility.set_location(l_proc, 25);
878     --
879   end if;
880   --
881   hr_utility.set_location(' Leaving:'||l_proc, 30);
882   --
883 End update_validate;
884 --
885 -- ----------------------------------------------------------------------------
886 -- |---------------------------< delete_validate >----------------------------|
887 -- ----------------------------------------------------------------------------
888 Procedure delete_validate(p_rec in pe_aei_shd.g_rec_type) is
889 --
890   l_proc  varchar2(72) := g_package||'delete_validate';
891 --
892 Begin
893   hr_utility.set_location('Entering:'||l_proc, 5);
894   --
895   -- Call all supporting business operations
896   --
897   hr_utility.set_location(' Leaving:'||l_proc, 10);
898   --
899 End delete_validate;
900 --
901 end pe_aei_bus;