DBA Data[Home] [Help]

PACKAGE: APPS.BEN_EPA_SHD

Source


1 Package ben_epa_shd AUTHID CURRENT_USER as
2 /* $Header: beeparhi.pkh 120.0 2005/05/28 02:35:28 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   prtn_elig_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   oipl_id                           number(15),
17   ptip_id                           number(15),
18   plip_id                           number(15),
19   trk_scr_for_inelg_flag            varchar2(30),
20   prtn_eff_strt_dt_cd               varchar2(30),
21   prtn_eff_end_dt_cd                varchar2(30),
22   prtn_eff_strt_dt_rl               number(15),
23   prtn_eff_end_dt_rl                number(15),
24   wait_perd_dt_to_use_cd            varchar2(30),
25   wait_perd_dt_to_use_rl            number(15),
26   wait_perd_val                     number(15),
27   wait_perd_uom                     varchar2(30),
28   wait_perd_rl                      number(15),
29   mx_poe_det_dt_cd                  varchar2(30),
30   mx_poe_det_dt_rl                  number(15),
31   mx_poe_val                        number(15),
32   mx_poe_uom                        varchar2(30),
33   mx_poe_rl                         number(15),
34   mx_poe_apls_cd                    varchar2(30),
35   epa_attribute_category            varchar2(30),
36   epa_attribute1                    varchar2(150),
37   epa_attribute2                    varchar2(150),
38   epa_attribute3                    varchar2(150),
39   epa_attribute4                    varchar2(150),
40   epa_attribute5                    varchar2(150),
41   epa_attribute6                    varchar2(150),
42   epa_attribute7                    varchar2(150),
43   epa_attribute8                    varchar2(150),
44   epa_attribute9                    varchar2(150),
45   epa_attribute10                   varchar2(150),
46   epa_attribute11                   varchar2(150),
47   epa_attribute12                   varchar2(150),
48   epa_attribute13                   varchar2(150),
49   epa_attribute14                   varchar2(150),
50   epa_attribute15                   varchar2(150),
51   epa_attribute16                   varchar2(150),
52   epa_attribute17                   varchar2(150),
53   epa_attribute18                   varchar2(150),
54   epa_attribute19                   varchar2(150),
55   epa_attribute20                   varchar2(150),
56   epa_attribute21                   varchar2(150),
57   epa_attribute22                   varchar2(150),
58   epa_attribute23                   varchar2(150),
59   epa_attribute24                   varchar2(150),
60   epa_attribute25                   varchar2(150),
61   epa_attribute26                   varchar2(150),
62   epa_attribute27                   varchar2(150),
63   epa_attribute28                   varchar2(150),
64   epa_attribute29                   varchar2(150),
65   epa_attribute30                   varchar2(150),
66   object_version_number             number(9)
67   );
68 --
69 -- ----------------------------------------------------------------------------
70 -- |           Global Definitions - Internal Development Use Only             |
71 -- ----------------------------------------------------------------------------
72 --
73 g_old_rec  g_rec_type;                            -- Global record definition
74 g_api_dml  boolean;                               -- Global api dml status
75 --
76 -- ----------------------------------------------------------------------------
77 -- |------------------------< return_api_dml_status >-------------------------|
78 -- ----------------------------------------------------------------------------
79 -- {Start Of Comments}
80 --
81 -- Description:
82 --   This function will return the current g_api_dml private global
83 --   boolean status.
84 --   The g_api_dml status determines if at the time of the function
85 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
86 --   is being issued from within an api.
87 --   If the status is TRUE then a dml statement is being issued from
88 --   within this entity api.
89 --   This function is primarily to support database triggers which
90 --   need to maintain the object_version_number for non-supported
91 --   dml statements (i.e. dml statement issued outside of the api layer).
92 --
93 -- Prerequisites:
94 --   None.
95 --
96 -- In Parameters:
97 --   None.
98 --
99 -- Post Success:
100 --   Processing continues.
101 --   If the function returns a TRUE value then, dml is being executed from
102 --   within this api.
103 --
104 -- Post Failure:
105 --   None.
106 --
107 -- Access Status:
108 --   Internal Row Handler Use Only.
109 --
110 -- {End Of Comments}
111 -- ----------------------------------------------------------------------------
112 Function return_api_dml_status Return Boolean;
113 --
114 -- ----------------------------------------------------------------------------
115 -- |---------------------------< constraint_error >---------------------------|
116 -- ----------------------------------------------------------------------------
117 -- {Start Of Comments}
118 --
119 -- Description:
120 --   This procedure is called when a constraint has been violated (i.e.
121 --   The exception hr_api.check_integrity_violated,
122 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
123 --   hr_api.unique_integrity_violated has been raised).
124 --   The exceptions can only be raised as follows:
125 --   1) A check constraint can only be violated during an INSERT or UPDATE
126 --      dml operation.
127 --   2) A parent integrity constraint can only be violated during an
128 --      INSERT or UPDATE dml operation.
129 --   3) A child integrity constraint can only be violated during an
130 --      DELETE dml operation.
131 --   4) A unique integrity constraint can only be violated during INSERT or
132 --      UPDATE dml operation.
133 --
134 -- Prerequisites:
135 --   1) Either hr_api.check_integrity_violated,
136 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
137 --      hr_api.unique_integrity_violated has been raised with the subsequent
138 --      stripping of the constraint name from the generated error message
139 --      text.
140 --   2) Standalone validation test which corresponds with a constraint error.
141 --
142 -- In Parameter:
143 --   p_constraint_name is in upper format and is just the constraint name
144 --   (e.g. not prefixed by brackets, schema owner etc).
145 --
146 -- Post Success:
147 --   Development dependant.
148 --
149 -- Post Failure:
150 --   Developement dependant.
151 --
152 -- Developer Implementation Notes:
153 --   For each constraint being checked the hr system package failure message
154 --   has been generated as a template only. These system error messages should
155 --   be modified as required (i.e. change the system failure message to a user
156 --   friendly defined error message).
157 --
158 -- Access Status:
159 --   Internal Development Use Only.
160 --
161 -- {End Of Comments}
162 -- ----------------------------------------------------------------------------
163 Procedure constraint_error
164             (p_constraint_name in all_constraints.constraint_name%TYPE);
165 --
166 -- ----------------------------------------------------------------------------
167 -- |-----------------------------< api_updating >-----------------------------|
168 -- ----------------------------------------------------------------------------
169 -- {Start Of Comments}
170 --
171 -- Description:
172 --   This function is used to populate the g_old_rec record with the current
173 --   row from the database for the specified primary key provided that the
174 --   primary key exists, and is valid, and does not already match the current
175 --   g_old_rec.
176 --   The function will always return a TRUE value if the g_old_rec is
177 --   populated with the current row. A FALSE value will be returned if all of
178 --   the primary key arguments are null.
179 --
180 -- Prerequisites:
181 --   None.
182 --
183 -- In Parameters:
184 --
185 -- Post Success:
186 --   A value of TRUE will be returned indiciating that the g_old_rec is
187 --   current.
188 --   A value of FALSE will be returned if all of the primary key arguments
189 --   have a null value (this indicates that the row has not be inserted into
190 --   the Schema), and therefore could never have a corresponding row.
191 --
192 -- Post Failure:
193 --   A failure can only occur under two circumstances:
194 --   1) The primary key is invalid (i.e. a row does not exist for the
195 --      specified primary key values).
196 --   2) If an object_version_number exists but is NOT the same as the current
197 --      g_old_rec value.
198 --
199 -- Developer Implementation Notes:
200 --   None.
201 --
202 -- Access Status:
203 --   Internal Development Use Only.
204 --
205 -- {End Of Comments}
206 -- ----------------------------------------------------------------------------
207 Function api_updating
208   (p_effective_date        in date,
209    p_prtn_elig_id        in number,
210    p_object_version_number    in number
211   ) Return Boolean;
212 --
213 -- ----------------------------------------------------------------------------
214 -- |--------------------------< find_dt_del_modes >---------------------------|
215 -- ----------------------------------------------------------------------------
216 -- {Start Of Comments}
217 --
218 -- Description:
219 --   This procedure is used to determine what datetrack delete modes are
220 --   allowed as of the effective date for this entity. The procedure will
221 --   return a corresponding Boolean value for each of the delete modes
222 --   available where TRUE indicates that the corresponding delete mode is
223 --   available.
224 --
225 -- Prerequisites:
226 --   None.
227 --
228 -- In Parameters:
229 --   p_effective_date
230 --     Specifies the date at which the datetrack modes will be operated on.
231 --   p_base_key_value
232 --     Specifies the primary key value for this datetrack entity.
233 --     (E.g. For this entity the assignment of the argument would be:
234 --           p_base_key_value = :prtn_elig_id).
235 --
236 -- Post Success:
237 --   Processing continues.
238 --
239 -- Post Failure:
240 --   Failure might occur if for the specified effective date and primary key
241 --   value a row doesn't exist.
242 --
243 -- Developer Implementation Notes:
244 --   This procedure could require changes if this entity has any sepcific
245 --   delete restrictions.
246 --   For example, this entity might disallow the datetrack delete mode of
247 --   ZAP. To implement this you would have to set and return a Boolean value
248 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
249 --
250 -- Access Status:
251 --   Internal Development Use Only.
252 --
253 -- {End Of Comments}
254 -- ----------------------------------------------------------------------------
255 Procedure find_dt_del_modes
256     (p_effective_date    in  date,
257      p_base_key_value    in  number,
258      p_zap            out nocopy boolean,
259      p_delete        out nocopy boolean,
260      p_future_change    out nocopy boolean,
261      p_delete_next_change    out nocopy boolean);
262 --
263 -- ----------------------------------------------------------------------------
264 -- |--------------------------< find_dt_upd_modes >---------------------------|
265 -- ----------------------------------------------------------------------------
266 -- {Start Of Comments}
267 --
268 -- Description:
269 --   This procedure is used to determine what datetrack update modes are
270 --   allowed as of the effective date for this entity. The procedure will
271 --   return a corresponding Boolean value for each of the update modes
272 --   available where TRUE indicates that the corresponding update mode
273 --   is available.
274 --
275 -- Prerequisites:
276 --   None.
277 --
278 -- In Parameters:
279 --   p_effective_date
280 --     Specifies the date at which the datetrack modes will be operated on.
281 --   p_base_key_value
282 --     Specifies the primary key value for this datetrack entity.
283 --     (E.g. For this entity the assignment of the argument would be:
284 --           p_base_key_value = :prtn_elig_id).
285 --
286 -- Post Success:
287 --   Processing continues.
288 --
289 -- Post Failure:
290 --   Failure might occur if for the specified effective date and primary key
291 --   value a row doesn't exist.
292 --
293 -- Developer Implementation Notes:
294 --   This procedure could require changes if this entity has any sepcific
295 --   delete restrictions.
296 --   For example, this entity might disallow the datetrack update mode of
297 --   UPDATE. To implement this you would have to set and return a Boolean
298 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
299 --
300 -- Access Status:
301 --   Internal Development Use Only.
302 --
303 -- {End Of Comments}
304 -- ----------------------------------------------------------------------------
305 Procedure find_dt_upd_modes
306     (p_effective_date    in  date,
307      p_base_key_value    in  number,
308      p_correction        out nocopy boolean,
309      p_update        out nocopy boolean,
310      p_update_override    out nocopy boolean,
311      p_update_change_insert    out nocopy boolean);
312 --
313 -- ----------------------------------------------------------------------------
314 -- |------------------------< upd_effective_end_date >------------------------|
315 -- ----------------------------------------------------------------------------
316 -- {Start Of Comments}
317 --
318 -- Description:
319 --   This procedure will update the specified datetrack row with the
320 --   specified new effective end date. The object version number is also
321 --   set to the next object version number. DateTrack modes which call
322 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
323 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
324 --   This is an internal datetrack maintenance procedure which should
325 --   not be modified in anyway.
326 --
327 -- Prerequisites:
328 --   None.
329 --
330 -- In Parameters:
331 --   p_new_effective_end_date
332 --     Specifies the new effective end date which will be set for the
333 --     row as of the effective date.
334 --   p_base_key_value
335 --     Specifies the primary key value for this datetrack entity.
336 --     (E.g. For this entity the assignment of the argument would be:
337 --           p_base_key_value = :prtn_elig_id).
338 --
339 -- Post Success:
340 --   The specified row will be updated with the new effective end date and
341 --   object_version_number.
342 --
343 -- Post Failure:
344 --   Failure might occur if for the specified effective date and primary key
345 --   value a row doesn't exist.
346 --
347 -- Developer Implementation Notes:
348 --   This is an internal datetrack maintenance procedure which should
349 --   not be modified in anyway.
350 --
351 -- Access Status:
352 --   Internal Row Handler Use Only.
353 --
354 -- {End Of Comments}
355 -- ----------------------------------------------------------------------------
356 Procedure upd_effective_end_date
357     (p_effective_date        in date,
358      p_base_key_value        in number,
359      p_new_effective_end_date    in date,
360      p_validation_start_date    in date,
361      p_validation_end_date        in date,
362          p_object_version_number       out nocopy number);
363 --
364 -- ----------------------------------------------------------------------------
365 -- |---------------------------------< lck >----------------------------------|
369 -- Description:
366 -- ----------------------------------------------------------------------------
367 -- {Start Of Comments}
368 --
370 --   The Lck process for datetrack is complicated and comprises of the
371 --   following processing
372 --   The processing steps are as follows:
373 --   1) The row to be updated or deleted must be locked.
374 --      By locking this row, the g_old_rec record data type is populated.
375 --   2) If a comment exists the text is selected from hr_comments.
376 --   3) The datetrack mode is then validated to ensure the operation is
377 --      valid. If the mode is valid the validation start and end dates for
378 --      the mode will be derived and returned. Any required locking is
379 --      completed when the datetrack mode is validated.
380 --
381 -- Prerequisites:
382 --   When attempting to call the lck procedure the object version number,
383 --   primary key, effective date and datetrack mode must be specified.
384 --
385 -- In Parameters:
386 --   p_effective_date
387 --     Specifies the date of the datetrack update operation.
388 --   p_datetrack_mode
389 --     Determines the datetrack update or delete mode.
390 --
391 -- Post Success:
392 --   On successful completion of the Lck process the row to be updated or
393 --   deleted will be locked and selected into the global data structure
394 --   g_old_rec.
395 --
396 -- Post Failure:
397 --   The Lck process can fail for three reasons:
398 --   1) When attempting to lock the row the row could already be locked by
399 --      another user. This will raise the HR_Api.Object_Locked exception.
400 --   2) The row which is required to be locked doesn't exist in the HR Schema.
401 --      This error is trapped and reported using the message name
402 --      'HR_7220_INVALID_PRIMARY_KEY'.
403 --   3) The row although existing in the HR Schema has a different object
404 --      version number than the object version number specified.
405 --      This error is trapped and reported using the message name
406 --      'HR_7155_OBJECT_INVALID'.
407 --
408 -- Developer Implementation Notes:
409 --   None.
410 --
411 -- Access Status:
412 --   Internal Development Use Only.
413 --
414 -- {End Of Comments}
415 -- ----------------------------------------------------------------------------
416 Procedure lck
417     (p_effective_date     in  date,
418      p_datetrack_mode     in  varchar2,
419      p_prtn_elig_id     in  number,
420      p_object_version_number in  number,
421      p_validation_start_date out nocopy date,
422      p_validation_end_date     out nocopy date);
423 --
424 -- ----------------------------------------------------------------------------
425 -- |-----------------------------< convert_args >-----------------------------|
426 -- ----------------------------------------------------------------------------
427 -- {Start Of Comments}
428 --
429 -- Description:
430 --   This function is used to turn attribute parameters into the record
431 --   structure parameter g_rec_type.
432 --
433 -- Prerequisites:
434 --   This is a private function and can only be called from the ins or upd
435 --   attribute processes.
436 --
437 -- In Parameters:
438 --
439 -- Post Success:
440 --   A returning record structure will be returned.
441 --
442 -- Post Failure:
443 --   No direct error handling is required within this function. Any possible
444 --   errors within this function will be a PL/SQL value error due to conversion
445 --   of datatypes or data lengths.
446 --
447 -- Developer Implementation Notes:
448 --   None.
449 --
450 -- Access Status:
451 --   Internal Row Handler Use Only.
452 --
453 -- {End Of Comments}
454 -- ----------------------------------------------------------------------------
455 Function convert_args
456     (
457     p_prtn_elig_id                  in number,
458     p_effective_start_date          in date,
459     p_effective_end_date            in date,
460     p_business_group_id             in number,
461     p_pgm_id                        in number,
462     p_pl_id                         in number,
463     p_oipl_id                       in number,
464     p_ptip_id                       in number,
465     p_plip_id                       in number,
466     p_trk_scr_for_inelg_flag        in varchar2,
467     p_prtn_eff_strt_dt_cd           in varchar2,
468     p_prtn_eff_end_dt_cd            in varchar2,
469     p_prtn_eff_strt_dt_rl           in number,
470     p_prtn_eff_end_dt_rl            in number,
471     p_wait_perd_dt_to_use_cd        in varchar2,
472     p_wait_perd_dt_to_use_rl        in number,
473     p_wait_perd_val                 in number,
474     p_wait_perd_uom                 in varchar2,
475     p_wait_perd_rl                  in number,
476     p_mx_poe_det_dt_cd              in varchar2,
477     p_mx_poe_det_dt_rl              in number,
478     p_mx_poe_val                    in number,
479     p_mx_poe_uom                    in varchar2,
480     p_mx_poe_rl                     in number,
481     p_mx_poe_apls_cd                in varchar2,
482     p_epa_attribute_category        in varchar2,
483     p_epa_attribute1                in varchar2,
484     p_epa_attribute2                in varchar2,
485     p_epa_attribute3                in varchar2,
486     p_epa_attribute4                in varchar2,
487     p_epa_attribute5                in varchar2,
488     p_epa_attribute6                in varchar2,
489     p_epa_attribute7                in varchar2,
490     p_epa_attribute8                in varchar2,
491     p_epa_attribute9                in varchar2,
492     p_epa_attribute10               in varchar2,
493     p_epa_attribute11               in varchar2,
494     p_epa_attribute12               in varchar2,
495     p_epa_attribute13               in varchar2,
496     p_epa_attribute14               in varchar2,
497     p_epa_attribute15               in varchar2,
498     p_epa_attribute16               in varchar2,
499     p_epa_attribute17               in varchar2,
500     p_epa_attribute18               in varchar2,
501     p_epa_attribute19               in varchar2,
502     p_epa_attribute20               in varchar2,
503     p_epa_attribute21               in varchar2,
504     p_epa_attribute22               in varchar2,
505     p_epa_attribute23               in varchar2,
506     p_epa_attribute24               in varchar2,
507     p_epa_attribute25               in varchar2,
508     p_epa_attribute26               in varchar2,
509     p_epa_attribute27               in varchar2,
510     p_epa_attribute28               in varchar2,
511     p_epa_attribute29               in varchar2,
512     p_epa_attribute30               in varchar2,
513     p_object_version_number         in number
514     )
515     Return g_rec_type;
516 --
517 end ben_epa_shd;