1 Package ben_cop_shd AUTHID CURRENT_USER as
2 /* $Header: becoprhi.pkh 120.0.12020000.2 2012/07/03 12:02:44 amnaraya ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 oipl_id number(15),
11 effective_start_date date,
12 effective_end_date date,
13 ivr_ident varchar2(90), -- UTF8 Change Bug 2254683
14 url_ref_name varchar2(240),
15 opt_id number(15),
16 business_group_id number(15),
17 pl_id number(15),
18 ordr_num number(15),
19 rqd_perd_enrt_nenrt_val number(15),
20 dflt_flag varchar2(30),
21 actl_prem_id number(15),
22 mndtry_flag varchar2(30),
23 oipl_stat_cd varchar2(30),
24 pcp_dsgn_cd varchar2(30),
25 pcp_dpnt_dsgn_cd varchar2(30),
26 rqd_perd_enrt_nenrt_uom varchar2(30),
27 elig_apls_flag varchar2(30),
28 dflt_enrt_det_rl number(15),
29 trk_inelig_per_flag varchar2(30),
30 drvbl_fctr_prtn_elig_flag varchar2(30),
31 mndtry_rl number(15),
32 rqd_perd_enrt_nenrt_rl number(15),
33 dflt_enrt_cd varchar2(30),
34 prtn_elig_ovrid_alwd_flag varchar2(30),
35 drvbl_fctr_apls_rts_flag varchar2(30),
36 per_cvrd_cd varchar2(30),
37 postelcn_edit_rl number(15),
38 vrfy_fmly_mmbr_cd varchar2(30),
39 vrfy_fmly_mmbr_rl number(15),
40 enrt_cd varchar2(30),
41 enrt_rl number(15),
42 auto_enrt_flag varchar2(30),
43 auto_enrt_mthd_rl number(15),
44 short_name varchar2(30), --FHR
45 short_code varchar2(30), --FHR
46 legislation_code varchar2(30),
47 legislation_subgroup varchar2(30),
48 hidden_flag varchar2(30), --CWB Itemization
49 susp_if_ctfn_not_prvd_flag varchar2(30),
50 ctfn_determine_cd varchar2(30),
51 cop_attribute_category varchar2(30),
52 cop_attribute1 varchar2(150),
53 cop_attribute2 varchar2(150),
54 cop_attribute3 varchar2(150),
55 cop_attribute4 varchar2(150),
56 cop_attribute5 varchar2(150),
57 cop_attribute6 varchar2(150),
58 cop_attribute7 varchar2(150),
59 cop_attribute8 varchar2(150),
60 cop_attribute9 varchar2(150),
61 cop_attribute10 varchar2(150),
62 cop_attribute11 varchar2(150),
63 cop_attribute12 varchar2(150),
64 cop_attribute13 varchar2(150),
65 cop_attribute14 varchar2(150),
66 cop_attribute15 varchar2(150),
67 cop_attribute16 varchar2(150),
68 cop_attribute17 varchar2(150),
69 cop_attribute18 varchar2(150),
70 cop_attribute19 varchar2(150),
71 cop_attribute20 varchar2(150),
72 cop_attribute21 varchar2(150),
73 cop_attribute22 varchar2(150),
74 cop_attribute23 varchar2(150),
75 cop_attribute24 varchar2(150),
76 cop_attribute25 varchar2(150),
77 cop_attribute26 varchar2(150),
78 cop_attribute27 varchar2(150),
79 cop_attribute28 varchar2(150),
80 cop_attribute29 varchar2(150),
81 cop_attribute30 varchar2(150),
82 all_inelig varchar2(30),
83 object_version_number number(9)
84 );
85 --
86 -- ----------------------------------------------------------------------------
87 -- | Global Definitions - Internal Development Use Only |
88 -- ----------------------------------------------------------------------------
89 --
90 g_old_rec g_rec_type; -- Global record definition
91 g_api_dml boolean; -- Global api dml status
92 --
93 -- ----------------------------------------------------------------------------
94 -- |------------------------< return_api_dml_status >-------------------------|
95 -- ----------------------------------------------------------------------------
96 -- {Start Of Comments}
97 --
98 -- Description:
99 -- This function will return the current g_api_dml private global
100 -- boolean status.
101 -- The g_api_dml status determines if at the time of the function
102 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
103 -- is being issued from within an api.
104 -- If the status is TRUE then a dml statement is being issued from
105 -- within this entity api.
106 -- This function is primarily to support database triggers which
107 -- need to maintain the object_version_number for non-supported
108 -- dml statements (i.e. dml statement issued outside of the api layer).
109 --
110 -- Prerequisites:
111 -- None.
112 --
113 -- In Parameters:
114 -- None.
115 --
116 -- Post Success:
117 -- Processing continues.
118 -- If the function returns a TRUE value then, dml is being executed from
119 -- within this api.
120 --
121 -- Post Failure:
122 -- None.
123 --
124 -- Access Status:
125 -- Internal Row Handler Use Only.
126 --
127 -- {End Of Comments}
128 -- ----------------------------------------------------------------------------
129 Function return_api_dml_status Return Boolean;
130 --
131 -- ----------------------------------------------------------------------------
132 -- |---------------------------< constraint_error >---------------------------|
133 -- ----------------------------------------------------------------------------
134 -- {Start Of Comments}
135 --
136 -- Description:
137 -- This procedure is called when a constraint has been violated (i.e.
138 -- The exception hr_api.check_integrity_violated,
139 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
140 -- hr_api.unique_integrity_violated has been raised).
141 -- The exceptions can only be raised as follows:
142 -- 1) A check constraint can only be violated during an INSERT or UPDATE
143 -- dml operation.
144 -- 2) A parent integrity constraint can only be violated during an
145 -- INSERT or UPDATE dml operation.
146 -- 3) A child integrity constraint can only be violated during an
147 -- DELETE dml operation.
148 -- 4) A unique integrity constraint can only be violated during INSERT or
149 -- UPDATE dml operation.
150 --
151 -- Prerequisites:
152 -- 1) Either 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 with the subsequent
155 -- stripping of the constraint name from the generated error message
156 -- text.
157 -- 2) Standalone validation test which corresponds with a constraint error.
158 --
159 -- In Parameter:
160 -- p_constraint_name is in upper format and is just the constraint name
161 -- (e.g. not prefixed by brackets, schema owner etc).
162 --
163 -- Post Success:
164 -- Development dependant.
165 --
166 -- Post Failure:
167 -- Developement dependant.
168 --
169 -- Developer Implementation Notes:
170 -- For each constraint being checked the hr system package failure message
171 -- has been generated as a template only. These system error messages should
172 -- be modified as required (i.e. change the system failure message to a user
173 -- friendly defined error message).
174 --
175 -- Access Status:
176 -- Internal Development Use Only.
177 --
178 -- {End Of Comments}
179 -- ----------------------------------------------------------------------------
180 Procedure constraint_error
181 (p_constraint_name in all_constraints.constraint_name%TYPE);
182 --
183 -- ----------------------------------------------------------------------------
184 -- |-----------------------------< api_updating >-----------------------------|
185 -- ----------------------------------------------------------------------------
186 -- {Start Of Comments}
187 --
188 -- Description:
189 -- This function is used to populate the g_old_rec record with the current
190 -- row from the database for the specified primary key provided that the
191 -- primary key exists, and is valid, and does not already match the current
192 -- g_old_rec.
193 -- The function will always return a TRUE value if the g_old_rec is
194 -- populated with the current row. A FALSE value will be returned if all of
195 -- the primary key arguments are null.
196 --
197 -- Prerequisites:
198 -- None.
199 --
200 -- In Parameters:
201 --
202 -- Post Success:
203 -- A value of TRUE will be returned indiciating that the g_old_rec is
204 -- current.
205 -- A value of FALSE will be returned if all of the primary key arguments
206 -- have a null value (this indicates that the row has not be inserted into
207 -- the Schema), and therefore could never have a corresponding row.
208 --
209 -- Post Failure:
210 -- A failure can only occur under two circumstances:
211 -- 1) The primary key is invalid (i.e. a row does not exist for the
212 -- specified primary key values).
213 -- 2) If an object_version_number exists but is NOT the same as the current
214 -- g_old_rec value.
215 --
216 -- Developer Implementation Notes:
217 -- None.
218 --
219 -- Access Status:
220 -- Internal Development Use Only.
221 --
222 -- {End Of Comments}
223 -- ----------------------------------------------------------------------------
224 Function api_updating
225 (p_effective_date in date,
226 p_oipl_id in number,
227 p_object_version_number in number
228 ) Return Boolean;
229 --
230 -- ----------------------------------------------------------------------------
231 -- |--------------------------< find_dt_del_modes >---------------------------|
232 -- ----------------------------------------------------------------------------
233 -- {Start Of Comments}
234 --
235 -- Description:
236 -- This procedure is used to determine what datetrack delete modes are
237 -- allowed as of the effective date for this entity. The procedure will
238 -- return a corresponding Boolean value for each of the delete modes
239 -- available where TRUE indicates that the corresponding delete mode is
240 -- available.
241 --
242 -- Prerequisites:
243 -- None.
244 --
245 -- In Parameters:
246 -- p_effective_date
247 -- Specifies the date at which the datetrack modes will be operated on.
248 -- p_base_key_value
249 -- Specifies the primary key value for this datetrack entity.
250 -- (E.g. For this entity the assignment of the argument would be:
251 -- p_base_key_value = :oipl_id).
252 --
253 -- Post Success:
254 -- Processing continues.
255 --
256 -- Post Failure:
257 -- Failure might occur if for the specified effective date and primary key
258 -- value a row doesn't exist.
259 --
260 -- Developer Implementation Notes:
261 -- This procedure could require changes if this entity has any sepcific
262 -- delete restrictions.
263 -- For example, this entity might disallow the datetrack delete mode of
264 -- ZAP. To implement this you would have to set and return a Boolean value
265 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
266 --
267 -- Access Status:
268 -- Internal Development Use Only.
269 --
270 -- {End Of Comments}
271 -- ----------------------------------------------------------------------------
272 Procedure find_dt_del_modes
273 (p_effective_date in date,
274 p_base_key_value in number,
275 p_zap out nocopy boolean,
276 p_delete out nocopy boolean,
277 p_future_change out nocopy boolean,
278 p_delete_next_change out nocopy boolean);
279 --
280 -- ----------------------------------------------------------------------------
281 -- |--------------------------< find_dt_upd_modes >---------------------------|
282 -- ----------------------------------------------------------------------------
283 -- {Start Of Comments}
284 --
285 -- Description:
286 -- This procedure is used to determine what datetrack update modes are
287 -- allowed as of the effective date for this entity. The procedure will
288 -- return a corresponding Boolean value for each of the update modes
289 -- available where TRUE indicates that the corresponding update mode
290 -- is available.
291 --
292 -- Prerequisites:
293 -- None.
294 --
295 -- In Parameters:
296 -- p_effective_date
297 -- Specifies the date at which the datetrack modes will be operated on.
298 -- p_base_key_value
302 --
299 -- Specifies the primary key value for this datetrack entity.
300 -- (E.g. For this entity the assignment of the argument would be:
301 -- p_base_key_value = :oipl_id).
303 -- Post Success:
304 -- Processing continues.
305 --
306 -- Post Failure:
307 -- Failure might occur if for the specified effective date and primary key
308 -- value a row doesn't exist.
309 --
310 -- Developer Implementation Notes:
311 -- This procedure could require changes if this entity has any sepcific
312 -- delete restrictions.
313 -- For example, this entity might disallow the datetrack update mode of
314 -- UPDATE. To implement this you would have to set and return a Boolean
315 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
316 --
317 -- Access Status:
318 -- Internal Development Use Only.
319 --
320 -- {End Of Comments}
321 -- ----------------------------------------------------------------------------
322 Procedure find_dt_upd_modes
323 (p_effective_date in date,
324 p_base_key_value in number,
325 p_correction out nocopy boolean,
326 p_update out nocopy boolean,
327 p_update_override out nocopy boolean,
328 p_update_change_insert out nocopy boolean);
329 --
330 -- ----------------------------------------------------------------------------
331 -- |------------------------< upd_effective_end_date >------------------------|
332 -- ----------------------------------------------------------------------------
333 -- {Start Of Comments}
334 --
335 -- Description:
336 -- This procedure will update the specified datetrack row with the
337 -- specified new effective end date. The object version number is also
338 -- set to the next object version number. DateTrack modes which call
339 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
340 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
341 -- This is an internal datetrack maintenance procedure which should
342 -- not be modified in anyway.
343 --
344 -- Prerequisites:
345 -- None.
346 --
347 -- In Parameters:
348 -- p_new_effective_end_date
349 -- Specifies the new effective end date which will be set for the
350 -- row as of the effective date.
351 -- p_base_key_value
352 -- Specifies the primary key value for this datetrack entity.
353 -- (E.g. For this entity the assignment of the argument would be:
354 -- p_base_key_value = :oipl_id).
355 --
356 -- Post Success:
357 -- The specified row will be updated with the new effective end date and
358 -- object_version_number.
359 --
360 -- Post Failure:
361 -- Failure might occur if for the specified effective date and primary key
362 -- value a row doesn't exist.
363 --
364 -- Developer Implementation Notes:
365 -- This is an internal datetrack maintenance procedure which should
366 -- not be modified in anyway.
367 --
368 -- Access Status:
369 -- Internal Row Handler Use Only.
370 --
371 -- {End Of Comments}
372 -- ----------------------------------------------------------------------------
373 Procedure upd_effective_end_date
374 (p_effective_date in date,
375 p_base_key_value in number,
376 p_new_effective_end_date in date,
377 p_validation_start_date in date,
378 p_validation_end_date in date,
379 p_object_version_number out nocopy number);
380 --
381 -- ----------------------------------------------------------------------------
382 -- |---------------------------------< lck >----------------------------------|
383 -- ----------------------------------------------------------------------------
384 -- {Start Of Comments}
385 --
386 -- Description:
387 -- The Lck process for datetrack is complicated and comprises of the
388 -- following processing
389 -- The processing steps are as follows:
390 -- 1) The row to be updated or deleted must be locked.
391 -- By locking this row, the g_old_rec record data type is populated.
392 -- 2) If a comment exists the text is selected from hr_comments.
393 -- 3) The datetrack mode is then validated to ensure the operation is
394 -- valid. If the mode is valid the validation start and end dates for
395 -- the mode will be derived and returned. Any required locking is
396 -- completed when the datetrack mode is validated.
397 --
398 -- Prerequisites:
399 -- When attempting to call the lck procedure the object version number,
400 -- primary key, effective date and datetrack mode must be specified.
401 --
402 -- In Parameters:
403 -- p_effective_date
404 -- Specifies the date of the datetrack update operation.
405 -- p_datetrack_mode
406 -- Determines the datetrack update or delete mode.
407 --
408 -- Post Success:
409 -- On successful completion of the Lck process the row to be updated or
410 -- deleted will be locked and selected into the global data structure
411 -- g_old_rec.
412 --
413 -- Post Failure:
414 -- The Lck process can fail for three reasons:
415 -- 1) When attempting to lock the row the row could already be locked by
416 -- another user. This will raise the HR_Api.Object_Locked exception.
417 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
418 -- This error is trapped and reported using the message name
419 -- 'HR_7220_INVALID_PRIMARY_KEY'.
420 -- 3) The row although existing in the HR Schema has a different object
421 -- version number than the object version number specified.
422 -- This error is trapped and reported using the message name
423 -- 'HR_7155_OBJECT_INVALID'.
424 --
425 -- Developer Implementation Notes:
426 -- None.
427 --
428 -- Access Status:
429 -- Internal Development Use Only.
430 --
431 -- {End Of Comments}
432 -- ----------------------------------------------------------------------------
433 Procedure lck
434 (p_effective_date in date,
435 p_datetrack_mode in varchar2,
436 p_oipl_id in number,
437 p_object_version_number in number,
438 p_validation_start_date out nocopy date,
439 p_validation_end_date out nocopy date);
440 --
441 -- ----------------------------------------------------------------------------
442 -- |-----------------------------< convert_args >-----------------------------|
443 -- ----------------------------------------------------------------------------
444 -- {Start Of Comments}
445 --
446 -- Description:
447 -- This function is used to turn attribute parameters into the record
448 -- structure parameter g_rec_type.
449 --
450 -- Prerequisites:
451 -- This is a private function and can only be called from the ins or upd
452 -- attribute processes.
453 --
454 -- In Parameters:
455 --
456 -- Post Success:
457 -- A returning record structure will be returned.
458 --
459 -- Post Failure:
460 -- No direct error handling is required within this function. Any possible
461 -- errors within this function will be a PL/SQL value error due to conversion
462 -- of datatypes or data lengths.
463 --
464 -- Developer Implementation Notes:
465 -- None.
466 --
467 -- Access Status:
468 -- Internal Row Handler Use Only.
469 --
470 -- {End Of Comments}
471 -- ----------------------------------------------------------------------------
472 Function convert_args
473 (
474 p_oipl_id in number,
475 p_effective_start_date in date,
476 p_effective_end_date in date,
477 p_ivr_ident in varchar2,
478 p_url_ref_name in varchar2,
479 p_opt_id in number,
480 p_business_group_id in number,
481 p_pl_id in number,
482 p_ordr_num in number,
483 p_rqd_perd_enrt_nenrt_val in number,
484 p_dflt_flag in varchar2,
485 p_actl_prem_id in number,
486 p_mndtry_flag in varchar2,
487 p_oipl_stat_cd in varchar2,
488 p_pcp_dsgn_cd in varchar2,
489 p_pcp_dpnt_dsgn_cd in varchar2,
490 p_rqd_perd_enrt_nenrt_uom in varchar2,
491 p_elig_apls_flag in varchar2,
492 p_dflt_enrt_det_rl in number,
496 p_rqd_perd_enrt_nenrt_rl in number,
493 p_trk_inelig_per_flag in varchar2,
494 p_drvbl_fctr_prtn_elig_flag in varchar2,
495 p_mndtry_rl in number,
497 p_dflt_enrt_cd in varchar2,
498 p_prtn_elig_ovrid_alwd_flag in varchar2,
499 p_drvbl_fctr_apls_rts_flag in varchar2,
500 p_per_cvrd_cd in varchar2,
501 p_postelcn_edit_rl in number,
502 p_vrfy_fmly_mmbr_cd in varchar2,
503 p_vrfy_fmly_mmbr_rl in number,
504 p_enrt_cd in varchar2,
505 p_enrt_rl in number,
506 p_auto_enrt_flag in varchar2,
507 p_auto_enrt_mthd_rl in number,
508 p_short_name in varchar2, --FHR
509 p_short_code in varchar2, --FHR
510 p_legislation_code in varchar2,
511 p_legislation_subgroup in varchar2,
512 p_hidden_flag in varchar2, --CWB Itemization
513 p_susp_if_ctfn_not_prvd_flag in varchar2 default 'Y' ,
514 p_ctfn_determine_cd in varchar2 default null ,
515 p_cop_attribute_category in varchar2,
516 p_cop_attribute1 in varchar2,
517 p_cop_attribute2 in varchar2,
518 p_cop_attribute3 in varchar2,
519 p_cop_attribute4 in varchar2,
520 p_cop_attribute5 in varchar2,
521 p_cop_attribute6 in varchar2,
522 p_cop_attribute7 in varchar2,
523 p_cop_attribute8 in varchar2,
524 p_cop_attribute9 in varchar2,
525 p_cop_attribute10 in varchar2,
526 p_cop_attribute11 in varchar2,
527 p_cop_attribute12 in varchar2,
528 p_cop_attribute13 in varchar2,
529 p_cop_attribute14 in varchar2,
530 p_cop_attribute15 in varchar2,
531 p_cop_attribute16 in varchar2,
532 p_cop_attribute17 in varchar2,
533 p_cop_attribute18 in varchar2,
534 p_cop_attribute19 in varchar2,
535 p_cop_attribute20 in varchar2,
536 p_cop_attribute21 in varchar2,
537 p_cop_attribute22 in varchar2,
538 p_cop_attribute23 in varchar2,
539 p_cop_attribute24 in varchar2,
540 p_cop_attribute25 in varchar2,
541 p_cop_attribute26 in varchar2,
542 p_cop_attribute27 in varchar2,
543 p_cop_attribute28 in varchar2,
544 p_cop_attribute29 in varchar2,
545 p_cop_attribute30 in varchar2,
546 p_all_inelig in varchar2,
547 p_object_version_number in number
548 )
549 Return g_rec_type;
550 --
551 end ben_cop_shd;