DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PSH_BUS

Source


1 Package Body per_psh_bus as
2 /* $Header: pepshrhi.pkb 120.2 2006/05/08 19:35 tpapired noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_psh_bus.';  -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code            varchar2(150)  default null;
14 g_sharing_instance_id         number         default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |----------------------< set_security_group_id >--------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21   (p_sharing_instance_id                  in number
22   ,p_associated_column1                   in varchar2 default null
23   ) is
24   --
25   -- Declare cursor
26   --
27   cursor csr_sec_grp is
28     select pbg.security_group_id,
29            pbg.legislation_code
30       from per_business_groups_perf pbg
31          , per_scorecard_sharing psh
32          , per_all_people_f ppf
33      where psh.sharing_instance_id = p_sharing_instance_id
34        and psh.person_id = ppf.person_id
35        and ppf.business_group_id = pbg.business_group_id;
36   --
37   -- Declare local variables
38   --
39   l_security_group_id number;
40   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
41   l_legislation_code  varchar2(150);
42   --
43 begin
44   --
45   hr_utility.set_location('Entering:'|| l_proc, 10);
46   --
47   -- Ensure that all the mandatory parameter are not null
48   --
49   hr_api.mandatory_arg_error
50     (p_api_name           => l_proc
51     ,p_argument           => 'sharing_instance_id'
52     ,p_argument_value     => p_sharing_instance_id
53     );
54   --
55   open csr_sec_grp;
56   fetch csr_sec_grp into l_security_group_id
57                        , l_legislation_code;
58   --
59   if csr_sec_grp%notfound then
60      --
61      close csr_sec_grp;
62      --
63      -- The primary key is invalid therefore we must error
64      --
65      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
66      hr_multi_message.add
67        (p_associated_column1
68         => nvl(p_associated_column1,'SHARING_INSTANCE_ID')
69        );
70      --
71   else
72     close csr_sec_grp;
73     --
74     -- Set the security_group_id in CLIENT_INFO
75     --
76     hr_api.set_security_group_id
77       (p_security_group_id => l_security_group_id
78       );
79     --
80     -- Set the sessions legislation context in HR_SESSION_DATA
81     --
82     hr_api.set_legislation_context(l_legislation_code);
83   end if;
84   --
85   hr_utility.set_location(' Leaving:'|| l_proc, 20);
86   --
87 end set_security_group_id;
88 --
89 --  ---------------------------------------------------------------------------
90 --  |---------------------< return_legislation_code >-------------------------|
91 --  ---------------------------------------------------------------------------
92 --
93 Function return_legislation_code
94   (p_sharing_instance_id                  in     number
95   )
96   Return Varchar2 Is
97   --
98   -- Declare cursor
99   --
100   cursor csr_leg_code is
101     select pbg.legislation_code
102       from per_business_groups_perf pbg
103          , per_scorecard_sharing psh
104          , per_all_people_f ppf
105      where psh.sharing_instance_id = p_sharing_instance_id
106        and psh.person_id = ppf.person_id
107        and ppf.business_group_id = pbg.business_group_id;
108   --
109   -- Declare local variables
110   --
111   l_legislation_code  varchar2(150);
112   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
113   --
114 Begin
115   --
116   hr_utility.set_location('Entering:'|| l_proc, 10);
117   --
118   -- Ensure that all the mandatory parameter are not null
119   --
120   hr_api.mandatory_arg_error
121     (p_api_name           => l_proc
122     ,p_argument           => 'sharing_instance_id'
123     ,p_argument_value     => p_sharing_instance_id
124     );
125   --
126   if ( nvl(per_psh_bus.g_sharing_instance_id, hr_api.g_number)
127        = p_sharing_instance_id) then
128     --
129     -- The legislation code has already been found with a previous
130     -- call to this function. Just return the value in the global
131     -- variable.
132     --
133     l_legislation_code := per_psh_bus.g_legislation_code;
134     hr_utility.set_location(l_proc, 20);
135   else
136     --
137     -- The ID is different to the last call to this function
138     -- or this is the first call to this function.
139     --
140     open csr_leg_code;
141     fetch csr_leg_code into l_legislation_code;
142     --
143     if csr_leg_code%notfound then
144       --
145       -- The primary key is invalid therefore we must error
146       --
147       close csr_leg_code;
148       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
149       fnd_message.raise_error;
150     end if;
151     hr_utility.set_location(l_proc,30);
152     --
153     -- Set the global variables so the values are
154     -- available for the next call to this function.
155     --
156     close csr_leg_code;
157     per_psh_bus.g_sharing_instance_id         := p_sharing_instance_id;
158     per_psh_bus.g_legislation_code  := l_legislation_code;
159   end if;
160   hr_utility.set_location(' Leaving:'|| l_proc, 40);
161   return l_legislation_code;
162 end return_legislation_code;
163 --
164 -- ----------------------------------------------------------------------------
165 -- |------------------------------< chk_df >----------------------------------|
166 -- ----------------------------------------------------------------------------
167 --
168 -- Description:
169 --   Validates all the Descriptive Flexfield values.
170 --
171 -- Prerequisites:
172 --   All other columns have been validated.  Must be called as the
173 --   last step from insert_validate and update_validate.
174 --
175 -- In Arguments:
176 --   p_rec
177 --
178 -- Post Success:
179 --   If the Descriptive Flexfield structure column and data values are
180 --   all valid this procedure will end normally and processing will
181 --   continue.
182 --
183 -- Post Failure:
184 --   If the Descriptive Flexfield structure column value or any of
185 --   the data values are invalid then an application error is raised as
186 --   a PL/SQL exception.
187 --
188 -- Access Status:
189 --   Internal Row Handler Use Only.
190 --
191 -- ----------------------------------------------------------------------------
192 procedure chk_df
193   (p_rec in per_psh_shd.g_rec_type
194   ) is
195 --
196   l_proc   varchar2(72) := g_package || 'chk_df';
197 --
198 begin
199   hr_utility.set_location('Entering:'||l_proc,10);
200   --
201   if ((p_rec.sharing_instance_id is not null)  and (
202     nvl(per_psh_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
203     nvl(p_rec.attribute_category, hr_api.g_varchar2)  or
204     nvl(per_psh_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
205     nvl(p_rec.attribute1, hr_api.g_varchar2)  or
206     nvl(per_psh_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
207     nvl(p_rec.attribute2, hr_api.g_varchar2)  or
208     nvl(per_psh_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
209     nvl(p_rec.attribute3, hr_api.g_varchar2)  or
210     nvl(per_psh_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
211     nvl(p_rec.attribute4, hr_api.g_varchar2)  or
212     nvl(per_psh_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
213     nvl(p_rec.attribute5, hr_api.g_varchar2)  or
214     nvl(per_psh_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
215     nvl(p_rec.attribute6, hr_api.g_varchar2)  or
216     nvl(per_psh_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
217     nvl(p_rec.attribute7, hr_api.g_varchar2)  or
218     nvl(per_psh_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
219     nvl(p_rec.attribute8, hr_api.g_varchar2)  or
220     nvl(per_psh_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
221     nvl(p_rec.attribute9, hr_api.g_varchar2)  or
222     nvl(per_psh_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
223     nvl(p_rec.attribute10, hr_api.g_varchar2)  or
224     nvl(per_psh_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
225     nvl(p_rec.attribute11, hr_api.g_varchar2)  or
226     nvl(per_psh_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
227     nvl(p_rec.attribute12, hr_api.g_varchar2)  or
228     nvl(per_psh_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
229     nvl(p_rec.attribute13, hr_api.g_varchar2)  or
230     nvl(per_psh_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
231     nvl(p_rec.attribute14, hr_api.g_varchar2)  or
232     nvl(per_psh_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
233     nvl(p_rec.attribute15, hr_api.g_varchar2)  or
234     nvl(per_psh_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
235     nvl(p_rec.attribute16, hr_api.g_varchar2)  or
236     nvl(per_psh_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
237     nvl(p_rec.attribute17, hr_api.g_varchar2)  or
238     nvl(per_psh_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
239     nvl(p_rec.attribute18, hr_api.g_varchar2)  or
240     nvl(per_psh_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
241     nvl(p_rec.attribute19, hr_api.g_varchar2)  or
242     nvl(per_psh_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
243     nvl(p_rec.attribute20, hr_api.g_varchar2)  or
244     nvl(per_psh_shd.g_old_rec.attribute21, hr_api.g_varchar2) <>
245     nvl(p_rec.attribute21, hr_api.g_varchar2)  or
246     nvl(per_psh_shd.g_old_rec.attribute22, hr_api.g_varchar2) <>
247     nvl(p_rec.attribute22, hr_api.g_varchar2)  or
248     nvl(per_psh_shd.g_old_rec.attribute23, hr_api.g_varchar2) <>
249     nvl(p_rec.attribute23, hr_api.g_varchar2)  or
250     nvl(per_psh_shd.g_old_rec.attribute24, hr_api.g_varchar2) <>
251     nvl(p_rec.attribute24, hr_api.g_varchar2)  or
252     nvl(per_psh_shd.g_old_rec.attribute25, hr_api.g_varchar2) <>
253     nvl(p_rec.attribute25, hr_api.g_varchar2)  or
254     nvl(per_psh_shd.g_old_rec.attribute26, hr_api.g_varchar2) <>
255     nvl(p_rec.attribute26, hr_api.g_varchar2)  or
256     nvl(per_psh_shd.g_old_rec.attribute27, hr_api.g_varchar2) <>
257     nvl(p_rec.attribute27, hr_api.g_varchar2)  or
258     nvl(per_psh_shd.g_old_rec.attribute28, hr_api.g_varchar2) <>
259     nvl(p_rec.attribute28, hr_api.g_varchar2)  or
260     nvl(per_psh_shd.g_old_rec.attribute29, hr_api.g_varchar2) <>
261     nvl(p_rec.attribute29, hr_api.g_varchar2)  or
262     nvl(per_psh_shd.g_old_rec.attribute30, hr_api.g_varchar2) <>
263     nvl(p_rec.attribute30, hr_api.g_varchar2) ))
264     or (p_rec.sharing_instance_id is null)  then
265     --
266     -- Only execute the validation if absolutely necessary:
267     -- a) During update, the structure column value or any
268     --    of the attribute values have actually changed.
269     -- b) During insert.
270     --
271     hr_dflex_utility.ins_or_upd_descflex_attribs
272       (p_appl_short_name                 => 'PER'
273       ,p_descflex_name                   => 'PER_SCORECARD_SHARING'
274       ,p_attribute_category              => p_rec.attribute_category
275       ,p_attribute1_name                 => 'ATTRIBUTE1'
276       ,p_attribute1_value                => p_rec.attribute1
277       ,p_attribute2_name                 => 'ATTRIBUTE2'
278       ,p_attribute2_value                => p_rec.attribute2
279       ,p_attribute3_name                 => 'ATTRIBUTE3'
280       ,p_attribute3_value                => p_rec.attribute3
281       ,p_attribute4_name                 => 'ATTRIBUTE4'
282       ,p_attribute4_value                => p_rec.attribute4
283       ,p_attribute5_name                 => 'ATTRIBUTE5'
284       ,p_attribute5_value                => p_rec.attribute5
285       ,p_attribute6_name                 => 'ATTRIBUTE6'
286       ,p_attribute6_value                => p_rec.attribute6
287       ,p_attribute7_name                 => 'ATTRIBUTE7'
288       ,p_attribute7_value                => p_rec.attribute7
289       ,p_attribute8_name                 => 'ATTRIBUTE8'
290       ,p_attribute8_value                => p_rec.attribute8
291       ,p_attribute9_name                 => 'ATTRIBUTE9'
292       ,p_attribute9_value                => p_rec.attribute9
293       ,p_attribute10_name                => 'ATTRIBUTE10'
294       ,p_attribute10_value               => p_rec.attribute10
295       ,p_attribute11_name                => 'ATTRIBUTE11'
296       ,p_attribute11_value               => p_rec.attribute11
297       ,p_attribute12_name                => 'ATTRIBUTE12'
298       ,p_attribute12_value               => p_rec.attribute12
299       ,p_attribute13_name                => 'ATTRIBUTE13'
300       ,p_attribute13_value               => p_rec.attribute13
301       ,p_attribute14_name                => 'ATTRIBUTE14'
302       ,p_attribute14_value               => p_rec.attribute14
303       ,p_attribute15_name                => 'ATTRIBUTE15'
304       ,p_attribute15_value               => p_rec.attribute15
305       ,p_attribute16_name                => 'ATTRIBUTE16'
306       ,p_attribute16_value               => p_rec.attribute16
307       ,p_attribute17_name                => 'ATTRIBUTE17'
308       ,p_attribute17_value               => p_rec.attribute17
309       ,p_attribute18_name                => 'ATTRIBUTE18'
310       ,p_attribute18_value               => p_rec.attribute18
311       ,p_attribute19_name                => 'ATTRIBUTE19'
312       ,p_attribute19_value               => p_rec.attribute19
313       ,p_attribute20_name                => 'ATTRIBUTE20'
314       ,p_attribute20_value               => p_rec.attribute20
315       ,p_attribute21_name                => 'ATTRIBUTE21'
316       ,p_attribute21_value               => p_rec.attribute21
317       ,p_attribute22_name                => 'ATTRIBUTE22'
318       ,p_attribute22_value               => p_rec.attribute22
319       ,p_attribute23_name                => 'ATTRIBUTE23'
320       ,p_attribute23_value               => p_rec.attribute23
321       ,p_attribute24_name                => 'ATTRIBUTE24'
322       ,p_attribute24_value               => p_rec.attribute24
323       ,p_attribute25_name                => 'ATTRIBUTE25'
327       ,p_attribute27_name                => 'ATTRIBUTE27'
324       ,p_attribute25_value               => p_rec.attribute25
325       ,p_attribute26_name                => 'ATTRIBUTE26'
326       ,p_attribute26_value               => p_rec.attribute26
328       ,p_attribute27_value               => p_rec.attribute27
329       ,p_attribute28_name                => 'ATTRIBUTE28'
330       ,p_attribute28_value               => p_rec.attribute28
331       ,p_attribute29_name                => 'ATTRIBUTE29'
332       ,p_attribute29_value               => p_rec.attribute29
333       ,p_attribute30_name                => 'ATTRIBUTE30'
334       ,p_attribute30_value               => p_rec.attribute30
335       );
336   end if;
337   --
338   hr_utility.set_location(' Leaving:'||l_proc,20);
339 end chk_df;
340 --
341 -- ----------------------------------------------------------------------------
342 -- |-----------------------< chk_non_updateable_args >------------------------|
343 -- ----------------------------------------------------------------------------
344 -- {Start Of Comments}
345 --
346 -- Description:
347 --   This procedure is used to ensure that non updateable attributes have
348 --   not been updated. If an attribute has been updated an error is generated.
349 --
350 -- Pre Conditions:
351 --   g_old_rec has been populated with details of the values currently in
352 --   the database.
353 --
354 -- In Arguments:
355 --   p_rec has been populated with the updated values the user would like the
356 --   record set to.
357 --
358 -- Post Success:
359 --   Processing continues if all the non updateable attributes have not
360 --   changed.
361 --
362 -- Post Failure:
363 --   An application error is raised if any of the non updatable attributes
364 --   have been altered.
365 --
366 -- {End Of Comments}
367 -- ----------------------------------------------------------------------------
368 Procedure chk_non_updateable_args
369   (p_rec in per_psh_shd.g_rec_type
370   ) IS
371 --
372   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
373 --
374 Begin
375   --
376   -- Only proceed with the validation if a row exists for the current
377   -- record in the HR Schema.
378   --
379   IF NOT per_psh_shd.api_updating
380       (p_sharing_instance_id               => p_rec.sharing_instance_id
381       ,p_object_version_number             => p_rec.object_version_number
382       ) THEN
383      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
384      fnd_message.set_token('PROCEDURE ', l_proc);
385      fnd_message.set_token('STEP ', '5');
386      fnd_message.raise_error;
387   END IF;
388   --
389   -- There are no non-updateable args to check here.
390   --
391 End chk_non_updateable_args;
392 --
393 -- ----------------------------------------------------------------------------
394 -- |--------------------------< chk_scorecard_id >----------------------------|
395 -- ----------------------------------------------------------------------------
396 --
397 Procedure chk_scorecard_id
398   (p_scorecard_id          IN number
399   ,p_person_id             IN number
400   ) IS
401 
402   --
403   l_proc          varchar2(72) := g_package || 'chk_scorecard_id';
404   l_scorecard_person_id       number;
405   --
406   CURSOR csr_chk_scard_id IS
407   SELECT psc.person_id
408   FROM   per_personal_scorecards psc
409   WHERE  psc.scorecard_id = p_scorecard_id;
410 --
411 BEGIN
412 
413   hr_utility.set_location('Entering:'|| l_proc, 10);
414 
415   --
416   -- Check mandatory parameters have been set
417   --
418     hr_api.mandatory_arg_error
419     (p_api_name       => l_proc
420     ,p_argument       => 'person_id'
421     ,p_argument_value => p_person_id
422     );
423   IF p_scorecard_id IS NOT null THEN
424     --
425     -- Check that scorecard exists.
426     --
427     hr_utility.set_location(l_proc, 20);
428     OPEN  csr_chk_scard_id;
429     FETCH csr_chk_scard_id INTO l_scorecard_person_id;
430     CLOSE csr_chk_scard_id;
431     --
432     IF l_scorecard_person_id IS null THEN
433       fnd_message.set_name('PER', 'HR_WPM_INVALID_SCORECARD');
434       fnd_message.raise_error;
435     END IF;
436     --
437     -- Check that scorecard is not shared with owner of scorecard
438     --
439     IF l_scorecard_person_id = p_person_id THEN
440       fnd_message.set_name('PER', 'HR_WPM_INV_SHR_SAME_PER');
441       fnd_message.raise_error;
442     END IF;
443     --
444   END IF;
445   --
446   hr_utility.set_location('Leaving:'|| l_proc, 970);
447   --
448 EXCEPTION
449 
450   WHEN app_exception.application_exception THEN
451     IF hr_multi_message.exception_add
452       (p_associated_column1 => 'PER_SCORECARD_SHARING.SCORECARD_ID')
453     THEN
454       hr_utility.set_location(' Leaving:'|| l_proc, 980);
455       RAISE;
456     END IF;
457     hr_utility.set_location(' Leaving:'|| l_proc, 990);
458 
459 END chk_scorecard_id;
460 --
461 -----------------------------------------------------------------------------
462 --------------------------------<chk_person_id>------------------------------
463 -----------------------------------------------------------------------------
464 --
465 procedure chk_person_id
466 (p_person_id          in      per_objectives.owning_person_id%TYPE
467 )
468 is
469 --
470 l_exists	     varchar2(1);
471   l_proc               varchar2(72)  :=  g_package||'chk_person_id';
472   --
473   -- Cursor to check if person is valid
474   -- as of sys date
475   --
476   Cursor csr_person_valid
477     is
478     select 'Y'
482           effective_start_date and nvl(effective_end_date,hr_api.g_eot);
479     from  per_all_people_f
480     where person_id = p_person_id
481     and	  trunc(sysdate) between
483     --
484 --
485 begin
486   hr_utility.set_location('Entering:'|| l_proc, 1);
487   --
488   -- Check mandatory parameters have been set
489   --
490     hr_api.mandatory_arg_error
491     (p_api_name       => l_proc
492     ,p_argument       => 'person_id'
493     ,p_argument_value => p_person_id
494     );
495   --
496   --
497   hr_utility.set_location('Entering:'|| l_proc, 2);
498   --
499   if p_person_id is not null then
500      -- check if person is valid
501      open csr_person_valid;
502      fetch csr_person_valid into l_exists;
503      if csr_person_valid%notfound then
504         close csr_person_valid;
505        fnd_message.set_name('PER','HR_WPM_INV_PERSON');
506        fnd_message.raise_error;
507      else
508         close csr_person_valid;
509      end if;
510      hr_utility.set_location(l_proc, 5);
511   end if;
512   --
513  hr_utility.set_location('Leaving: '|| l_proc, 10);
514 --
515 exception
516 when app_exception.application_exception then
517      if hr_multi_message.exception_add
518           (p_associated_column1      => 'PER_SCORECARD_SHARING.PERSON_ID'
519            ) then
520         raise;
521      end if;
522 
523 end chk_person_id;
524 --
525 -- ----------------------------------------------------------------------------
526 -- |----------------------< chk_scorecard_person_unique >---------------------|
527 -- ----------------------------------------------------------------------------
528 --
529 Procedure chk_scorecard_person_unique
530   (p_scorecard_id          IN number
531   ,p_person_id             IN number
532   ) IS
533 
534   --
535   l_proc          varchar2(72) := g_package || 'chk_scorecard_person_unique';
536   l_exists        varchar2(1);
537   --
538   CURSOR csr_chk_unique IS
539   SELECT 'Y'
540   FROM   per_scorecard_sharing
541   WHERE  scorecard_id = p_scorecard_id
542   AND    person_id    = p_person_id;
543 --
544 BEGIN
545   --
546   hr_utility.set_location('Entering:'|| l_proc, 10);
547   OPEN  csr_chk_unique;
548   FETCH csr_chk_unique INTO l_exists;
549   CLOSE csr_chk_unique;
550   --
551   -- Check whether scorecard and person combination already exists
552   --
553   IF nvl(l_exists,'N')='Y' THEN
554     fnd_message.set_name('PER', 'HR_WPM_INV_SCORE_PERSON_COMB');
555     fnd_message.raise_error;
556   END IF;
557   --
558   hr_utility.set_location('Leaving:'|| l_proc, 70);
559   --
560 EXCEPTION
561   WHEN app_exception.application_exception THEN
562     IF hr_multi_message.exception_add
563       (p_associated_column1 => 'PER_SCORECARD_SHARING.SCORECARD_ID'
564       ,p_associated_column2 => 'PER_SCORECARD_SHARING.PERSON_ID')
565     THEN
566       hr_utility.set_location(' Leaving:'|| l_proc, 80);
567       RAISE;
568     END IF;
569     hr_utility.set_location(' Leaving:'|| l_proc, 90);
570 
571 END chk_scorecard_person_unique;
572 --
573 -- ----------------------------------------------------------------------------
574 -- |---------------------------< insert_validate >----------------------------|
575 -- ----------------------------------------------------------------------------
576 Procedure insert_validate
577   (p_rec               in per_psh_shd.g_rec_type
578   ) is
579 --
580   l_proc  varchar2(72) := g_package||'insert_validate';
581 --
582 Begin
583   hr_utility.set_location('Entering:'||l_proc, 5);
584   --
585   -- Call all supporting business operations
586   --
587   -- CLIENT_INFO not set.  No lookup validation or joins to HR_LOOKUPS.
588   --
589   -- Validate Dependent Attributes
590   --
591   --
592   -- check if person_id is valid
593   --
594   per_psh_bus.chk_person_id
595   (p_person_id                 => p_rec.person_id
596   );
597   --
598   -- check if scorecard_id is valid
599   --
600   per_psh_bus.chk_scorecard_id
601   (p_scorecard_id              => p_rec.scorecard_id
602   ,p_person_id                 => p_rec.person_id
603   );
604   --
605   -- check whetehr scorecard_id person_id combination already exists
606   --
607   per_psh_bus.chk_scorecard_person_unique
608   (p_scorecard_id              => p_rec.scorecard_id
609   ,p_person_id                 => p_rec.person_id
610   );
611   --
612   per_psh_bus.chk_df(p_rec);
613   --
614   hr_utility.set_location(' Leaving:'||l_proc, 10);
615 End insert_validate;
616 --
617 -- ----------------------------------------------------------------------------
618 -- |---------------------------< update_validate >----------------------------|
619 -- ----------------------------------------------------------------------------
620 Procedure update_validate
621   (p_rec               in per_psh_shd.g_rec_type
622   ) is
623 --
624   l_proc  varchar2(72) := g_package||'update_validate';
625 --
626 Begin
627   hr_utility.set_location('Entering:'||l_proc, 5);
628   --
629   -- Call all supporting business operations
630   --
631   -- CLIENT_INFO not set.  No lookup validation or joins to HR_LOOKUPS.
632   --
633   -- Validate Dependent Attributes
634   --
635   chk_non_updateable_args
636     (p_rec              => p_rec
637     );
638   --
639   --
640   -- check if person_id is valid
641   --
642   per_psh_bus.chk_person_id
643   (p_person_id                 => p_rec.person_id
644   );
645   --
646   -- check if scorecard_id is valid
647   --
648   per_psh_bus.chk_scorecard_id
649   (p_scorecard_id              => p_rec.scorecard_id
650   ,p_person_id                 => p_rec.person_id
651   );
652   --
653   per_psh_bus.chk_df(p_rec);
654   --
655   hr_utility.set_location(' Leaving:'||l_proc, 10);
656 End update_validate;
657 --
658 -- ----------------------------------------------------------------------------
659 -- |---------------------------< delete_validate >----------------------------|
660 -- ----------------------------------------------------------------------------
661 Procedure delete_validate
662   (p_rec                          in per_psh_shd.g_rec_type
663   ) is
664 --
665   l_proc  varchar2(72) := g_package||'delete_validate';
666 --
667 Begin
668   hr_utility.set_location('Entering:'||l_proc, 5);
669   --
670   -- Call all supporting business operations
671   --
672   hr_utility.set_location(' Leaving:'||l_proc, 10);
673 End delete_validate;
674 --
675 end per_psh_bus;