[Home] [Help]
PACKAGE BODY: APPS.BEN_ENV_OBJECT
Source
1 package body ben_env_object as
2 /* $Header: benenvir.pkb 120.0 2005/05/28 08:58:11 appldev noship $ */
3 --------------------------------------------------------------------------------
4 /*
5 +==============================================================================+
6 | Copyright (c) 1997 Oracle Corporation |
7 | Redwood Shores, California, USA |
8 | All rights reserved. |
9 +==============================================================================+
10
11 Name
12 Environment Object Caching Routine
13 Purpose
14 This package is used to return environment object information.
15 History
16 Date Who Version What?
17 --------- ---------- ------- --------------------------------------------
18 17 May 99 G Perry 115.0 Created
19 11 Jun 99 bbulusu 115.1 Added setenv procs for the elig flags.
20 23 Jun 99 G Perry 115.2 Added plip_id to structure.
21 06 Jul 99 s das 115.3 Added setenv for business group.
22 08 Jul 99 mhoyes 115.4 Removed trace messages.
23 26 Jul 99 G Perry 115.5 Removed setenv for business group.
24 20 Jan 2000 mhoyes 115.6 - Added PTIP to env object.
25 20 Jan 2000 mhoyes 115.7 - Added exit.
26 28 Jan 2000 mhoyes 115.8 - Added elig for PLIP and PTIP
27 flags.
28 - Fixed bug 1169613.
29 26 Fen 2000 mhoyes 115.9 - Removed elig flags and routines. Moved into
30 benmngle where they belong.
31 15 May 2000 mhoyes 115.10 - Added audit_log_flag.
32 15 May 2000 mhoyes 115.11 - Fixed audit log problem.
33 30 Nov 2001 mhoyes 115.12 - Added mode_cd.
34 30 Dec 2002 ikasire 115.13 - nocopy changes plus dbdrv plus commit
35 05 May 2003 mhoyes 115.14 - Added bgp_legislation_code.
36 */
37 --------------------------------------------------------------------------------
38 --
39 g_package varchar2(30) := 'ben_env_object.';
40 --
41 procedure init
42 (p_business_group_id in number
43 ,p_effective_date in date
44 ,p_thread_id in number
45 ,p_chunk_size in number
46 ,p_threads in number
47 ,p_max_errors in number
48 ,p_benefit_action_id in number
49 ,p_audit_log_flag in varchar2 default 'N'
50 )
51 is
52 --
53 l_proc varchar2(80) := g_package||'init';
54 --
55 cursor c_bftdets
56 (c_bft_id in number
57 )
58 is
59 select bft.audit_log_flag,
60 bft.mode_cd
61 from ben_benefit_actions bft
62 where bft.benefit_action_id = c_bft_id;
63 --
64 l_bft_rec c_bftdets%rowtype;
65 --
66 cursor c_bgpdets
67 (c_bgp_id in number
68 )
69 is
70 select bgp.legislation_code
71 from per_business_groups bgp
72 where bgp.business_group_id = c_bgp_id;
73 --
74 l_bgpdets c_bgpdets%rowtype;
75 --
76 begin
77 --
78 hr_utility.set_location('Entering '||l_proc,10);
79 --
80 -- Get benefit action info
81 --
82 open c_bftdets
83 (c_bft_id => p_benefit_action_id
84 );
85 fetch c_bftdets into l_bft_rec;
86 close c_bftdets;
87 --
88 -- Get Business group details
89 --
90 if p_business_group_id is not null
91 then
92 --
93 open c_bgpdets
94 (c_bgp_id => p_business_group_id
95 );
96 fetch c_bgpdets into l_bgpdets;
97 close c_bgpdets;
98 --
99 end if;
100 --
101 -- Default environment variables
102 --
103 g_global_env_rec.business_group_id := p_business_group_id;
104 g_global_env_rec.bgp_legislation_code := l_bgpdets.legislation_code;
105 g_global_env_rec.effective_date := p_effective_date;
106 g_global_env_rec.thread_id := p_thread_id;
107 g_global_env_rec.chunk_size := p_chunk_size;
108 g_global_env_rec.threads := p_threads;
109 g_global_env_rec.max_errors := p_max_errors;
110 g_global_env_rec.benefit_action_id := p_benefit_action_id;
111 g_global_env_rec.audit_log_flag := l_bft_rec.audit_log_flag;
112 g_global_env_rec.mode_cd := l_bft_rec.mode_cd;
113 --
114 -- Default remaining parameters to null
115 --
116 g_global_env_rec.lf_evt_ocrd_dt := null;
117 g_global_env_rec.person_id := null;
118 g_global_env_rec.pgm_id := null;
119 g_global_env_rec.pl_id := null;
120 g_global_env_rec.oipl_id := null;
121 g_global_env_rec.plip_id := null;
122 g_global_env_rec.ptip_id := null;
123 --
124 hr_utility.set_location('Leaving '||l_proc,10);
125 --
126 end init;
127 --
128 procedure get(p_rec out nocopy g_global_env_rec_type) is
129 --
130 l_proc varchar2(80) := g_package||'get';
131 --
132 begin
133 --
134 p_rec := g_global_env_rec;
135 --
136 end get;
137 --
138 procedure setenv(p_lf_evt_ocrd_dt in date) is
139 --
140 l_proc varchar2(80) := g_package||'setenv 1';
141 --
142 begin
143 --
144 g_global_env_rec.lf_evt_ocrd_dt := p_lf_evt_ocrd_dt;
145 --
146 end setenv;
147 --
148 procedure setenv(p_person_id in number) is
149 --
150 l_proc varchar2(80) := g_package||'setenv 2';
151 --
152 begin
153 --
154 g_global_env_rec.person_id := p_person_id;
155 --
156 end setenv;
157 --
158 procedure setenv(p_pgm_id in number) is
159 --
160 l_proc varchar2(80) := g_package||'setenv 3';
161 --
162 begin
163 --
164 g_global_env_rec.pgm_id := p_pgm_id;
165 --
166 end setenv;
167 --
168 procedure setenv(p_ptip_id in number) is
169 --
170 l_proc varchar2(80) := g_package||'setenv 3.1';
171 --
172 begin
173 --
174 g_global_env_rec.ptip_id := p_ptip_id;
175 --
176 end setenv;
177 --
178 procedure setenv(p_pl_id in number) is
179 --
180 l_proc varchar2(80) := g_package||'setenv 4';
181 --
182 begin
183 --
184 g_global_env_rec.pl_id := p_pl_id;
185 --
186 end setenv;
187 --
188 procedure setenv(p_plip_id in number) is
189 --
190 l_proc varchar2(80) := g_package||'setenv 5';
191 --
192 begin
193 --
194 g_global_env_rec.plip_id := p_plip_id;
195 --
196 end setenv;
197 --
198 procedure setenv(p_oipl_id in number) is
199 --
200 l_proc varchar2(80) := g_package||'setenv 6';
201 --
202 begin
203 --
204 g_global_env_rec.oipl_id := p_oipl_id;
205 --
206 end setenv;
207 --
208 end ben_env_object;