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