DBA Data[Home] [Help]

PACKAGE: APPS.BEN_CPP_SHD

Source


1 Package ben_cpp_shd as
2 /* $Header: becpprhi.pkh 120.0 2005/05/28 01:17:02 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   plip_id                           number(15),
11   effective_start_date              date,
12   effective_end_date                date,
13   business_group_id                 number(15),
14   pgm_id                            number(15),
15   pl_id                             number(15),
16   cmbn_plip_id                      number(15),
17   dflt_flag                         varchar2(30),
18   plip_stat_cd                      varchar2(30),
19   dflt_enrt_cd                      varchar2(30),
20   dflt_enrt_det_rl                  number(15),
21   ordr_num                          number(15),
22   alws_unrstrctd_enrt_flag          varchar2(30),
23   auto_enrt_mthd_rl                 number(15),
24   enrt_cd                           varchar2(30),
25   enrt_mthd_cd                      varchar2(30),
26   enrt_rl                           number(15),
27   ivr_ident                         varchar2(90), -- UTF8 Change Bug 2254683
28   url_ref_name                      varchar2(240),
29   enrt_cvg_strt_dt_cd               varchar2(30),
30   enrt_cvg_strt_dt_rl               number(15),
31   enrt_cvg_end_dt_cd                varchar2(30),
32   enrt_cvg_end_dt_rl                number(15),
33   rt_strt_dt_cd                     varchar2(30),
34   rt_strt_dt_rl                     number(15),
35   rt_end_dt_cd                      varchar2(30),
36   rt_end_dt_rl                      number(15),
37   drvbl_fctr_apls_rts_flag          varchar2(30),
38   drvbl_fctr_prtn_elig_flag         varchar2(30),
39   elig_apls_flag                    varchar2(30),
40   prtn_elig_ovrid_alwd_flag         varchar2(30),
41   trk_inelig_per_flag               varchar2(30),
42   postelcn_edit_rl                  number(15),
43   dflt_to_asn_pndg_ctfn_cd          varchar2(30),
44   dflt_to_asn_pndg_ctfn_rl          number(15),
45   mn_cvg_amt                        number,
46   mn_cvg_rl                         number(15),
47   mx_cvg_alwd_amt                   number,
48   mx_cvg_incr_alwd_amt              number,
49   mx_cvg_incr_wcf_alwd_amt          number,
50   mx_cvg_mlt_incr_num               number(15),
51   mx_cvg_mlt_incr_wcf_num	    number(15),
52   mx_cvg_rl            		    number(15),
53   mx_cvg_wcfn_amt                   number,
54   mx_cvg_wcfn_mlt_num               number(15),
55   no_mn_cvg_amt_apls_flag           varchar2(30),
56   no_mn_cvg_incr_apls_flag          varchar2(30),
57   no_mx_cvg_amt_apls_flag           varchar2(30),
58   no_mx_cvg_incr_apls_flag          varchar2(30),
59   unsspnd_enrt_cd                   varchar2(30),
60   prort_prtl_yr_cvg_rstrn_cd        varchar2(30),
61   prort_prtl_yr_cvg_rstrn_rl        number(15),
62   cvg_incr_r_decr_only_cd           varchar2(30),
63   bnft_or_option_rstrctn_cd         varchar2(30),
64   per_cvrd_cd                       varchar2(30),
65   short_name                       varchar2(30),
66   short_code                       varchar2(30),
67   legislation_code                       varchar2(30),
68   legislation_subgroup                       varchar2(30),
69   vrfy_fmly_mmbr_rl                 number(15),
70   vrfy_fmly_mmbr_cd                 varchar2(30),
71   use_csd_rsd_prccng_cd             varchar2(30),
72   cpp_attribute_category            varchar2(30),
73   cpp_attribute1                    varchar2(150),
74   cpp_attribute2                    varchar2(150),
75   cpp_attribute3                    varchar2(150),
76   cpp_attribute4                    varchar2(150),
77   cpp_attribute5                    varchar2(150),
78   cpp_attribute6                    varchar2(150),
79   cpp_attribute7                    varchar2(150),
80   cpp_attribute8                    varchar2(150),
81   cpp_attribute9                    varchar2(150),
82   cpp_attribute10                   varchar2(150),
83   cpp_attribute11                   varchar2(150),
84   cpp_attribute12                   varchar2(150),
85   cpp_attribute13                   varchar2(150),
86   cpp_attribute14                   varchar2(150),
87   cpp_attribute15                   varchar2(150),
88   cpp_attribute16                   varchar2(150),
89   cpp_attribute17                   varchar2(150),
90   cpp_attribute18                   varchar2(150),
91   cpp_attribute19                   varchar2(150),
92   cpp_attribute20                   varchar2(150),
93   cpp_attribute21                   varchar2(150),
94   cpp_attribute22                   varchar2(150),
95   cpp_attribute23                   varchar2(150),
96   cpp_attribute24                   varchar2(150),
97   cpp_attribute25                   varchar2(150),
98   cpp_attribute26                   varchar2(150),
99   cpp_attribute27                   varchar2(150),
100   cpp_attribute28                   varchar2(150),
101   cpp_attribute29                   varchar2(150),
102   cpp_attribute30                   varchar2(150),
103   object_version_number             number(9)
104   );
105 --
106 -- ----------------------------------------------------------------------------
107 -- |           Global Definitions - Internal Development Use Only             |
108 -- ----------------------------------------------------------------------------
109 --
110 g_old_rec  g_rec_type;                            -- Global record definition
111 g_api_dml  boolean;                               -- Global api dml status
112 --
113 -- ----------------------------------------------------------------------------
114 -- |------------------------< return_api_dml_status >-------------------------|
115 -- ----------------------------------------------------------------------------
116 -- {Start Of Comments}
117 --
118 -- Description:
119 --   This function will return the current g_api_dml private global
120 --   boolean status.
121 --   The g_api_dml status determines if at the time of the function
122 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
123 --   is being issued from within an api.
124 --   If the status is TRUE then a dml statement is being issued from
125 --   within this entity api.
126 --   This function is primarily to support database triggers which
127 --   need to maintain the object_version_number for non-supported
128 --   dml statements (i.e. dml statement issued outside of the api layer).
129 --
130 -- Prerequisites:
131 --   None.
132 --
133 -- In Parameters:
134 --   None.
135 --
136 -- Post Success:
137 --   Processing continues.
138 --   If the function returns a TRUE value then, dml is being executed from
139 --   within this api.
140 --
141 -- Post Failure:
142 --   None.
143 --
144 -- Access Status:
145 --   Internal Row Handler Use Only.
146 --
147 -- {End Of Comments}
148 -- ----------------------------------------------------------------------------
149 Function return_api_dml_status Return Boolean;
150 --
151 -- ----------------------------------------------------------------------------
152 -- |---------------------------< constraint_error >---------------------------|
153 -- ----------------------------------------------------------------------------
154 -- {Start Of Comments}
155 --
156 -- Description:
157 --   This procedure is called when a constraint has been violated (i.e.
158 --   The exception hr_api.check_integrity_violated,
159 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
160 --   hr_api.unique_integrity_violated has been raised).
161 --   The exceptions can only be raised as follows:
162 --   1) A check constraint can only be violated during an INSERT or UPDATE
163 --      dml operation.
164 --   2) A parent integrity constraint can only be violated during an
165 --      INSERT or UPDATE dml operation.
166 --   3) A child integrity constraint can only be violated during an
167 --      DELETE dml operation.
168 --   4) A unique integrity constraint can only be violated during INSERT or
169 --      UPDATE dml operation.
170 --
171 -- Prerequisites:
172 --   1) Either hr_api.check_integrity_violated,
173 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
174 --      hr_api.unique_integrity_violated has been raised with the subsequent
175 --      stripping of the constraint name from the generated error message
176 --      text.
177 --   2) Standalone validation test which corresponds with a constraint error.
178 --
179 -- In Parameter:
180 --   p_constraint_name is in upper format and is just the constraint name
181 --   (e.g. not prefixed by brackets, schema owner etc).
182 --
183 -- Post Success:
184 --   Development dependant.
185 --
186 -- Post Failure:
187 --   Developement dependant.
188 --
189 -- Developer Implementation Notes:
190 --   For each constraint being checked the hr system package failure message
191 --   has been generated as a template only. These system error messages should
192 --   be modified as required (i.e. change the system failure message to a user
193 --   friendly defined error message).
194 --
195 -- Access Status:
196 --   Internal Development Use Only.
197 --
198 -- {End Of Comments}
199 -- ----------------------------------------------------------------------------
200 Procedure constraint_error
201             (p_constraint_name in all_constraints.constraint_name%TYPE);
202 --
203 -- ----------------------------------------------------------------------------
204 -- |-----------------------------< api_updating >-----------------------------|
205 -- ----------------------------------------------------------------------------
206 -- {Start Of Comments}
207 --
208 -- Description:
209 --   This function is used to populate the g_old_rec record with the current
210 --   row from the database for the specified primary key provided that the
211 --   primary key exists, and is valid, and does not already match the current
212 --   g_old_rec.
213 --   The function will always return a TRUE value if the g_old_rec is
214 --   populated with the current row. A FALSE value will be returned if all of
215 --   the primary key arguments are null.
216 --
217 -- Prerequisites:
218 --   None.
219 --
220 -- In Parameters:
221 --
222 -- Post Success:
223 --   A value of TRUE will be returned indiciating that the g_old_rec is
224 --   current.
225 --   A value of FALSE will be returned if all of the primary key arguments
226 --   have a null value (this indicates that the row has not be inserted into
227 --   the Schema), and therefore could never have a corresponding row.
228 --
229 -- Post Failure:
230 --   A failure can only occur under two circumstances:
231 --   1) The primary key is invalid (i.e. a row does not exist for the
232 --      specified primary key values).
233 --   2) If an object_version_number exists but is NOT the same as the current
234 --      g_old_rec value.
235 --
236 -- Developer Implementation Notes:
237 --   None.
238 --
239 -- Access Status:
240 --   Internal Development Use Only.
241 --
242 -- {End Of Comments}
243 -- ----------------------------------------------------------------------------
244 Function api_updating
245   (p_effective_date		in date,
246    p_plip_id		in number,
247    p_object_version_number	in number
248   ) Return Boolean;
249 --
250 -- ----------------------------------------------------------------------------
251 -- |--------------------------< find_dt_del_modes >---------------------------|
252 -- ----------------------------------------------------------------------------
253 -- {Start Of Comments}
254 --
255 -- Description:
256 --   This procedure is used to determine what datetrack delete modes are
257 --   allowed as of the effective date for this entity. The procedure will
258 --   return a corresponding Boolean value for each of the delete modes
259 --   available where TRUE indicates that the corresponding delete mode is
260 --   available.
261 --
262 -- Prerequisites:
263 --   None.
264 --
265 -- In Parameters:
266 --   p_effective_date
267 --     Specifies the date at which the datetrack modes will be operated on.
268 --   p_base_key_value
269 --     Specifies the primary key value for this datetrack entity.
270 --     (E.g. For this entity the assignment of the argument would be:
271 --           p_base_key_value = :plip_id).
272 --
273 -- Post Success:
274 --   Processing continues.
275 --
276 -- Post Failure:
277 --   Failure might occur if for the specified effective date and primary key
278 --   value a row doesn't exist.
279 --
280 -- Developer Implementation Notes:
281 --   This procedure could require changes if this entity has any sepcific
282 --   delete restrictions.
283 --   For example, this entity might disallow the datetrack delete mode of
284 --   ZAP. To implement this you would have to set and return a Boolean value
285 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
286 --
287 -- Access Status:
288 --   Internal Development Use Only.
289 --
290 -- {End Of Comments}
291 -- ----------------------------------------------------------------------------
292 Procedure find_dt_del_modes
293 	(p_effective_date	in  date,
294 	 p_base_key_value	in  number,
295 	 p_zap		 out nocopy boolean,
296 	 p_delete	 out nocopy boolean,
297 	 p_future_change out nocopy boolean,
298 	 p_delete_next_change out nocopy boolean);
299 --
300 -- ----------------------------------------------------------------------------
301 -- |--------------------------< find_dt_upd_modes >---------------------------|
302 -- ----------------------------------------------------------------------------
303 -- {Start Of Comments}
304 --
305 -- Description:
306 --   This procedure is used to determine what datetrack update modes are
307 --   allowed as of the effective date for this entity. The procedure will
308 --   return a corresponding Boolean value for each of the update modes
309 --   available where TRUE indicates that the corresponding update mode
310 --   is available.
311 --
312 -- Prerequisites:
313 --   None.
314 --
315 -- In Parameters:
316 --   p_effective_date
317 --     Specifies the date at which the datetrack modes will be operated on.
318 --   p_base_key_value
319 --     Specifies the primary key value for this datetrack entity.
320 --     (E.g. For this entity the assignment of the argument would be:
321 --           p_base_key_value = :plip_id).
322 --
323 -- Post Success:
324 --   Processing continues.
325 --
326 -- Post Failure:
327 --   Failure might occur if for the specified effective date and primary key
328 --   value a row doesn't exist.
329 --
330 -- Developer Implementation Notes:
331 --   This procedure could require changes if this entity has any sepcific
332 --   delete restrictions.
333 --   For example, this entity might disallow the datetrack update mode of
334 --   UPDATE. To implement this you would have to set and return a Boolean
335 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
336 --
337 -- Access Status:
338 --   Internal Development Use Only.
339 --
340 -- {End Of Comments}
341 -- ----------------------------------------------------------------------------
342 Procedure find_dt_upd_modes
343 	(p_effective_date	in  date,
344 	 p_base_key_value	in  number,
345 	 p_correction	 out nocopy boolean,
346 	 p_update	 out nocopy boolean,
347 	 p_update_override out nocopy boolean,
348 	 p_update_change_insert out nocopy boolean);
349 --
350 -- ----------------------------------------------------------------------------
351 -- |------------------------< upd_effective_end_date >------------------------|
352 -- ----------------------------------------------------------------------------
353 -- {Start Of Comments}
354 --
355 -- Description:
356 --   This procedure will update the specified datetrack row with the
357 --   specified new effective end date. The object version number is also
358 --   set to the next object version number. DateTrack modes which call
359 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
360 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
364 -- Prerequisites:
361 --   This is an internal datetrack maintenance procedure which should
362 --   not be modified in anyway.
363 --
365 --   None.
366 --
367 -- In Parameters:
368 --   p_new_effective_end_date
369 --     Specifies the new effective end date which will be set for the
370 --     row as of the effective date.
371 --   p_base_key_value
372 --     Specifies the primary key value for this datetrack entity.
373 --     (E.g. For this entity the assignment of the argument would be:
374 --           p_base_key_value = :plip_id).
375 --
376 -- Post Success:
377 --   The specified row will be updated with the new effective end date and
378 --   object_version_number.
379 --
380 -- Post Failure:
381 --   Failure might occur if for the specified effective date and primary key
382 --   value a row doesn't exist.
383 --
384 -- Developer Implementation Notes:
385 --   This is an internal datetrack maintenance procedure which should
386 --   not be modified in anyway.
387 --
388 -- Access Status:
389 --   Internal Row Handler Use Only.
390 --
391 -- {End Of Comments}
392 -- ----------------------------------------------------------------------------
393 Procedure upd_effective_end_date
394 	(p_effective_date		in date,
395 	 p_base_key_value		in number,
396 	 p_new_effective_end_date	in date,
397 	 p_validation_start_date	in date,
398 	 p_validation_end_date		in date,
399          p_object_version_number       out nocopy number);
400 --
401 -- ----------------------------------------------------------------------------
402 -- |---------------------------------< lck >----------------------------------|
403 -- ----------------------------------------------------------------------------
404 -- {Start Of Comments}
405 --
406 -- Description:
407 --   The Lck process for datetrack is complicated and comprises of the
408 --   following processing
409 --   The processing steps are as follows:
410 --   1) The row to be updated or deleted must be locked.
411 --      By locking this row, the g_old_rec record data type is populated.
412 --   2) If a comment exists the text is selected from hr_comments.
413 --   3) The datetrack mode is then validated to ensure the operation is
414 --      valid. If the mode is valid the validation start and end dates for
415 --      the mode will be derived and returned. Any required locking is
416 --      completed when the datetrack mode is validated.
417 --
418 -- Prerequisites:
419 --   When attempting to call the lck procedure the object version number,
420 --   primary key, effective date and datetrack mode must be specified.
421 --
422 -- In Parameters:
423 --   p_effective_date
424 --     Specifies the date of the datetrack update operation.
425 --   p_datetrack_mode
426 --     Determines the datetrack update or delete mode.
427 --
428 -- Post Success:
429 --   On successful completion of the Lck process the row to be updated or
430 --   deleted will be locked and selected into the global data structure
431 --   g_old_rec.
432 --
433 -- Post Failure:
434 --   The Lck process can fail for three reasons:
435 --   1) When attempting to lock the row the row could already be locked by
436 --      another user. This will raise the HR_Api.Object_Locked exception.
437 --   2) The row which is required to be locked doesn't exist in the HR Schema.
438 --      This error is trapped and reported using the message name
439 --      'HR_7220_INVALID_PRIMARY_KEY'.
440 --   3) The row although existing in the HR Schema has a different object
441 --      version number than the object version number specified.
442 --      This error is trapped and reported using the message name
443 --      'HR_7155_OBJECT_INVALID'.
444 --
445 -- Developer Implementation Notes:
446 --   None.
447 --
448 -- Access Status:
449 --   Internal Development Use Only.
450 --
451 -- {End Of Comments}
452 -- ----------------------------------------------------------------------------
453 Procedure lck
454 	(p_effective_date	 in  date,
455 	 p_datetrack_mode	 in  varchar2,
456 	 p_plip_id	 in  number,
457 	 p_object_version_number in  number,
458 	 p_validation_start_date out nocopy date,
459 	 p_validation_end_date	 out nocopy date);
460 --
461 -- ----------------------------------------------------------------------------
462 -- |-----------------------------< convert_args >-----------------------------|
463 -- ----------------------------------------------------------------------------
464 -- {Start Of Comments}
465 --
466 -- Description:
467 --   This function is used to turn attribute parameters into the record
468 --   structure parameter g_rec_type.
469 --
470 -- Prerequisites:
471 --   This is a private function and can only be called from the ins or upd
472 --   attribute processes.
473 --
474 -- In Parameters:
475 --
476 -- Post Success:
477 --   A returning record structure will be returned.
478 --
479 -- Post Failure:
480 --   No direct error handling is required within this function. Any possible
481 --   errors within this function will be a PL/SQL value error due to conversion
482 --   of datatypes or data lengths.
483 --
484 -- Developer Implementation Notes:
485 --   None.
486 --
487 -- Access Status:
488 --   Internal Row Handler Use Only.
489 --
490 -- {End Of Comments}
491 -- ----------------------------------------------------------------------------
495 	p_effective_start_date          in date,
492 Function convert_args
493 	(
494 	p_plip_id                       in number,
496 	p_effective_end_date            in date,
497 	p_business_group_id             in number,
498 	p_pgm_id                        in number,
499 	p_pl_id                         in number,
500 	p_cmbn_plip_id                  in number,
501 	p_dflt_flag                     in varchar2,
502 	p_plip_stat_cd                  in varchar2,
503 	p_dflt_enrt_cd                  in varchar2,
504 	p_dflt_enrt_det_rl              in number,
505 	p_ordr_num                      in number,
506         p_alws_unrstrctd_enrt_flag      in varchar2,
507         p_auto_enrt_mthd_rl             in number,
508         p_enrt_cd                       in varchar2,
509         p_enrt_mthd_cd                  in varchar2,
510         p_enrt_rl                       in number,
511 	p_ivr_ident                     in varchar2,
512         p_url_ref_name                  in varchar2,
513         p_enrt_cvg_strt_dt_cd           in varchar2,
514         p_enrt_cvg_strt_dt_rl           in number,
515         p_enrt_cvg_end_dt_cd            in varchar2,
516         p_enrt_cvg_end_dt_rl            in number,
517         p_rt_strt_dt_cd                 in varchar2,
518         p_rt_strt_dt_rl                 in number,
519         p_rt_end_dt_cd                  in varchar2,
520         p_rt_end_dt_rl                  in number,
521         p_drvbl_fctr_apls_rts_flag      in varchar2,
522         p_drvbl_fctr_prtn_elig_flag     in varchar2,
523         p_elig_apls_flag                in varchar2,
524         p_prtn_elig_ovrid_alwd_flag     in varchar2,
525         p_trk_inelig_per_flag           in varchar2,
526         p_postelcn_edit_rl              in number,
527   	p_dflt_to_asn_pndg_ctfn_cd      in varchar2,
528   	p_dflt_to_asn_pndg_ctfn_rl      in number,
529   	p_mn_cvg_amt                    in number,
530   	p_mn_cvg_rl                     in number,
531   	p_mx_cvg_alwd_amt               in number,
532   	p_mx_cvg_incr_alwd_amt          in number,
533   	p_mx_cvg_incr_wcf_alwd_amt      in number,
534   	p_mx_cvg_mlt_incr_num           in number,
535   	p_mx_cvg_mlt_incr_wcf_num       in number,
536   	p_mx_cvg_rl            		in number,
537   	p_mx_cvg_wcfn_amt               in number,
538   	p_mx_cvg_wcfn_mlt_num           in number,
539   	p_no_mn_cvg_amt_apls_flag       in varchar2,
540   	p_no_mn_cvg_incr_apls_flag      in varchar2,
541   	p_no_mx_cvg_amt_apls_flag       in varchar2,
542   	p_no_mx_cvg_incr_apls_flag      in varchar2,
543   	p_unsspnd_enrt_cd               in varchar2,
544   	p_prort_prtl_yr_cvg_rstrn_cd    in varchar2,
545   	p_prort_prtl_yr_cvg_rstrn_rl    in number,
546         p_cvg_incr_r_decr_only_cd       in varchar2,
547         p_bnft_or_option_rstrctn_cd     in varchar2,
548         p_per_cvrd_cd                   in  varchar2,
549         p_short_name                   in  varchar2,
550         p_short_code                   in  varchar2,
551                 p_legislation_code                   in  varchar2,
552                 p_legislation_subgroup                   in  varchar2,
553         P_vrfy_fmly_mmbr_rl             in  number,
554         P_vrfy_fmly_mmbr_cd             in  varchar2,
555         P_use_csd_rsd_prccng_cd         in  varchar2,
556 	p_cpp_attribute_category        in varchar2,
557 	p_cpp_attribute1                in varchar2,
558 	p_cpp_attribute2                in varchar2,
559 	p_cpp_attribute3                in varchar2,
560 	p_cpp_attribute4                in varchar2,
561 	p_cpp_attribute5                in varchar2,
562 	p_cpp_attribute6                in varchar2,
563 	p_cpp_attribute7                in varchar2,
564 	p_cpp_attribute8                in varchar2,
565 	p_cpp_attribute9                in varchar2,
566 	p_cpp_attribute10               in varchar2,
567 	p_cpp_attribute11               in varchar2,
568 	p_cpp_attribute12               in varchar2,
569 	p_cpp_attribute13               in varchar2,
570 	p_cpp_attribute14               in varchar2,
571 	p_cpp_attribute15               in varchar2,
572 	p_cpp_attribute16               in varchar2,
573 	p_cpp_attribute17               in varchar2,
574 	p_cpp_attribute18               in varchar2,
575 	p_cpp_attribute19               in varchar2,
576 	p_cpp_attribute20               in varchar2,
577 	p_cpp_attribute21               in varchar2,
578 	p_cpp_attribute22               in varchar2,
579 	p_cpp_attribute23               in varchar2,
580 	p_cpp_attribute24               in varchar2,
581 	p_cpp_attribute25               in varchar2,
582 	p_cpp_attribute26               in varchar2,
583 	p_cpp_attribute27               in varchar2,
584 	p_cpp_attribute28               in varchar2,
585 	p_cpp_attribute29               in varchar2,
586 	p_cpp_attribute30               in varchar2,
587 	p_object_version_number         in number
588 	)
589 	Return g_rec_type;
590 --
591 end ben_cpp_shd;