DBA Data[Home] [Help]

PACKAGE: APPS.BEN_LGE_SHD

Source


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