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