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