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