DBA Data[Home] [Help]

PACKAGE: APPS.BEN_LPR_SHD

Source


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