DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_SUMMARY_API

Source


1 package body hr_summary_api as
2 /* $Header: hrsumapi.pkb 115.5 2002/11/26 10:30:14 sfmorris noship $ */
3 --
4 g_package varchar2(20) := 'hr_summary_api.';
5 update_allowed exception;
6 --
7 -----------------
8 procedure lck (p_id_value                  in     number
9               ,p_object_version_number     in     number ) is
10   --
11   --
12   -- Declare cursors and local variables
13   --
14   l_proc varchar2(72) := 'lck';
15   --
16 begin
17   --
18   hr_utility.set_location('Entering:'|| l_proc, 10);
19   --
20   per_bil_shd.lck
21     (
22       p_id_value               => p_id_value
23      ,p_object_version_number  => p_object_version_number
24     );
25   --
26   hr_utility.set_location(' Leaving:'||l_proc, 70);
27   --
28 end lck;
29 -----------------
30 procedure row_data (p_business_group_id in number,
31                     p_type              in varchar2,
32                     p_text_value1       in varchar2,
33                     p_text_value2       in varchar2,
34                     p_fk_value1         in number,
35                     p_fk_value2         in number,
36                     l_id_value          out nocopy number,
37                     l_ovn               out nocopy number) is
38 --
39 cursor csr_exists is
40   select id_value,
41          object_version_number
42   from   hr_summary
43   where  (type = p_type
44           and p_type in ('TEMPLATE','ITEM_TYPE','KEY_TYPE','RESTRICTION_TYPE')
45           and text_value1 = p_text_value1
46           and business_group_id = p_business_group_id
47          )
48   or
49          (type = p_type
50           and p_type IN ('RESTRICTION_USAGE','VALID_KEY_TYPE','KEY_TYPE_USAGE','VALID_RESTRICTION')
51           and fk_value1 = p_fk_value1
52           and fk_value2 = p_fk_value2
53           and business_group_id = p_business_group_id
54          )
55   or     (type = p_type
56           and p_type = 'ITEM_TYPE_USAGE'
57           and fk_value1 = p_fk_value1
58           and business_group_id = p_business_group_id
59           and text_value1 = p_text_value1
60          )
61   or     (type = p_type
62           and p_type = 'PROCESS_RUN'
63           and text_value2 = p_text_value2
64           and text_value1 = p_text_value1
65           and business_group_id = p_business_group_id
66          )
67   or     (type = p_type
68           and p_type = 'RESTRICTION_VALUE'
69           and fk_value1 = p_fk_value1
70           and text_value1 = p_text_value1
71           and business_group_id = p_business_group_id
72          );
73 --
74 begin
75 --
76 hr_utility.set_location('Entering: hr_summary_api.row_data', 10);
77 --
78 open csr_exists;
79 fetch csr_exists into l_id_value,
80                       l_ovn;
81 if csr_exists%notfound then
82    l_id_value := 0;
83    l_ovn := 0;
84 end if;
85 close csr_exists;
86 --
87 hr_utility.set_location('Leaving: hr_summary_api.row_data', 20);
88 --
89 end row_data;
90 -----------------
91 function get_id (p_name in varchar2,
92                  p_type in varchar2,
93                  p_business_group_id in number) return number is
94 --
95 l_id number;
96 --
97 cursor csr_id is
98   select id_value
99   from   hr_summary
100   where  text_value1 = p_name
101   and    type        = p_type
102   and    business_group_id = p_business_group_id;
103 --
104 begin
105   --
106   open csr_id;
107   fetch csr_id into l_id;
108   close csr_id;
109   --
110   return nvl(l_id,0);
111   --
112 end get_id;
113 -----------------
114 function get_itu_id (p_template_name     in varchar2
115                     ,p_item_type_name    in varchar2
116                     ,p_itu_name          in varchar2
117                     ,p_business_group_id in number) return number is
118 --
119 l_id number;
120 --
121 cursor csr_id is
122   select itu.id_value
123   from   hr_summary itu,
124          hr_summary t,
125          hr_summary it
126   where  it.id_value = itu.fk_value2
127   and    t.id_value = itu.fk_value1
128   and    itu.text_value1 = p_itu_name
129   and    it.business_group_id = p_business_group_id
130   and    it.text_value1 = p_item_type_name
131   and    it.type = 'ITEM_TYPE'
132   and    t.business_group_id  = p_business_group_id
133   and    t.text_value1 = p_template_name
134   and    t.type = 'TEMPLATE';
135 --
136 begin
137   --
138   open csr_id;
139   fetch csr_id into l_id;
140   close csr_id;
141   --
142   return nvl(l_id,0);
143   --
144 end get_itu_id;
145 -----------------
146 function get_itu_id (p_template_name     in varchar2
147                     ,p_sequence_number   in number
148                     ,p_business_group_id in number) return number is
149 --
150 l_id number;
151 --
152 cursor csr_id is
153   select itu.id_value
154   from   hr_summary itu,
155          hr_summary t
156   where  t.id_value = itu.fk_value1
157   and    itu.num_value1 = p_sequence_number
158   and    itu.type = 'ITEM_TYPE_USAGE'
159   and    t.business_group_id  = p_business_group_id
160   and    t.text_value1 = p_template_name
161   and    t.type = 'TEMPLATE';
162 --
163 begin
164   --
165   open csr_id;
166   fetch csr_id into l_id;
167   close csr_id;
168   --
169   return nvl(l_id,0);
170   --
171 end get_itu_id;
172 ---------------
173 function get_vkt_id (p_key_type_name     in varchar2
174                     ,p_item_type_name    in varchar2
175                     ,p_business_group_id in number) return number is
176 --
177 l_id number;
178 --
179 cursor csr_id is
180   select vkt.id_value
181   from   hr_summary  vkt,
182          hr_summary  kt,
183          hr_summary  it
184   where  kt.id_value = vkt.fk_value2
185   and    it.id_value = vkt.fk_value1
186   and    kt.business_group_id = p_business_group_id
187   and    kt.text_value1 = p_key_type_name
188   and    kt.type = 'KEY_TYPE'
189   and    it.business_group_id = p_business_group_id
190   and    it.text_value1 = p_item_type_name
191   and    it.type = 'ITEM_TYPE';
192 --
193 begin
194   --
195   open csr_id;
196   fetch csr_id into l_id;
197   close csr_id;
198   --
199   return nvl(l_id,0);
200   --
201 end get_vkt_id;
202 -----------------
203 function get_ru_id (p_restriction_name  in varchar2
204                    ,p_item_type_name    in varchar2
205                    ,p_business_group_id in number) return number is
206 l_id number;
207 cursor csr_id is
208   select vr.id_value
209   from   hr_summary vr,
210          hr_summary it,
211          hr_summary rt
212   where  it.id_value = vr.fk_value1
213   and    vr.fk_value2 = rt.id_value
214   and    it.business_group_id = p_business_group_id
215   and    it.type = 'ITEM_TYPE'
216   and    it.text_value1 = p_item_type_name
217   and    rt.business_group_id = p_business_group_id
218   and    rt.type = 'RESTRICTION_TYPE'
219   and    rt.text_value1 = p_restriction_name;
220 --
221 begin
222   --
223   open csr_id;
224   fetch csr_id into l_id;
225   close csr_id;
226   --
227   return nvl(l_id,0);
228   --
229 end get_ru_id;
230 -----------------
231 function get_rv_id (p_template          in varchar2
232                    ,p_item              in varchar2
233                    ,p_restriction       in varchar2
234                    ,p_itu_name          in varchar2
235                    ,p_business_group_id in number) return number is
236 l_id number;
237 cursor csr_id is
238   select restriction_usage_id
239   from   hr_summary_restriction_usage
240   where  item_type_usage_id   = hr_summary_api.get_itu_id(p_template,p_item,p_itu_name,p_business_group_id)
241   and    valid_restriction_id = hr_summary_api.get_ru_id(p_restriction,p_item,p_business_group_id)
242   and    business_group_id = p_business_group_id;
243 --
244 begin
245   --
246   open csr_id;
247   fetch csr_id into l_id;
248   close csr_id;
249   --
250   return nvl(l_id,0);
251   --
252 end get_rv_id;
253 -----------------
254 function get_rv_id (p_template          in varchar2
255                    ,p_item              in varchar2
256                    ,p_restriction       in varchar2
257                    ,p_itu_seq_num       in number
258                    ,p_business_group_id in number) return number is
259 l_id number;
260 cursor csr_id is
261   select restriction_usage_id
262   from   hr_summary_restriction_usage
263   where  item_type_usage_id   = hr_summary_api.get_itu_id(p_template,p_itu_seq_num,p_business_group_id)
264   and    valid_restriction_id = hr_summary_api.get_ru_id(p_restriction,p_item,p_business_group_id)
265   and    business_group_id = p_business_group_id;
266 --
267 begin
268   --
269   open csr_id;
270   fetch csr_id into l_id;
271   close csr_id;
272   --
273   return nvl(l_id,0);
274   --
275 end get_rv_id;
276 -----------------
277 procedure create_item_type (p_item_type_id           out nocopy number
278                            ,p_business_group_id      in number
279                            ,p_object_version_number  out nocopy number
280                            ,p_name                   in varchar2
281                            ,p_units                  in varchar2
282                            ,p_datatype               in varchar2
283                            ,p_count_clause1          in varchar2
284                            ,p_count_clause2          in varchar2
285                            ,p_where_clause           in varchar2
286                            ,p_seeded_data            in varchar2) is
287 --
288 l_id  number := 0;
289 l_ovn number := 0;
290 --
291 begin
292 --
293 hr_utility.set_location('Entering: hr_summary_api.create_item_type', 10);
294 --
295 row_data (p_business_group_id => p_business_group_id
296          ,p_type              => 'ITEM_TYPE'
297          ,p_text_value1       => p_name
298          ,l_id_value          => l_id
299          ,l_ovn               => l_ovn);
300 --
301 if l_id <> 0 and p_seeded_data = 'Y' then
302    per_bil_upd.upd(p_type                  => 'ITEM_TYPE'
303                   ,p_id_value              => l_id
304                   ,p_business_group_id     => p_business_group_id
305                   ,p_object_version_number => l_ovn
306                   ,p_text_value1           => p_name
307                   ,p_text_value2           => p_units
308                   ,p_text_value3           => p_datatype
309                   ,p_text_value4           => p_count_clause1
310                   ,p_text_value5           => p_count_clause2
311                   ,p_text_value6           => p_where_clause
312                   ,p_text_value7           => p_seeded_data);
313 else
314    /* call row handler package with correct parameters */
315    per_bil_ins.ins(p_type                  => 'ITEM_TYPE'
316                   ,p_id_value              => p_item_type_id
317                   ,p_business_group_id     => p_business_group_id
318                   ,p_object_version_number => p_object_version_number
319                   ,p_text_value1           => p_name
320                   ,p_text_value2           => p_units
321                   ,p_text_value3           => p_datatype
322                   ,p_text_value4           => p_count_clause1
323                   ,p_text_value5           => p_count_clause2
324                   ,p_text_value6           => p_where_clause
325                   ,p_text_value7           => p_seeded_data);
326 end if;
327 --
328 hr_utility.set_location('Leaving: hr_summary_api.create_item_type', 20);
329 --
330 end create_item_type;
331 -----------------
332 procedure create_key_type  (p_key_type_id           out nocopy number
333                            ,p_business_group_id     in  number
334                            ,p_object_version_number out nocopy number
335                            ,p_name                  in varchar2
336                            ,p_key_function          in varchar2
337                            ,p_seeded_data           in varchar2 ) is
338 --
339 l_id  number := 0;
340 l_ovn number := 0;
341 --
342 begin
343 --
344 hr_utility.set_location('Entering: hr_summary_api.create_key_type'||p_seeded_data, 10);
345 --
346 row_data (p_business_group_id => p_business_group_id
347          ,p_type              => 'KEY_TYPE'
348          ,p_text_value1       => p_name
349          ,l_id_value          => l_id
350          ,l_ovn               => l_ovn);
351 --
352 if l_id <> 0 and p_seeded_data = 'Y' then
353    per_bil_upd.upd(p_type                  => 'KEY_TYPE'
354                   ,p_id_value              => l_id
355                   ,p_business_group_id     => p_business_group_id
356                   ,p_object_version_number => l_ovn
357                   ,p_text_value1           => p_name
358                   ,p_text_value6           => p_key_function
359                   ,p_text_value7           => p_seeded_data);
360 else
361    /* call row handler package with correct parameters */
362    per_bil_ins.ins(p_type                  => 'KEY_TYPE'
363                   ,p_id_value              => p_key_type_id
364                   ,p_business_group_id     => p_business_group_id
365                   ,p_object_version_number => p_object_version_number
366                   ,p_text_value1           => p_name
367                   ,p_text_value6           => p_key_function
368                   ,p_text_value7           => p_seeded_data);
369 end if;
370 --
371 hr_utility.set_location('Leaving: hr_summary_api.create_key_type'||p_seeded_data, 20);
372 --
373 end create_key_type;
374 -----------------
375 procedure create_key_value (p_key_value_id          out  nocopy number
376                            ,p_business_group_id     in number
377                            ,p_object_version_number out  nocopy number
378                            ,p_key_type_id           in number
379                            ,p_item_value_id         in number
380                            ,p_name                  in varchar2 ) is
381 begin
382 --
383 hr_utility.set_location('Entering: hr_summary_api.create_key_value', 10);
384 --
385 /* call row handler package with correct parameters */
386 per_bil_ins.ins(p_type                  => 'KEY_VALUE'
387                ,p_id_value              => p_key_value_id
388                ,p_business_group_id     => p_business_group_id
389                ,p_object_version_number => p_object_version_number
390                ,p_fk_value1             => p_key_type_id
391                ,p_fk_value2             => p_item_value_id
392                ,p_text_value1           => p_name);
393 --
394 hr_utility.set_location('Leaving: hr_summary_api.create_key_value', 20);
395 --
396 end create_key_value;
397 -----------------
398 procedure create_item_value (p_item_value_id          out  nocopy number
399                             ,p_business_group_id      in number
400                             ,p_object_version_number  out  nocopy number
401                             ,p_process_run_id         in number
402                             ,p_item_type_usage_id     in number
403                             ,p_textvalue              in varchar2
404                             ,p_numvalue1              in number
405                             ,p_numvalue2              in number
406                             ,p_datevalue              in date ) is
407 begin
408 --
409 hr_utility.set_location('Entering: hr_summary_api.create_item_value', 10);
410 --
411 /* call row handler package with correct parameters */
412 per_bil_ins.ins(p_type                  => 'ITEM_VALUE'
413                ,p_id_value              => p_item_value_id
414                ,p_business_group_id     => p_business_group_id
415                ,p_object_version_number => p_object_version_number
416                ,p_fk_value1             => p_process_run_id
417                ,p_fk_value2             => p_item_type_usage_id
418                ,p_text_value1           => p_textvalue
419                ,p_num_value1            => p_numvalue1
420                ,p_num_value2            => p_numvalue2
421                ,p_date_value1           => p_datevalue);
422 --
423 hr_utility.set_location('Leaving: hr_summary_api.create_item_value', 20);
424 --
425 end create_item_value;
426 -----------------
427 procedure create_valid_restriction (p_valid_restriction_id  out nocopy number
428                                    ,p_business_group_id     in number
429                                    ,p_object_version_number out nocopy number
430                                    ,p_item_type_id          in number
431                                    ,p_restriction_type_id   in number
432                                    ,p_seeded_data           in varchar2) is
433 --
434 l_id  number := 0;
435 l_ovn number := 0;
436 --
437 begin
438 --
439 hr_utility.set_location('Entering: hr_summary_api.create_valid_restriction', 10);
440 --
441 row_data (p_business_group_id => p_business_group_id
442          ,p_type              => 'VALID_RESTRICTION'
443          ,p_fk_value1         => p_item_type_id
444          ,p_fk_value2         => p_restriction_type_id
445          ,l_id_value          => l_id
446          ,l_ovn               => l_ovn);
447 --
448 if l_id <> 0 and p_seeded_data = 'Y' then
449    per_bil_upd.upd(p_type                  => 'VALID_RESTRICTION'
450                   ,p_id_value              => l_id
451                   ,p_business_group_id     => p_business_group_id
452                   ,p_object_version_number => l_ovn
453                   ,p_fk_value1             => p_item_type_id
454                   ,p_fk_value2             => p_restriction_type_id
455                   ,p_text_value7           => p_seeded_data);
456 else
457    /* call row handler package with correct parameters */
458    per_bil_ins.ins(p_type                  => 'VALID_RESTRICTION'
459                   ,p_id_value              => p_valid_restriction_id
460                   ,p_business_group_id     => p_business_group_id
461                   ,p_object_version_number => p_object_version_number
462                   ,p_fk_value1             => p_item_type_id
463                   ,p_fk_value2             => p_restriction_type_id
464                   ,p_text_value7           => p_seeded_data);
465 end if;
466 --
467 hr_utility.set_location('Leaving: hr_summary_api.create_valid_restriction', 20);
468 --
469 end create_valid_restriction;
470 -----------------
471 procedure create_restriction_type  (p_restriction_type_id   out  nocopy number
472                                    ,p_business_group_id     in number
473                                    ,p_object_version_number out  nocopy number
474                                    ,p_name                  in varchar2
475                                    ,p_data_type             in varchar2
476                                    ,p_restriction_clause    in varchar2
477                                    ,p_restriction_sql       in varchar2
478                                    ,p_seeded_data           in varchar2) is
479 --
480 l_id  number := 0;
481 l_ovn number := 0;
482 --
483 begin
484 --
485 hr_utility.set_location('Entering: hr_summary_api.create_restriction_type', 10);
486 --
487 row_data (p_business_group_id => p_business_group_id
488          ,p_type              => 'RESTRICTION_TYPE'
489          ,p_text_value1       => p_name
490          ,l_id_value          => l_id
491          ,l_ovn               => l_ovn);
492 --
493 if l_id <> 0 and p_seeded_data = 'Y' then
494    per_bil_upd.upd(p_type                  => 'RESTRICTION_TYPE'
495                   ,p_id_value              => l_id
496                   ,p_business_group_id     => p_business_group_id
497                   ,p_object_version_number => l_ovn
498                   ,p_text_value1           => p_name
499                   ,p_text_value2           => p_data_type
500                   ,p_text_value3           => p_restriction_clause
501                   ,p_text_value4           => p_restriction_sql
502                   ,p_text_value7           => p_seeded_data);
503 else
504    /* call row handler package with correct parameters */
505    per_bil_ins.ins(p_type                  => 'RESTRICTION_TYPE'
506                   ,p_id_value              => p_restriction_type_id
507                   ,p_business_group_id     => p_business_group_id
508                   ,p_object_version_number => p_object_version_number
509                   ,p_text_value1           => p_name
510                   ,p_text_value2           => p_data_type
511                   ,p_text_value3           => p_restriction_clause
512                   ,p_text_value4           => p_restriction_sql
513                   ,p_text_value7           => p_seeded_data);
514 end if;
515 --
516 hr_utility.set_location('Leaving: hr_summary_api.create_restriction_type', 20);
517 --
518 end create_restriction_type;
519 -----------------
520 procedure create_restriction_usage (p_restriction_usage_id    out  nocopy number
521                                    ,p_business_group_id       in number
522                                    ,p_object_version_number   out  nocopy number
523                                    ,p_item_type_usage_id      in number
524                                    ,p_valid_restriction_id    in number
525                                    ,p_restriction_type        in varchar2
526                                    ,p_seeded_data             in varchar2) is
527 --
528 l_id  number := 0;
529 l_ovn number := 0;
530 --
531 begin
532 --
533 hr_utility.set_location('Entering: hr_summary_api.create_restriction_usage', 10);
534 --
535 row_data (p_business_group_id => p_business_group_id
536          ,p_type              => 'RESTRICTION_USAGE'
537          ,p_fk_value1         => p_item_type_usage_id
538          ,p_fk_value2         => p_valid_restriction_id
539          ,l_id_value          => l_id
540          ,l_ovn               => l_ovn);
541 --
542 if l_id <> 0 and p_seeded_data = 'Y' then
543    per_bil_upd.upd(p_type                  => 'RESTRICTION_USAGE'
544                   ,p_id_value              => l_id
545                   ,p_business_group_id     => p_business_group_id
546                   ,p_object_version_number => l_ovn
547                   ,p_fk_value1             => p_item_type_usage_id
548                   ,p_fk_value2             => p_valid_restriction_id
549                   ,p_text_value1           => p_restriction_type
550                   ,p_text_value7           => p_seeded_data);
551 else
552    /* call row handler package with correct parameters */
553    per_bil_ins.ins(p_type                  => 'RESTRICTION_USAGE'
554                   ,p_id_value              => p_restriction_usage_id
555                   ,p_business_group_id     => p_business_group_id
556                   ,p_object_version_number => p_object_version_number
557                   ,p_fk_value1             => p_item_type_usage_id
558                   ,p_fk_value2             => p_valid_restriction_id
559                   ,p_text_value1           => p_restriction_type
560                   ,p_text_value7           => p_seeded_data);
561 end if;
562 --
563 hr_utility.set_location('Leaving: hr_summary_api.create_restriction_usage', 20);
564 --
565 end create_restriction_usage;
566 -----------------
567 procedure create_restriction_value ( p_restriction_value_id  out  nocopy number
568                                     ,p_business_group_id     in number
569                                     ,p_object_version_number out  nocopy number
570                                     ,p_restriction_usage_id  in number
571                                     ,p_value                 in varchar2
572                                     ,p_seeded_data           in varchar2) is
573 --
574 l_id  number := 0;
575 l_ovn number := 0;
576 --
577 begin
578 --
579 hr_utility.set_location('Entering: hr_summary_api.create_restriction_value', 10);
580 --
581 row_data (p_business_group_id => p_business_group_id
582          ,p_type              => 'RESTRICTION_VALUE'
583          ,p_text_value1       => p_value
584          ,p_fk_value1         => p_restriction_usage_id
585          ,l_id_value          => l_id
586          ,l_ovn               => l_ovn);
587 --
588 if l_id <> 0 and p_seeded_data = 'Y' then
589    per_bil_upd.upd(p_type                  => 'RESTRICTION_VALUE'
590                   ,p_id_value              => l_id
591                   ,p_business_group_id     => p_business_group_id
592                   ,p_object_version_number => l_ovn
593                   ,p_fk_value1             => p_restriction_usage_id
594                   ,p_text_value1           => p_value);
595 else
596    /* call row handler package with correct parameters */
597    per_bil_ins.ins(p_type                  => 'RESTRICTION_VALUE'
598                   ,p_id_value              => p_restriction_value_id
599                   ,p_business_group_id     => p_business_group_id
600                   ,p_object_version_number => p_object_version_number
601                   ,p_fk_value1             => p_restriction_usage_id
602                   ,p_text_value1           => p_value);
603 end if;
604 --
605 hr_utility.set_location('Leaving: hr_summary_api.create_restriction_value', 20);
606 --
607 end create_restriction_value;
608 -----------------
609 procedure create_item_type_usage ( p_item_type_usage_id     out  nocopy number
610                                   ,p_business_group_id      in number
611                                   ,p_object_version_number  out  nocopy number
612                                   ,p_sequence_number        in number
613                                   ,p_name                   in varchar2
614                                   ,p_template_id            in number
615                                   ,p_item_type_id           in number
616                                   ,p_seeded_data            in varchar2) is
617 --
618 l_id  number := 0;
619 l_ovn number := 0;
620 --
621 begin
622 --
623 hr_utility.set_location('Entering: hr_summary_api.create_item_type_usage', 10);
624 --
625 row_data (p_business_group_id => p_business_group_id
626          ,p_type              => 'ITEM_TYPE_USAGE'
627          ,p_text_value1       => p_name
628          ,p_fk_value1         => p_template_id
629          ,p_fk_value2         => p_item_type_id
630          ,l_id_value          => l_id
631          ,l_ovn               => l_ovn);
632 --
633 if l_id <> 0 and p_seeded_data = 'Y' then
634    per_bil_upd.upd(p_type                  => 'ITEM_TYPE_USAGE'
635                   ,p_id_value              => l_id
636                   ,p_business_group_id     => p_business_group_id
637                   ,p_object_version_number => l_ovn
638                   ,p_text_value1           => p_name
639                   ,p_num_value1            => p_sequence_number
640                   ,p_fk_value1             => p_template_id
641                   ,p_fk_value2             => p_item_type_id
642                   ,p_text_value7           => p_seeded_data);
643 else
644    /* call row handler package with correct parameters */
645    per_bil_ins.ins(p_type                  => 'ITEM_TYPE_USAGE'
646                   ,p_id_value              => p_item_type_usage_id
647                   ,p_business_group_id     => p_business_group_id
648                   ,p_object_version_number => p_object_version_number
649                   ,p_text_value1           => p_name
650                   ,p_num_value1            => p_sequence_number
651                   ,p_fk_value1             => p_template_id
652                   ,p_fk_value2             => p_item_type_id
653                   ,p_text_value7           => p_seeded_data);
654 end if;
655 --
656 hr_utility.set_location('Leaving: hr_summary_api.create_item_type_usage', 20);
657 --
658 end create_item_type_usage;
659 -----------------
660 procedure create_valid_key_type (p_valid_key_type_id      out  nocopy number
661                                 ,p_business_group_id      in number
662                                 ,p_object_version_number  out  nocopy number
663                                 ,p_item_type_id           in number
664                                 ,p_key_type_id            in number
665                                 ,p_seeded_data            in varchar2 ) is
666 --
667 l_id  number := 0;
668 l_ovn number := 0;
669 --
670 begin
671 --
672 hr_utility.set_location('Entering: hr_summary_api.create_valid_key_type', 10);
673 --
674 row_data (p_business_group_id => p_business_group_id
675          ,p_type              => 'VALID_KEY_TYPE'
676          ,p_fk_value1         => p_item_type_id
677          ,p_fk_value2         => p_key_type_id
678          ,l_id_value          => l_id
679          ,l_ovn               => l_ovn);
680 --
681 if l_id <> 0 and p_seeded_data = 'Y' then
682    per_bil_upd.upd(p_type                  => 'VALID_KEY_TYPE'
683                   ,p_id_value              => l_id
684                   ,p_business_group_id     => p_business_group_id
685                   ,p_object_version_number => l_ovn
686                   ,p_fk_value1             => p_item_type_id
687                   ,p_fk_value2             => p_key_type_id
688                   ,p_text_value7           => p_seeded_data);
689 else
690    /* call row handler package with correct parameters */
691    per_bil_ins.ins(p_type                  => 'VALID_KEY_TYPE'
692                   ,p_id_value              => p_valid_key_type_id
693                   ,p_business_group_id     => p_business_group_id
694                   ,p_object_version_number => p_object_version_number
695                   ,p_fk_value1             => p_item_type_id
696                   ,p_fk_value2             => p_key_type_id
697                   ,p_text_value7           => p_seeded_data);
698 end if;
699 --
700 hr_utility.set_location('Leaving: hr_summary_api.create_valid_key_type', 20);
701 --
702 end create_valid_key_type;
703 -----------------
704 procedure create_key_type_usage (p_key_type_usage_id      out  nocopy number
705                                 ,p_business_group_id      in number
706                                 ,p_object_version_number  out  nocopy number
707                                 ,p_item_type_usage_id     in number
708                                 ,p_valid_key_type_id      in number
709                                 ,p_seeded_data            in varchar2) is
710 --
711 l_id  number := 0;
712 l_ovn number := 0;
713 --
714 begin
715 --
716 hr_utility.set_location('Entering: hr_summary_api.create_key_type_usage', 10);
717 --
718 row_data (p_business_group_id => p_business_group_id
719          ,p_type              => 'KEY_TYPE_USAGE'
720          ,p_fk_value1         => p_item_type_usage_id
721          ,p_fk_value2         => p_valid_key_type_id
722          ,l_id_value          => l_id
723          ,l_ovn               => l_ovn);
724 --
725 if l_id <> 0 and p_seeded_data = 'Y' then
726    per_bil_upd.upd(p_type                  => 'KEY_TYPE_USAGE'
727                   ,p_id_value              => l_id
728                   ,p_business_group_id     => p_business_group_id
729                   ,p_object_version_number => l_ovn
730                   ,p_fk_value1             => p_item_type_usage_id
731                   ,p_fk_value2             => p_valid_key_type_id
732                   ,p_text_value7           => p_seeded_data);
733 else
734    /* call row handler package with correct parameters */
735    per_bil_ins.ins(p_type                  => 'KEY_TYPE_USAGE'
736                   ,p_id_value              => p_key_type_usage_id
737                   ,p_business_group_id     => p_business_group_id
738                   ,p_object_version_number => p_object_version_number
739                   ,p_fk_value1             => p_item_type_usage_id
740                   ,p_fk_value2             => p_valid_key_type_id
741                   ,p_text_value7           => p_seeded_data);
742 end if;
743 --
744 hr_utility.set_location('Leaving: hr_summary_api.create_key_type_usage', 20);
745 --
746 end create_key_type_usage;
747 -----------------
748 procedure create_template (p_template_id            out  nocopy number
749                           ,p_business_group_id      in number
750                           ,p_object_version_number  out  nocopy number
751                           ,p_name                   in varchar2
752                           ,p_seeded_data            in varchar2) is
753 --
754 l_id  number := 0;
755 l_ovn number := 0;
756 --
757 begin
758 --
759 hr_utility.set_location('Entering: hr_summary_api.create_template', 10);
760 --
761 row_data (p_business_group_id => p_business_group_id
762          ,p_type              => 'TEMPLATE'
763          ,p_text_value1       => p_name
764          ,l_id_value          => l_id
765          ,l_ovn               => l_ovn);
766 --
767 if l_id <> 0 and p_seeded_data = 'Y' then
768    per_bil_upd.upd(p_type                  => 'TEMPLATE'
769                   ,p_id_value              => l_id
770                   ,p_business_group_id     => p_business_group_id
771                   ,p_object_version_number => l_ovn
772                   ,p_text_value1           => p_name
773                   ,p_text_value7           => p_seeded_data);
774 else
775    /* call row handler package with correct parameters */
776    per_bil_ins.ins(p_type                  => 'TEMPLATE'
777                   ,p_id_value              => p_template_id
778                   ,p_business_group_id     => p_business_group_id
779                   ,p_object_version_number => p_object_version_number
780                   ,p_text_value1           => p_name
781                   ,p_text_value7           => p_seeded_data);
782 end if;
783 --
784 hr_utility.set_location('Leaving: hr_summary_api.create_template', 20);
785 --
786 end create_template;
787 -----------------
788 procedure create_process_run (p_process_run_id         out  nocopy number
789                              ,p_business_group_id      in  number
790                              ,p_object_version_number  out  nocopy number
791                              ,p_name                   in  varchar2
792                              ,p_template_id            in  varchar2
793                              ,p_process_type           in  varchar2) is
794 begin
795 --
796 hr_utility.set_location('Entering: hr_summary_api.create_process_run', 10);
797 --
798 /* call row handler package with correct parameters */
799 per_bil_ins.ins(p_type                  => 'PROCESS_RUN'
800                ,p_id_value              => p_process_run_id
801                ,p_business_group_id     => p_business_group_id
802                ,p_object_version_number => p_object_version_number
803                ,p_text_value2           => p_name
804                ,p_fk_value1             => p_template_id
805                ,p_text_value1           => p_process_type);
806 --
807 hr_utility.set_location('Leaving: hr_summary_api.create_process_run', 20);
808 --
809 end create_process_run;
810 -----------------
811 procedure create_parameter (p_parameter_id           out  nocopy number
812                            ,p_business_group_id      in  number
813                            ,p_object_version_number  out  nocopy number
814                            ,p_process_run_id         in  number
815                            ,p_name                   in  varchar2
816                            ,p_value                  in  varchar2) is
817 begin
818 --
819 hr_utility.set_location('Entering: hr_summary_api.create_process_run', 10);
820 --
821 /* call row handler package with correct parameters */
822 per_bil_ins.ins(p_type                  => 'PARAMETER'
823                ,p_id_value              => p_parameter_id
824                ,p_business_group_id     => p_business_group_id
825                ,p_object_version_number => p_object_version_number
826                ,p_fk_value1             => p_process_run_id
827                ,p_text_value1           => p_name
828                ,p_text_value6           => p_value);
829 --
830 hr_utility.set_location('Leaving: hr_summary_api.create_process_run', 20);
831 --
832 end create_parameter;
833 -----------------------------------------------
834 --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@--
835 -----------------------------------------------
836 procedure delete_hr_summary (p_validate              in boolean
837                             ,p_id_value              in number
838                             ,p_object_version_number in number) is
839   --
840   -- Declare cursors and local variables
841   --
842   l_proc varchar2(72) := 'hr_summary_api.delete_hr_summary';
843   l_object_version_number hr_summary.object_version_number%TYPE;
844   --
845 begin
846   --
847   hr_utility.set_location('Entering:'|| l_proc, 10);
848   --
849   -- Issue a savepoint if operating in validation only mode
850   --
851   savepoint delete_hr_summary;
852   --
853   hr_utility.set_location(l_proc, 20);
854   --
855   -- Process Logic
856   --
857   l_object_version_number := p_object_version_number;
858   --
859   per_bil_del.del(p_id_value              => p_id_value
860                  ,p_object_version_number => l_object_version_number);
861   --
862   --
863   hr_utility.set_location(l_proc, 60);
864   --
865   -- When in validation only mode raise the Validate_Enabled exception
866   --
867   if p_validate then
868     raise hr_api.validate_enabled;
869   end if;
870   --
871   hr_utility.set_location(' Leaving:'||l_proc, 70);
872   --
873 exception
874   --
875   when hr_api.validate_enabled then
876     --
877     -- As the Validate_Enabled exception has been raised
878     -- we must rollback to the savepoint
879     --
880     ROLLBACK TO delete_hr_summary;
881     --
882     -- Only set output warning arguments
883     -- (Any key or derived arguments must be set to null
884     -- when validation only mode is being used.)
885     --
886     --
887   when others then
888     --
889     -- A validation or unexpected error has occured
890     --
891     ROLLBACK TO delete_hr_summary;
892     raise;
893 end delete_hr_summary;
894 --
895 end hr_summary_api;