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