DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_EXT_ACTN

Source


1 package body BEN_EXT_ACTN as
2 /* $Header: benxactn.pkb 115.10 2003/02/08 06:58:37 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ext_actn.';  -- Global package name
9 --
10 -- procedure to initialize the globals - May, 99
11 -- ----------------------------------------------------------------------------
12 -- |---------------------< initialize_globals >-------------------------------------|
13 -- ----------------------------------------------------------------------------
14 PROCEDURE initialize_globals IS
15    --
16    l_proc             varchar2(72) := g_package||'initialize_globals';
17    --
18 BEGIN
19   --
20   hr_utility.set_location('Entering'||l_proc, 5);
21   --
22     ben_ext_person.g_actn_prtt_enrt_actn_id       := null;
23     ben_ext_person.g_actn_type_id       := null;
24     ben_ext_person.g_actn_name          := null;
25     ben_ext_person.g_actn_description   := null;
26     ben_ext_person.g_actn_type          := null;
27     ben_ext_person.g_actn_due_date      := null;
28     ben_ext_person.g_actn_required_flag := null;
29     ben_ext_person.g_actn_cmpltd_date   := null;
30   --
31   hr_utility.set_location('Exiting'||l_proc, 15);
32   --
33 End initialize_globals;
34 --
35 -- ----------------------------------------------------------------------------
36 -- |---------------------< main >---------------------------------------------|
37 -- ----------------------------------------------------------------------------
38 PROCEDURE main
39     (                        p_person_id          in number,
40                              p_prtt_enrt_rslt_id  in number,
41                              p_ext_rslt_id        in number,
42                              p_ext_file_id        in number,
43                              p_data_typ_cd        in varchar2,
44                              p_ext_typ_cd         in varchar2,
45                              p_chg_evt_cd         in varchar2,
46                              p_business_group_id  in number,
47                              p_effective_date     in date) is
48    --
49    l_proc             varchar2(72) := g_package||'main';
50    --
51   cursor c_actn (l_prtt_enrt_rslt_id number) is
52     select
53 	     type.actn_typ_id     	action_id
54 	    ,type.name			action_name
55 	    ,type.description		action_desc
56 	    ,type.type_cd		action_type
57           ,actn.due_dt		action_due_dt
58 	    ,actn.rqd_flag		action_rqd_flag
59           ,actn.cmpltd_dt             action_cmpltd_dt
60           ,actn.prtt_enrt_actn_id
61 	from ben_actn_typ    		type,
62              ben_prtt_enrt_actn_f 	actn,
63 	     ben_prtt_enrt_rslt_f	rslt
64        where
65             actn.prtt_enrt_rslt_id = l_prtt_enrt_rslt_id
66         and p_effective_date between actn.effective_start_date
67                                  and actn.effective_end_date
68         and actn.actn_typ_id = type.actn_typ_id
69         and actn.prtt_enrt_rslt_id = rslt.prtt_enrt_rslt_id
70         and rslt.person_id = p_person_id
71       ;
72  l_include varchar2(1) := 'Y';
73  --
74  BEGIN
75    --
76    hr_utility.set_location('Entering'||l_proc, 5);
77    --
78    FOR actn IN c_actn(p_prtt_enrt_rslt_id) LOOP
79         --
80         initialize_globals;
81         --
82         l_include := 'Y';
83         --
84         ben_ext_evaluate_inclusion.Evaluate_action_item_Incl
85                      (p_actn_typ_id       => actn.action_id,
86                       p_prtt_enrt_actn_id => actn.prtt_enrt_actn_id,
87                       p_include           => l_include);
88 
89         if l_include = 'Y' then
90 
91           -- fetch actions information into globals
92           --
93           ben_ext_person.g_actn_type_id       := actn.action_id;
94           ben_ext_person.g_actn_name          := actn.action_name;
95           ben_ext_person.g_actn_description   := actn.action_desc;
96           ben_ext_person.g_actn_type          := actn.action_type;
97           ben_ext_person.g_actn_due_date      := actn.action_due_dt;
98           ben_ext_person.g_actn_required_flag := actn.action_rqd_flag;
99           ben_ext_person.g_actn_cmpltd_date   := actn.action_cmpltd_dt;
100           ben_ext_person.g_actn_prtt_enrt_actn_id       := actn.prtt_enrt_actn_id;
101           --
102           -- format and write
103           --
104           ben_ext_fmt.process_ext_recs(p_ext_rslt_id       => p_ext_rslt_id,
105                                      p_ext_file_id       => p_ext_file_id,
106                                      p_data_typ_cd       => p_data_typ_cd,
107                                      p_ext_typ_cd        => p_ext_typ_cd,
108                                      p_rcd_typ_cd        => 'D',
109                                      p_low_lvl_cd        => 'A',
110                                      p_person_id         => p_person_id,
111                                      p_chg_evt_cd        => p_chg_evt_cd,
112                                      p_business_group_id => p_business_group_id,
113                                      p_effective_date    => p_effective_date
114                                      );
115         end if;
116      --
117    END LOOP;
118    --
119    hr_utility.set_location('Exiting'||l_proc, 15);
120 
121  END; -- main
122 --
123 END; -- package