1 Package ben_bec_shd as
2 /* $Header: bebecrhi.pkh 120.0 2005/05/28 00:37:33 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 batch_elctbl_id number(15),
11 benefit_action_id number(15),
12 person_id number(15),
13 pgm_id number(15),
14 pl_id number(15),
15 oipl_id number(15),
16 enrt_cvg_strt_dt date,
17 enrt_perd_strt_dt date,
18 enrt_perd_end_dt date,
19 erlst_deenrt_dt date,
20 dflt_enrt_dt date,
21 enrt_typ_cycl_cd varchar2(30),
22 comp_lvl_cd varchar2(30),
23 mndtry_flag varchar2(30),
24 dflt_flag varchar2(30),
25 business_group_id number(15),
26 object_version_number number(9)
27 );
28 --
29 -- ----------------------------------------------------------------------------
30 -- | Global Definitions - Internal Development Use Only |
31 -- ----------------------------------------------------------------------------
32 --
33 g_old_rec g_rec_type; -- Global record definition
34 g_api_dml boolean; -- Global api dml status
35 --
36 -- ----------------------------------------------------------------------------
37 -- |------------------------< return_api_dml_status >-------------------------|
38 -- ----------------------------------------------------------------------------
39 -- {Start Of Comments}
40 --
41 -- Description:
42 -- This function will return the current g_api_dml private global
43 -- boolean status.
44 -- The g_api_dml status determines if at the time of the function
45 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
46 -- is being issued from within an api.
47 -- If the status is TRUE then a dml statement is being issued from
48 -- within this entity api.
49 -- This function is primarily to support database triggers which
50 -- need to maintain the object_version_number for non-supported
51 -- dml statements (i.e. dml statement issued outside of the api layer).
52 --
53 -- Prerequisites:
54 -- None.
55 --
56 -- In Parameters:
57 -- None.
58 --
59 -- Post Success:
60 -- Processing continues.
61 -- If the function returns a TRUE value then, dml is being executed from
62 -- within this api.
63 --
64 -- Post Failure:
65 -- None.
66 --
67 -- Access Status:
68 -- Internal Row Handler Use Only.
69 --
70 -- {End Of Comments}
71 -- ----------------------------------------------------------------------------
72 Function return_api_dml_status Return Boolean;
73 --
74 -- ----------------------------------------------------------------------------
75 -- |---------------------------< constraint_error >---------------------------|
76 -- ----------------------------------------------------------------------------
77 -- {Start Of Comments}
78 --
79 -- Description:
80 -- This procedure is called when a constraint has been violated (i.e.
81 -- The exception hr_api.check_integrity_violated,
82 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
83 -- hr_api.unique_integrity_violated has been raised).
84 -- The exceptions can only be raised as follows:
85 -- 1) A check constraint can only be violated during an INSERT or UPDATE
86 -- dml operation.
87 -- 2) A parent integrity constraint can only be violated during an
88 -- INSERT or UPDATE dml operation.
89 -- 3) A child integrity constraint can only be violated during an
90 -- DELETE dml operation.
91 -- 4) A unique integrity constraint can only be violated during INSERT or
92 -- UPDATE dml operation.
93 --
94 -- Prerequisites:
95 -- 1) Either hr_api.check_integrity_violated,
96 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
97 -- hr_api.unique_integrity_violated has been raised with the subsequent
98 -- stripping of the constraint name from the generated error message
99 -- text.
100 -- 2) Standalone validation test which corresponds with a constraint error.
101 --
102 -- In Parameter:
103 -- p_constraint_name is in upper format and is just the constraint name
104 -- (e.g. not prefixed by brackets, schema owner etc).
105 --
106 -- Post Success:
107 -- Development dependant.
108 --
109 -- Post Failure:
110 -- Developement dependant.
111 --
112 -- Developer Implementation Notes:
113 -- For each constraint being checked the hr system package failure message
114 -- has been generated as a template only. These system error messages should
115 -- be modified as required (i.e. change the system failure message to a user
116 -- friendly defined error message).
117 --
118 -- Access Status:
119 -- Internal Development Use Only.
120 --
121 -- {End Of Comments}
122 -- ----------------------------------------------------------------------------
123 Procedure constraint_error
124 (p_constraint_name in all_constraints.constraint_name%TYPE);
125 --
126 -- ----------------------------------------------------------------------------
127 -- |-----------------------------< api_updating >-----------------------------|
128 -- ----------------------------------------------------------------------------
129 -- {Start Of Comments}
130 --
131 -- Description:
132 -- This function is used to populate the g_old_rec record with the
133 -- current row from the database for the specified primary key
134 -- provided that the primary key exists and is valid and does not
135 -- already match the current g_old_rec. The function will always return
136 -- a TRUE value if the g_old_rec is populated with the current row.
137 -- A FALSE value will be returned if all of the primary key arguments
138 -- are null.
139 --
140 -- Prerequisites:
141 -- None.
142 --
143 -- In Parameters:
144 --
145 -- Post Success:
146 -- A value of TRUE will be returned indiciating that the g_old_rec
147 -- is current.
148 -- A value of FALSE will be returned if all of the primary key arguments
149 -- have a null value (this indicates that the row has not be inserted into
150 -- the Schema), and therefore could never have a corresponding row.
151 --
152 -- Post Failure:
153 -- A failure can only occur under two circumstances:
154 -- 1) The primary key is invalid (i.e. a row does not exist for the
155 -- specified primary key values).
156 -- 2) If an object_version_number exists but is NOT the same as the current
157 -- g_old_rec value.
158 --
159 -- Developer Implementation Notes:
160 -- None.
161 --
162 -- Access Status:
163 -- Internal Development Use Only.
164 --
165 -- {End Of Comments}
166 -- ----------------------------------------------------------------------------
167 Function api_updating
168 (
169 p_batch_elctbl_id in number,
170 p_object_version_number in number
171 ) Return Boolean;
172 --
173 -- ----------------------------------------------------------------------------
174 -- |---------------------------------< lck >----------------------------------|
175 -- ----------------------------------------------------------------------------
176 -- {Start Of Comments}
177 --
178 -- Description:
179 -- The Lck process has two main functions to perform. Firstly, the row to be
180 -- updated or deleted must be locked. The locking of the row will only be
181 -- successful if the row is not currently locked by another user.
182 -- Secondly, during the locking of the row, the row is selected into
183 -- the g_old_rec data structure which enables the current row values from the
184 -- server to be available to the api.
185 --
186 -- Prerequisites:
187 -- When attempting to call the lock the object version number (if defined)
188 -- is mandatory.
189 --
190 -- In Parameters:
191 -- The arguments to the Lck process are the primary key(s) which uniquely
192 -- identify the row and the object version number of row.
193 --
194 -- Post Success:
195 -- On successful completion of the Lck process the row to be updated or
196 -- deleted will be locked and selected into the global data structure
197 -- g_old_rec.
198 --
199 -- Post Failure:
200 -- The Lck process can fail for three reasons:
201 -- 1) When attempting to lock the row the row could already be locked by
202 -- another user. This will raise the HR_Api.Object_Locked exception.
203 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
204 -- This error is trapped and reported using the message name
205 -- 'HR_7220_INVALID_PRIMARY_KEY'.
206 -- 3) The row although existing in the HR Schema has a different object
207 -- version number than the object version number specified.
208 -- This error is trapped and reported using the message name
209 -- 'HR_7155_OBJECT_INVALID'.
210 --
211 -- Developer Implementation Notes:
212 -- For each primary key and the object version number arguments add a
213 -- call to hr_api.mandatory_arg_error procedure to ensure that these
214 -- argument values are not null.
215 --
216 -- Access Status:
217 -- Internal Development Use Only.
218 --
219 -- {End Of Comments}
220 -- ----------------------------------------------------------------------------
221 Procedure lck
222 (
223 p_batch_elctbl_id in number,
224 p_object_version_number in number
225 );
226 --
227 -- ----------------------------------------------------------------------------
228 -- |-----------------------------< convert_args >-----------------------------|
229 -- ----------------------------------------------------------------------------
230 -- {Start Of Comments}
231 --
232 -- Description:
233 -- This function is used to turn attribute parameters into the record
234 -- structure parameter g_rec_type.
235 --
236 -- Prerequisites:
237 -- This is a private function and can only be called from the ins or upd
238 -- attribute processes.
239 --
240 -- In Parameters:
241 --
242 -- Post Success:
243 -- A returning record structure will be returned.
244 --
245 -- Post Failure:
246 -- No direct error handling is required within this function. Any possible
247 -- errors within this function will be a PL/SQL value error due to conversion
248 -- of datatypes or data lengths.
249 --
250 -- Developer Implementation Notes:
251 -- None.
252 --
253 -- Access Status:
254 -- Internal Row Handler Use Only.
255 --
256 -- {End Of Comments}
257 -- ----------------------------------------------------------------------------
258 Function convert_args
259 (
260 p_batch_elctbl_id in number,
261 p_benefit_action_id in number,
262 p_person_id in number,
263 p_pgm_id in number,
264 p_pl_id in number,
265 p_oipl_id in number,
266 p_enrt_cvg_strt_dt in date,
267 p_enrt_perd_strt_dt in date,
268 p_enrt_perd_end_dt in date,
269 p_erlst_deenrt_dt in date,
270 p_dflt_enrt_dt in date,
271 p_enrt_typ_cycl_cd in varchar2,
272 p_comp_lvl_cd in varchar2,
273 p_mndtry_flag in varchar2,
274 p_dflt_flag in varchar2,
275 p_business_group_id in number,
276 p_object_version_number in number
277 )
278 Return g_rec_type;
279 --
280 end ben_bec_shd;