1 Package pay_prt_shd as
2 /* $Header: pyprtrhi.pkh 120.0 2005/05/29 07:52:46 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (run_type_id number(9)
10 ,run_type_name varchar2(80)
11 ,run_method varchar2(30)
12 ,effective_start_date date
13 ,effective_end_date date
14 ,business_group_id number(15)
15 ,legislation_code varchar2(30)
16 ,shortname varchar2(30)
17 ,srs_flag varchar2(30)
18 ,run_information_category varchar2(30)
19 ,run_information1 varchar2(150)
20 ,run_information2 varchar2(150)
21 ,run_information3 varchar2(150)
22 ,run_information4 varchar2(150)
23 ,run_information5 varchar2(150)
24 ,run_information6 varchar2(150)
25 ,run_information7 varchar2(150)
26 ,run_information8 varchar2(150)
27 ,run_information9 varchar2(150)
28 ,run_information10 varchar2(150)
29 ,run_information11 varchar2(150)
30 ,run_information12 varchar2(150)
31 ,run_information13 varchar2(150)
32 ,run_information14 varchar2(150)
33 ,run_information15 varchar2(150)
34 ,run_information16 varchar2(150)
35 ,run_information17 varchar2(150)
36 ,run_information18 varchar2(150)
37 ,run_information19 varchar2(150)
38 ,run_information20 varchar2(150)
39 ,run_information21 varchar2(150)
40 ,run_information22 varchar2(150)
41 ,run_information23 varchar2(150)
42 ,run_information24 varchar2(150)
43 ,run_information25 varchar2(150)
44 ,run_information26 varchar2(150)
45 ,run_information27 varchar2(150)
46 ,run_information28 varchar2(150)
47 ,run_information29 varchar2(150)
48 ,run_information30 varchar2(150)
49 ,object_version_number number(9)
50 );
51 --
52 -- ----------------------------------------------------------------------------
53 -- | Global Definitions - Internal Development Use Only |
54 -- ----------------------------------------------------------------------------
55 --
56 g_old_rec g_rec_type; -- Global record definition
57 --
58 -- ----------------------------------------------------------------------------
59 -- |---------------------------< constraint_error >---------------------------|
60 -- ----------------------------------------------------------------------------
61 -- {Start Of Comments}
62 --
63 -- Description:
64 -- This procedure is called when a constraint has been violated (i.e.
65 -- The exception hr_api.check_integrity_violated,
66 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
67 -- hr_api.unique_integrity_violated has been raised).
68 -- The exceptions can only be raised as follows:
69 -- 1) A check constraint can only be violated during an INSERT or UPDATE
70 -- dml operation.
71 -- 2) A parent integrity constraint can only be violated during an
72 -- INSERT or UPDATE dml operation.
73 -- 3) A child integrity constraint can only be violated during an
74 -- DELETE dml operation.
75 -- 4) A unique integrity constraint can only be violated during INSERT or
76 -- UPDATE dml operation.
77 --
78 -- Prerequisites:
79 -- 1) Either hr_api.check_integrity_violated,
80 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
81 -- hr_api.unique_integrity_violated has been raised with the subsequent
82 -- stripping of the constraint name from the generated error message
83 -- text.
84 -- 2) Standalone validation test which corresponds with a constraint error.
85 --
86 -- In Parameter:
87 -- p_constraint_name is in upper format and is just the constraint name
88 -- (e.g. not prefixed by brackets, schema owner etc).
89 --
90 -- Post Success:
91 -- Development dependant.
92 --
93 -- Post Failure:
94 -- Developement dependant.
95 --
96 -- Developer Implementation Notes:
97 -- For each constraint being checked the hr system package failure message
98 -- has been generated as a template only. These system error messages should
99 -- be modified as required (i.e. change the system failure message to a user
100 -- friendly defined error message).
101 --
102 -- Access Status:
103 -- Internal Development Use Only.
104 --
105 -- {End Of Comments}
106 -- ----------------------------------------------------------------------------
107 Procedure constraint_error
108 (p_constraint_name in all_constraints.constraint_name%TYPE);
109 --
110 -- ----------------------------------------------------------------------------
111 -- |-----------------------------< api_updating >-----------------------------|
112 -- ----------------------------------------------------------------------------
113 -- {Start Of Comments}
114 --
115 -- Description:
116 -- This function is used to populate the g_old_rec record with the
117 -- current row from the database for the specified primary key
118 -- provided that the primary key exists and is valid and does not
119 -- already match the current g_old_rec. The function will always return
120 -- a TRUE value if the g_old_rec is populated with the current row.
121 -- A FALSE value will be returned if all of the primary key arguments
122 -- are null.
123 --
124 -- Prerequisites:
125 -- None.
126 --
127 -- In Parameters:
128 --
129 -- Post Success:
130 -- A value of TRUE will be returned indiciating that the g_old_rec
131 -- is current.
132 -- A value of FALSE will be returned if all of the primary key arguments
133 -- have a null value (this indicates that the row has not be inserted into
134 -- the Schema), and therefore could never have a corresponding row.
135 --
136 -- Post Failure:
137 -- A failure can only occur under two circumstances:
138 -- 1) The primary key is invalid (i.e. a row does not exist for the
139 -- specified primary key values).
140 -- 2) If an object_version_number exists but is NOT the same as the current
141 -- g_old_rec value.
142 --
143 -- Developer Implementation Notes:
144 -- None.
145 --
146 -- Access Status:
147 -- Internal Development Use Only.
148 --
149 -- {End Of Comments}
150 -- ----------------------------------------------------------------------------
151 Function api_updating
152 (p_effective_date in date
153 ,p_run_type_id in number
154 ,p_object_version_number in number
155 ) Return Boolean;
156 --
157 -- ----------------------------------------------------------------------------
158 -- |---------------------------< find_dt_upd_modes >--------------------------|
159 -- ----------------------------------------------------------------------------
160 -- {Start Of Comments}
161 --
162 -- Description:
163 -- This procedure is used to determine what datetrack update modes are
164 -- allowed as of the effective date for this entity. The procedure will
165 -- return a corresponding Boolean value for each of the update modes
166 -- available where TRUE indicates that the corresponding update mode
167 -- is available.
168 --
169 -- Prerequisites:
170 -- None.
171 --
172 -- In Parameters:
173 -- p_effective_date
174 -- Specifies the date at which the datetrack modes will be operated on.
175 -- p_base_key_value
176 -- Specifies the primary key value for this datetrack entity.
177 -- (E.g. For this entity the assignment of the argument would be:
178 -- p_base_key_value = :run_type_id).
179 --
180 -- Post Success:
181 -- Processing continues.
182 --
183 -- Post Failure:
184 -- Failure might occur if for the specified effective date and primary key
185 -- value a row doesn't exist.
186 --
187 -- Developer Implementation Notes:
188 -- This procedure could require changes if this entity has any sepcific
189 -- delete restrictions.
190 -- For example, this entity might disallow the datetrack update mode of
191 -- UPDATE. To implement this you would have to set and return a Boolean
192 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
193 --
194 -- Access Status:
195 -- Internal Development Use Only.
196 --
197 -- {End Of Comments}
198 -- ----------------------------------------------------------------------------
199 Procedure find_dt_upd_modes
200 (p_effective_date in date
201 ,p_base_key_value in number
202 ,p_correction out nocopy boolean
203 ,p_update out nocopy boolean
204 ,p_update_override out nocopy boolean
205 ,p_update_change_insert out nocopy boolean
206 );
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 = :run_type_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 -- ----------------------------------------------------------------------------
260 -- |-----------------------< upd_effective_end_date >-------------------------|
261 -- ----------------------------------------------------------------------------
262 -- {Start Of Comments}
263 --
264 -- Description:
265 -- This procedure will update the specified datetrack row with the
266 -- specified new effective end date. The object version number is also
267 -- set to the next object version number. DateTrack modes which call
268 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
269 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
270 -- This is an internal datetrack maintenance procedure which should
271 -- not be modified in anyway.
272 --
273 -- Prerequisites:
274 -- None.
275 --
276 -- In Parameters:
277 -- p_new_effective_end_date
278 -- Specifies the new effective end date which will be set for the
279 -- row as of the effective date.
280 -- p_base_key_value
281 -- Specifies the primary key value for this datetrack entity.
282 -- (E.g. For this entity the assignment of the argument would be:
283 -- p_base_key_value = :run_type_id).
284 --
285 -- Post Success:
286 -- The specified row will be updated with the new effective end date and
287 -- object_version_number.
288 --
289 -- Post Failure:
290 -- Failure might occur if for the specified effective date and primary key
291 -- value a row doesn't exist.
292 --
293 -- Developer Implementation Notes:
294 -- This is an internal datetrack maintenance procedure which should
295 -- not be modified in anyway.
296 --
297 -- Access Status:
298 -- Internal Row Handler Use Only.
299 --
300 -- {End Of Comments}
301 -- ----------------------------------------------------------------------------
302 Procedure upd_effective_end_date
303 (p_effective_date in date
304 ,p_base_key_value in number
305 ,p_new_effective_end_date in date
306 ,p_validation_start_date in date
307 ,p_validation_end_date in date
308 ,p_object_version_number out nocopy number
309 );
310 --
311 -- ----------------------------------------------------------------------------
312 -- |---------------------------------< lck >----------------------------------|
313 -- ----------------------------------------------------------------------------
314 -- {Start Of Comments}
315 --
316 -- Description:
317 -- The Lck process for datetrack is complicated and comprises of the
318 -- following processing
319 -- The processing steps are as follows:
320 -- 1) The row to be updated or deleted must be locked.
321 -- By locking this row, the g_old_rec record data type is populated.
322 -- 2) If a comment exists the text is selected from hr_comments.
323 -- 3) The datetrack mode is then validated to ensure the operation is
324 -- valid. If the mode is valid the validation start and end dates for
325 -- the mode will be derived and returned. Any required locking is
326 -- completed when the datetrack mode is validated.
327 --
328 -- Prerequisites:
329 -- When attempting to call the lck procedure the object version number,
330 -- primary key, effective date and datetrack mode must be specified.
331 --
332 -- In Parameters:
333 -- p_effective_date
334 -- Specifies the date of the datetrack update operation.
335 -- p_datetrack_mode
336 -- Determines the datetrack update or delete mode.
337 --
338 -- Post Success:
339 -- On successful completion of the Lck process the row to be updated or
340 -- deleted will be locked and selected into the global data structure
341 -- g_old_rec.
342 --
343 -- Post Failure:
344 -- The Lck process can fail for three reasons:
345 -- 1) When attempting to lock the row the row could already be locked by
346 -- another user. This will raise the HR_Api.Object_Locked exception.
347 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
348 -- This error is trapped and reported using the message name
349 -- 'HR_7220_INVALID_PRIMARY_KEY'.
350 -- 3) The row although existing in the HR Schema has a different object
351 -- version number than the object version number specified.
352 -- This error is trapped and reported using the message name
353 -- 'HR_7155_OBJECT_INVALID'.
354 --
355 -- Developer Implementation Notes:
356 -- None.
357 --
358 -- Access Status:
359 -- Internal Development Use Only.
360 --
361 -- {End Of Comments}
362 -- ----------------------------------------------------------------------------
363 Procedure lck
364 (p_effective_date in date
365 ,p_datetrack_mode in varchar2
366 ,p_run_type_id in number
367 ,p_object_version_number in number
368 ,p_validation_start_date out nocopy date
369 ,p_validation_end_date out nocopy date
370 );
371 --
372 -- ----------------------------------------------------------------------------
373 -- |-----------------------------< convert_args >-----------------------------|
374 -- ----------------------------------------------------------------------------
375 -- {Start Of Comments}
376 --
377 -- Description:
378 -- This function is used to turn attribute parameters into the record
379 -- structure parameter g_rec_type.
380 --
381 -- Prerequisites:
382 -- This is a private function and can only be called from the ins or upd
383 -- attribute processes.
384 --
385 -- In Parameters:
386 --
387 -- Post Success:
388 -- A returning record structure will be returned.
389 --
390 -- Post Failure:
391 -- No direct error handling is required within this function. Any possible
392 -- errors within this function will be a PL/SQL value error due to conversion
393 -- of datatypes or data lengths.
394 --
395 -- Developer Implementation Notes:
396 -- None.
397 --
398 -- Access Status:
399 -- Internal Row Handler Use Only.
400 --
401 -- {End Of Comments}
402 -- ----------------------------------------------------------------------------
403 Function convert_args
404 (p_run_type_id in number
405 ,p_run_type_name in varchar2
406 ,p_run_method in varchar2
407 ,p_effective_start_date in date
408 ,p_effective_end_date in date
409 ,p_business_group_id in number
410 ,p_legislation_code in varchar2
411 ,p_shortname in varchar2
412 ,p_srs_flag in varchar2
413 ,p_run_information_category in varchar2
414 ,p_run_information1 in varchar2
415 ,p_run_information2 in varchar2
416 ,p_run_information3 in varchar2
417 ,p_run_information4 in varchar2
418 ,p_run_information5 in varchar2
419 ,p_run_information6 in varchar2
420 ,p_run_information7 in varchar2
421 ,p_run_information8 in varchar2
422 ,p_run_information9 in varchar2
423 ,p_run_information10 in varchar2
424 ,p_run_information11 in varchar2
425 ,p_run_information12 in varchar2
426 ,p_run_information13 in varchar2
427 ,p_run_information14 in varchar2
428 ,p_run_information15 in varchar2
429 ,p_run_information16 in varchar2
430 ,p_run_information17 in varchar2
431 ,p_run_information18 in varchar2
432 ,p_run_information19 in varchar2
433 ,p_run_information20 in varchar2
434 ,p_run_information21 in varchar2
435 ,p_run_information22 in varchar2
436 ,p_run_information23 in varchar2
437 ,p_run_information24 in varchar2
438 ,p_run_information25 in varchar2
439 ,p_run_information26 in varchar2
440 ,p_run_information27 in varchar2
441 ,p_run_information28 in varchar2
442 ,p_run_information29 in varchar2
443 ,p_run_information30 in varchar2
444 ,p_object_version_number in number
445 )
446 Return g_rec_type;
447 --
448 end pay_prt_shd;