[Home] [Help]
PACKAGE BODY: APPS.PER_ORS_BUS
Source
4 -- ----------------------------------------------------------------------------
1 Package Body per_ors_bus as
2 /* $Header: peorsrhi.pkb 115.8 2003/06/30 09:58:15 kjagadee noship $ */
3 --
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_ors_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_organization_structure_id number default null;
15
16 --
17 -- ---------------------------------------------------------------------------
18 -- |----------------------------< chk_org_name >-----------------------------|
19 -- ---------------------------------------------------------------------------
20 --
21 Procedure chk_org_name
22 (p_organization_structure_id in number,
23 p_business_group_id in number,
24 p_name in varchar2
25 ) is
26 l_proc VARCHAR2(72) := g_package||'chk_org_name';
27 --
28 -- Declare cursor
29 --
30 cursor csr_org_name is
31 select organization_structure_id, business_group_id
32 from per_organization_structures
33 where name = p_name;
34 begin
35 --
36 hr_utility.set_location('Entering:'|| l_proc, 10);
37 --
38 --
39 hr_api.mandatory_arg_error
40 (p_api_name => l_proc
41 ,p_argument => 'p_name'
42 ,p_argument_value => p_name
43 );
44
45 --
46 --
47 hr_utility.set_location(l_proc, 20);
48 --
49 --
50
51 for Crec in csr_org_name loop
52 if Crec.organization_structure_id <> nvl(p_organization_structure_id,-1)
53 and Crec.business_group_id = nvl(p_business_group_id,crec.business_group_id) then
54 hr_utility.set_message('801','PER_7901_SYS_DUPLICATE_RECORDS');
55 hr_utility.raise_error;
56 end if;
57 end loop;
58 --
59 hr_utility.set_location('Leaving:'||l_proc, 30);
60 --
61 end chk_org_name;
62
63
64 -- ---------------------------------------------------------------------------
65 -- |---------------------------< get_hr_status >-----------------------------|
66 -- ---------------------------------------------------------------------------
67 --
68
69 function get_hr_status return VARCHAR2 is
70 --
71 l_hr_installed varchar2(1);
72 begin
73 --
74 -- Get status of Any of HR's Product set.
75 --
76 select 'I'
77 into l_hr_installed
78 from sys.dual
79 where exists (select 'I'
80 from fnd_product_installations
81 where application_id between 800 and 899
82 and status = 'I');
83 return l_hr_installed;
84 exception
85 when no_data_found then
86 return 'S';
87 end;
88
89 -- ---------------------------------------------------------------------------
90 -- |---------------------------< get_pa_status >-----------------------------|
91 -- ---------------------------------------------------------------------------
92 --
93
94 function get_pa_status return VARCHAR2 is
95 --
96 l_pa_installed boolean;
100 --
97 p_pa_installed varchar2(1);
98 l_industry varchar2(1);
99 begin
101 -- Get status of the Oracle Projects application
102 --
103 l_pa_installed := fnd_installation.get(appl_id => 275
104 ,dep_appl_id => 275
105 ,status => p_pa_installed
106 ,industry => l_industry);
107 return(p_pa_installed);
108 end;
109
110
111
112 -- ---------------------------------------------------------------------------
113 -- |---------------------------< chk_no_children >---------------------------|
114 -- ---------------------------------------------------------------------------
115 --
116 Procedure chk_no_children
117 (p_organization_structure_id in number) is
118
119 l_proc VARCHAR2(72) := g_package||'chk_no_children';
120 l_count number(2);
121 begin
122 --
123 hr_utility.set_location('Entering:'|| l_proc, 10);
124 --
125 --
126 hr_api.mandatory_arg_error
127 (p_api_name => l_proc
128 ,p_argument => 'p_organization_structure_id'
129 ,p_argument_value => p_organization_structure_id
130 );
131
132 select count(*)
133 into l_count
134 from PER_ORG_STRUCTURE_VERSIONS
135 where ORGANIZATION_STRUCTURE_ID = p_organization_Structure_Id;
136
137 if l_count >0 then
138 hr_utility.set_message('801','HR_6084_PO_POS_HAS_HIER_VER');
139 hr_utility.raise_error;
140 end if;
141
142 --
143 hr_utility.set_location('Leaving:'||l_proc, 30);
144 --
145 end chk_no_children;
146
147 -- ---------------------------------------------------------------------------
148 -- |----------------------------< chk_y_or_n>--------------------------------|
149 -- ---------------------------------------------------------------------------
150 --
151 Procedure chk_y_or_n
152 (p_effective_date in date
153 ,p_flag in varchar2
154 ,p_flag_name in varchar2)
155 IS
156 l_proc VARCHAR2(72) := g_package||'chk_sec_profile';
157 begin
158 hr_utility.set_location('Entering:'|| l_proc, 10);
159 --
160 --
161 IF hr_api.not_exists_in_hrstanlookups
162 (p_effective_date => p_effective_date
163 ,p_lookup_type => 'YES_NO'
164 ,p_lookup_code => p_flag
165 ) THEN
166 fnd_message.set_name('801','HR_52970_COL_Y_OR_N');
167 fnd_message.set_token('COLUMN',p_flag_name);
168 fnd_message.raise_error;
169 end if;
170 --
171 hr_utility.set_location('Leaving:'||l_proc, 30);
172 --
173 end chk_y_or_n;
174
175 -- ---------------------------------------------------------------------------
176 -- |--------------------------< chk_sec_profile >----------------------------|
177 -- ---------------------------------------------------------------------------
178 --
179 Procedure chk_sec_profile
180 (p_organization_structure_id in number) is
181
182 l_proc VARCHAR2(72) := g_package||'chk_sec_profile';
183 l_count number(2);
184 begin
188 --
185 --
186 hr_utility.set_location('Entering:'|| l_proc, 10);
187 --
189 hr_api.mandatory_arg_error
190 (p_api_name => l_proc
191 ,p_argument => 'p_organization_structure_id'
192 ,p_argument_value => p_organization_structure_id
193 );
194 select count(*)
195 into l_count
196 from per_security_profiles
197 where organization_structure_id = p_organization_structure_id;
198 if l_count >0 then
199 hr_utility.set_message('801','PAY_7694_PER_NO_DEL_STRUCTURE');
200 hr_utility.raise_error;
201 end if;
202
203 --
204 hr_utility.set_location('Leaving:'||l_proc, 30);
205 --
206 end chk_sec_profile;
207
208
209 --
210 -- ---------------------------------------------------------------------------
211 -- |-----------------------< chk_position_control >--------------------------|
212 -- ---------------------------------------------------------------------------
213 --
214 Procedure chk_position_control
215 (p_organization_structure_id in number,
216 p_business_group_id in number,
217 p_pos_control_structure_flag in varchar2
218 ) is
219 l_proc VARCHAR2(72) := g_package||'chk_position_control';
220 --
221 -- Declare cursor
222 --
223 cursor csr_org_pos is
224 select organization_structure_id,business_group_id
225 from per_organization_structures
229 --
226 where position_control_structure_flg = 'Y'
227 and business_group_id = p_business_group_id;
228 begin
230 hr_utility.set_location('Entering:'|| l_proc, 10);
231 --
232 --
233 --
234 --
235 hr_utility.set_location(l_proc, 20);
236 --
237 --
238 if p_pos_control_structure_flag = 'Y' then
239 for Crec in csr_org_pos loop
240 if Crec.organization_structure_id <> nvl(p_organization_structure_id,-1) then
241 hr_utility.set_message(800, 'PER_50053_POS_CTRL_DUPLICATED');
242 hr_utility.raise_error;
243 end if;
244 end loop;
245 end if;
246 --
247 hr_utility.set_location('Leaving:'||l_proc, 30);
248 --
249 end chk_position_control;
250
251 --
252 -- ---------------------------------------------------------------------------
253 -- |-------------------------< chk_primary_flag >----------------------------|
254 -- ---------------------------------------------------------------------------
255 --
256 Procedure chk_primary_flag
257 (p_organization_structure_id in number,
258 p_business_group_id in number,
259 p_primary_structure_flag in varchar2
260 ) is
261 l_proc VARCHAR2(72) := g_package||'chk_primary_flag';
262 --
263 -- Declare cursor
264 --
265 cursor csr_org_primary is
266 select organization_structure_id,business_group_id
267 from per_organization_structures
268 where primary_structure_flag = 'Y';
269 begin
270 --
271 hr_utility.set_location('Entering:'|| l_proc, 10);
272 --
273 --
274 hr_utility.set_location(l_proc, 20);
275 --
276 --
277 if p_primary_structure_flag = 'Y' then
278 for Crec in csr_org_primary loop
279 if Crec.organization_structure_id <> nvl(p_organization_structure_id,-1)
280 and Crec.business_group_id = p_business_group_id then
281 hr_utility.set_message(800, 'HR_6085_PO_POS_ONE_PRIMARY');
282 hr_utility.raise_error;
283 end if;
284 end loop;
285 end if;
286 --
287 hr_utility.set_location('Leaving:'||l_proc, 30);
288 --
289 end chk_primary_flag;
290
291 --
292 -- ---------------------------------------------------------------------------
293 -- |----------------------< set_security_group_id >--------------------------|
294 -- ---------------------------------------------------------------------------
295 --
296 Procedure set_security_group_id
297 (p_organization_structure_id in number
298 ) is
299 --
300 -- Declare cursor
301 --
302 cursor csr_sec_grp is
303 select pbg.security_group_id
304 from per_business_groups pbg
305 , per_organization_structures ors
306 where ors.organization_structure_id = p_organization_structure_id
307 and pbg.business_group_id = ors.business_group_id;
308 --
309 -- Declare local variables
310 --
311 l_security_group_id number;
312 l_proc varchar2(72) := g_package||'set_security_group_id';
313 --
314 begin
315 --
316 hr_utility.set_location('Entering:'|| l_proc, 10);
317 --
318 -- Ensure that all the mandatory parameter are not null
319 --
320 hr_api.mandatory_arg_error
321 (p_api_name => l_proc
322 ,p_argument => 'organization_structure_id'
323 ,p_argument_value => p_organization_structure_id
324 );
325 --
326 open csr_sec_grp;
327 fetch csr_sec_grp into l_security_group_id;
328 --
329 if csr_sec_grp%notfound then
330 --
331 close csr_sec_grp;
332 --
333 -- The primary key is invalid therefore we must error
334 --
335 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
336 fnd_message.raise_error;
337 --
338 end if;
339 close csr_sec_grp;
340 --
341 -- Set the security_group_id in CLIENT_INFO
342 --
343 hr_api.set_security_group_id
344 (p_security_group_id => l_security_group_id
345 );
346 --
347 hr_utility.set_location(' Leaving:'|| l_proc, 20);
348 --
349 end set_security_group_id;
350
351 --
352 -- ---------------------------------------------------------------------------
353 -- |---------------------< return_legislation_code >-------------------------|
354 -- ---------------------------------------------------------------------------
355 --
356 Function return_legislation_code
357 (p_organization_structure_id in number
358 )
359 Return Varchar2 Is
360 --
361 -- Declare cursor
362 --
363 cursor csr_leg_code is
364 select pbg.legislation_code
365 from per_business_groups pbg
366 , per_organization_structures ors
367 where ors.organization_structure_id = p_organization_structure_id
368 and pbg.business_group_id (+) = ors.business_group_id;
369 --
370 -- Declare local variables
371 --
372 l_legislation_code varchar2(150);
376 --
373 l_proc varchar2(72) := g_package||'return_legislation_code';
374 --
375 Begin
377 hr_utility.set_location('Entering:'|| l_proc, 10);
378 --
379 -- Ensure that all the mandatory parameter are not null
380 --
381 hr_api.mandatory_arg_error
382 (p_api_name => l_proc
383 ,p_argument => 'organization_structure_id'
384 ,p_argument_value => p_organization_structure_id
385 );
386 --
387 if ( nvl(per_ors_bus.g_organization_structure_id, hr_api.g_number)
388 = p_organization_structure_id) then
389 --
390 -- The legislation code has already been found with a previous
391 -- call to this function. Just return the value in the global
392 -- variable.
393 --
394 l_legislation_code := per_ors_bus.g_legislation_code;
395 hr_utility.set_location(l_proc, 20);
396 else
397 --
398 -- The ID is different to the last call to this function
399 -- or this is the first call to this function.
400 --
401 open csr_leg_code;
402 fetch csr_leg_code into l_legislation_code;
403 --
404 if csr_leg_code%notfound then
405 --
406 -- The primary key is invalid therefore we must error
407 --
408 close csr_leg_code;
409 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
410 fnd_message.raise_error;
411 end if;
412 hr_utility.set_location(l_proc,30);
413 --
414 -- Set the global variables so the values are
415 -- available for the next call to this function.
416 --
417 close csr_leg_code;
418 per_ors_bus.g_organization_structure_id := p_organization_structure_id;
419 per_ors_bus.g_legislation_code := l_legislation_code;
420 end if;
421 hr_utility.set_location(' Leaving:'|| l_proc, 40);
422 return l_legislation_code;
423 end return_legislation_code;
424 --
425 -- ----------------------------------------------------------------------------
426 -- |------------------------------< chk_df >----------------------------------|
427 -- ----------------------------------------------------------------------------
428 --
429 -- Description:
430 -- Validates all the Descriptive Flexfield values.
431 --
432 -- Prerequisites:
433 -- All other columns have been validated. Must be called as the
434 -- last step from insert_validate and update_validate.
435 --
436 -- In Arguments:
437 -- p_rec
438 --
439 -- Post Success:
440 -- If the Descriptive Flexfield structure column and data values are
441 -- all valid this procedure will end normally and processing will
442 -- continue.
443 --
444 -- Post Failure:
445 -- If the Descriptive Flexfield structure column value or any of
446 -- the data values are invalid then an application error is raised as
447 -- a PL/SQL exception.
448 --
449 -- Access Status:
450 -- Internal Row Handler Use Only.
451 --
452 -- ----------------------------------------------------------------------------
453 procedure chk_df
454 (p_rec in per_ors_shd.g_rec_type
455 ) is
456 --
457 l_proc varchar2(72) := g_package || 'chk_df';
458 --
459 begin
460 hr_utility.set_location('Entering:'||l_proc,10);
461 --
462 if ((p_rec.organization_structure_id is not null) and (
463 nvl(per_ors_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
464 nvl(p_rec.attribute_category, hr_api.g_varchar2) or
465 nvl(per_ors_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
466 nvl(p_rec.attribute1, hr_api.g_varchar2) or
467 nvl(per_ors_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
468 nvl(p_rec.attribute2, hr_api.g_varchar2) or
469 nvl(per_ors_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
470 nvl(p_rec.attribute3, hr_api.g_varchar2) or
471 nvl(per_ors_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
472 nvl(p_rec.attribute4, hr_api.g_varchar2) or
476 nvl(p_rec.attribute6, hr_api.g_varchar2) or
473 nvl(per_ors_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
474 nvl(p_rec.attribute5, hr_api.g_varchar2) or
475 nvl(per_ors_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
477 nvl(per_ors_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
478 nvl(p_rec.attribute7, hr_api.g_varchar2) or
479 nvl(per_ors_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
480 nvl(p_rec.attribute8, hr_api.g_varchar2) or
481 nvl(per_ors_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
482 nvl(p_rec.attribute9, hr_api.g_varchar2) or
483 nvl(per_ors_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
484 nvl(p_rec.attribute10, hr_api.g_varchar2) or
485 nvl(per_ors_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
486 nvl(p_rec.attribute11, hr_api.g_varchar2) or
487 nvl(per_ors_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
488 nvl(p_rec.attribute12, hr_api.g_varchar2) or
489 nvl(per_ors_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
490 nvl(p_rec.attribute13, hr_api.g_varchar2) or
491 nvl(per_ors_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
492 nvl(p_rec.attribute14, hr_api.g_varchar2) or
493 nvl(per_ors_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
494 nvl(p_rec.attribute15, hr_api.g_varchar2) or
495 nvl(per_ors_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
496 nvl(p_rec.attribute16, hr_api.g_varchar2) or
497 nvl(per_ors_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
498 nvl(p_rec.attribute17, hr_api.g_varchar2) or
499 nvl(per_ors_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
500 nvl(p_rec.attribute18, hr_api.g_varchar2) or
501 nvl(per_ors_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
502 nvl(p_rec.attribute19, hr_api.g_varchar2) or
503 nvl(per_ors_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
504 nvl(p_rec.attribute20, hr_api.g_varchar2) ))
505 or (p_rec.organization_structure_id is null) then
506 --
507 -- Only execute the validation if absolutely necessary:
508 -- a) During update, the structure column value or any
509 -- of the attribute values have actually changed.
510 -- b) During insert.
511 --
512 hr_dflex_utility.ins_or_upd_descflex_attribs
513 (p_appl_short_name => 'PER'
514 ,p_descflex_name => 'PER_ORGANIZATION_STRUCTURES'
515 ,p_attribute_category => p_rec.attribute_category
516 ,p_attribute1_name => 'ATTRIBUTE1'
517 ,p_attribute1_value => p_rec.attribute1
518 ,p_attribute2_name => 'ATTRIBUTE2'
519 ,p_attribute2_value => p_rec.attribute2
523 ,p_attribute4_value => p_rec.attribute4
520 ,p_attribute3_name => 'ATTRIBUTE3'
521 ,p_attribute3_value => p_rec.attribute3
522 ,p_attribute4_name => 'ATTRIBUTE4'
524 ,p_attribute5_name => 'ATTRIBUTE5'
525 ,p_attribute5_value => p_rec.attribute5
526 ,p_attribute6_name => 'ATTRIBUTE6'
527 ,p_attribute6_value => p_rec.attribute6
528 ,p_attribute7_name => 'ATTRIBUTE7'
529 ,p_attribute7_value => p_rec.attribute7
530 ,p_attribute8_name => 'ATTRIBUTE8'
531 ,p_attribute8_value => p_rec.attribute8
532 ,p_attribute9_name => 'ATTRIBUTE9'
533 ,p_attribute9_value => p_rec.attribute9
534 ,p_attribute10_name => 'ATTRIBUTE10'
535 ,p_attribute10_value => p_rec.attribute10
536 ,p_attribute11_name => 'ATTRIBUTE11'
537 ,p_attribute11_value => p_rec.attribute11
538 ,p_attribute12_name => 'ATTRIBUTE12'
539 ,p_attribute12_value => p_rec.attribute12
540 ,p_attribute13_name => 'ATTRIBUTE13'
541 ,p_attribute13_value => p_rec.attribute13
542 ,p_attribute14_name => 'ATTRIBUTE14'
543 ,p_attribute14_value => p_rec.attribute14
544 ,p_attribute15_name => 'ATTRIBUTE15'
545 ,p_attribute15_value => p_rec.attribute15
546 ,p_attribute16_name => 'ATTRIBUTE16'
547 ,p_attribute16_value => p_rec.attribute16
548 ,p_attribute17_name => 'ATTRIBUTE17'
549 ,p_attribute17_value => p_rec.attribute17
550 ,p_attribute18_name => 'ATTRIBUTE18'
551 ,p_attribute18_value => p_rec.attribute18
552 ,p_attribute19_name => 'ATTRIBUTE19'
553 ,p_attribute19_value => p_rec.attribute19
554 ,p_attribute20_name => 'ATTRIBUTE20'
558 --
555 ,p_attribute20_value => p_rec.attribute20
556 );
557 end if;
559 hr_utility.set_location(' Leaving:'||l_proc,20);
560 end chk_df;
561 --
562 -- ----------------------------------------------------------------------------
563 -- |-----------------------< chk_non_updateable_args >------------------------|
564 -- ----------------------------------------------------------------------------
565 -- {Start Of Comments}
566 --
567 -- Description:
568 -- This procedure is used to ensure that non updateable attributes have
569 -- not been updated. If an attribute has been updated an error is generated.
570 --
571 -- Pre Conditions:
572 -- g_old_rec has been populated with details of the values currently in
573 -- the database.
574 --
575 -- In Arguments:
576 -- p_rec has been populated with the updated values the user would like the
577 -- record set to.
578 --
579 -- Post Success:
580 -- Processing continues if all the non updateable attributes have not
581 -- changed.
582 --
583 -- Post Failure:
584 -- An application error is raised if any of the non updatable attributes
585 -- have been altered.
586 --
587 -- {End Of Comments}
588 -- ----------------------------------------------------------------------------
589 Procedure chk_non_updateable_args
590 (p_effective_date in date
591 ,p_rec in per_ors_shd.g_rec_type
592 ) IS
593 --
594 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
595 l_error EXCEPTION;
596 l_argument varchar2(30);
597 --
598 Begin
599 --
600 -- Only proceed with the validation if a row exists for the current
601 -- record in the HR Schema.
602 --
603 IF NOT per_ors_shd.api_updating
604 (p_organization_structure_id => p_rec.organization_structure_id
605 ,p_object_version_number => p_rec.object_version_number
606 ) THEN
607 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
608 fnd_message.set_token('PROCEDURE ', l_proc);
609 fnd_message.set_token('STEP ', '5');
610 fnd_message.raise_error;
611 END IF;
612 --
613 EXCEPTION
614 WHEN l_error THEN
615 hr_api.argument_changed_error
616 (p_api_name => l_proc
617 ,p_argument => l_argument);
618 WHEN OTHERS THEN
619 RAISE;
620 End chk_non_updateable_args;
621 --
622 -- ----------------------------------------------------------------------------
623 -- |---------------------------< insert_validate >----------------------------|
624 -- ----------------------------------------------------------------------------
625 Procedure insert_validate
626 (p_effective_date in date
627 ,p_rec in per_ors_shd.g_rec_type
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 -- Call all supporting business operations
636 --
637 if p_rec.business_group_id IS NOT NULL then
638 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
639 end if;
640
641 chk_org_name
642 (p_organization_structure_id => p_rec.organization_structure_id
643 ,p_business_group_id => p_rec.business_group_id
644 ,p_name => p_rec.name);
645
646 chk_y_or_n
647 (p_effective_date => p_effective_date
648 ,p_flag => p_rec.primary_structure_flag
649 ,p_flag_name => 'PRIMARY_STRUCTURE_FLAG');
650
651 chk_y_or_n
652 (p_effective_date => p_effective_date
653 ,p_flag => p_rec.position_control_structure_flg
654 ,p_flag_name => 'POSITION_CONTROL_STRUCTURE_F');
655
656 chk_primary_flag
657 (p_organization_structure_id => p_rec.organization_structure_id
658 ,p_business_group_id => p_rec.business_group_id
659 ,p_primary_structure_flag => p_rec.primary_structure_flag);
660
661 --
662 --
663 per_ors_bus.chk_df(p_rec);
664 --
665 hr_utility.set_location(' Leaving:'||l_proc, 10);
666 End insert_validate;
667 --
668 -- ----------------------------------------------------------------------------
669 -- |---------------------------< update_validate >----------------------------|
673 ,p_rec in per_ors_shd.g_rec_type
670 -- ----------------------------------------------------------------------------
671 Procedure update_validate
672 (p_effective_date in date
674 ) is
675 --
676 l_proc varchar2(72) := g_package||'update_validate';
677 --
678 Begin
679 hr_utility.set_location('Entering:'||l_proc, 5);
680 --
681 -- Call all supporting business operations
682 --
683 if p_rec.business_group_id IS NOT NULL then
684 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
685 end if;
686
687 chk_y_or_n
688 (p_effective_date => p_effective_date
689 ,p_flag => p_rec.primary_structure_flag
690 ,p_flag_name => 'PRIMARY_STRUCTURE_FLAG');
691
692 chk_y_or_n
693 (p_effective_date => p_effective_date
694 ,p_flag => p_rec.position_control_structure_flg
695 ,p_flag_name => 'POSITION_CONTROL_STRUCTURE_F');
696
697 chk_org_name
698 (p_organization_structure_id => p_rec.organization_structure_id
699 ,p_business_group_id => p_rec.business_group_id
700 ,p_name => p_rec.name);
701
702 chk_primary_flag
703 (p_organization_structure_id => p_rec.organization_structure_id
704 ,p_business_group_id => p_rec.business_group_id
705 ,p_primary_structure_flag => p_rec.primary_structure_flag);
706 --
707 chk_non_updateable_args
708 (p_effective_date => p_effective_date
709 ,p_rec => p_rec
710 );
711 --
712 --
713 per_ors_bus.chk_df(p_rec);
714 --
715 hr_utility.set_location(' Leaving:'||l_proc, 10);
716 End update_validate;
717 --
718 -- ----------------------------------------------------------------------------
719 -- |---------------------------< delete_validate >----------------------------|
720 -- ----------------------------------------------------------------------------
721 Procedure delete_validate
722 (p_rec in per_ors_shd.g_rec_type
723 ) is
724 --
725 l_proc varchar2(72) := g_package||'delete_validate';
726 --
727 Begin
728 hr_utility.set_location('Entering:'||l_proc, 5);
729 --
730 -- Call all supporting business operations
731 chk_no_children
732 (p_organization_structure_id => p_rec.organization_structure_id);
733 chk_sec_profile
734 (p_organization_structure_id => p_rec.organization_structure_id);
735 if get_hr_status = 'I' then
736 pa_org.pa_os_predel_validation(p_rec.organization_structure_id);
737 end if;
738
739 --
740 hr_utility.set_location(' Leaving:'||l_proc, 10);
741 End delete_validate;
742 --
743 end per_ors_bus;