DBA Data[Home] [Help]

PACKAGE: APPS.BEN_PSL_SHD

Source


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