DBA Data[Home] [Help]

PACKAGE BODY: APPS.AME_GCF_INS

Source


1 Package Body ame_gcf_ins as
2 /* $Header: amgcfrhi.pkb 120.5 2006/10/05 16:08:09 pvelugul noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ame_gcf_ins.';  -- Global package name
9 --
10 -- The following global variables are only to be used by
11 -- the set_base_key_value and pre_insert procedures.
12 --
13 g_application_id_i  number   default null;
14 g_approval_group_id_i  number   default null;
15 --
16 -- ----------------------------------------------------------------------------
17 -- |------------------------< set_base_key_value >----------------------------|
18 -- ----------------------------------------------------------------------------
19 procedure set_base_key_value
20   (p_application_id  in  number
21   ,p_approval_group_id  in  number) is
22 --
23   l_proc       varchar2(72) := g_package||'set_base_key_value';
24 --
25 Begin
26   hr_utility.set_location('Entering:'||l_proc, 10);
27   --
28   ame_gcf_ins.g_application_id_i := p_application_id;
29   ame_gcf_ins.g_approval_group_id_i := p_approval_group_id;
30   --
31   hr_utility.set_location(' Leaving:'||l_proc, 20);
32 End set_base_key_value;
33 --
34 --
35 -- ----------------------------------------------------------------------------
36 -- |----------------------------< dt_insert_dml >-----------------------------|
37 -- ----------------------------------------------------------------------------
38 -- {Start Of Comments}
39 --
40 -- Description:
41 --   This procedure controls the actual dml insert logic for datetrack. The
42 --   functions of this procedure are as follows:
43 --   1) Get the object_version_number.
44 --   2) To set the effective start and end dates to the corresponding
45 --      validation start and end dates. Also, the object version number
46 --      record attribute is set.
47 --   3) To set and unset the g_api_dml status as required (as we are about to
48 --      perform dml).
49 --   4) To insert the row into the schema with the derived effective start
50 --      and end dates and the object version number.
51 --   5) To trap any constraint violations that may have occurred.
52 --   6) To raise any other errors.
53 --
54 -- Prerequisites:
55 --   This is an internal private procedure which must be called from the
56 --   insert_dml and pre_update (logic permitting) procedure and must have
57 --   all mandatory arguments set.
58 --
59 -- In Parameters:
60 --   A Pl/Sql record structure.
61 --
62 -- Post Success:
63 --   The specified row will be inserted into the schema.
64 --
65 -- Post Failure:
66 --   On the insert dml failure it is important to note that we always reset the
67 --   g_api_dml status to false.
68 --   If a check or unique integrity constraint violation is raised the
69 --   constraint_error procedure will be called.
70 --   If any other error is reported, the error will be raised after the
71 --   g_api_dml status is reset.
72 --
73 -- Developer Implementation Notes:
74 --   This is an internal datetrack maintenance procedure which should
75 --   not be modified in anyway.
76 --
77 -- Access Status:
78 --   Internal Row Handler Use Only.
79 --
80 -- {End Of Comments}
81 -- ----------------------------------------------------------------------------
82 Procedure dt_insert_dml
83   (p_rec                     in out nocopy ame_gcf_shd.g_rec_type
84   ,p_effective_date          in date
85   ,p_datetrack_mode          in varchar2
86   ,p_validation_start_date   in date
87   ,p_validation_end_date     in date
88   ) is
89 -- Cursor to select 'old' created AOL who column values
90 --
91   Cursor C_Sel1 Is
92     select t.creation_date
93     from   ame_approval_group_config t
94     where t.approval_group_id = p_rec.approval_group_id
95  and    t.application_id = p_rec.application_id
96     and    t.start_date =
97              ame_gcf_shd.g_old_rec.start_date
98     and    t.end_date   = p_validation_start_date;
99 --
100    Cursor C_Sel2 Is
101     select created_by
102       from ame_approval_group_config t
103      where t.approval_group_id = p_rec.approval_group_id
104  and    t.application_id = p_rec.application_id
105        and ame_utility_pkg.is_seed_user(created_by) = ame_util.seededDataCreatedById
106        and rownum < 2;
107 --
108   l_proc                varchar2(72) := g_package||'dt_insert_dml';
109   l_created_by          ame_approval_group_config.created_by%TYPE;
110   l_creation_date       ame_approval_group_config.creation_date%TYPE;
111   l_last_update_date    ame_approval_group_config.last_update_date%TYPE;
112   l_last_updated_by     ame_approval_group_config.last_updated_by%TYPE;
113   l_last_update_login   ame_approval_group_config.last_update_login%TYPE;
114   l_current_user_id     integer;
115   l_temp_count          integer;
116 --
117 Begin
118   hr_utility.set_location('Entering:'||l_proc, 5);
119   --
120   -- Set the effective start and end dates to the corresponding
121   -- validation start and end dates
122   --
123   p_rec.start_date  := p_validation_start_date;
124   p_rec.end_date    := p_validation_end_date;
125   l_current_user_id := fnd_global.user_id;
126   --
127   -- If the datetrack_mode is not INSERT then we must populate the WHO
128   -- columns with the 'old' creation values and 'new' updated values.
129   --
130   If (p_datetrack_mode <> hr_api.g_insert) then
131     hr_utility.set_location(l_proc, 10);
132     --
133       -- Get the object version number for the insert
134   --
135   p_rec.object_version_number :=
136    ame_gcf_shd.get_object_version_number
137       (p_approval_group_id =>  p_rec.approval_group_id
138  ,p_application_id =>  p_rec.application_id
139       );
140   --
141     -- Select the 'old' created values
142     --
143     Open C_Sel1;
144     Fetch C_Sel1 Into l_creation_date;
145     If C_Sel1%notfound Then
146       --
147       -- The previous 'old' created row has not been found. We need
148       -- to error as an internal datetrack problem exists.
149       --
150       Close C_Sel1;
151       fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
152       fnd_message.set_token('PROCEDURE', l_proc);
153       fnd_message.set_token('STEP','10');
154       fnd_message.raise_error;
155     End If;
156     Close C_Sel1;
157     --
158     --
159     Open C_Sel2;
160     Fetch C_Sel2 Into l_temp_count;
161     if C_Sel2%found then
162       l_created_by := l_temp_count;
163     else
164       l_created_by := l_current_user_id;
165     end if;
166     Close C_Sel2;
167     --
168     -- Set the AOL updated WHO values
169     --
170     l_last_update_date   := sysdate;
171     l_last_updated_by    := l_current_user_id;
172     l_last_update_login  := l_current_user_id;
173   Else
174     p_rec.object_version_number := 1;  -- Initialise the object version
175     --
176     -- If the current user logged in using AME Developer responsibility
177     -- then the created_by value should be ame_util.seededDataCreatedById
178     --
179     if fnd_global.resp_name = 'AME Developer' then
180       l_created_by         := ame_util.seededDataCreatedById;
181     else
182       l_created_by         := l_current_user_id;
183     end if;
184     l_creation_date      := sysdate;
185     l_last_update_date   := sysdate;
186     l_last_updated_by    := l_current_user_id;
187     l_last_update_login  := l_current_user_id;
188   End If;
189   --
190   --
191   --
192   -- Insert the row into: ame_approval_group_config
193   --
194   insert into ame_approval_group_config
195       (application_id
196       ,approval_group_id
197       ,voting_regime
198       ,order_number
199       ,start_date
200       ,end_date
201       ,object_version_number
202       ,created_by
203       ,creation_date
204       ,last_update_date
205       ,last_updated_by
206       ,last_update_login
207       )
208   Values
209     (p_rec.application_id
210     ,p_rec.approval_group_id
211     ,p_rec.voting_regime
212     ,p_rec.order_number
213     ,p_rec.start_date
214     ,p_rec.end_date
215     ,p_rec.object_version_number
216     ,l_created_by
217     ,l_creation_date
218     ,l_last_update_date
219     ,l_last_updated_by
220     ,l_last_update_login
221     );
222   --
223   --
224   hr_utility.set_location(' Leaving:'||l_proc, 15);
225 --
226 Exception
227   When hr_api.check_integrity_violated Then
228     -- A check constraint has been violated
229     --
230     ame_gcf_shd.constraint_error
231       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
232   When hr_api.unique_integrity_violated Then
233     -- Unique integrity has been violated
234     --
235     ame_gcf_shd.constraint_error
236       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
237   When Others Then
238     --
239     Raise;
240 End dt_insert_dml;
241 --
242 -- ----------------------------------------------------------------------------
243 -- |------------------------------< insert_dml >------------------------------|
244 -- ----------------------------------------------------------------------------
245 Procedure insert_dml
246   (p_rec                   in out nocopy ame_gcf_shd.g_rec_type
247   ,p_effective_date        in date
248   ,p_datetrack_mode        in varchar2
249   ,p_validation_start_date in date
250   ,p_validation_end_date   in date
251   ) is
252 --
253   l_proc        varchar2(72) := g_package||'insert_dml';
254 --
255 Begin
256   hr_utility.set_location('Entering:'||l_proc, 5);
257   --
258   ame_gcf_ins.dt_insert_dml
259     (p_rec                   => p_rec
260     ,p_effective_date        => p_effective_date
261     ,p_datetrack_mode        => p_datetrack_mode
262     ,p_validation_start_date => p_validation_start_date
263     ,p_validation_end_date   => p_validation_end_date
264     );
265   --
266   hr_utility.set_location(' Leaving:'||l_proc, 10);
267 End insert_dml;
268 --
269 --  ---------------------------------------------------------------------------
270 --  |----------------------< generate_order_number >-------------------------------|
271 --  ---------------------------------------------------------------------------
272 --
273 --  {Start Of Comments}
274 --
275 -- Description:
276 --   Used to generate max(order_number) + 1 for an application_id for all
277 --   approver groups. Used whenever order number is passed as null.
278 --
279 -- Prerequisites:
280 --   None.
281 --
282 -- In Parameters:
283 --  p_effective_date
284 --  p_order_number
285 --  p_application_id
286 --
287 -- Post Success:
288 --   Processing continues if order number is in a valid range.
289 --
290 -- Post Failure:
291 --   Log the error message.
292 --
293 -- Developer Implementation Notes:
294 --   None.
295 ----
296 -- Access Status:
297 --   Internal Row Handler Use Only.
298 --
299 -- {End Of Comments}
300 -- ----------------------------------------------------------------------------
301 procedure generate_order_number
302   (
303     p_effective_date in            date
304    ,p_application_id in            number
305    ,p_order_number   IN out NOCOPY number) is
306   l_proc  varchar2(72)  :=  g_package||'generate_order_number';
307   l_temp_count NUMBER;
308 begin
309   if p_order_number is null then
310     select nvl(max(order_number),0)
311       into l_temp_count
312       from ame_approval_group_config
313      where application_id = p_application_id
314        and p_effective_date between start_date and nvl(end_date - (1/84600),sysdate);
315     l_temp_count := l_temp_count + 1;
316     p_order_number := l_temp_count;
317   else
318     if(p_order_number < 1) then
319       fnd_message.set_name('PER','AME_400565_INVALID_ORDER_NUM');
320       fnd_message.raise_error;
321     end if;
322   end if;
323 exception
324    when app_exception.application_exception then
325      if hr_multi_message.exception_add
326           (p_associated_column1 => 'ORDER_NUMBER') then
327        hr_utility.set_location(' Leaving:'|| l_proc, 50);
328        raise;
329      end if;
330    hr_utility.set_location(' Leaving:'|| l_proc, 60);
331 end generate_order_number;
332 --
333 -- ----------------------------------------------------------------------------
334 -- |------------------------------< pre_insert >------------------------------|
335 -- ----------------------------------------------------------------------------
336 -- {Start Of Comments}
337 --
338 -- Description:
339 --   This private procedure contains any processing which is required before
340 --   the insert dml. Presently, if the entity has a corresponding primary
341 --   key which is maintained by an associating sequence, the primary key for
342 --   the entity will be populated with the next sequence value in
343 --   preparation for the insert dml.
344 --   Also, if comments are defined for this entity, the comments insert
345 --   logic will also be called, generating a comment_id if required.
346 --
347 -- Prerequisites:
348 --   This is an internal procedure which is called from the ins procedure.
349 --
350 -- In Parameters:
351 --   A Pl/Sql record structure.
352 --
353 -- Post Success:
354 --   Processing continues.
355 --
356 -- Post Failure:
357 --   If an error has occurred, an error message and exception will be raised
358 --   but not handled.
359 --
360 -- Developer Implementation Notes:
361 --   Any pre-processing required before the insert dml is issued should be
362 --   coded within this procedure. As stated above, a good example is the
363 --   generation of a primary key number via a corresponding sequence.
364 --   It is important to note that any 3rd party maintenance should be reviewed
365 --   before placing in this procedure.
366 --
367 -- Access Status:
368 --   Internal Row Handler Use Only.
369 --
370 -- {End Of Comments}
371 -- ----------------------------------------------------------------------------
372 Procedure pre_insert
373   (p_rec                   in out nocopy ame_gcf_shd.g_rec_type
374   ,p_effective_date        in date
375   ,p_datetrack_mode        in varchar2
376   ,p_validation_start_date in date
377   ,p_validation_end_date   in date
378   ) is
379 --
380 --  Cursor C_Sel1 is select ame_approval_group_config_s.nextval from sys.dual;
381 --
382  Cursor C_Sel2 is
383     Select null
384       from ame_approval_group_config
385      where application_id =
386              ame_gcf_ins.g_application_id_i
387        and approval_group_id =
388              ame_gcf_ins.g_approval_group_id_i
389        and p_effective_date between start_date
390              and nvl(end_date - ame_util.oneSecond , p_effective_date);
391 --
392   l_proc        varchar2(72) := g_package||'pre_insert';
393   l_exists      varchar2(1);
394 --
395 Begin
396   hr_utility.set_location('Entering:'||l_proc, 5);
397   --
398     If (ame_gcf_ins.g_application_id_i is not null or
399       ame_gcf_ins.g_approval_group_id_i is not null) Then
400     --
401     -- Verify registered primary key values not already in use
402     --
403     Open C_Sel2;
404     Fetch C_Sel2 into l_exists;
405     If C_Sel2%found Then
406        Close C_Sel2;
407        --
408        -- The primary key values are already in use.
409        --
410        fnd_message.set_name('PER','PER_289391_KEY_ALREADY_USED');
411        fnd_message.set_token('TABLE_NAME','ame_approval_group_config');
412        fnd_message.raise_error;
413     End If;
414     Close C_Sel2;
415     --
416     -- Use registered key values and clear globals
417     --
418     p_rec.application_id :=
419       ame_gcf_ins.g_application_id_i;
420     ame_gcf_ins.g_application_id_i := null;
421     p_rec.approval_group_id :=
422       ame_gcf_ins.g_approval_group_id_i;
423     ame_gcf_ins.g_approval_group_id_i := null;
424   end if;
425   --+
426   --+ Set the appropriate order number.
427   --+
428   generate_order_number
429   (
430     p_effective_date => p_effective_date
431    ,p_application_id => p_rec.application_id
432    ,p_order_number   => p_rec.order_number);
433     --
434     -- No registerd key values, so select the next sequence number
435     --
436     --
437     -- Select the next sequence number
438     --
439   --  Open C_Sel1;
440   --  Fetch C_Sel1 Into p_rec.application_id;
441   --  Close C_Sel1;
442   --
443   --
444   hr_utility.set_location(' Leaving:'||l_proc, 10);
445 End pre_insert;
446 --
447 -- ----------------------------------------------------------------------------
448 -- |----------------------------< post_insert >-------------------------------|
449 -- ----------------------------------------------------------------------------
450 -- {Start Of Comments}
451 --
452 -- Description:
453 --   This private procedure contains any processing which is required after
454 --   the insert dml.
455 --
456 -- Prerequisites:
457 --   This is an internal procedure which is called from the ins procedure.
458 --
459 -- In Parameters:
460 --   A Pl/Sql record structure.
461 --
462 -- Post Success:
463 --   Processing continues.
464 --
465 -- Post Failure:
466 --   If an error has occurred, an error message and exception will be raised
467 --   but not handled.
468 --
469 -- Developer Implementation Notes:
470 --   Any post-processing required after the insert dml is issued should be
471 --   coded within this procedure. It is important to note that any 3rd party
472 --   maintenance should be reviewed before placing in this procedure.
473 --
474 -- Access Status:
475 --   Internal Row Handler Use Only.
476 --
477 -- {End Of Comments}
478 -- ----------------------------------------------------------------------------
479 Procedure post_insert
480   (p_rec                   in ame_gcf_shd.g_rec_type
481   ,p_effective_date        in date
482   ,p_datetrack_mode        in varchar2
483   ,p_validation_start_date in date
484   ,p_validation_end_date   in date
485   ) is
486 --
487   l_proc        varchar2(72) := g_package||'post_insert';
488 --
489 Begin
490   hr_utility.set_location('Entering:'||l_proc, 5);
491   begin
492     --
493     ame_gcf_rki.after_insert
494       (p_effective_date
495       => p_effective_date
496       ,p_validation_start_date
497       => p_validation_start_date
498       ,p_validation_end_date
499       => p_validation_end_date
500       ,p_application_id
501       => p_rec.application_id
502       ,p_approval_group_id
503       => p_rec.approval_group_id
504       ,p_voting_regime
505       => p_rec.voting_regime
506       ,p_order_number
507       => p_rec.order_number
508       ,p_start_date
509       => p_rec.start_date
510       ,p_end_date
511       => p_rec.end_date
512       ,p_object_version_number
513       => p_rec.object_version_number
514       );
515     --
516   exception
517     --
518     when hr_api.cannot_find_prog_unit then
519       --
520       hr_api.cannot_find_prog_unit_error
521         (p_module_name => 'AME_APPROVAL_GROUP_CONFIG'
522         ,p_hook_type   => 'AI');
523       --
524   end;
525   --
526   hr_utility.set_location(' Leaving:'||l_proc, 10);
527 End post_insert;
528 --
529 -- ----------------------------------------------------------------------------
530 -- |-------------------------------< ins_lck >--------------------------------|
531 -- ----------------------------------------------------------------------------
532 -- {Start Of Comments}
533 --
534 -- Description:
535 --   The ins_lck process has one main function to perform. When inserting
536 --   a datetracked row, we must validate the DT mode.
537 --
538 -- Prerequisites:
539 --   This procedure can only be called for the datetrack mode of INSERT.
540 --
541 -- In Parameters:
542 --
543 -- Post Success:
544 --   On successful completion of the ins_lck process the parental
545 --   datetracked rows will be locked providing the p_enforce_foreign_locking
546 --   argument value is TRUE.
547 --   If the p_enforce_foreign_locking argument value is FALSE then the
548 --   parential rows are not locked.
549 --
550 -- Post Failure:
551 --   The Lck process can fail for:
552 --   1) When attempting to lock the row the row could already be locked by
553 --      another user. This will raise the HR_Api.Object_Locked exception.
554 --   2) When attempting to the lock the parent which doesn't exist.
555 --      For the entity to be locked the parent must exist!
556 --
557 -- Developer Implementation Notes:
558 --   None.
559 --
560 -- Access Status:
561 --   Internal Row Handler Use Only.
562 --
563 -- {End Of Comments}
564 -- ----------------------------------------------------------------------------
565 Procedure ins_lck
566   (p_effective_date        in date
567   ,p_datetrack_mode        in varchar2
568   ,p_rec                   in ame_gcf_shd.g_rec_type
569   ,p_validation_start_date out nocopy date
570   ,p_validation_end_date   out nocopy date
571   ) is
572 --
573   l_proc                  varchar2(72) := g_package||'ins_lck';
574   l_validation_start_date date;
575   l_validation_end_date   date;
576 --
577   --
578   -- Cursor C_Sel1 selects the current parent row as of session date
579   --
580   Cursor C_Sel1 is
581     select
582       null
583     from    ame_calling_apps
584     where   application_id = p_rec.application_id
585     and     p_effective_date
586     between start_date and nvl(end_date - ame_util.oneSecond, p_effective_date)
587     for update nowait;
588   Cursor C_Sel2 is
589     select
590       null
591     from    ame_approval_groups
592     where   approval_group_id = p_rec.approval_group_id
593     and     p_effective_date
594     between start_date and nvl(end_date - ame_util.oneSecond, p_effective_date)
595     for update nowait;
596 Begin
597   hr_utility.set_location('Entering:'||l_proc, 5);
598   --
599   -- Validate the datetrack mode mode getting the validation start
600   -- and end dates for the specified datetrack operation.
601   --
602   --
603   -- Set the validation start and end date OUT arguments
604   --
605 --  p_validation_start_date := l_validation_start_date;
606 --  p_validation_end_date   := l_validation_end_date;
607 -- MURTHY_CHANGES
608   p_validation_start_date := sysdate;
609   p_validation_end_date   := ame_utility_pkg.endOfTime;
610   --
611   ame_gcf_bus.chk_application_id(p_application_id   => p_rec.application_id
612                     ,p_effective_date   => p_effective_date
613                     );
614   ame_gcf_bus.chk_approval_group_id(p_approval_group_id => p_rec.approval_group_id
615                        ,p_effective_date    => p_effective_date
616                        );
617   open C_Sel1;
618   close C_Sel1;
619   open C_Sel2;
620   close C_Sel2;
621   hr_utility.set_location(' Leaving:'||l_proc, 10);
622   --
623 End ins_lck;
624 --
625 -- ----------------------------------------------------------------------------
626 -- |---------------------------------< ins >----------------------------------|
627 -- ----------------------------------------------------------------------------
628 Procedure ins
629   (p_effective_date in     date
630   ,p_rec            in out nocopy ame_gcf_shd.g_rec_type
631   ) is
632 --
633   l_proc                        varchar2(72) := g_package||'ins';
634   l_datetrack_mode              varchar2(30) := hr_api.g_insert;
635   l_validation_start_date       date;
636   l_validation_end_date         date;
637 --
638 Begin
639   hr_utility.set_location('Entering:'||l_proc, 5);
640   --
641   -- Call the lock operation
642   --
643   ame_gcf_ins.ins_lck
644     (p_effective_date        => p_effective_date
645     ,p_datetrack_mode        => l_datetrack_mode
646     ,p_rec                   => p_rec
647     ,p_validation_start_date => l_validation_start_date
648     ,p_validation_end_date   => l_validation_end_date
649     );
650   --
651   -- Call the supporting insert validate operations
652   --
653   ame_gcf_bus.insert_validate
654     (p_rec                   => p_rec
655     ,p_effective_date        => p_effective_date
656     ,p_datetrack_mode        => l_datetrack_mode
657     ,p_validation_start_date => l_validation_start_date
658     ,p_validation_end_date   => l_validation_end_date
659     );
660   --
661   -- Call to raise any errors on multi-message list
662   hr_multi_message.end_validation_set;
663   --
664   -- Call the supporting pre-insert operation
665   --
666   ame_gcf_ins.pre_insert
667     (p_rec                   => p_rec
668     ,p_effective_date        => p_effective_date
669     ,p_datetrack_mode        => l_datetrack_mode
670     ,p_validation_start_date => l_validation_start_date
671     ,p_validation_end_date   => l_validation_end_date
672     );
673   --
674   -- Insert the row
675   --
676   ame_gcf_ins.insert_dml
677     (p_rec                   => p_rec
678     ,p_effective_date        => p_effective_date
679     ,p_datetrack_mode        => l_datetrack_mode
680     ,p_validation_start_date => l_validation_start_date
681     ,p_validation_end_date   => l_validation_end_date
682     );
683   --
684   -- Call the supporting post-insert operation
685   --
686   ame_gcf_ins.post_insert
687     (p_rec                   => p_rec
688     ,p_effective_date        => p_effective_date
689     ,p_datetrack_mode        => l_datetrack_mode
690     ,p_validation_start_date => l_validation_start_date
691     ,p_validation_end_date   => l_validation_end_date
692     );
693   --
694   -- Call to raise any errors on multi-message list
695   hr_multi_message.end_validation_set;
696   --
697   hr_utility.set_location('Leaving:'||l_proc,10);
698 end ins;
699 --
700 -- ----------------------------------------------------------------------------
701 -- |---------------------------------< ins >----------------------------------|
702 -- ----------------------------------------------------------------------------
703 Procedure ins
704   (p_effective_date                 in     date
705   ,p_voting_regime                  in     varchar2
706   ,p_order_number                   in     number
707   ,p_application_id                 in     number
708   ,p_approval_group_id              in     number
709   ,p_object_version_number             out nocopy number
710   ,p_start_date                        out nocopy date
711   ,p_end_date                          out nocopy date
712   ) is
713 --
714   l_rec         ame_gcf_shd.g_rec_type;
715   l_proc        varchar2(72) := g_package||'ins';
716 --
717 Begin
718   hr_utility.set_location('Entering:'||l_proc, 5);
719   --
720   -- Call conversion function to turn arguments into the
721   -- p_rec structure.
722   --
723   l_rec :=
724   ame_gcf_shd.convert_args
725     (p_application_id
726     ,p_approval_group_id
727     ,p_voting_regime
728     ,p_order_number
729     ,null
730     ,null
731     ,null
732     );
733   --
734   -- Having converted the arguments into the ame_gcf_rec
735   -- plsql record structure we call the corresponding record
736   -- business process.
737   --
738   ame_gcf_ins.ins
739     (p_effective_date
740     ,l_rec
741     );
742   --
743   -- Set the OUT arguments.
744   --
745   p_start_date             := l_rec.start_date;
746   p_end_date               := l_rec.end_date;
747   p_object_version_number            := l_rec.object_version_number;
748   --
749   --
750   hr_utility.set_location(' Leaving:'||l_proc, 10);
751 End ins;
752 --
753 end ame_gcf_ins;