DBA Data[Home] [Help]

PACKAGE: APPS.BEN_LCT_SHD

Source


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