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