1 Package ben_epo_shd AUTHID CURRENT_USER as
2 /* $Header: beeporhi.pkh 120.0 2005/05/28 02:42:36 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 elig_per_opt_id number(15),
11 elig_per_id number(15),
12 effective_start_date date,
13 effective_end_date date,
14 prtn_ovridn_flag varchar2(30),
15 prtn_ovridn_thru_dt date,
16 no_mx_prtn_ovrid_thru_flag varchar2(30),
17 elig_flag varchar2(30),
18 prtn_strt_dt date,
19 prtn_end_dt date,
20 wait_perd_cmpltn_date date,
21 wait_perd_strt_dt date,
22 prtn_ovridn_rsn_cd varchar2(30),
23 pct_fl_tm_val number,
24 opt_id number(15),
25 per_in_ler_id number(15),
26 rt_comp_ref_amt number,
27 rt_cmbn_age_n_los_val number,
28 rt_comp_ref_uom varchar2(30),
29 rt_age_val number,
30 rt_los_val number,
31 rt_hrs_wkd_val number,
32 rt_hrs_wkd_bndry_perd_cd varchar2(30),
33 rt_age_uom varchar2(30),
34 rt_los_uom varchar2(30),
35 rt_pct_fl_tm_val number,
36 rt_frz_los_flag varchar2(30),
37 rt_frz_age_flag varchar2(30),
38 rt_frz_cmp_lvl_flag varchar2(30),
39 rt_frz_pct_fl_tm_flag varchar2(30),
40 rt_frz_hrs_wkd_flag varchar2(30),
41 rt_frz_comb_age_and_los_flag varchar2(30),
42 comp_ref_amt number,
43 cmbn_age_n_los_val number,
44 comp_ref_uom varchar2(30),
45 age_val number,
46 los_val number,
47 hrs_wkd_val number,
48 hrs_wkd_bndry_perd_cd varchar2(30),
49 age_uom varchar2(30),
50 los_uom varchar2(30),
51 frz_los_flag varchar2(30),
52 frz_age_flag varchar2(30),
53 frz_cmp_lvl_flag varchar2(30),
54 frz_pct_fl_tm_flag varchar2(30),
55 frz_hrs_wkd_flag varchar2(30),
56 frz_comb_age_and_los_flag varchar2(30),
57 ovrid_svc_dt date,
58 inelg_rsn_cd varchar2(30),
59 once_r_cntug_cd varchar2(30),
60 oipl_ordr_num number(15),
61 business_group_id number(15),
62 epo_attribute_category varchar2(30),
63 epo_attribute1 varchar2(150),
64 epo_attribute2 varchar2(150),
65 epo_attribute3 varchar2(150),
66 epo_attribute4 varchar2(150),
67 epo_attribute5 varchar2(150),
68 epo_attribute6 varchar2(150),
69 epo_attribute7 varchar2(150),
70 epo_attribute8 varchar2(150),
71 epo_attribute9 varchar2(150),
72 epo_attribute10 varchar2(150),
73 epo_attribute11 varchar2(150),
74 epo_attribute12 varchar2(150),
75 epo_attribute13 varchar2(150),
76 epo_attribute14 varchar2(150),
77 epo_attribute15 varchar2(150),
78 epo_attribute16 varchar2(150),
79 epo_attribute17 varchar2(150),
80 epo_attribute18 varchar2(150),
81 epo_attribute19 varchar2(150),
82 epo_attribute20 varchar2(150),
83 epo_attribute21 varchar2(150),
84 epo_attribute22 varchar2(150),
85 epo_attribute23 varchar2(150),
86 epo_attribute24 varchar2(150),
87 epo_attribute25 varchar2(150),
88 epo_attribute26 varchar2(150),
89 epo_attribute27 varchar2(150),
90 epo_attribute28 varchar2(150),
91 epo_attribute29 varchar2(150),
92 epo_attribute30 varchar2(150),
93 request_id number(15),
94 program_application_id number(15),
95 program_id number(15),
96 program_update_date date,
97 object_version_number number(9)
98 );
99 --
100 -- ----------------------------------------------------------------------------
101 -- | Global Definitions - Internal Development Use Only |
102 -- ----------------------------------------------------------------------------
103 --
104 g_old_rec g_rec_type; -- Global record definition
105 g_api_dml boolean; -- Global api dml status
106 --
107 -- ----------------------------------------------------------------------------
108 -- |------------------------< return_api_dml_status >-------------------------|
109 -- ----------------------------------------------------------------------------
110 -- {Start Of Comments}
111 --
112 -- Description:
113 -- This function will return the current g_api_dml private global
114 -- boolean status.
115 -- The g_api_dml status determines if at the time of the function
116 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
117 -- is being issued from within an api.
118 -- If the status is TRUE then a dml statement is being issued from
119 -- within this entity api.
120 -- This function is primarily to support database triggers which
121 -- need to maintain the object_version_number for non-supported
122 -- dml statements (i.e. dml statement issued outside of the api layer).
123 --
124 -- Prerequisites:
125 -- None.
126 --
127 -- In Parameters:
128 -- None.
129 --
130 -- Post Success:
131 -- Processing continues.
132 -- If the function returns a TRUE value then, dml is being executed from
133 -- within this api.
134 --
135 -- Post Failure:
136 -- None.
137 --
138 -- Access Status:
139 -- Internal Row Handler Use Only.
140 --
141 -- {End Of Comments}
142 -- ----------------------------------------------------------------------------
143 Function return_api_dml_status Return Boolean;
144 --
145 -- ----------------------------------------------------------------------------
146 -- |---------------------------< constraint_error >---------------------------|
147 -- ----------------------------------------------------------------------------
148 -- {Start Of Comments}
149 --
150 -- Description:
151 -- This procedure is called when a constraint has been violated (i.e.
152 -- The exception hr_api.check_integrity_violated,
153 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
154 -- hr_api.unique_integrity_violated has been raised).
155 -- The exceptions can only be raised as follows:
156 -- 1) A check constraint can only be violated during an INSERT or UPDATE
157 -- dml operation.
158 -- 2) A parent integrity constraint can only be violated during an
159 -- INSERT or UPDATE dml operation.
160 -- 3) A child integrity constraint can only be violated during an
161 -- DELETE dml operation.
162 -- 4) A unique integrity constraint can only be violated during INSERT or
163 -- UPDATE dml operation.
164 --
165 -- Prerequisites:
166 -- 1) Either hr_api.check_integrity_violated,
167 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
168 -- hr_api.unique_integrity_violated has been raised with the subsequent
169 -- stripping of the constraint name from the generated error message
170 -- text.
171 -- 2) Standalone validation test which corresponds with a constraint error.
172 --
173 -- In Parameter:
174 -- p_constraint_name is in upper format and is just the constraint name
175 -- (e.g. not prefixed by brackets, schema owner etc).
176 --
177 -- Post Success:
178 -- Development dependant.
179 --
180 -- Post Failure:
181 -- Developement dependant.
182 --
183 -- Developer Implementation Notes:
184 -- For each constraint being checked the hr system package failure message
185 -- has been generated as a template only. These system error messages should
186 -- be modified as required (i.e. change the system failure message to a user
187 -- friendly defined error message).
188 --
189 -- Access Status:
190 -- Internal Development Use Only.
191 --
192 -- {End Of Comments}
193 -- ----------------------------------------------------------------------------
194 Procedure constraint_error
195 (p_constraint_name in all_constraints.constraint_name%TYPE);
196 --
197 -- ----------------------------------------------------------------------------
198 -- |-----------------------------< api_updating >-----------------------------|
199 -- ----------------------------------------------------------------------------
200 -- {Start Of Comments}
201 --
202 -- Description:
203 -- This function is used to populate the g_old_rec record with the current
204 -- row from the database for the specified primary key provided that the
205 -- primary key exists, and is valid, and does not already match the current
206 -- g_old_rec.
207 -- The function will always return a TRUE value if the g_old_rec is
208 -- populated with the current row. A FALSE value will be returned if all of
209 -- the primary key arguments are null.
210 --
211 -- Prerequisites:
212 -- None.
213 --
214 -- In Parameters:
215 --
216 -- Post Success:
217 -- A value of TRUE will be returned indiciating that the g_old_rec is
218 -- current.
219 -- A value of FALSE will be returned if all of the primary key arguments
220 -- have a null value (this indicates that the row has not be inserted into
221 -- the Schema), and therefore could never have a corresponding row.
222 --
223 -- Post Failure:
224 -- A failure can only occur under two circumstances:
225 -- 1) The primary key is invalid (i.e. a row does not exist for the
226 -- specified primary key values).
227 -- 2) If an object_version_number exists but is NOT the same as the current
228 -- g_old_rec value.
229 --
230 -- Developer Implementation Notes:
231 -- None.
232 --
233 -- Access Status:
234 -- Internal Development Use Only.
235 --
236 -- {End Of Comments}
237 -- ----------------------------------------------------------------------------
238 Function api_updating
239 (p_effective_date in date,
240 p_elig_per_opt_id in number,
241 p_object_version_number in number
242 ) Return Boolean;
243 --
244 -- ----------------------------------------------------------------------------
245 -- |--------------------------< find_dt_del_modes >---------------------------|
246 -- ----------------------------------------------------------------------------
247 -- {Start Of Comments}
248 --
249 -- Description:
250 -- This procedure is used to determine what datetrack delete modes are
251 -- allowed as of the effective date for this entity. The procedure will
252 -- return a corresponding Boolean value for each of the delete modes
253 -- available where TRUE indicates that the corresponding delete mode is
254 -- available.
255 --
256 -- Prerequisites:
257 -- None.
258 --
259 -- In Parameters:
260 -- p_effective_date
261 -- Specifies the date at which the datetrack modes will be operated on.
262 -- p_base_key_value
263 -- Specifies the primary key value for this datetrack entity.
264 -- (E.g. For this entity the assignment of the argument would be:
265 -- p_base_key_value = :elig_per_opt_id).
266 --
267 -- Post Success:
268 -- Processing continues.
269 --
270 -- Post Failure:
271 -- Failure might occur if for the specified effective date and primary key
272 -- value a row doesn't exist.
273 --
274 -- Developer Implementation Notes:
275 -- This procedure could require changes if this entity has any sepcific
276 -- delete restrictions.
277 -- For example, this entity might disallow the datetrack delete mode of
278 -- ZAP. To implement this you would have to set and return a Boolean value
279 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
280 --
281 -- Access Status:
282 -- Internal Development Use Only.
283 --
284 -- {End Of Comments}
285 -- ----------------------------------------------------------------------------
286 Procedure find_dt_del_modes
287 (p_effective_date in date,
288 p_base_key_value in number,
289 p_zap out nocopy boolean,
290 p_delete out nocopy boolean,
291 p_future_change out nocopy boolean,
292 p_delete_next_change out nocopy boolean);
293 --
294 -- ----------------------------------------------------------------------------
295 -- |--------------------------< find_dt_upd_modes >---------------------------|
296 -- ----------------------------------------------------------------------------
297 -- {Start Of Comments}
298 --
299 -- Description:
300 -- This procedure is used to determine what datetrack update modes are
301 -- allowed as of the effective date for this entity. The procedure will
302 -- return a corresponding Boolean value for each of the update modes
303 -- available where TRUE indicates that the corresponding update mode
304 -- is available.
305 --
306 -- Prerequisites:
307 -- None.
308 --
309 -- In Parameters:
310 -- p_effective_date
311 -- Specifies the date at which the datetrack modes will be operated on.
312 -- p_base_key_value
313 -- Specifies the primary key value for this datetrack entity.
314 -- (E.g. For this entity the assignment of the argument would be:
315 -- p_base_key_value = :elig_per_opt_id).
316 --
317 -- Post Success:
318 -- Processing continues.
319 --
320 -- Post Failure:
321 -- Failure might occur if for the specified effective date and primary key
322 -- value a row doesn't exist.
323 --
324 -- Developer Implementation Notes:
325 -- This procedure could require changes if this entity has any sepcific
326 -- delete restrictions.
327 -- For example, this entity might disallow the datetrack update mode of
328 -- UPDATE. To implement this you would have to set and return a Boolean
329 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
330 --
331 -- Access Status:
332 -- Internal Development Use Only.
333 --
334 -- {End Of Comments}
335 -- ----------------------------------------------------------------------------
336 Procedure find_dt_upd_modes
337 (p_effective_date in date,
338 p_base_key_value in number,
339 p_correction out nocopy boolean,
340 p_update out nocopy boolean,
341 p_update_override out nocopy boolean,
342 p_update_change_insert out nocopy boolean);
343 --
344 -- ----------------------------------------------------------------------------
345 -- |------------------------< upd_effective_end_date >------------------------|
346 -- ----------------------------------------------------------------------------
347 -- {Start Of Comments}
348 --
349 -- Description:
350 -- This procedure will update the specified datetrack row with the
351 -- specified new effective end date. The object version number is also
352 -- set to the next object version number. DateTrack modes which call
353 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
354 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
355 -- This is an internal datetrack maintenance procedure which should
356 -- not be modified in anyway.
357 --
358 -- Prerequisites:
359 -- None.
360 --
361 -- In Parameters:
365 -- p_base_key_value
362 -- p_new_effective_end_date
363 -- Specifies the new effective end date which will be set for the
364 -- row as of the effective date.
366 -- Specifies the primary key value for this datetrack entity.
367 -- (E.g. For this entity the assignment of the argument would be:
368 -- p_base_key_value = :elig_per_opt_id).
369 --
370 -- Post Success:
371 -- The specified row will be updated with the new effective end date and
372 -- object_version_number.
373 --
374 -- Post Failure:
375 -- Failure might occur if for the specified effective date and primary key
376 -- value a row doesn't exist.
377 --
378 -- Developer Implementation Notes:
379 -- This is an internal datetrack maintenance procedure which should
380 -- not be modified in anyway.
381 --
382 -- Access Status:
383 -- Internal Row Handler Use Only.
384 --
385 -- {End Of Comments}
386 -- ----------------------------------------------------------------------------
387 Procedure upd_effective_end_date
388 (p_effective_date in date,
389 p_base_key_value in number,
390 p_new_effective_end_date in date,
391 p_validation_start_date in date,
392 p_validation_end_date in date,
393 p_object_version_number out nocopy number);
394 --
395 -- ----------------------------------------------------------------------------
396 -- |---------------------------------< lck >----------------------------------|
397 -- ----------------------------------------------------------------------------
398 -- {Start Of Comments}
399 --
400 -- Description:
401 -- The Lck process for datetrack is complicated and comprises of the
402 -- following processing
403 -- The processing steps are as follows:
404 -- 1) The row to be updated or deleted must be locked.
405 -- By locking this row, the g_old_rec record data type is populated.
406 -- 2) If a comment exists the text is selected from hr_comments.
407 -- 3) The datetrack mode is then validated to ensure the operation is
408 -- valid. If the mode is valid the validation start and end dates for
409 -- the mode will be derived and returned. Any required locking is
410 -- completed when the datetrack mode is validated.
411 --
412 -- Prerequisites:
413 -- When attempting to call the lck procedure the object version number,
414 -- primary key, effective date and datetrack mode must be specified.
415 --
416 -- In Parameters:
417 -- p_effective_date
418 -- Specifies the date of the datetrack update operation.
419 -- p_datetrack_mode
420 -- Determines the datetrack update or delete mode.
421 --
422 -- Post Success:
423 -- On successful completion of the Lck process the row to be updated or
424 -- deleted will be locked and selected into the global data structure
425 -- g_old_rec.
426 --
427 -- Post Failure:
428 -- The Lck process can fail for three reasons:
429 -- 1) When attempting to lock the row the row could already be locked by
430 -- another user. This will raise the HR_Api.Object_Locked exception.
431 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
432 -- This error is trapped and reported using the message name
433 -- 'HR_7220_INVALID_PRIMARY_KEY'.
434 -- 3) The row although existing in the HR Schema has a different object
435 -- version number than the object version number specified.
436 -- This error is trapped and reported using the message name
437 -- 'HR_7155_OBJECT_INVALID'.
438 --
439 -- Developer Implementation Notes:
440 -- None.
441 --
442 -- Access Status:
443 -- Internal Development Use Only.
444 --
445 -- {End Of Comments}
446 -- ----------------------------------------------------------------------------
447 Procedure lck
448 (p_effective_date in date,
449 p_datetrack_mode in varchar2,
450 p_elig_per_opt_id in number,
451 p_object_version_number in number,
452 p_validation_start_date out nocopy date,
453 p_validation_end_date out nocopy date);
454 --
455 -- ----------------------------------------------------------------------------
456 -- |-----------------------------< convert_args >-----------------------------|
457 -- ----------------------------------------------------------------------------
458 -- {Start Of Comments}
459 --
460 -- Description:
461 -- This function is used to turn attribute parameters into the record
462 -- structure parameter g_rec_type.
463 --
464 -- Prerequisites:
465 -- This is a private function and can only be called from the ins or upd
466 -- attribute processes.
467 --
468 -- In Parameters:
469 --
470 -- Post Success:
471 -- A returning record structure will be returned.
472 --
473 -- Post Failure:
474 -- No direct error handling is required within this function. Any possible
475 -- errors within this function will be a PL/SQL value error due to conversion
476 -- of datatypes or data lengths.
477 --
478 -- Developer Implementation Notes:
479 -- None.
480 --
481 -- Access Status:
482 -- Internal Row Handler Use Only.
483 --
484 -- {End Of Comments}
485 -- ----------------------------------------------------------------------------
486 Function convert_args
487 (
488 p_elig_per_opt_id in number,
489 p_elig_per_id in number,
493 p_prtn_ovridn_thru_dt in date,
490 p_effective_start_date in date,
491 p_effective_end_date in date,
492 p_prtn_ovridn_flag in varchar2,
494 p_no_mx_prtn_ovrid_thru_flag in varchar2,
495 p_elig_flag in varchar2,
496 p_prtn_strt_dt in date,
497 p_prtn_end_dt in date,
498 p_wait_perd_cmpltn_date in date,
499 p_wait_perd_strt_dt in date,
500 p_prtn_ovridn_rsn_cd in varchar2,
501 p_pct_fl_tm_val in number,
502 p_opt_id in number,
503 p_per_in_ler_id in number,
504 p_rt_comp_ref_amt in number,
505 p_rt_cmbn_age_n_los_val in number,
506 p_rt_comp_ref_uom in varchar2,
507 p_rt_age_val in number,
508 p_rt_los_val in number,
509 p_rt_hrs_wkd_val in number,
510 p_rt_hrs_wkd_bndry_perd_cd in varchar2,
511 p_rt_age_uom in varchar2,
512 p_rt_los_uom in varchar2,
513 p_rt_pct_fl_tm_val in number,
514 p_rt_frz_los_flag in varchar2,
515 p_rt_frz_age_flag in varchar2,
516 p_rt_frz_cmp_lvl_flag in varchar2,
517 p_rt_frz_pct_fl_tm_flag in varchar2,
518 p_rt_frz_hrs_wkd_flag in varchar2,
519 p_rt_frz_comb_age_and_los_flag in varchar2,
520 p_comp_ref_amt in number,
521 p_cmbn_age_n_los_val in number,
522 p_comp_ref_uom in varchar2,
523 p_age_val in number,
524 p_los_val in number,
525 p_hrs_wkd_val in number,
526 p_hrs_wkd_bndry_perd_cd in varchar2,
527 p_age_uom in varchar2,
528 p_los_uom in varchar2,
529 p_frz_los_flag in varchar2,
530 p_frz_age_flag in varchar2,
531 p_frz_cmp_lvl_flag in varchar2,
532 p_frz_pct_fl_tm_flag in varchar2,
533 p_frz_hrs_wkd_flag in varchar2,
534 p_frz_comb_age_and_los_flag in varchar2,
535 p_ovrid_svc_dt in date,
536 p_inelg_rsn_cd in varchar2,
537 p_once_r_cntug_cd in varchar2,
538 p_oipl_ordr_num in number,
539 p_business_group_id in number,
540 p_epo_attribute_category in varchar2,
541 p_epo_attribute1 in varchar2,
542 p_epo_attribute2 in varchar2,
543 p_epo_attribute3 in varchar2,
544 p_epo_attribute4 in varchar2,
545 p_epo_attribute5 in varchar2,
546 p_epo_attribute6 in varchar2,
547 p_epo_attribute7 in varchar2,
548 p_epo_attribute8 in varchar2,
549 p_epo_attribute9 in varchar2,
550 p_epo_attribute10 in varchar2,
551 p_epo_attribute11 in varchar2,
552 p_epo_attribute12 in varchar2,
553 p_epo_attribute13 in varchar2,
554 p_epo_attribute14 in varchar2,
555 p_epo_attribute15 in varchar2,
556 p_epo_attribute16 in varchar2,
557 p_epo_attribute17 in varchar2,
558 p_epo_attribute18 in varchar2,
559 p_epo_attribute19 in varchar2,
560 p_epo_attribute20 in varchar2,
561 p_epo_attribute21 in varchar2,
562 p_epo_attribute22 in varchar2,
563 p_epo_attribute23 in varchar2,
564 p_epo_attribute24 in varchar2,
565 p_epo_attribute25 in varchar2,
566 p_epo_attribute26 in varchar2,
567 p_epo_attribute27 in varchar2,
568 p_epo_attribute28 in varchar2,
569 p_epo_attribute29 in varchar2,
570 p_epo_attribute30 in varchar2,
571 p_request_id in number,
572 p_program_application_id in number,
573 p_program_id in number,
574 p_program_update_date in date,
575 p_object_version_number in number
576 )
577 Return g_rec_type;
578 --
579 end ben_epo_shd;