1 Package ben_apr_shd AUTHID CURRENT_USER as
2 /* $Header: beaprrhi.pkh 120.0 2005/05/28 00:27:01 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 actl_prem_id number(15),
11 effective_start_date date,
12 effective_end_date date,
13 name varchar2(240), -- UTF8 Change Bug 2254683
14 acty_ref_perd_cd varchar2(30),
15 uom varchar2(30),
16 rt_typ_cd varchar2(30),
17 bnft_rt_typ_cd varchar2(30),
18 val number,
19 mlt_cd varchar2(30),
20 prdct_cd varchar2(30),
21 rndg_cd varchar2(30),
22 rndg_rl number(15),
23 val_calc_rl number(15),
24 prem_asnmt_cd varchar2(30),
25 prem_asnmt_lvl_cd varchar2(30),
26 actl_prem_typ_cd varchar2(30),
27 prem_pyr_cd varchar2(30),
28 cr_lkbk_val number,
29 cr_lkbk_uom varchar2(30),
30 cr_lkbk_crnt_py_only_flag varchar2(30),
31 prsptv_r_rtsptv_cd varchar2(30),
32 upr_lmt_val number,
33 upr_lmt_calc_rl number,
34 lwr_lmt_val number,
35 lwr_lmt_calc_rl number,
36 cost_allocation_keyflex_id number(15),
37 organization_id number(15),
38 oipl_id number(15),
39 pl_id number(15),
40 comp_lvl_fctr_id number(15),
41 business_group_id number(15),
42 prtl_mo_det_mthd_cd varchar2(30),
43 prtl_mo_det_mthd_rl number(15),
44 wsh_rl_dy_mo_num number(9),
45 vrbl_rt_add_on_calc_rl number(15),
46 apr_attribute_category varchar2(30),
47 apr_attribute1 varchar2(150),
48 apr_attribute2 varchar2(150),
49 apr_attribute3 varchar2(150),
50 apr_attribute4 varchar2(150),
51 apr_attribute5 varchar2(150),
52 apr_attribute6 varchar2(150),
53 apr_attribute7 varchar2(150),
54 apr_attribute8 varchar2(150),
55 apr_attribute9 varchar2(150),
56 apr_attribute10 varchar2(150),
57 apr_attribute11 varchar2(150),
58 apr_attribute12 varchar2(150),
59 apr_attribute13 varchar2(150),
60 apr_attribute14 varchar2(150),
61 apr_attribute15 varchar2(150),
62 apr_attribute16 varchar2(150),
63 apr_attribute17 varchar2(150),
64 apr_attribute18 varchar2(150),
65 apr_attribute19 varchar2(150),
66 apr_attribute20 varchar2(150),
67 apr_attribute21 varchar2(150),
68 apr_attribute22 varchar2(150),
69 apr_attribute23 varchar2(150),
70 apr_attribute24 varchar2(150),
71 apr_attribute25 varchar2(150),
72 apr_attribute26 varchar2(150),
73 apr_attribute27 varchar2(150),
74 apr_attribute28 varchar2(150),
75 apr_attribute29 varchar2(150),
76 apr_attribute30 varchar2(150),
77 object_version_number number(9)
78 );
79 --
80 -- ----------------------------------------------------------------------------
81 -- | Global Definitions - Internal Development Use Only |
82 -- ----------------------------------------------------------------------------
83 --
84 g_old_rec g_rec_type; -- Global record definition
85 g_api_dml boolean; -- Global api dml status
86 --
87 -- ----------------------------------------------------------------------------
88 -- |------------------------< return_api_dml_status >-------------------------|
89 -- ----------------------------------------------------------------------------
90 -- {Start Of Comments}
91 --
92 -- Description:
93 -- This function will return the current g_api_dml private global
94 -- boolean status.
95 -- The g_api_dml status determines if at the time of the function
96 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
97 -- is being issued from within an api.
98 -- If the status is TRUE then a dml statement is being issued from
99 -- within this entity api.
100 -- This function is primarily to support database triggers which
101 -- need to maintain the object_version_number for non-supported
102 -- dml statements (i.e. dml statement issued outside of the api layer).
103 --
104 -- Prerequisites:
105 -- None.
106 --
107 -- In Parameters:
108 -- None.
109 --
110 -- Post Success:
111 -- Processing continues.
112 -- If the function returns a TRUE value then, dml is being executed from
113 -- within this api.
114 --
115 -- Post Failure:
116 -- None.
117 --
118 -- Access Status:
119 -- Internal Row Handler Use Only.
120 --
121 -- {End Of Comments}
122 -- ----------------------------------------------------------------------------
123 Function return_api_dml_status Return Boolean;
124 --
125 -- ----------------------------------------------------------------------------
126 -- |---------------------------< constraint_error >---------------------------|
127 -- ----------------------------------------------------------------------------
128 -- {Start Of Comments}
129 --
130 -- Description:
131 -- This procedure is called when a constraint has been violated (i.e.
132 -- The exception hr_api.check_integrity_violated,
133 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
134 -- hr_api.unique_integrity_violated has been raised).
135 -- The exceptions can only be raised as follows:
136 -- 1) A check constraint can only be violated during an INSERT or UPDATE
137 -- dml operation.
138 -- 2) A parent integrity constraint can only be violated during an
139 -- INSERT or UPDATE dml operation.
140 -- 3) A child integrity constraint can only be violated during an
141 -- DELETE dml operation.
142 -- 4) A unique integrity constraint can only be violated during INSERT or
143 -- UPDATE dml operation.
144 --
145 -- Prerequisites:
146 -- 1) Either hr_api.check_integrity_violated,
147 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
148 -- hr_api.unique_integrity_violated has been raised with the subsequent
149 -- stripping of the constraint name from the generated error message
150 -- text.
151 -- 2) Standalone validation test which corresponds with a constraint error.
152 --
153 -- In Parameter:
154 -- p_constraint_name is in upper format and is just the constraint name
155 -- (e.g. not prefixed by brackets, schema owner etc).
156 --
157 -- Post Success:
158 -- Development dependant.
159 --
160 -- Post Failure:
161 -- Developement dependant.
162 --
163 -- Developer Implementation Notes:
164 -- For each constraint being checked the hr system package failure message
165 -- has been generated as a template only. These system error messages should
166 -- be modified as required (i.e. change the system failure message to a user
167 -- friendly defined error message).
168 --
169 -- Access Status:
170 -- Internal Development Use Only.
171 --
172 -- {End Of Comments}
173 -- ----------------------------------------------------------------------------
174 Procedure constraint_error
175 (p_constraint_name in all_constraints.constraint_name%TYPE);
176 --
177 -- ----------------------------------------------------------------------------
178 -- |-----------------------------< api_updating >-----------------------------|
179 -- ----------------------------------------------------------------------------
180 -- {Start Of Comments}
181 --
182 -- Description:
183 -- This function is used to populate the g_old_rec record with the current
184 -- row from the database for the specified primary key provided that the
185 -- primary key exists, and is valid, and does not already match the current
186 -- g_old_rec.
187 -- The function will always return a TRUE value if the g_old_rec is
188 -- populated with the current row. A FALSE value will be returned if all of
189 -- the primary key arguments are null.
190 --
191 -- Prerequisites:
192 -- None.
193 --
194 -- In Parameters:
195 --
196 -- Post Success:
197 -- A value of TRUE will be returned indiciating that the g_old_rec is
198 -- current.
199 -- A value of FALSE will be returned if all of the primary key arguments
200 -- have a null value (this indicates that the row has not be inserted into
201 -- the Schema), and therefore could never have a corresponding row.
202 --
203 -- Post Failure:
204 -- A failure can only occur under two circumstances:
205 -- 1) The primary key is invalid (i.e. a row does not exist for the
206 -- specified primary key values).
207 -- 2) If an object_version_number exists but is NOT the same as the current
208 -- g_old_rec value.
209 --
210 -- Developer Implementation Notes:
211 -- None.
212 --
213 -- Access Status:
214 -- Internal Development Use Only.
215 --
216 -- {End Of Comments}
217 -- ----------------------------------------------------------------------------
218 Function api_updating
219 (p_effective_date in date,
220 p_actl_prem_id in number,
221 p_object_version_number in number
222 ) Return Boolean;
223 --
224 -- ----------------------------------------------------------------------------
225 -- |--------------------------< find_dt_del_modes >---------------------------|
226 -- ----------------------------------------------------------------------------
227 -- {Start Of Comments}
228 --
229 -- Description:
230 -- This procedure is used to determine what datetrack delete modes are
231 -- allowed as of the effective date for this entity. The procedure will
232 -- return a corresponding Boolean value for each of the delete modes
233 -- available where TRUE indicates that the corresponding delete mode is
234 -- available.
235 --
236 -- Prerequisites:
237 -- None.
238 --
239 -- In Parameters:
240 -- p_effective_date
241 -- Specifies the date at which the datetrack modes will be operated on.
242 -- p_base_key_value
243 -- Specifies the primary key value for this datetrack entity.
244 -- (E.g. For this entity the assignment of the argument would be:
245 -- p_base_key_value = :actl_prem_id).
246 --
247 -- Post Success:
248 -- Processing continues.
249 --
250 -- Post Failure:
251 -- Failure might occur if for the specified effective date and primary key
252 -- value a row doesn't exist.
253 --
254 -- Developer Implementation Notes:
255 -- This procedure could require changes if this entity has any sepcific
256 -- delete restrictions.
257 -- For example, this entity might disallow the datetrack delete mode of
258 -- ZAP. To implement this you would have to set and return a Boolean value
259 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
260 --
261 -- Access Status:
262 -- Internal Development Use Only.
263 --
264 -- {End Of Comments}
265 -- ----------------------------------------------------------------------------
266 Procedure find_dt_del_modes
267 (p_effective_date in date,
268 p_base_key_value in number,
269 p_zap out nocopy boolean,
270 p_delete out nocopy boolean,
271 p_future_change out nocopy boolean,
272 p_delete_next_change out nocopy boolean);
273 --
274 -- ----------------------------------------------------------------------------
275 -- |--------------------------< find_dt_upd_modes >---------------------------|
276 -- ----------------------------------------------------------------------------
277 -- {Start Of Comments}
278 --
279 -- Description:
280 -- This procedure is used to determine what datetrack update modes are
281 -- allowed as of the effective date for this entity. The procedure will
282 -- return a corresponding Boolean value for each of the update modes
283 -- available where TRUE indicates that the corresponding update mode
284 -- is available.
285 --
286 -- Prerequisites:
287 -- None.
288 --
289 -- In Parameters:
290 -- p_effective_date
291 -- Specifies the date at which the datetrack modes will be operated on.
292 -- p_base_key_value
293 -- Specifies the primary key value for this datetrack entity.
294 -- (E.g. For this entity the assignment of the argument would be:
295 -- p_base_key_value = :actl_prem_id).
296 --
297 -- Post Success:
298 -- Processing continues.
299 --
300 -- Post Failure:
301 -- Failure might occur if for the specified effective date and primary key
302 -- value a row doesn't exist.
303 --
304 -- Developer Implementation Notes:
305 -- This procedure could require changes if this entity has any sepcific
306 -- delete restrictions.
307 -- For example, this entity might disallow the datetrack update mode of
308 -- UPDATE. To implement this you would have to set and return a Boolean
309 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
310 --
311 -- Access Status:
312 -- Internal Development Use Only.
313 --
314 -- {End Of Comments}
315 -- ----------------------------------------------------------------------------
316 Procedure find_dt_upd_modes
317 (p_effective_date in date,
318 p_base_key_value in number,
319 p_correction out nocopy boolean,
320 p_update out nocopy boolean,
321 p_update_override out nocopy boolean,
322 p_update_change_insert out nocopy boolean);
323 --
324 -- ----------------------------------------------------------------------------
325 -- |------------------------< upd_effective_end_date >------------------------|
326 -- ----------------------------------------------------------------------------
327 -- {Start Of Comments}
328 --
329 -- Description:
330 -- This procedure will update the specified datetrack row with the
331 -- specified new effective end date. The object version number is also
332 -- set to the next object version number. DateTrack modes which call
333 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
334 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
335 -- This is an internal datetrack maintenance procedure which should
336 -- not be modified in anyway.
337 --
338 -- Prerequisites:
339 -- None.
340 --
341 -- In Parameters:
342 -- p_new_effective_end_date
343 -- Specifies the new effective end date which will be set for the
344 -- row as of the effective date.
345 -- p_base_key_value
346 -- Specifies the primary key value for this datetrack entity.
347 -- (E.g. For this entity the assignment of the argument would be:
348 -- p_base_key_value = :actl_prem_id).
349 --
350 -- Post Success:
351 -- The specified row will be updated with the new effective end date and
352 -- object_version_number.
353 --
354 -- Post Failure:
355 -- Failure might occur if for the specified effective date and primary key
356 -- value a row doesn't exist.
357 --
358 -- Developer Implementation Notes:
359 -- This is an internal datetrack maintenance procedure which should
360 -- not be modified in anyway.
361 --
362 -- Access Status:
363 -- Internal Row Handler Use Only.
364 --
365 -- {End Of Comments}
366 -- ----------------------------------------------------------------------------
370 p_new_effective_end_date in date,
367 Procedure upd_effective_end_date
368 (p_effective_date in date,
369 p_base_key_value in number,
371 p_validation_start_date in date,
372 p_validation_end_date in date,
373 p_object_version_number out nocopy number);
374 --
375 -- ----------------------------------------------------------------------------
376 -- |---------------------------------< lck >----------------------------------|
377 -- ----------------------------------------------------------------------------
378 -- {Start Of Comments}
379 --
380 -- Description:
381 -- The Lck process for datetrack is complicated and comprises of the
382 -- following processing
383 -- The processing steps are as follows:
384 -- 1) The row to be updated or deleted must be locked.
385 -- By locking this row, the g_old_rec record data type is populated.
386 -- 2) If a comment exists the text is selected from hr_comments.
387 -- 3) The datetrack mode is then validated to ensure the operation is
388 -- valid. If the mode is valid the validation start and end dates for
389 -- the mode will be derived and returned. Any required locking is
390 -- completed when the datetrack mode is validated.
391 --
392 -- Prerequisites:
393 -- When attempting to call the lck procedure the object version number,
394 -- primary key, effective date and datetrack mode must be specified.
395 --
396 -- In Parameters:
397 -- p_effective_date
398 -- Specifies the date of the datetrack update operation.
399 -- p_datetrack_mode
400 -- Determines the datetrack update or delete mode.
401 --
402 -- Post Success:
403 -- On successful completion of the Lck process the row to be updated or
404 -- deleted will be locked and selected into the global data structure
405 -- g_old_rec.
406 --
407 -- Post Failure:
408 -- The Lck process can fail for three reasons:
409 -- 1) When attempting to lock the row the row could already be locked by
410 -- another user. This will raise the HR_Api.Object_Locked exception.
411 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
412 -- This error is trapped and reported using the message name
413 -- 'HR_7220_INVALID_PRIMARY_KEY'.
414 -- 3) The row although existing in the HR Schema has a different object
415 -- version number than the object version number specified.
416 -- This error is trapped and reported using the message name
417 -- 'HR_7155_OBJECT_INVALID'.
418 --
419 -- Developer Implementation Notes:
420 -- None.
421 --
422 -- Access Status:
423 -- Internal Development Use Only.
424 --
425 -- {End Of Comments}
426 -- ----------------------------------------------------------------------------
427 Procedure lck
428 (p_effective_date in date,
429 p_datetrack_mode in varchar2,
430 p_actl_prem_id in number,
431 p_object_version_number in number,
432 p_validation_start_date out nocopy date,
433 p_validation_end_date out nocopy date);
434 --
435 -- ----------------------------------------------------------------------------
436 -- |-----------------------------< convert_args >-----------------------------|
437 -- ----------------------------------------------------------------------------
438 -- {Start Of Comments}
439 --
440 -- Description:
441 -- This function is used to turn attribute parameters into the record
442 -- structure parameter g_rec_type.
443 --
444 -- Prerequisites:
445 -- This is a private function and can only be called from the ins or upd
446 -- attribute processes.
447 --
448 -- In Parameters:
449 --
450 -- Post Success:
451 -- A returning record structure will be returned.
452 --
453 -- Post Failure:
454 -- No direct error handling is required within this function. Any possible
455 -- errors within this function will be a PL/SQL value error due to conversion
456 -- of datatypes or data lengths.
457 --
458 -- Developer Implementation Notes:
459 -- None.
460 --
461 -- Access Status:
462 -- Internal Row Handler Use Only.
463 --
464 -- {End Of Comments}
465 -- ----------------------------------------------------------------------------
466 Function convert_args
467 (
468 p_actl_prem_id in number,
469 p_effective_start_date in date,
470 p_effective_end_date in date,
471 p_name in varchar2,
472 p_acty_ref_perd_cd in varchar2,
473 p_uom in varchar2,
474 p_rt_typ_cd in varchar2,
475 p_bnft_rt_typ_cd in varchar2,
476 p_val in number,
477 p_mlt_cd in varchar2,
478 p_prdct_cd in varchar2,
479 p_rndg_cd in varchar2,
480 p_rndg_rl in number,
481 p_val_calc_rl in number,
482 p_prem_asnmt_cd in varchar2,
483 p_prem_asnmt_lvl_cd in varchar2,
484 p_actl_prem_typ_cd in varchar2,
485 p_prem_pyr_cd in varchar2,
486 p_cr_lkbk_val in number,
487 p_cr_lkbk_uom in varchar2,
488 p_cr_lkbk_crnt_py_only_flag in varchar2,
489 p_prsptv_r_rtsptv_cd in varchar2,
490 p_upr_lmt_val in number,
494 p_cost_allocation_keyflex_id in number,
491 p_upr_lmt_calc_rl in number,
492 p_lwr_lmt_val in number,
493 p_lwr_lmt_calc_rl in number,
495 p_organization_id in number,
496 p_oipl_id in number,
497 p_pl_id in number,
498 p_comp_lvl_fctr_id in number,
499 p_business_group_id in number,
500 p_prtl_mo_det_mthd_cd in varchar2,
501 p_prtl_mo_det_mthd_rl in number,
502 p_wsh_rl_dy_mo_num in number,
503 p_vrbl_rt_add_on_calc_rl in number,
504 p_apr_attribute_category in varchar2,
505 p_apr_attribute1 in varchar2,
506 p_apr_attribute2 in varchar2,
507 p_apr_attribute3 in varchar2,
508 p_apr_attribute4 in varchar2,
509 p_apr_attribute5 in varchar2,
510 p_apr_attribute6 in varchar2,
511 p_apr_attribute7 in varchar2,
512 p_apr_attribute8 in varchar2,
513 p_apr_attribute9 in varchar2,
514 p_apr_attribute10 in varchar2,
515 p_apr_attribute11 in varchar2,
516 p_apr_attribute12 in varchar2,
517 p_apr_attribute13 in varchar2,
518 p_apr_attribute14 in varchar2,
519 p_apr_attribute15 in varchar2,
520 p_apr_attribute16 in varchar2,
521 p_apr_attribute17 in varchar2,
522 p_apr_attribute18 in varchar2,
523 p_apr_attribute19 in varchar2,
524 p_apr_attribute20 in varchar2,
525 p_apr_attribute21 in varchar2,
526 p_apr_attribute22 in varchar2,
527 p_apr_attribute23 in varchar2,
528 p_apr_attribute24 in varchar2,
529 p_apr_attribute25 in varchar2,
530 p_apr_attribute26 in varchar2,
531 p_apr_attribute27 in varchar2,
532 p_apr_attribute28 in varchar2,
533 p_apr_attribute29 in varchar2,
534 p_apr_attribute30 in varchar2,
535 p_object_version_number in number
536 )
537 Return g_rec_type;
538 --
539 end ben_apr_shd;