DBA Data[Home] [Help]

PACKAGE: APPS.BEN_LBR_SHD

Source


1 Package ben_lbr_shd AUTHID CURRENT_USER as
2 /* $Header: belbrrhi.pkh 120.0 2005/05/28 03:17:01 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   ler_bnft_rstrn_id                 number(15),
11   effective_start_date              date,
12   effective_end_date                date,
13   no_mx_cvg_amt_apls_flag           varchar2(30),
14   no_mn_cvg_incr_apls_flag          varchar2(30),
15   no_mx_cvg_incr_apls_flag          varchar2(30),
16   mx_cvg_incr_wcf_alwd_amt          number,
17   mx_cvg_incr_alwd_amt              number,
18   mx_cvg_alwd_amt                   number,
19   mx_cvg_mlt_incr_num               number(15),
20   mx_cvg_mlt_incr_wcf_num           number(15),
21   mx_cvg_rl                         number(15),
22   mx_cvg_wcfn_amt                   number,
23   mx_cvg_wcfn_mlt_num               number(15),
24   mn_cvg_amt                        number,
25   mn_cvg_rl                         number(15),
26   cvg_incr_r_decr_only_cd           varchar2(30),
27   unsspnd_enrt_cd                   varchar2(30),
28   dflt_to_asn_pndg_ctfn_cd          varchar2(30),
29   dflt_to_asn_pndg_ctfn_rl          number(15),
30   ler_id                            number(15),
31   pl_id                             number(15),
32   business_group_id                 number(15),
33   plip_id    	 		    number(15),
34   lbr_attribute_category            varchar2(30),
35   lbr_attribute1                    varchar2(150),
36   lbr_attribute2                    varchar2(150),
37   lbr_attribute3                    varchar2(150),
38   lbr_attribute4                    varchar2(150),
39   lbr_attribute5                    varchar2(150),
40   lbr_attribute6                    varchar2(150),
41   lbr_attribute7                    varchar2(150),
42   lbr_attribute8                    varchar2(150),
43   lbr_attribute9                    varchar2(150),
44   lbr_attribute10                   varchar2(150),
45   lbr_attribute11                   varchar2(150),
46   lbr_attribute12                   varchar2(150),
47   lbr_attribute13                   varchar2(150),
48   lbr_attribute14                   varchar2(150),
49   lbr_attribute15                   varchar2(150),
50   lbr_attribute16                   varchar2(150),
51   lbr_attribute17                   varchar2(150),
52   lbr_attribute18                   varchar2(150),
53   lbr_attribute19                   varchar2(150),
54   lbr_attribute20                   varchar2(150),
55   lbr_attribute21                   varchar2(150),
56   lbr_attribute22                   varchar2(150),
57   lbr_attribute23                   varchar2(150),
58   lbr_attribute24                   varchar2(150),
59   lbr_attribute25                   varchar2(150),
60   lbr_attribute26                   varchar2(150),
61   lbr_attribute27                   varchar2(150),
62   lbr_attribute28                   varchar2(150),
63   lbr_attribute29                   varchar2(150),
64   lbr_attribute30                   varchar2(150),
65   susp_if_ctfn_not_prvd_flag        varchar2(30),
66   ctfn_determine_cd                 varchar2(30),
67   object_version_number             number(9)
68   );
69 --
70 -- ----------------------------------------------------------------------------
71 -- |           Global Definitions - Internal Development Use Only             |
72 -- ----------------------------------------------------------------------------
73 --
74 g_old_rec  g_rec_type;                            -- Global record definition
75 g_api_dml  boolean;                               -- Global api dml status
76 --
77 -- ----------------------------------------------------------------------------
78 -- |------------------------< return_api_dml_status >-------------------------|
79 -- ----------------------------------------------------------------------------
80 -- {Start Of Comments}
81 --
82 -- Description:
83 --   This function will return the current g_api_dml private global
84 --   boolean status.
85 --   The g_api_dml status determines if at the time of the function
86 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
87 --   is being issued from within an api.
88 --   If the status is TRUE then a dml statement is being issued from
89 --   within this entity api.
90 --   This function is primarily to support database triggers which
91 --   need to maintain the object_version_number for non-supported
92 --   dml statements (i.e. dml statement issued outside of the api layer).
93 --
94 -- Prerequisites:
95 --   None.
96 --
97 -- In Parameters:
98 --   None.
99 --
100 -- Post Success:
101 --   Processing continues.
102 --   If the function returns a TRUE value then, dml is being executed from
103 --   within this api.
104 --
105 -- Post Failure:
106 --   None.
107 --
108 -- Access Status:
109 --   Internal Row Handler Use Only.
110 --
111 -- {End Of Comments}
112 -- ----------------------------------------------------------------------------
113 Function return_api_dml_status Return Boolean;
114 --
115 -- ----------------------------------------------------------------------------
116 -- |---------------------------< constraint_error >---------------------------|
117 -- ----------------------------------------------------------------------------
118 -- {Start Of Comments}
119 --
120 -- Description:
121 --   This procedure is called when a constraint has been violated (i.e.
122 --   The exception hr_api.check_integrity_violated,
123 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
124 --   hr_api.unique_integrity_violated has been raised).
125 --   The exceptions can only be raised as follows:
126 --   1) A check constraint can only be violated during an INSERT or UPDATE
127 --      dml operation.
128 --   2) A parent integrity constraint can only be violated during an
129 --      INSERT or UPDATE dml operation.
130 --   3) A child integrity constraint can only be violated during an
131 --      DELETE dml operation.
132 --   4) A unique integrity constraint can only be violated during INSERT or
133 --      UPDATE dml operation.
134 --
135 -- Prerequisites:
136 --   1) Either hr_api.check_integrity_violated,
137 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
138 --      hr_api.unique_integrity_violated has been raised with the subsequent
139 --      stripping of the constraint name from the generated error message
140 --      text.
141 --   2) Standalone validation test which corresponds with a constraint error.
142 --
143 -- In Parameter:
144 --   p_constraint_name is in upper format and is just the constraint name
145 --   (e.g. not prefixed by brackets, schema owner etc).
146 --
147 -- Post Success:
148 --   Development dependant.
149 --
150 -- Post Failure:
151 --   Developement dependant.
152 --
153 -- Developer Implementation Notes:
154 --   For each constraint being checked the hr system package failure message
155 --   has been generated as a template only. These system error messages should
156 --   be modified as required (i.e. change the system failure message to a user
157 --   friendly defined error message).
158 --
159 -- Access Status:
160 --   Internal Development Use Only.
161 --
162 -- {End Of Comments}
163 -- ----------------------------------------------------------------------------
164 Procedure constraint_error
165             (p_constraint_name in all_constraints.constraint_name%TYPE);
166 --
167 -- ----------------------------------------------------------------------------
168 -- |-----------------------------< api_updating >-----------------------------|
169 -- ----------------------------------------------------------------------------
170 -- {Start Of Comments}
171 --
172 -- Description:
173 --   This function is used to populate the g_old_rec record with the current
174 --   row from the database for the specified primary key provided that the
175 --   primary key exists, and is valid, and does not already match the current
176 --   g_old_rec.
177 --   The function will always return a TRUE value if the g_old_rec is
178 --   populated with the current row. A FALSE value will be returned if all of
179 --   the primary key arguments are null.
180 --
181 -- Prerequisites:
182 --   None.
183 --
184 -- In Parameters:
185 --
186 -- Post Success:
187 --   A value of TRUE will be returned indiciating that the g_old_rec is
188 --   current.
189 --   A value of FALSE will be returned if all of the primary key arguments
190 --   have a null value (this indicates that the row has not be inserted into
191 --   the Schema), and therefore could never have a corresponding row.
192 --
193 -- Post Failure:
194 --   A failure can only occur under two circumstances:
195 --   1) The primary key is invalid (i.e. a row does not exist for the
196 --      specified primary key values).
197 --   2) If an object_version_number exists but is NOT the same as the current
198 --      g_old_rec value.
199 --
200 -- Developer Implementation Notes:
201 --   None.
202 --
203 -- Access Status:
204 --   Internal Development Use Only.
205 --
206 -- {End Of Comments}
207 -- ----------------------------------------------------------------------------
208 Function api_updating
209   (p_effective_date		in date,
210    p_ler_bnft_rstrn_id		in number,
211    p_object_version_number	in number
212   ) Return Boolean;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |--------------------------< find_dt_del_modes >---------------------------|
216 -- ----------------------------------------------------------------------------
217 -- {Start Of Comments}
218 --
219 -- Description:
220 --   This procedure is used to determine what datetrack delete modes are
221 --   allowed as of the effective date for this entity. The procedure will
222 --   return a corresponding Boolean value for each of the delete modes
223 --   available where TRUE indicates that the corresponding delete mode is
224 --   available.
225 --
226 -- Prerequisites:
227 --   None.
228 --
229 -- In Parameters:
230 --   p_effective_date
231 --     Specifies the date at which the datetrack modes will be operated on.
232 --   p_base_key_value
233 --     Specifies the primary key value for this datetrack entity.
234 --     (E.g. For this entity the assignment of the argument would be:
235 --           p_base_key_value = :ler_bnft_rstrn_id).
236 --
237 -- Post Success:
238 --   Processing continues.
239 --
240 -- Post Failure:
241 --   Failure might occur if for the specified effective date and primary key
242 --   value a row doesn't exist.
243 --
244 -- Developer Implementation Notes:
245 --   This procedure could require changes if this entity has any sepcific
246 --   delete restrictions.
247 --   For example, this entity might disallow the datetrack delete mode of
248 --   ZAP. To implement this you would have to set and return a Boolean value
249 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
250 --
251 -- Access Status:
252 --   Internal Development Use Only.
253 --
254 -- {End Of Comments}
255 -- ----------------------------------------------------------------------------
256 Procedure find_dt_del_modes
257 	(p_effective_date	in  date,
258 	 p_base_key_value	in  number,
259 	 p_zap		 out nocopy boolean,
260 	 p_delete	 out nocopy boolean,
261 	 p_future_change out nocopy boolean,
262 	 p_delete_next_change out nocopy boolean);
263 --
264 -- ----------------------------------------------------------------------------
265 -- |--------------------------< find_dt_upd_modes >---------------------------|
266 -- ----------------------------------------------------------------------------
267 -- {Start Of Comments}
268 --
269 -- Description:
270 --   This procedure is used to determine what datetrack update modes are
271 --   allowed as of the effective date for this entity. The procedure will
272 --   return a corresponding Boolean value for each of the update modes
273 --   available where TRUE indicates that the corresponding update mode
274 --   is available.
275 --
276 -- Prerequisites:
277 --   None.
278 --
279 -- In Parameters:
280 --   p_effective_date
281 --     Specifies the date at which the datetrack modes will be operated on.
282 --   p_base_key_value
283 --     Specifies the primary key value for this datetrack entity.
284 --     (E.g. For this entity the assignment of the argument would be:
285 --           p_base_key_value = :ler_bnft_rstrn_id).
286 --
287 -- Post Success:
288 --   Processing continues.
289 --
290 -- Post Failure:
291 --   Failure might occur if for the specified effective date and primary key
292 --   value a row doesn't exist.
293 --
294 -- Developer Implementation Notes:
295 --   This procedure could require changes if this entity has any sepcific
296 --   delete restrictions.
297 --   For example, this entity might disallow the datetrack update mode of
298 --   UPDATE. To implement this you would have to set and return a Boolean
299 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
300 --
301 -- Access Status:
302 --   Internal Development Use Only.
303 --
304 -- {End Of Comments}
305 -- ----------------------------------------------------------------------------
306 Procedure find_dt_upd_modes
307 	(p_effective_date	in  date,
308 	 p_base_key_value	in  number,
309 	 p_correction	 out nocopy boolean,
310 	 p_update	 out nocopy boolean,
311 	 p_update_override out nocopy boolean,
312 	 p_update_change_insert out nocopy boolean);
313 --
314 -- ----------------------------------------------------------------------------
315 -- |------------------------< upd_effective_end_date >------------------------|
316 -- ----------------------------------------------------------------------------
317 -- {Start Of Comments}
318 --
319 -- Description:
320 --   This procedure will update the specified datetrack row with the
321 --   specified new effective end date. The object version number is also
322 --   set to the next object version number. DateTrack modes which call
323 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
324 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
325 --   This is an internal datetrack maintenance procedure which should
326 --   not be modified in anyway.
327 --
328 -- Prerequisites:
329 --   None.
330 --
331 -- In Parameters:
332 --   p_new_effective_end_date
333 --     Specifies the new effective end date which will be set for the
334 --     row as of the effective date.
335 --   p_base_key_value
336 --     Specifies the primary key value for this datetrack entity.
337 --     (E.g. For this entity the assignment of the argument would be:
338 --           p_base_key_value = :ler_bnft_rstrn_id).
339 --
340 -- Post Success:
341 --   The specified row will be updated with the new effective end date and
342 --   object_version_number.
343 --
344 -- Post Failure:
345 --   Failure might occur if for the specified effective date and primary key
346 --   value a row doesn't exist.
347 --
348 -- Developer Implementation Notes:
349 --   This is an internal datetrack maintenance procedure which should
350 --   not be modified in anyway.
351 --
352 -- Access Status:
353 --   Internal Row Handler Use Only.
354 --
355 -- {End Of Comments}
356 -- ----------------------------------------------------------------------------
357 Procedure upd_effective_end_date
358 	(p_effective_date		in date,
359 	 p_base_key_value		in number,
360 	 p_new_effective_end_date	in date,
361 	 p_validation_start_date	in date,
362 	 p_validation_end_date		in date,
363          p_object_version_number       out nocopy number);
364 --
365 -- ----------------------------------------------------------------------------
366 -- |---------------------------------< lck >----------------------------------|
367 -- ----------------------------------------------------------------------------
368 -- {Start Of Comments}
372 --   following processing
369 --
370 -- Description:
371 --   The Lck process for datetrack is complicated and comprises of the
373 --   The processing steps are as follows:
374 --   1) The row to be updated or deleted must be locked.
375 --      By locking this row, the g_old_rec record data type is populated.
376 --   2) If a comment exists the text is selected from hr_comments.
377 --   3) The datetrack mode is then validated to ensure the operation is
378 --      valid. If the mode is valid the validation start and end dates for
379 --      the mode will be derived and returned. Any required locking is
380 --      completed when the datetrack mode is validated.
381 --
382 -- Prerequisites:
383 --   When attempting to call the lck procedure the object version number,
384 --   primary key, effective date and datetrack mode must be specified.
385 --
386 -- In Parameters:
387 --   p_effective_date
388 --     Specifies the date of the datetrack update operation.
389 --   p_datetrack_mode
390 --     Determines the datetrack update or delete mode.
391 --
392 -- Post Success:
393 --   On successful completion of the Lck process the row to be updated or
394 --   deleted will be locked and selected into the global data structure
395 --   g_old_rec.
396 --
397 -- Post Failure:
398 --   The Lck process can fail for three reasons:
399 --   1) When attempting to lock the row the row could already be locked by
400 --      another user. This will raise the HR_Api.Object_Locked exception.
401 --   2) The row which is required to be locked doesn't exist in the HR Schema.
402 --      This error is trapped and reported using the message name
403 --      'HR_7220_INVALID_PRIMARY_KEY'.
404 --   3) The row although existing in the HR Schema has a different object
405 --      version number than the object version number specified.
406 --      This error is trapped and reported using the message name
407 --      'HR_7155_OBJECT_INVALID'.
408 --
409 -- Developer Implementation Notes:
410 --   None.
411 --
412 -- Access Status:
413 --   Internal Development Use Only.
414 --
415 -- {End Of Comments}
416 -- ----------------------------------------------------------------------------
417 Procedure lck
418 	(p_effective_date	 in  date,
419 	 p_datetrack_mode	 in  varchar2,
420 	 p_ler_bnft_rstrn_id	 in  number,
421 	 p_object_version_number in  number,
422 	 p_validation_start_date out nocopy date,
423 	 p_validation_end_date	 out nocopy date);
424 --
425 -- ----------------------------------------------------------------------------
426 -- |-----------------------------< convert_args >-----------------------------|
427 -- ----------------------------------------------------------------------------
428 -- {Start Of Comments}
429 --
430 -- Description:
431 --   This function is used to turn attribute parameters into the record
432 --   structure parameter g_rec_type.
433 --
434 -- Prerequisites:
435 --   This is a private function and can only be called from the ins or upd
436 --   attribute processes.
437 --
438 -- In Parameters:
439 --
440 -- Post Success:
441 --   A returning record structure will be returned.
442 --
443 -- Post Failure:
444 --   No direct error handling is required within this function. Any possible
445 --   errors within this function will be a PL/SQL value error due to conversion
446 --   of datatypes or data lengths.
447 --
448 -- Developer Implementation Notes:
449 --   None.
450 --
451 -- Access Status:
452 --   Internal Row Handler Use Only.
453 --
454 -- {End Of Comments}
455 -- ----------------------------------------------------------------------------
456 Function convert_args
457 	(
458 	p_ler_bnft_rstrn_id             in number,
459 	p_effective_start_date          in date,
460 	p_effective_end_date            in date,
461 	p_no_mx_cvg_amt_apls_flag       in varchar2,
462 	p_no_mn_cvg_incr_apls_flag      in varchar2,
463 	p_no_mx_cvg_incr_apls_flag      in varchar2,
464 	p_mx_cvg_incr_wcf_alwd_amt      in number,
465 	p_mx_cvg_incr_alwd_amt          in number,
466 	p_mx_cvg_alwd_amt               in number,
467 	p_mx_cvg_mlt_incr_num           in number,
468 	p_mx_cvg_mlt_incr_wcf_num       in number,
469 	p_mx_cvg_rl                     in number,
470 	p_mx_cvg_wcfn_amt               in number,
471 	p_mx_cvg_wcfn_mlt_num           in number,
472 	p_mn_cvg_amt                    in number,
473 	p_mn_cvg_rl                     in number,
474 	p_cvg_incr_r_decr_only_cd       in varchar2,
475         p_unsspnd_enrt_cd               in varchar2,
476         p_dflt_to_asn_pndg_ctfn_cd      in varchar2,
477         p_dflt_to_asn_pndg_ctfn_rl      in number,
478 	p_ler_id                        in number,
479 	p_pl_id                         in number,
480 	p_business_group_id             in number,
481 	p_plip_id                       in number,
482 	p_lbr_attribute_category        in varchar2,
483 	p_lbr_attribute1                in varchar2,
484 	p_lbr_attribute2                in varchar2,
485 	p_lbr_attribute3                in varchar2,
486 	p_lbr_attribute4                in varchar2,
487 	p_lbr_attribute5                in varchar2,
488 	p_lbr_attribute6                in varchar2,
489 	p_lbr_attribute7                in varchar2,
490 	p_lbr_attribute8                in varchar2,
491 	p_lbr_attribute9                in varchar2,
492 	p_lbr_attribute10               in varchar2,
493 	p_lbr_attribute11               in varchar2,
494 	p_lbr_attribute12               in varchar2,
495 	p_lbr_attribute13               in varchar2,
496 	p_lbr_attribute14               in varchar2,
497 	p_lbr_attribute15               in varchar2,
498 	p_lbr_attribute16               in varchar2,
499 	p_lbr_attribute17               in varchar2,
500 	p_lbr_attribute18               in varchar2,
501 	p_lbr_attribute19               in varchar2,
502 	p_lbr_attribute20               in varchar2,
503 	p_lbr_attribute21               in varchar2,
504 	p_lbr_attribute22               in varchar2,
505 	p_lbr_attribute23               in varchar2,
506 	p_lbr_attribute24               in varchar2,
507 	p_lbr_attribute25               in varchar2,
508 	p_lbr_attribute26               in varchar2,
509 	p_lbr_attribute27               in varchar2,
510 	p_lbr_attribute28               in varchar2,
511 	p_lbr_attribute29               in varchar2,
512 	p_lbr_attribute30               in varchar2,
513         p_susp_if_ctfn_not_prvd_flag    in varchar2,
514         p_ctfn_determine_cd             in varchar2,
515 	p_object_version_number         in number
516 	)
517 	Return g_rec_type;
518 --
519 end ben_lbr_shd;