1 Package ben_lpe_shd as
2 /* $Header: belperhi.pkh 120.0 2005/05/28 03:30:23 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 ler_chg_pl_nip_enrt_id number(15),
11 effective_start_date date,
12 effective_end_date date,
13 business_group_id number(15),
14 pl_id number(15),
15 ler_id number(15),
16 tco_chg_enrt_cd varchar2(30),
17 crnt_enrt_prclds_chg_flag varchar2(30),
18 dflt_enrt_cd varchar2(30),
19 dflt_enrt_rl number(15),
20 dflt_flag varchar2(30),
21 enrt_rl number(15),
22 enrt_cd varchar2(30),
23 stl_elig_cant_chg_flag varchar2(30),
24 enrt_mthd_cd varchar2(30),
25 auto_enrt_mthd_rl number(15),
26 lpe_attribute_category varchar2(30),
27 lpe_attribute1 varchar2(150),
28 lpe_attribute2 varchar2(150),
29 lpe_attribute3 varchar2(150),
30 lpe_attribute4 varchar2(150),
31 lpe_attribute5 varchar2(150),
32 lpe_attribute6 varchar2(150),
33 lpe_attribute7 varchar2(150),
34 lpe_attribute8 varchar2(150),
35 lpe_attribute9 varchar2(150),
36 lpe_attribute10 varchar2(150),
37 lpe_attribute11 varchar2(150),
38 lpe_attribute12 varchar2(150),
39 lpe_attribute13 varchar2(150),
40 lpe_attribute14 varchar2(150),
41 lpe_attribute15 varchar2(150),
42 lpe_attribute16 varchar2(150),
43 lpe_attribute17 varchar2(150),
44 lpe_attribute18 varchar2(150),
45 lpe_attribute19 varchar2(150),
46 lpe_attribute20 varchar2(150),
47 lpe_attribute21 varchar2(150),
48 lpe_attribute22 varchar2(150),
49 lpe_attribute23 varchar2(150),
50 lpe_attribute24 varchar2(150),
51 lpe_attribute25 varchar2(150),
52 lpe_attribute26 varchar2(150),
53 lpe_attribute27 varchar2(150),
54 lpe_attribute28 varchar2(150),
55 lpe_attribute29 varchar2(150),
56 lpe_attribute30 varchar2(150),
57 object_version_number number(9)
58 );
59 --
60 -- ----------------------------------------------------------------------------
61 -- | Global Definitions - Internal Development Use Only |
62 -- ----------------------------------------------------------------------------
63 --
64 g_old_rec g_rec_type; -- Global record definition
65 g_api_dml boolean; -- Global api dml status
66 --
67 -- ----------------------------------------------------------------------------
68 -- |------------------------< return_api_dml_status >-------------------------|
69 -- ----------------------------------------------------------------------------
70 -- {Start Of Comments}
71 --
72 -- Description:
73 -- This function will return the current g_api_dml private global
74 -- boolean status.
75 -- The g_api_dml status determines if at the time of the function
76 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
77 -- is being issued from within an api.
78 -- If the status is TRUE then a dml statement is being issued from
79 -- within this entity api.
80 -- This function is primarily to support database triggers which
81 -- need to maintain the object_version_number for non-supported
82 -- dml statements (i.e. dml statement issued outside of the api layer).
83 --
84 -- Prerequisites:
85 -- None.
86 --
87 -- In Parameters:
88 -- None.
89 --
90 -- Post Success:
91 -- Processing continues.
92 -- If the function returns a TRUE value then, dml is being executed from
93 -- within this api.
94 --
95 -- Post Failure:
96 -- None.
97 --
98 -- Access Status:
99 -- Internal Row Handler Use Only.
100 --
101 -- {End Of Comments}
102 -- ----------------------------------------------------------------------------
103 Function return_api_dml_status Return Boolean;
104 --
105 -- ----------------------------------------------------------------------------
106 -- |---------------------------< constraint_error >---------------------------|
107 -- ----------------------------------------------------------------------------
108 -- {Start Of Comments}
109 --
110 -- Description:
111 -- This procedure is called when a constraint has been violated (i.e.
112 -- The exception hr_api.check_integrity_violated,
113 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
114 -- hr_api.unique_integrity_violated has been raised).
115 -- The exceptions can only be raised as follows:
116 -- 1) A check constraint can only be violated during an INSERT or UPDATE
117 -- dml operation.
118 -- 2) A parent integrity constraint can only be violated during an
119 -- INSERT or UPDATE dml operation.
120 -- 3) A child integrity constraint can only be violated during an
121 -- DELETE dml operation.
122 -- 4) A unique integrity constraint can only be violated during INSERT or
123 -- UPDATE dml operation.
124 --
125 -- Prerequisites:
126 -- 1) Either hr_api.check_integrity_violated,
127 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
128 -- hr_api.unique_integrity_violated has been raised with the subsequent
129 -- stripping of the constraint name from the generated error message
130 -- text.
131 -- 2) Standalone validation test which corresponds with a constraint error.
132 --
133 -- In Parameter:
134 -- p_constraint_name is in upper format and is just the constraint name
135 -- (e.g. not prefixed by brackets, schema owner etc).
136 --
137 -- Post Success:
138 -- Development dependant.
139 --
140 -- Post Failure:
141 -- Developement dependant.
142 --
143 -- Developer Implementation Notes:
144 -- For each constraint being checked the hr system package failure message
145 -- has been generated as a template only. These system error messages should
146 -- be modified as required (i.e. change the system failure message to a user
147 -- friendly defined error message).
148 --
149 -- Access Status:
150 -- Internal Development Use Only.
151 --
152 -- {End Of Comments}
153 -- ----------------------------------------------------------------------------
154 Procedure constraint_error
155 (p_constraint_name in all_constraints.constraint_name%TYPE);
156 --
157 -- ----------------------------------------------------------------------------
158 -- |-----------------------------< api_updating >-----------------------------|
159 -- ----------------------------------------------------------------------------
160 -- {Start Of Comments}
161 --
162 -- Description:
163 -- This function is used to populate the g_old_rec record with the current
164 -- row from the database for the specified primary key provided that the
165 -- primary key exists, and is valid, and does not already match the current
166 -- g_old_rec.
167 -- The function will always return a TRUE value if the g_old_rec is
168 -- populated with the current row. A FALSE value will be returned if all of
169 -- the primary key arguments are null.
170 --
171 -- Prerequisites:
172 -- None.
173 --
174 -- In Parameters:
175 --
176 -- Post Success:
177 -- A value of TRUE will be returned indiciating that the g_old_rec is
178 -- current.
179 -- A value of FALSE will be returned if all of the primary key arguments
180 -- have a null value (this indicates that the row has not be inserted into
181 -- the Schema), and therefore could never have a corresponding row.
182 --
183 -- Post Failure:
184 -- A failure can only occur under two circumstances:
185 -- 1) The primary key is invalid (i.e. a row does not exist for the
186 -- specified primary key values).
187 -- 2) If an object_version_number exists but is NOT the same as the current
188 -- g_old_rec value.
189 --
190 -- Developer Implementation Notes:
191 -- None.
192 --
193 -- Access Status:
194 -- Internal Development Use Only.
195 --
196 -- {End Of Comments}
197 -- ----------------------------------------------------------------------------
198 Function api_updating
199 (p_effective_date in date,
200 p_ler_chg_pl_nip_enrt_id in number,
201 p_object_version_number in number
202 ) Return Boolean;
203 --
204 -- ----------------------------------------------------------------------------
205 -- |--------------------------< find_dt_del_modes >---------------------------|
206 -- ----------------------------------------------------------------------------
207 -- {Start Of Comments}
208 --
209 -- Description:
210 -- This procedure is used to determine what datetrack delete modes are
211 -- allowed as of the effective date for this entity. The procedure will
212 -- return a corresponding Boolean value for each of the delete modes
213 -- available where TRUE indicates that the corresponding delete mode is
214 -- available.
215 --
216 -- Prerequisites:
217 -- None.
218 --
219 -- In Parameters:
220 -- p_effective_date
221 -- Specifies the date at which the datetrack modes will be operated on.
222 -- p_base_key_value
223 -- Specifies the primary key value for this datetrack entity.
224 -- (E.g. For this entity the assignment of the argument would be:
225 -- p_base_key_value = :ler_chg_pl_nip_enrt_id).
226 --
227 -- Post Success:
228 -- Processing continues.
229 --
230 -- Post Failure:
231 -- Failure might occur if for the specified effective date and primary key
232 -- value a row doesn't exist.
233 --
234 -- Developer Implementation Notes:
235 -- This procedure could require changes if this entity has any sepcific
236 -- delete restrictions.
237 -- For example, this entity might disallow the datetrack delete mode of
238 -- ZAP. To implement this you would have to set and return a Boolean value
239 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
240 --
241 -- Access Status:
242 -- Internal Development Use Only.
243 --
244 -- {End Of Comments}
245 -- ----------------------------------------------------------------------------
246 Procedure find_dt_del_modes
247 (p_effective_date in date,
248 p_base_key_value in number,
249 p_zap out nocopy boolean,
250 p_delete out nocopy boolean,
251 p_future_change out nocopy boolean,
252 p_delete_next_change out nocopy boolean);
253 --
254 -- ----------------------------------------------------------------------------
255 -- |--------------------------< find_dt_upd_modes >---------------------------|
256 -- ----------------------------------------------------------------------------
257 -- {Start Of Comments}
258 --
259 -- Description:
260 -- This procedure is used to determine what datetrack update modes are
261 -- allowed as of the effective date for this entity. The procedure will
262 -- return a corresponding Boolean value for each of the update modes
263 -- available where TRUE indicates that the corresponding update mode
264 -- is available.
265 --
266 -- Prerequisites:
267 -- None.
268 --
269 -- In Parameters:
270 -- p_effective_date
271 -- Specifies the date at which the datetrack modes will be operated on.
272 -- p_base_key_value
273 -- Specifies the primary key value for this datetrack entity.
274 -- (E.g. For this entity the assignment of the argument would be:
275 -- p_base_key_value = :ler_chg_pl_nip_enrt_id).
276 --
277 -- Post Success:
278 -- Processing continues.
279 --
280 -- Post Failure:
281 -- Failure might occur if for the specified effective date and primary key
282 -- value a row doesn't exist.
283 --
284 -- Developer Implementation Notes:
285 -- This procedure could require changes if this entity has any sepcific
286 -- delete restrictions.
287 -- For example, this entity might disallow the datetrack update mode of
288 -- UPDATE. To implement this you would have to set and return a Boolean
289 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
290 --
291 -- Access Status:
292 -- Internal Development Use Only.
293 --
294 -- {End Of Comments}
295 -- ----------------------------------------------------------------------------
296 Procedure find_dt_upd_modes
297 (p_effective_date in date,
298 p_base_key_value in number,
299 p_correction out nocopy boolean,
300 p_update out nocopy boolean,
301 p_update_override out nocopy boolean,
302 p_update_change_insert out nocopy boolean);
303 --
304 -- ----------------------------------------------------------------------------
305 -- |------------------------< upd_effective_end_date >------------------------|
306 -- ----------------------------------------------------------------------------
307 -- {Start Of Comments}
308 --
309 -- Description:
310 -- This procedure will update the specified datetrack row with the
311 -- specified new effective end date. The object version number is also
312 -- set to the next object version number. DateTrack modes which call
313 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
314 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
315 -- This is an internal datetrack maintenance procedure which should
316 -- not be modified in anyway.
317 --
318 -- Prerequisites:
319 -- None.
320 --
321 -- In Parameters:
322 -- p_new_effective_end_date
323 -- Specifies the new effective end date which will be set for the
324 -- row as of the effective date.
325 -- p_base_key_value
326 -- Specifies the primary key value for this datetrack entity.
327 -- (E.g. For this entity the assignment of the argument would be:
331 -- The specified row will be updated with the new effective end date and
328 -- p_base_key_value = :ler_chg_pl_nip_enrt_id).
329 --
330 -- Post Success:
332 -- object_version_number.
333 --
334 -- Post Failure:
335 -- Failure might occur if for the specified effective date and primary key
336 -- value a row doesn't exist.
337 --
338 -- Developer Implementation Notes:
339 -- This is an internal datetrack maintenance procedure which should
340 -- not be modified in anyway.
341 --
342 -- Access Status:
343 -- Internal Row Handler Use Only.
344 --
345 -- {End Of Comments}
346 -- ----------------------------------------------------------------------------
347 Procedure upd_effective_end_date
348 (p_effective_date in date,
349 p_base_key_value in number,
350 p_new_effective_end_date in date,
351 p_validation_start_date in date,
352 p_validation_end_date in date,
353 p_object_version_number out nocopy number);
354 --
355 -- ----------------------------------------------------------------------------
356 -- |---------------------------------< lck >----------------------------------|
357 -- ----------------------------------------------------------------------------
358 -- {Start Of Comments}
359 --
360 -- Description:
361 -- The Lck process for datetrack is complicated and comprises of the
362 -- following processing
363 -- The processing steps are as follows:
364 -- 1) The row to be updated or deleted must be locked.
365 -- By locking this row, the g_old_rec record data type is populated.
366 -- 2) If a comment exists the text is selected from hr_comments.
367 -- 3) The datetrack mode is then validated to ensure the operation is
368 -- valid. If the mode is valid the validation start and end dates for
369 -- the mode will be derived and returned. Any required locking is
370 -- completed when the datetrack mode is validated.
371 --
372 -- Prerequisites:
373 -- When attempting to call the lck procedure the object version number,
374 -- primary key, effective date and datetrack mode must be specified.
375 --
376 -- In Parameters:
377 -- p_effective_date
378 -- Specifies the date of the datetrack update operation.
379 -- p_datetrack_mode
380 -- Determines the datetrack update or delete mode.
381 --
382 -- Post Success:
383 -- On successful completion of the Lck process the row to be updated or
384 -- deleted will be locked and selected into the global data structure
385 -- g_old_rec.
386 --
387 -- Post Failure:
388 -- The Lck process can fail for three reasons:
389 -- 1) When attempting to lock the row the row could already be locked by
390 -- another user. This will raise the HR_Api.Object_Locked exception.
391 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
392 -- This error is trapped and reported using the message name
393 -- 'HR_7220_INVALID_PRIMARY_KEY'.
394 -- 3) The row although existing in the HR Schema has a different object
395 -- version number than the object version number specified.
396 -- This error is trapped and reported using the message name
397 -- 'HR_7155_OBJECT_INVALID'.
398 --
399 -- Developer Implementation Notes:
400 -- None.
401 --
402 -- Access Status:
403 -- Internal Development Use Only.
404 --
405 -- {End Of Comments}
406 -- ----------------------------------------------------------------------------
407 Procedure lck
408 (p_effective_date in date,
409 p_datetrack_mode in varchar2,
410 p_ler_chg_pl_nip_enrt_id in number,
411 p_object_version_number in number,
412 p_validation_start_date out nocopy date,
413 p_validation_end_date out nocopy date);
414 --
415 -- ----------------------------------------------------------------------------
416 -- |-----------------------------< convert_args >-----------------------------|
417 -- ----------------------------------------------------------------------------
418 -- {Start Of Comments}
419 --
420 -- Description:
421 -- This function is used to turn attribute parameters into the record
422 -- structure parameter g_rec_type.
423 --
424 -- Prerequisites:
425 -- This is a private function and can only be called from the ins or upd
426 -- attribute processes.
427 --
428 -- In Parameters:
429 --
430 -- Post Success:
431 -- A returning record structure will be returned.
432 --
433 -- Post Failure:
434 -- No direct error handling is required within this function. Any possible
435 -- errors within this function will be a PL/SQL value error due to conversion
436 -- of datatypes or data lengths.
437 --
438 -- Developer Implementation Notes:
439 -- None.
440 --
441 -- Access Status:
442 -- Internal Row Handler Use Only.
443 --
444 -- {End Of Comments}
445 -- ----------------------------------------------------------------------------
446 Function convert_args
447 (
448 p_ler_chg_pl_nip_enrt_id in number,
449 p_effective_start_date in date,
450 p_effective_end_date in date,
451 p_business_group_id in number,
452 p_pl_id in number,
453 p_ler_id in number,
454 p_tco_chg_enrt_cd in varchar2,
455 p_crnt_enrt_prclds_chg_flag in varchar2,
456 p_dflt_enrt_cd in varchar2,
457 p_dflt_enrt_rl in number,
458 p_dflt_flag in varchar2,
459 p_enrt_rl in number,
460 p_enrt_cd in varchar2,
461 p_stl_elig_cant_chg_flag in varchar2,
462 p_enrt_mthd_cd in varchar2,
463 p_auto_enrt_mthd_rl in number,
464 p_lpe_attribute_category in varchar2,
465 p_lpe_attribute1 in varchar2,
466 p_lpe_attribute2 in varchar2,
467 p_lpe_attribute3 in varchar2,
468 p_lpe_attribute4 in varchar2,
469 p_lpe_attribute5 in varchar2,
470 p_lpe_attribute6 in varchar2,
471 p_lpe_attribute7 in varchar2,
472 p_lpe_attribute8 in varchar2,
473 p_lpe_attribute9 in varchar2,
474 p_lpe_attribute10 in varchar2,
475 p_lpe_attribute11 in varchar2,
476 p_lpe_attribute12 in varchar2,
477 p_lpe_attribute13 in varchar2,
478 p_lpe_attribute14 in varchar2,
479 p_lpe_attribute15 in varchar2,
480 p_lpe_attribute16 in varchar2,
481 p_lpe_attribute17 in varchar2,
482 p_lpe_attribute18 in varchar2,
483 p_lpe_attribute19 in varchar2,
484 p_lpe_attribute20 in varchar2,
485 p_lpe_attribute21 in varchar2,
486 p_lpe_attribute22 in varchar2,
487 p_lpe_attribute23 in varchar2,
488 p_lpe_attribute24 in varchar2,
489 p_lpe_attribute25 in varchar2,
490 p_lpe_attribute26 in varchar2,
491 p_lpe_attribute27 in varchar2,
492 p_lpe_attribute28 in varchar2,
493 p_lpe_attribute29 in varchar2,
494 p_lpe_attribute30 in varchar2,
495 p_object_version_number in number
496 )
497 Return g_rec_type;
498 --
499 end ben_lpe_shd;