DBA Data[Home] [Help]

PACKAGE: APPS.BEN_LEN_SHD

Source


1 Package ben_len_shd AUTHID CURRENT_USER as
2 /* $Header: belenrhi.pkh 120.1.12020000.2 2012/07/03 12:13:17 amnaraya ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   lee_rsn_id                        number(15),
11   effective_start_date              date,
12   effective_end_date                date,
13   business_group_id                 number(15),
14   popl_enrt_typ_cycl_id             number(15),
15   ler_id                            number(15),
16   cls_enrt_dt_to_use_cd             varchar2(30),
17   dys_aftr_end_to_dflt_num          number(15),
18   enrt_cvg_end_dt_cd                varchar2(30),
19   enrt_cvg_strt_dt_cd               varchar2(30),
20   enrt_perd_strt_dt_cd              varchar2(30),
21   enrt_perd_strt_dt_rl              number(15),
22   enrt_perd_end_dt_cd               varchar2(30),
23   enrt_perd_end_dt_rl               number(15),
24   addl_procg_dys_num                number(15),
25   dys_no_enrl_not_elig_num          number(15),
26   dys_no_enrl_cant_enrl_num         number(15),
27   rt_end_dt_cd                      varchar2(30),
28   rt_end_dt_rl                      number(15),
29   rt_strt_dt_cd                     varchar2(30),
30   rt_strt_dt_rl                     number(15),
31   enrt_cvg_end_dt_rl                number(15),
32   enrt_cvg_strt_dt_rl               number(15),
33   len_attribute_category            varchar2(30),
34   len_attribute1                    varchar2(150),
35   len_attribute2                    varchar2(150),
36   len_attribute3                    varchar2(150),
37   len_attribute4                    varchar2(150),
38   len_attribute5                    varchar2(150),
39   len_attribute6                    varchar2(150),
40   len_attribute7                    varchar2(150),
41   len_attribute8                    varchar2(150),
42   len_attribute9                    varchar2(150),
43   len_attribute10                   varchar2(150),
44   len_attribute11                   varchar2(150),
45   len_attribute12                   varchar2(150),
46   len_attribute13                   varchar2(150),
47   len_attribute14                   varchar2(150),
48   len_attribute15                   varchar2(150),
49   len_attribute16                   varchar2(150),
50   len_attribute17                   varchar2(150),
51   len_attribute18                   varchar2(150),
52   len_attribute19                   varchar2(150),
53   len_attribute20                   varchar2(150),
54   len_attribute21                   varchar2(150),
55   len_attribute22                   varchar2(150),
56   len_attribute23                   varchar2(150),
57   len_attribute24                   varchar2(150),
58   len_attribute25                   varchar2(150),
59   len_attribute26                   varchar2(150),
60   len_attribute27                   varchar2(150),
61   len_attribute28                   varchar2(150),
62   len_attribute29                   varchar2(150),
63   len_attribute30                   varchar2(150),
64   object_version_number             number(9) ,
65   enrt_perd_det_ovrlp_bckdt_cd      varchar2(30),
66   reinstate_cd				varchar2(30),
67   reinstate_ovrdn_cd		varchar2(30),
68   reopen_le_on_reprocess varchar2(30),
69   ENRT_PERD_STRT_DAYS		number(15),
70   ENRT_PERD_END_DAYS		number(15),
71   defer_deenrol_flag            varchar2(30)
72   );
73 --
74 -- ----------------------------------------------------------------------------
75 -- |           Global Definitions - Internal Development Use Only             |
76 -- ----------------------------------------------------------------------------
77 --
78 g_old_rec  g_rec_type;                            -- Global record definition
79 g_api_dml  boolean;                               -- Global api dml status
80 --
81 -- ----------------------------------------------------------------------------
82 -- |------------------------< return_api_dml_status >-------------------------|
83 -- ----------------------------------------------------------------------------
84 -- {Start Of Comments}
85 --
86 -- Description:
87 --   This function will return the current g_api_dml private global
88 --   boolean status.
89 --   The g_api_dml status determines if at the time of the function
90 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
91 --   is being issued from within an api.
92 --   If the status is TRUE then a dml statement is being issued from
93 --   within this entity api.
94 --   This function is primarily to support database triggers which
95 --   need to maintain the object_version_number for non-supported
96 --   dml statements (i.e. dml statement issued outside of the api layer).
97 --
98 -- Prerequisites:
99 --   None.
100 --
101 -- In Parameters:
102 --   None.
103 --
104 -- Post Success:
105 --   Processing continues.
106 --   If the function returns a TRUE value then, dml is being executed from
107 --   within this api.
108 --
109 -- Post Failure:
110 --   None.
111 --
112 -- Access Status:
113 --   Internal Row Handler Use Only.
114 --
115 -- {End Of Comments}
116 -- ----------------------------------------------------------------------------
117 Function return_api_dml_status Return Boolean;
118 --
119 -- ----------------------------------------------------------------------------
120 -- |---------------------------< constraint_error >---------------------------|
121 -- ----------------------------------------------------------------------------
122 -- {Start Of Comments}
123 --
124 -- Description:
125 --   This procedure is called when a constraint has been violated (i.e.
126 --   The exception hr_api.check_integrity_violated,
127 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
128 --   hr_api.unique_integrity_violated has been raised).
129 --   The exceptions can only be raised as follows:
130 --   1) A check constraint can only be violated during an INSERT or UPDATE
131 --      dml operation.
132 --   2) A parent integrity constraint can only be violated during an
133 --      INSERT or UPDATE dml operation.
134 --   3) A child integrity constraint can only be violated during an
135 --      DELETE dml operation.
136 --   4) A unique integrity constraint can only be violated during INSERT or
137 --      UPDATE dml operation.
138 --
139 -- Prerequisites:
140 --   1) Either hr_api.check_integrity_violated,
141 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
142 --      hr_api.unique_integrity_violated has been raised with the subsequent
143 --      stripping of the constraint name from the generated error message
144 --      text.
145 --   2) Standalone validation test which corresponds with a constraint error.
146 --
147 -- In Parameter:
148 --   p_constraint_name is in upper format and is just the constraint name
149 --   (e.g. not prefixed by brackets, schema owner etc).
150 --
151 -- Post Success:
152 --   Development dependant.
153 --
154 -- Post Failure:
155 --   Developement dependant.
156 --
157 -- Developer Implementation Notes:
158 --   For each constraint being checked the hr system package failure message
159 --   has been generated as a template only. These system error messages should
160 --   be modified as required (i.e. change the system failure message to a user
161 --   friendly defined error message).
162 --
163 -- Access Status:
164 --   Internal Development Use Only.
165 --
166 -- {End Of Comments}
167 -- ----------------------------------------------------------------------------
168 Procedure constraint_error
169             (p_constraint_name in all_constraints.constraint_name%TYPE);
170 --
171 -- ----------------------------------------------------------------------------
172 -- |-----------------------------< api_updating >-----------------------------|
173 -- ----------------------------------------------------------------------------
174 -- {Start Of Comments}
175 --
176 -- Description:
177 --   This function is used to populate the g_old_rec record with the current
178 --   row from the database for the specified primary key provided that the
179 --   primary key exists, and is valid, and does not already match the current
180 --   g_old_rec.
181 --   The function will always return a TRUE value if the g_old_rec is
182 --   populated with the current row. A FALSE value will be returned if all of
183 --   the primary key arguments are null.
184 --
185 -- Prerequisites:
186 --   None.
187 --
188 -- In Parameters:
189 --
190 -- Post Success:
191 --   A value of TRUE will be returned indiciating that the g_old_rec is
192 --   current.
193 --   A value of FALSE will be returned if all of the primary key arguments
194 --   have a null value (this indicates that the row has not be inserted into
195 --   the Schema), and therefore could never have a corresponding row.
196 --
197 -- Post Failure:
198 --   A failure can only occur under two circumstances:
199 --   1) The primary key is invalid (i.e. a row does not exist for the
200 --      specified primary key values).
201 --   2) If an object_version_number exists but is NOT the same as the current
202 --      g_old_rec value.
203 --
204 -- Developer Implementation Notes:
205 --   None.
206 --
207 -- Access Status:
208 --   Internal Development Use Only.
209 --
210 -- {End Of Comments}
211 -- ----------------------------------------------------------------------------
212 Function api_updating
213   (p_effective_date		in date,
214    p_lee_rsn_id		in number,
215    p_object_version_number	in number
216   ) Return Boolean;
217 --
218 -- ----------------------------------------------------------------------------
219 -- |--------------------------< find_dt_del_modes >---------------------------|
220 -- ----------------------------------------------------------------------------
221 -- {Start Of Comments}
222 --
223 -- Description:
224 --   This procedure is used to determine what datetrack delete modes are
225 --   allowed as of the effective date for this entity. The procedure will
226 --   return a corresponding Boolean value for each of the delete modes
227 --   available where TRUE indicates that the corresponding delete mode is
228 --   available.
229 --
230 -- Prerequisites:
231 --   None.
232 --
233 -- In Parameters:
234 --   p_effective_date
235 --     Specifies the date at which the datetrack modes will be operated on.
236 --   p_base_key_value
237 --     Specifies the primary key value for this datetrack entity.
238 --     (E.g. For this entity the assignment of the argument would be:
239 --           p_base_key_value = :lee_rsn_id).
240 --
241 -- Post Success:
242 --   Processing continues.
243 --
244 -- Post Failure:
245 --   Failure might occur if for the specified effective date and primary key
246 --   value a row doesn't exist.
247 --
248 -- Developer Implementation Notes:
249 --   This procedure could require changes if this entity has any sepcific
250 --   delete restrictions.
251 --   For example, this entity might disallow the datetrack delete mode of
252 --   ZAP. To implement this you would have to set and return a Boolean value
253 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
254 --
255 -- Access Status:
256 --   Internal Development Use Only.
257 --
258 -- {End Of Comments}
259 -- ----------------------------------------------------------------------------
260 Procedure find_dt_del_modes
261 	(p_effective_date	in  date,
262 	 p_base_key_value	in  number,
263 	 p_zap		 out nocopy boolean,
264 	 p_delete	 out nocopy boolean,
265 	 p_future_change out nocopy boolean,
266 	 p_delete_next_change out nocopy boolean);
267 --
268 -- ----------------------------------------------------------------------------
269 -- |--------------------------< find_dt_upd_modes >---------------------------|
270 -- ----------------------------------------------------------------------------
271 -- {Start Of Comments}
272 --
273 -- Description:
274 --   This procedure is used to determine what datetrack update modes are
275 --   allowed as of the effective date for this entity. The procedure will
276 --   return a corresponding Boolean value for each of the update modes
277 --   available where TRUE indicates that the corresponding update mode
278 --   is available.
279 --
280 -- Prerequisites:
281 --   None.
282 --
283 -- In Parameters:
284 --   p_effective_date
285 --     Specifies the date at which the datetrack modes will be operated on.
286 --   p_base_key_value
287 --     Specifies the primary key value for this datetrack entity.
288 --     (E.g. For this entity the assignment of the argument would be:
289 --           p_base_key_value = :lee_rsn_id).
290 --
291 -- Post Success:
292 --   Processing continues.
293 --
294 -- Post Failure:
295 --   Failure might occur if for the specified effective date and primary key
296 --   value a row doesn't exist.
297 --
298 -- Developer Implementation Notes:
299 --   This procedure could require changes if this entity has any sepcific
300 --   delete restrictions.
301 --   For example, this entity might disallow the datetrack update mode of
302 --   UPDATE. To implement this you would have to set and return a Boolean
303 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
304 --
305 -- Access Status:
306 --   Internal Development Use Only.
307 --
308 -- {End Of Comments}
309 -- ----------------------------------------------------------------------------
310 Procedure find_dt_upd_modes
311 	(p_effective_date	in  date,
312 	 p_base_key_value	in  number,
313 	 p_correction	 out nocopy boolean,
314 	 p_update	 out nocopy boolean,
315 	 p_update_override out nocopy boolean,
316 	 p_update_change_insert out nocopy boolean);
317 --
318 -- ----------------------------------------------------------------------------
319 -- |------------------------< upd_effective_end_date >------------------------|
320 -- ----------------------------------------------------------------------------
321 -- {Start Of Comments}
322 --
323 -- Description:
324 --   This procedure will update the specified datetrack row with the
325 --   specified new effective end date. The object version number is also
326 --   set to the next object version number. DateTrack modes which call
327 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
328 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
329 --   This is an internal datetrack maintenance procedure which should
330 --   not be modified in anyway.
331 --
332 -- Prerequisites:
333 --   None.
334 --
335 -- In Parameters:
336 --   p_new_effective_end_date
337 --     Specifies the new effective end date which will be set for the
338 --     row as of the effective date.
339 --   p_base_key_value
340 --     Specifies the primary key value for this datetrack entity.
341 --     (E.g. For this entity the assignment of the argument would be:
342 --           p_base_key_value = :lee_rsn_id).
343 --
344 -- Post Success:
345 --   The specified row will be updated with the new effective end date and
346 --   object_version_number.
347 --
351 --
348 -- Post Failure:
349 --   Failure might occur if for the specified effective date and primary key
350 --   value a row doesn't exist.
352 -- Developer Implementation Notes:
353 --   This is an internal datetrack maintenance procedure which should
354 --   not be modified in anyway.
355 --
356 -- Access Status:
357 --   Internal Row Handler Use Only.
358 --
359 -- {End Of Comments}
360 -- ----------------------------------------------------------------------------
361 Procedure upd_effective_end_date
362 	(p_effective_date		in date,
363 	 p_base_key_value		in number,
364 	 p_new_effective_end_date	in date,
365 	 p_validation_start_date	in date,
366 	 p_validation_end_date		in date,
367          p_object_version_number       out nocopy number);
368 --
369 -- ----------------------------------------------------------------------------
370 -- |---------------------------------< lck >----------------------------------|
371 -- ----------------------------------------------------------------------------
372 -- {Start Of Comments}
373 --
374 -- Description:
375 --   The Lck process for datetrack is complicated and comprises of the
376 --   following processing
377 --   The processing steps are as follows:
378 --   1) The row to be updated or deleted must be locked.
379 --      By locking this row, the g_old_rec record data type is populated.
380 --   2) If a comment exists the text is selected from hr_comments.
381 --   3) The datetrack mode is then validated to ensure the operation is
382 --      valid. If the mode is valid the validation start and end dates for
383 --      the mode will be derived and returned. Any required locking is
384 --      completed when the datetrack mode is validated.
385 --
386 -- Prerequisites:
387 --   When attempting to call the lck procedure the object version number,
388 --   primary key, effective date and datetrack mode must be specified.
389 --
390 -- In Parameters:
391 --   p_effective_date
392 --     Specifies the date of the datetrack update operation.
393 --   p_datetrack_mode
394 --     Determines the datetrack update or delete mode.
395 --
396 -- Post Success:
397 --   On successful completion of the Lck process the row to be updated or
398 --   deleted will be locked and selected into the global data structure
399 --   g_old_rec.
400 --
401 -- Post Failure:
402 --   The Lck process can fail for three reasons:
403 --   1) When attempting to lock the row the row could already be locked by
404 --      another user. This will raise the HR_Api.Object_Locked exception.
405 --   2) The row which is required to be locked doesn't exist in the HR Schema.
406 --      This error is trapped and reported using the message name
407 --      'HR_7220_INVALID_PRIMARY_KEY'.
408 --   3) The row although existing in the HR Schema has a different object
409 --      version number than the object version number specified.
410 --      This error is trapped and reported using the message name
411 --      'HR_7155_OBJECT_INVALID'.
412 --
413 -- Developer Implementation Notes:
414 --   None.
415 --
416 -- Access Status:
417 --   Internal Development Use Only.
418 --
419 -- {End Of Comments}
420 -- ----------------------------------------------------------------------------
421 Procedure lck
422 	(p_effective_date	 in  date,
423 	 p_datetrack_mode	 in  varchar2,
424 	 p_lee_rsn_id	 in  number,
425 	 p_object_version_number in  number,
426 	 p_validation_start_date out nocopy date,
427 	 p_validation_end_date	 out nocopy date);
428 --
429 -- ----------------------------------------------------------------------------
430 -- |-----------------------------< convert_args >-----------------------------|
431 -- ----------------------------------------------------------------------------
432 -- {Start Of Comments}
433 --
434 -- Description:
435 --   This function is used to turn attribute parameters into the record
436 --   structure parameter g_rec_type.
437 --
438 -- Prerequisites:
439 --   This is a private function and can only be called from the ins or upd
440 --   attribute processes.
441 --
442 -- In Parameters:
443 --
444 -- Post Success:
445 --   A returning record structure will be returned.
446 --
447 -- Post Failure:
448 --   No direct error handling is required within this function. Any possible
449 --   errors within this function will be a PL/SQL value error due to conversion
450 --   of datatypes or data lengths.
451 --
452 -- Developer Implementation Notes:
453 --   None.
454 --
455 -- Access Status:
456 --   Internal Row Handler Use Only.
457 --
458 -- {End Of Comments}
459 -- ----------------------------------------------------------------------------
460 Function convert_args
461 	(
462 	p_lee_rsn_id                    in number,
463 	p_effective_start_date          in date,
464 	p_effective_end_date            in date,
465 	p_business_group_id             in number,
466 	p_popl_enrt_typ_cycl_id         in number,
467 	p_ler_id                        in number,
468 	p_cls_enrt_dt_to_use_cd         in varchar2,
469 	p_dys_aftr_end_to_dflt_num      in number,
470 	p_enrt_cvg_end_dt_cd            in varchar2,
471 	p_enrt_cvg_strt_dt_cd           in varchar2,
472 	p_enrt_perd_strt_dt_cd          in varchar2,
473 	p_enrt_perd_strt_dt_rl          in number,
474 	p_enrt_perd_end_dt_cd           in varchar2,
475 	p_enrt_perd_end_dt_rl           in number,
476 	p_addl_procg_dys_num            in number,
477 	p_dys_no_enrl_not_elig_num      in number,
478 	p_dys_no_enrl_cant_enrl_num     in number,
479 	p_rt_end_dt_cd                  in varchar2,
480 	p_rt_end_dt_rl                  in number,
481 	p_rt_strt_dt_cd                 in varchar2,
482 	p_rt_strt_dt_rl                 in number,
483 	p_enrt_cvg_end_dt_rl            in number,
484 	p_enrt_cvg_strt_dt_rl           in number,
485 	p_len_attribute_category       in varchar2,
486 	p_len_attribute1               in varchar2,
487 	p_len_attribute2               in varchar2,
488 	p_len_attribute3               in varchar2,
489 	p_len_attribute4               in varchar2,
490 	p_len_attribute5               in varchar2,
491 	p_len_attribute6               in varchar2,
492 	p_len_attribute7               in varchar2,
493 	p_len_attribute8               in varchar2,
494 	p_len_attribute9               in varchar2,
495 	p_len_attribute10              in varchar2,
496 	p_len_attribute11              in varchar2,
497 	p_len_attribute12              in varchar2,
498 	p_len_attribute13              in varchar2,
499 	p_len_attribute14              in varchar2,
500 	p_len_attribute15              in varchar2,
501 	p_len_attribute16              in varchar2,
502 	p_len_attribute17              in varchar2,
503 	p_len_attribute18              in varchar2,
504 	p_len_attribute19              in varchar2,
505 	p_len_attribute20              in varchar2,
506 	p_len_attribute21              in varchar2,
507 	p_len_attribute22              in varchar2,
508 	p_len_attribute23              in varchar2,
509 	p_len_attribute24              in varchar2,
510 	p_len_attribute25              in varchar2,
511 	p_len_attribute26              in varchar2,
512 	p_len_attribute27              in varchar2,
513 	p_len_attribute28              in varchar2,
514 	p_len_attribute29              in varchar2,
515 	p_len_attribute30              in varchar2,
516 	p_object_version_number        in number ,
517 	p_enrt_perd_det_ovrlp_bckdt_cd in varchar2,
518 	p_reinstate_cd		       in varchar2,
519 	p_reinstate_ovrdn_cd	       in varchar2,
520 	p_reopen_le_on_reprocess         in  varchar2,
521 	p_ENRT_PERD_STRT_DAYS	       in	number,
522 	p_ENRT_PERD_END_DAYS	       in	number,
523 	p_defer_deenrol_flag           in varchar2
524 	)
525 	Return g_rec_type;
526 --
527 end ben_len_shd;