DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_EST_BUS

Source


1 Package Body per_est_bus as
2 /* $Header: peestrhi.pkb 120.0.12010000.2 2008/11/28 11:06:53 ppentapa ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_est_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< chk_name_location_unique >----------------------|
12 -- ----------------------------------------------------------------------------
13 -- Description
14 --   This procedure checks that an establishment name and an establishment
15 --   location are unique.
16 --
17 -- Pre-Conditions
18 --   None.
19 --
20 -- In Parameters
21 --   p_establishment_id		PK
22 --   p_name			name of establishment
23 --   p_location			location of establishment
24 --   p_object_version_number	object version number
25 --
26 -- Post Success
27 --   Processing continues
28 --
29 -- Post Failure
30 --   Error raised.
31 --
32 -- Access Status
33 --   Internal table handler use only.
34 --
35 procedure chk_name_location_unique (p_establishment_id      in number,
36 				    p_name                  in varchar2,
37 				    p_location              in varchar2,
38 				    p_object_version_number in number) is
39   --
40   l_proc varchar2(72) := g_package||'chk_name_location_unique';
41   l_api_updating boolean;
42   l_dummy varchar2(1);
43   --
44   -- cursor to see if an establishment name already exists at a certain
45   -- location.
46   --
47   cursor c1 is
48     select null
49     from   per_establishments a
50     where  a.name = p_name
51     and    a.location = p_location;
52   --
53 begin
54   --
55   hr_utility.set_location('Entering:'||l_proc,5);
56   --
57   l_api_updating := per_est_shd.api_updating
58     (p_establishment_id      => p_establishment_id,
59      p_object_version_number => p_object_version_number);
60   --
61   if not l_api_updating
62      or (l_api_updating
63          and (per_est_shd.g_old_rec.name
64 	      <> nvl(p_name,hr_api.g_varchar2)
65               or per_est_shd.g_old_rec.location
66 	      <> nvl(p_location,hr_api.g_varchar2))) then
67     --
68     -- check if name is not null
69     --
70     if p_name is null then
71       --
72       -- raise error as name must be not null
73       --
74       hr_utility.set_message(801,'HR_51487_EST_CHK_NAME_NOT_NULL');
75       hr_utility.raise_error;
76       --
77     end if;
78     --
79     if p_location is null then
80       --
81       -- raise error as location must be not null
82       --
83       hr_utility.set_message(801,'HR_51488_EST_CHK_LOC_NOT_NULL');
84       hr_utility.raise_error;
85       --
86     end if;
87     --
88     -- check if establishment and location are unique.
89     --
90     open c1;
91       --
92       fetch c1 into l_dummy;
93       --
94       if c1%found then
95 	--
96 	-- raise error as name and location exists
97 	--
98 	close c1;
99 	per_est_shd.constraint_error('PER_ESTABLISHMENTS_UK');
100 	--
101       end if;
102       --
103     close c1;
104     --
105   end if;
106   --
107   hr_utility.set_location('Leaving:'||l_proc,5);
108   --
109 end chk_name_location_unique;
110 -- ----------------------------------------------------------------------------
111 -- |-------------------------< chk_establishment_id >-------------------------|
112 -- ----------------------------------------------------------------------------
113 -- Description
114 --   This procedure checks that the establishment id is unique and has been
115 --   entered and is not updated.
116 --
117 -- Pre-Conditions
118 --   None.
119 --
120 -- In Parameters
121 --   p_establishment_id		PK
122 --   p_object_version_number	object version number
123 --
124 -- Post Success
125 --   Processing continues
126 --
127 -- Post Failure
128 --   Error raised.
129 --
130 -- Access Status
131 --   Internal table handler use only
132 --
133 Procedure chk_establishment_id(p_establishment_id      in number,
134 			       p_object_version_number in number) is
135   --
136   l_proc  varchar2(72) := g_package||'chk_establishment_id';
137   l_api_updating boolean;
138   --
139 Begin
140   --
141   hr_utility.set_location('Entering:'||l_proc, 5);
142   --
143   l_api_updating := per_est_shd.api_updating
144     (p_establishment_id      => p_establishment_id,
145      p_object_version_number => p_object_version_number);
146   --
147   if (not l_api_updating) then
148     --
149     if p_establishment_id is not null then
150       --
151       -- raise error as establishment id is a not null value
152       --
153       per_est_shd.constraint_error('PER_ESTABLISHMENTS_PK');
154       --
155     end if;
156     --
157   elsif (l_api_updating
158 	 and nvl(p_establishment_id,hr_api.g_number)
159 	 <> per_est_shd.g_old_rec.establishment_id) then
160     --
161     -- raise error as PK has been updated
162     --
163     per_est_shd.constraint_error('PER_ESTABLISHMENTS_PK');
164     --
165   end if;
166   --
167   hr_utility.set_location(' Leaving:'||l_proc, 10);
168   --
169 end chk_establishment_id;
170 --
171 -- ----------------------------------------------------------------------------
172 -- |---------------------------< chk_estab_delete >---------------------------|
173 -- ----------------------------------------------------------------------------
174 -- Description
175 --   This procedure checks whether an establishment can be deleted which
176 --   depends on whether it is referenced anywhere.
177 --
178 -- Pre-Conditions
179 --   None.
180 --
181 -- In Parameters
182 --   p_establishment_id		PK
183 --
184 -- Post Success
185 --   Processing continues
186 --
187 -- Post Failure
188 --   Error raised.
189 --
190 -- Access Status
191 --   Internal table handler use only
192 --
193 Procedure chk_estab_delete(p_establishment_id      in number) is
194   --
195   l_proc  varchar2(72) := g_package||'chk_estab_delete';
196   l_api_updating boolean;
197   l_dummy varchar2(1);
198   --
199   cursor c1 is
200     select null
201     from   per_establishment_attendances per
202     where  per.establishment_id = p_establishment_id;
203   --
204 Begin
205   --
206   hr_utility.set_location('Entering:'||l_proc, 5);
207   --
208   -- check if the establishment_id is referenced in the per_estab_attendances
209   -- table
210   --
211   open c1;
212     --
213     fetch c1 into l_dummy;
214     --
215     if c1%found then
216       --
217       -- raise error as records exist that reference this primary key
218       --
219       hr_utility.set_message(801,'HR_51486_EST_CHK_DELETE_EST');
220       hr_utility.raise_error;
221       --
222     end if;
223     --
224   close c1;
225   --
226   hr_utility.set_location(' Leaving:'||l_proc, 10);
227   --
228 end chk_estab_delete;
229 --
230 -- -----------------------------------------------------------------------
231 -- |------------------------------< chk_df >-----------------------------|
232 -- -----------------------------------------------------------------------
233 --
234 -- Description:
235 --   Validates the all Descriptive Flexfield values.
236 --
237 -- Pre-conditions:
238 --   All other columns have been validated. Must be called as the
239 --   last step from insert_validate and update_validate.
240 --
241 -- In Arguments:
242 --   p_rec
243 --
244 -- Post Success:
245 --   If the Descriptive Flexfield structure column and data values are
246 --   all valid this procedure will end normally and processing will
247 --   continue.
248 --
249 -- Post Failure:
250 --   If the Descriptive Flexfield structure column value or any of
251 --   the data values are invalid then an application error is raised as
252 --   a PL/SQL exception.
253 --
254 -- Access Status:
255 --   Internal Row Handler Use Only.
256 --
257 procedure chk_df
258   (p_rec in per_est_shd.g_rec_type) is
259 --
260   l_proc     varchar2(72) := g_package||'chk_df';
261 --
262 begin
263   hr_utility.set_location('Entering:'||l_proc, 10);
264   --
265   if ((p_rec.establishment_id is not null) and (
266     nvl(per_est_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
267     nvl(p_rec.attribute_category, hr_api.g_varchar2) or
268     nvl(per_est_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
269     nvl(p_rec.attribute1, hr_api.g_varchar2) or
270     nvl(per_est_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
271     nvl(p_rec.attribute2, hr_api.g_varchar2) or
272     nvl(per_est_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
273     nvl(p_rec.attribute3, hr_api.g_varchar2) or
274     nvl(per_est_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
275     nvl(p_rec.attribute4, hr_api.g_varchar2) or
276     nvl(per_est_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
277     nvl(p_rec.attribute5, hr_api.g_varchar2) or
278     nvl(per_est_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
279     nvl(p_rec.attribute6, hr_api.g_varchar2) or
280     nvl(per_est_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
281     nvl(p_rec.attribute7, hr_api.g_varchar2) or
282     nvl(per_est_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
283     nvl(p_rec.attribute8, hr_api.g_varchar2) or
284     nvl(per_est_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
285     nvl(p_rec.attribute9, hr_api.g_varchar2) or
286     nvl(per_est_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
287     nvl(p_rec.attribute10, hr_api.g_varchar2) or
288     nvl(per_est_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
289     nvl(p_rec.attribute11, hr_api.g_varchar2) or
290     nvl(per_est_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
291     nvl(p_rec.attribute12, hr_api.g_varchar2) or
292     nvl(per_est_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
293     nvl(p_rec.attribute13, hr_api.g_varchar2) or
294     nvl(per_est_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
295     nvl(p_rec.attribute14, hr_api.g_varchar2) or
296     nvl(per_est_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
297     nvl(p_rec.attribute15, hr_api.g_varchar2) or
298     nvl(per_est_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
299     nvl(p_rec.attribute16, hr_api.g_varchar2) or
300     nvl(per_est_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
301     nvl(p_rec.attribute17, hr_api.g_varchar2) or
302     nvl(per_est_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
303     nvl(p_rec.attribute18, hr_api.g_varchar2) or
304     nvl(per_est_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
305     nvl(p_rec.attribute19, hr_api.g_varchar2) or
306     nvl(per_est_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
307     nvl(p_rec.attribute20, hr_api.g_varchar2)))
308     or
309     (p_rec.establishment_id is null) then
310    --
311    -- Only execute the validation if absolutely necessary:
312    -- a) During update, the structure column value or any
313    --    of the attribute values have actually changed.
314    -- b) During insert.
315    --
316    hr_dflex_utility.ins_or_upd_descflex_attribs
317      (p_appl_short_name     => 'PER'
318       ,p_descflex_name      => 'PER_ESTABLISHMENTS'
319       ,p_attribute_category => p_rec.attribute_category
320       ,p_attribute1_name    => 'ATTRIBUTE1'
321       ,p_attribute1_value   => p_rec.attribute1
322       ,p_attribute2_name    => 'ATTRIBUTE2'
323       ,p_attribute2_value   => p_rec.attribute2
324       ,p_attribute3_name    => 'ATTRIBUTE3'
325       ,p_attribute3_value   => p_rec.attribute3
326       ,p_attribute4_name    => 'ATTRIBUTE4'
327       ,p_attribute4_value   => p_rec.attribute4
328       ,p_attribute5_name    => 'ATTRIBUTE5'
329       ,p_attribute5_value   => p_rec.attribute5
330       ,p_attribute6_name    => 'ATTRIBUTE6'
331       ,p_attribute6_value   => p_rec.attribute6
332       ,p_attribute7_name    => 'ATTRIBUTE7'
333       ,p_attribute7_value   => p_rec.attribute7
334       ,p_attribute8_name    => 'ATTRIBUTE8'
335       ,p_attribute8_value   => p_rec.attribute8
336       ,p_attribute9_name    => 'ATTRIBUTE9'
337       ,p_attribute9_value   => p_rec.attribute9
338       ,p_attribute10_name   => 'ATTRIBUTE10'
339       ,p_attribute10_value  => p_rec.attribute10
340       ,p_attribute11_name   => 'ATTRIBUTE11'
341       ,p_attribute11_value  => p_rec.attribute11
342       ,p_attribute12_name   => 'ATTRIBUTE12'
343       ,p_attribute12_value  => p_rec.attribute12
344       ,p_attribute13_name   => 'ATTRIBUTE13'
345       ,p_attribute13_value  => p_rec.attribute13
346       ,p_attribute14_name   => 'ATTRIBUTE14'
347       ,p_attribute14_value  => p_rec.attribute14
348       ,p_attribute15_name   => 'ATTRIBUTE15'
349       ,p_attribute15_value  => p_rec.attribute15
350       ,p_attribute16_name   => 'ATTRIBUTE16'
351       ,p_attribute16_value  => p_rec.attribute16
352       ,p_attribute17_name   => 'ATTRIBUTE17'
353       ,p_attribute17_value  => p_rec.attribute17
354       ,p_attribute18_name   => 'ATTRIBUTE18'
355       ,p_attribute18_value  => p_rec.attribute18
356       ,p_attribute19_name   => 'ATTRIBUTE19'
357       ,p_attribute19_value  => p_rec.attribute19
358       ,p_attribute20_name   => 'ATTRIBUTE20'
359       ,p_attribute20_value  => p_rec.attribute20
360       );
361   end if;
362   --
363   hr_utility.set_location(' Leaving:'||l_proc, 20);
364 
365 end chk_df;
366 -- ----------------------------------------------------------------------------
367 -- |-----------------------------< chk_ddf >----------------------------------|
368 -- ----------------------------------------------------------------------------
369 --
370 -- Description:
371 --   Validates all the Developer Descriptive Flexfield values.
372 --
373 -- Prerequisites:
374 --   All other columns have been validated.  Must be called as the
375 --   last step from insert_validate and update_validate.
376 --
377 -- In Arguments:
378 --   p_rec
379 --
380 -- Post Success:
381 --   If the Developer Descriptive Flexfield structure column and data values
382 --   are all valid this procedure will end normally and processing will
383 --   continue.
384 --
385 -- Post Failure:
386 --   If the Developer Descriptive Flexfield structure column value or any of
387 --   the data values are invalid then an application error is raised as
388 --   a PL/SQL exception.
389 --
390 -- Access Status:
391 --   Internal Row Handler Use Only.
392 --
393 -- ----------------------------------------------------------------------------
394 procedure chk_ddf
395   (p_rec in per_est_shd.g_rec_type
396   ) is
397 --
398   l_proc   varchar2(72) := g_package || 'chk_ddf';
399 --
400 begin
401   hr_utility.set_location('Entering:'||l_proc,10);
402   --
403   if ((p_rec.establishment_id is not null)  and (
404     nvl(per_est_shd.g_old_rec.est_information_category, hr_api.g_varchar2) <>
405     nvl(p_rec.est_information_category, hr_api.g_varchar2)  or
406     nvl(per_est_shd.g_old_rec.est_information1, hr_api.g_varchar2) <>
407     nvl(p_rec.est_information1, hr_api.g_varchar2)  or
408     nvl(per_est_shd.g_old_rec.est_information2, hr_api.g_varchar2) <>
409     nvl(p_rec.est_information2, hr_api.g_varchar2)  or
410     nvl(per_est_shd.g_old_rec.est_information3, hr_api.g_varchar2) <>
411     nvl(p_rec.est_information3, hr_api.g_varchar2)  or
412     nvl(per_est_shd.g_old_rec.est_information4, hr_api.g_varchar2) <>
413     nvl(p_rec.est_information4, hr_api.g_varchar2)  or
414     nvl(per_est_shd.g_old_rec.est_information5, hr_api.g_varchar2) <>
415     nvl(p_rec.est_information5, hr_api.g_varchar2)  or
416     nvl(per_est_shd.g_old_rec.est_information6, hr_api.g_varchar2) <>
420     nvl(per_est_shd.g_old_rec.est_information8, hr_api.g_varchar2) <>
417     nvl(p_rec.est_information6, hr_api.g_varchar2)  or
418     nvl(per_est_shd.g_old_rec.est_information7, hr_api.g_varchar2) <>
419     nvl(p_rec.est_information7, hr_api.g_varchar2)  or
421     nvl(p_rec.est_information8, hr_api.g_varchar2)  or
422     nvl(per_est_shd.g_old_rec.est_information9, hr_api.g_varchar2) <>
423     nvl(p_rec.est_information9, hr_api.g_varchar2)  or
424     nvl(per_est_shd.g_old_rec.est_information10, hr_api.g_varchar2) <>
425     nvl(p_rec.est_information10, hr_api.g_varchar2)  or
426     nvl(per_est_shd.g_old_rec.est_information11, hr_api.g_varchar2) <>
427     nvl(p_rec.est_information11, hr_api.g_varchar2)  or
428     nvl(per_est_shd.g_old_rec.est_information12, hr_api.g_varchar2) <>
429     nvl(p_rec.est_information12, hr_api.g_varchar2)  or
430     nvl(per_est_shd.g_old_rec.est_information13, hr_api.g_varchar2) <>
431     nvl(p_rec.est_information13, hr_api.g_varchar2)  or
432     nvl(per_est_shd.g_old_rec.est_information14, hr_api.g_varchar2) <>
433     nvl(p_rec.est_information14, hr_api.g_varchar2)  or
434     nvl(per_est_shd.g_old_rec.est_information15, hr_api.g_varchar2) <>
435     nvl(p_rec.est_information15, hr_api.g_varchar2)  or
436     nvl(per_est_shd.g_old_rec.est_information16, hr_api.g_varchar2) <>
437     nvl(p_rec.est_information16, hr_api.g_varchar2)  or
438     nvl(per_est_shd.g_old_rec.est_information17, hr_api.g_varchar2) <>
439     nvl(p_rec.est_information17, hr_api.g_varchar2)  or
440     nvl(per_est_shd.g_old_rec.est_information18, hr_api.g_varchar2) <>
441     nvl(p_rec.est_information18, hr_api.g_varchar2)  or
442     nvl(per_est_shd.g_old_rec.est_information19, hr_api.g_varchar2) <>
443     nvl(p_rec.est_information19, hr_api.g_varchar2)  or
444     nvl(per_est_shd.g_old_rec.est_information20, hr_api.g_varchar2) <>
445     nvl(p_rec.est_information20, hr_api.g_varchar2) ))
446     or (p_rec.establishment_id is null)  then
447     --
448     -- Only execute the validation if absolutely necessary:
449     -- a) During update, the structure column value or any
450     --    of the attribute values have actually changed.
451     -- b) During insert.
452     --
453     hr_dflex_utility.ins_or_upd_descflex_attribs
454       (p_appl_short_name                 => 'PER'
455       ,p_descflex_name                   => 'Establishment Developer DF'
456       ,p_attribute_category              => p_rec.EST_INFORMATION_CATEGORY
457       ,p_attribute1_name                 => 'EST_INFORMATION1'
458       ,p_attribute1_value                => p_rec.est_information1
459       ,p_attribute2_name                 => 'EST_INFORMATION2'
460       ,p_attribute2_value                => p_rec.est_information2
461       ,p_attribute3_name                 => 'EST_INFORMATION3'
462       ,p_attribute3_value                => p_rec.est_information3
463       ,p_attribute4_name                 => 'EST_INFORMATION4'
464       ,p_attribute4_value                => p_rec.est_information4
465       ,p_attribute5_name                 => 'EST_INFORMATION5'
466       ,p_attribute5_value                => p_rec.est_information5
467       ,p_attribute6_name                 => 'EST_INFORMATION6'
468       ,p_attribute6_value                => p_rec.est_information6
469       ,p_attribute7_name                 => 'EST_INFORMATION7'
470       ,p_attribute7_value                => p_rec.est_information7
471       ,p_attribute8_name                 => 'EST_INFORMATION8'
472       ,p_attribute8_value                => p_rec.est_information8
473       ,p_attribute9_name                 => 'EST_INFORMATION9'
474       ,p_attribute9_value                => p_rec.est_information9
475       ,p_attribute10_name                => 'EST_INFORMATION10'
476       ,p_attribute10_value               => p_rec.est_information10
477       ,p_attribute11_name                => 'EST_INFORMATION11'
478       ,p_attribute11_value               => p_rec.est_information11
479       ,p_attribute12_name                => 'EST_INFORMATION12'
480       ,p_attribute12_value               => p_rec.est_information12
481       ,p_attribute13_name                => 'EST_INFORMATION13'
482       ,p_attribute13_value               => p_rec.est_information13
483       ,p_attribute14_name                => 'EST_INFORMATION14'
484       ,p_attribute14_value               => p_rec.est_information14
485       ,p_attribute15_name                => 'EST_INFORMATION15'
486       ,p_attribute15_value               => p_rec.est_information15
487       ,p_attribute16_name                => 'EST_INFORMATION16'
488       ,p_attribute16_value               => p_rec.est_information16
489       ,p_attribute17_name                => 'EST_INFORMATION17'
490       ,p_attribute17_value               => p_rec.est_information17
491       ,p_attribute18_name                => 'EST_INFORMATION18'
492       ,p_attribute18_value               => p_rec.est_information18
493       ,p_attribute19_name                => 'EST_INFORMATION19'
494       ,p_attribute19_value               => p_rec.est_information19
495       ,p_attribute20_name                => 'EST_INFORMATION20'
496       ,p_attribute20_value               => p_rec.est_information20
497       );
498   end if;
499   --
500   hr_utility.set_location(' Leaving:'||l_proc,20);
501 end chk_ddf;
502 -- ----------------------------------------------------------------------------
503 -- |---------------------------< insert_validate >----------------------------|
504 -- ----------------------------------------------------------------------------
505 Procedure insert_validate(p_rec in per_est_shd.g_rec_type) is
506 --
510   hr_utility.set_location('Entering:'||l_proc, 5);
507   l_proc  varchar2(72) := g_package||'insert_validate';
508 --
509 Begin
511   --
512   -- As this data is not within the context of a business group
513   -- the set_security_group_id procedure has zero passed
514   -- to it as the default security_group_id.
515   --
516   If hr_multi_tenancy_pkg.is_multi_tenant_system Then
517     hr_api.set_security_group_id(p_security_group_id => fnd_global.security_group_id);
518   Else
519     hr_api.set_security_group_id(p_security_group_id => 0);
520   End If;
521   --
522   hr_utility.set_location('Entering:'||l_proc, 7);
523   --
524   -- Call all supporting business operations
525   --
526   -- Business Rule Mapping
527   -- =====================
528   -- CHK_ESTABLISHMENT_ID
529   --
530   chk_establishment_id(p_rec.establishment_id,
531 		       p_rec.object_version_number);
532   --
533   -- Business Rule Mapping
534   -- =====================
535   -- CHK_NAME_LOCATION_UNIQUE
536   --
537   chk_name_location_unique(p_rec.establishment_id,
538 			   p_rec.name,
539 			   p_rec.location,
540 			   p_rec.object_version_number);
541   --
542   -- Descriptive flex checking
543   --
544   per_est_bus.chk_df(p_rec => p_rec);
545   --
546   per_est_bus.chk_ddf(p_rec);
547   --
548   hr_utility.set_location(' Leaving:'||l_proc, 10);
549 End insert_validate;
550 --
551 -- ----------------------------------------------------------------------------
552 -- |---------------------------< update_validate >----------------------------|
553 -- ----------------------------------------------------------------------------
554 Procedure update_validate(p_rec in per_est_shd.g_rec_type) is
555 --
556   l_proc  varchar2(72) := g_package||'update_validate';
557 --
558 Begin
559   hr_utility.set_location('Entering:'||l_proc, 5);
560   --
561   -- As this data is not within the context of a business group
562   -- the set_security_group_id procedure has zero passed
563   -- to it as the default security_group_id.
564   --
565   If hr_multi_tenancy_pkg.is_multi_tenant_system Then
566     hr_api.set_security_group_id(p_security_group_id => fnd_global.security_group_id);
567   Else
568     hr_api.set_security_group_id(p_security_group_id => 0);
569   End If;
570   --
571   hr_utility.set_location('Entering:'||l_proc, 7);
572   --
573   -- Call all supporting business operations
574   --
575   -- Business Rule Mapping
576   -- =====================
577   -- CHK_ESTABLISHMENT_ID
578   --
579   chk_establishment_id(p_rec.establishment_id,
580 		       p_rec.object_version_number);
581   --
582   -- Business Rule Mapping
583   -- =====================
584   -- CHK_NAME_LOCATION_UNIQUE
585   --
586   chk_name_location_unique(p_rec.establishment_id,
587 			   p_rec.name,
588 			   p_rec.location,
589 			   p_rec.object_version_number);
590   --
591   -- Descriptive flex checking
592   --
593   per_est_bus.chk_df(p_rec => p_rec);
594   --
595   per_est_bus.chk_ddf(p_rec);
596   --
597   hr_utility.set_location(' Leaving:'||l_proc, 10);
598 End update_validate;
599 --
600 -- ----------------------------------------------------------------------------
601 -- |---------------------------< delete_validate >----------------------------|
602 -- ----------------------------------------------------------------------------
603 Procedure delete_validate(p_rec in per_est_shd.g_rec_type) is
604 --
605   l_proc  varchar2(72) := g_package||'delete_validate';
606 --
607 Begin
608   hr_utility.set_location('Entering:'||l_proc, 5);
609   --
610   -- Call all supporting business operations
611   --
612   -- Business Rule Mapping
613   -- =====================
614   -- CHK_ESTAB_DELETE
615   --
616   chk_estab_delete(p_rec.establishment_id);
617   --
618   hr_utility.set_location(' Leaving:'||l_proc, 10);
619 End delete_validate;
620 --
621 end per_est_bus;