1 Package per_abs_shd as
2 /* $Header: peabsrhi.pkh 120.3.12010000.1 2008/07/28 04:01:13 appldev ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (absence_attendance_id number(10)
10 ,business_group_id number(15)
11 ,absence_attendance_type_id number(9)
12 ,abs_attendance_reason_id number(9)
13 ,person_id number(10)
14 ,authorising_person_id number(10)
15 ,replacement_person_id number(10)
16 ,period_of_incapacity_id number(9)
17 ,absence_days number(9,4) -- Increased length
18 ,absence_hours number(9,4) -- Increased length
19 --start code changes for bug 5987410
20 --,comments varchar2(2000) -- pseudo column
21 ,comments long -- pseudo column
22 --end code changes for bug 5987410
23 ,date_end date
24 ,date_notification date
25 ,date_projected_end date
26 ,date_projected_start date
27 ,date_start date
28 ,occurrence number(15)
29 ,ssp1_issued varchar2(30)
30 ,time_end varchar2(9) -- Increased length
31 ,time_projected_end varchar2(9) -- Increased length
32 ,time_projected_start varchar2(9) -- Increased length
33 ,time_start varchar2(9) -- Increased length
34 ,request_id number(15)
35 ,program_application_id number(15)
36 ,program_id number(15)
37 ,program_update_date date
38 ,attribute_category varchar2(30)
39 ,attribute1 varchar2(150)
40 ,attribute2 varchar2(150)
41 ,attribute3 varchar2(150)
42 ,attribute4 varchar2(150)
43 ,attribute5 varchar2(150)
44 ,attribute6 varchar2(150)
45 ,attribute7 varchar2(150)
46 ,attribute8 varchar2(150)
47 ,attribute9 varchar2(150)
48 ,attribute10 varchar2(150)
49 ,attribute11 varchar2(150)
50 ,attribute12 varchar2(150)
51 ,attribute13 varchar2(150)
52 ,attribute14 varchar2(150)
53 ,attribute15 varchar2(150)
54 ,attribute16 varchar2(150)
55 ,attribute17 varchar2(150)
56 ,attribute18 varchar2(150)
57 ,attribute19 varchar2(150)
58 ,attribute20 varchar2(150)
59 ,maternity_id number
60 ,sickness_start_date date
61 ,sickness_end_date date
62 ,pregnancy_related_illness varchar2(30)
63 ,reason_for_notification_delay varchar2(2000)
64 ,accept_late_notification_flag varchar2(30)
65 ,linked_absence_id number
66 ,abs_information_category varchar2(30)
67 ,abs_information1 varchar2(150)
68 ,abs_information2 varchar2(150)
69 ,abs_information3 varchar2(150)
70 ,abs_information4 varchar2(150)
71 ,abs_information5 varchar2(150)
72 ,abs_information6 varchar2(150)
73 ,abs_information7 varchar2(150)
74 ,abs_information8 varchar2(150)
75 ,abs_information9 varchar2(150)
76 ,abs_information10 varchar2(150)
77 ,abs_information11 varchar2(150)
78 ,abs_information12 varchar2(150)
79 ,abs_information13 varchar2(150)
80 ,abs_information14 varchar2(150)
81 ,abs_information15 varchar2(150)
82 ,abs_information16 varchar2(150)
83 ,abs_information17 varchar2(150)
84 ,abs_information18 varchar2(150)
85 ,abs_information19 varchar2(150)
86 ,abs_information20 varchar2(150)
87 ,abs_information21 varchar2(150)
88 ,abs_information22 varchar2(150)
89 ,abs_information23 varchar2(150)
90 ,abs_information24 varchar2(150)
91 ,abs_information25 varchar2(150)
92 ,abs_information26 varchar2(150)
93 ,abs_information27 varchar2(150)
94 ,abs_information28 varchar2(150)
95 ,abs_information29 varchar2(150)
96 ,abs_information30 varchar2(150)
97 ,absence_case_id number(10)
98 ,batch_id number(9)
99 ,object_version_number number(9)
100 );
101 --
102 -- ----------------------------------------------------------------------------
103 -- | Global Definitions - Internal Development Use Only |
104 -- ----------------------------------------------------------------------------
105 --
106 g_old_rec g_rec_type; -- Global record definition
107 g_api_dml boolean; -- Global api dml status
108 g_absence_days number;
109 g_absence_hours number;
110
111 --
112 -- ----------------------------------------------------------------------------
113 -- |------------------------< return_api_dml_status >-------------------------|
114 -- ----------------------------------------------------------------------------
115 -- {Start Of Comments}
116 --
117 -- Description:
118 -- This function will return the current g_api_dml private global
119 -- boolean status.
120 -- The g_api_dml status determines if at the time of the function
121 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
122 -- is being issued from within an api.
123 -- If the status is TRUE then a dml statement is being issued from
124 -- within this entity api.
125 -- This function is primarily to support database triggers which
126 -- need to maintain the object_version_number for non-supported
127 -- dml statements (i.e. dml statement issued outside of the api layer).
128 --
129 -- Prerequisites:
130 -- None.
131 --
132 -- In Parameters:
133 -- None.
134 --
135 -- Post Success:
136 -- Processing continues.
137 -- If the function returns a TRUE value then, dml is being executed from
138 -- within this api.
139 --
140 -- Post Failure:
141 -- None.
142 --
143 -- Access Status:
144 -- Internal Row Handler Use Only.
145 --
146 -- {End Of Comments}
147 -- ----------------------------------------------------------------------------
148 Function return_api_dml_status Return Boolean;
149 --
150 -- ----------------------------------------------------------------------------
151 -- |---------------------------< constraint_error >---------------------------|
152 -- ----------------------------------------------------------------------------
153 -- {Start Of Comments}
154 --
155 -- Description:
156 -- This procedure is called when a constraint has been violated (i.e.
157 -- The exception hr_api.check_integrity_violated,
158 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
159 -- hr_api.unique_integrity_violated has been raised).
160 -- The exceptions can only be raised as follows:
161 -- 1) A check constraint can only be violated during an INSERT or UPDATE
162 -- dml operation.
163 -- 2) A parent integrity constraint can only be violated during an
164 -- INSERT or UPDATE dml operation.
165 -- 3) A child integrity constraint can only be violated during an
166 -- DELETE dml operation.
167 -- 4) A unique integrity constraint can only be violated during INSERT or
168 -- UPDATE dml operation.
169 --
170 -- Prerequisites:
171 -- 1) Either hr_api.check_integrity_violated,
172 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
173 -- hr_api.unique_integrity_violated has been raised with the subsequent
174 -- stripping of the constraint name from the generated error message
175 -- text.
176 -- 2) Standalone validation test which corresponds with a constraint error.
177 --
178 -- In Parameter:
179 -- p_constraint_name is in upper format and is just the constraint name
180 -- (e.g. not prefixed by brackets, schema owner etc).
181 --
182 -- Post Success:
183 -- Development dependant.
184 --
185 -- Post Failure:
186 -- Developement dependant.
187 --
188 -- Developer Implementation Notes:
189 -- For each constraint being checked the hr system package failure message
190 -- has been generated as a template only. These system error messages should
191 -- be modified as required (i.e. change the system failure message to a user
192 -- friendly defined error message).
193 --
194 -- Access Status:
195 -- Internal Development Use Only.
196 --
197 -- {End Of Comments}
198 -- ----------------------------------------------------------------------------
199 Procedure constraint_error
200 (p_constraint_name in all_constraints.constraint_name%TYPE);
201 --
202 -- ----------------------------------------------------------------------------
203 -- |-----------------------------< api_updating >-----------------------------|
204 -- ----------------------------------------------------------------------------
205 -- {Start Of Comments}
206 --
207 -- Description:
208 -- This function is used to populate the g_old_rec record with the
209 -- current row from the database for the specified primary key
210 -- provided that the primary key exists and is valid and does not
211 -- already match the current g_old_rec. The function will always return
212 -- a TRUE value if the g_old_rec is populated with the current row.
213 -- A FALSE value will be returned if all of the primary key arguments
214 -- are null.
215 --
216 -- Prerequisites:
217 -- None.
218 --
219 -- In Parameters:
220 --
221 -- Post Success:
222 -- A value of TRUE will be returned indiciating that the g_old_rec
223 -- is current.
224 -- A value of FALSE will be returned if all of the primary key arguments
225 -- have a null value (this indicates that the row has not be inserted into
226 -- the Schema), and therefore could never have a corresponding row.
227 --
228 -- Post Failure:
229 -- A failure can only occur under two circumstances:
230 -- 1) The primary key is invalid (i.e. a row does not exist for the
231 -- specified primary key values).
232 -- 2) If an object_version_number exists but is NOT the same as the current
233 -- g_old_rec value.
234 --
235 -- Developer Implementation Notes:
236 -- None.
237 --
238 -- Access Status:
239 -- Internal Development Use Only.
240 --
241 -- {End Of Comments}
242 -- ----------------------------------------------------------------------------
243 Function api_updating
244 (p_absence_attendance_id in number
245 ,p_object_version_number in number
246 ) Return Boolean;
247 --
248 -- ----------------------------------------------------------------------------
249 -- |---------------------------------< lck >----------------------------------|
250 -- ----------------------------------------------------------------------------
251 -- {Start of comments}
252 --
253 -- Description:
254 -- The Lck process has two main functions to perform. Firstly, the row to be
255 -- updated or deleted must be locked. The locking of the row will only be
256 -- successful if the row is not currently locked by another user.
257 -- Secondly, during the locking of the row, the row is selected into
258 -- the g_old_rec data structure which enables the current row values from the
259 -- server to be available to the api.
260 --
261 -- Prerequisites:
262 -- When attempting to call the lock the object version number (if defined)
263 -- is mandatory.
264 --
265 -- In Parameters:
266 -- The arguments to the Lck process are the primary key(s) which uniquely
267 -- identify the row and the object version number of row.
268 --
269 -- Post Success:
270 -- On successful completion of the Lck process the row to be updated or
271 -- deleted will be locked and selected into the global data structure
272 -- g_old_rec.
273 --
274 -- Post Failure:
275 -- The Lck process can fail for three reasons:
276 -- 1) When attempting to lock the row the row could already be locked by
277 -- another user. This will raise the HR_Api.Object_Locked exception.
278 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
279 -- This error is trapped and reported using the message name
280 -- 'HR_7220_INVALID_PRIMARY_KEY'.
281 -- 3) The row although existing in the HR Schema has a different object
282 -- version number than the object version number specified.
283 -- This error is trapped and reported using the message name
284 -- 'HR_7155_OBJECT_INVALID'.
285 --
286 -- Developer Implementation Notes:
287 -- For each primary key and the object version number arguments add a
288 -- call to hr_api.mandatory_arg_error procedure to ensure that these
289 -- argument values are not null.
290 --
291 -- Access Status:
292 -- Internal Development Use Only.
293 --
294 -- {End of comments}
295 -- ----------------------------------------------------------------------------
296 Procedure lck
297 (p_absence_attendance_id in number
298 ,p_object_version_number in number
299 );
300 --
301 -- ----------------------------------------------------------------------------
302 -- |-----------------------------< convert_args >-----------------------------|
303 -- ----------------------------------------------------------------------------
304 -- {Start Of Comments}
305 --
306 -- Description:
307 -- This function is used to turn attribute parameters into the record
308 -- structure parameter g_rec_type.
309 --
310 -- Prerequisites:
311 -- This is a private function and can only be called from the ins or upd
312 -- attribute processes.
313 --
317 -- A returning record structure will be returned.
314 -- In Parameters:
315 --
316 -- Post Success:
318 --
319 -- Post Failure:
320 -- No direct error handling is required within this function. Any possible
321 -- errors within this function will be a PL/SQL value error due to conversion
322 -- of datatypes or data lengths.
323 --
324 -- Developer Implementation Notes:
325 -- None.
326 --
327 -- Access Status:
328 -- Internal Row Handler Use Only.
329 --
330 -- {End Of Comments}
331 -- ----------------------------------------------------------------------------
332 Function convert_args
333 (p_absence_attendance_id in number
334 ,p_business_group_id in number
335 ,p_absence_attendance_type_id in number
336 ,p_abs_attendance_reason_id in number
337 ,p_person_id in number
338 ,p_authorising_person_id in number
339 ,p_replacement_person_id in number
340 ,p_period_of_incapacity_id in number
341 ,p_absence_days in number
342 ,p_absence_hours in number
343 --start changes for bug 5987410
344 --,p_comments in varchar2
345 ,p_comments in long
346 --end changes for bug 5987410
347 ,p_date_end in date
348 ,p_date_notification in date
349 ,p_date_projected_end in date
350 ,p_date_projected_start in date
351 ,p_date_start in date
352 ,p_occurrence in number
353 ,p_ssp1_issued in varchar2
354 ,p_time_end in varchar2
355 ,p_time_projected_end in varchar2
356 ,p_time_projected_start in varchar2
357 ,p_time_start in varchar2
358 ,p_request_id in number
359 ,p_program_application_id in number
360 ,p_program_id in number
361 ,p_program_update_date in date
362 ,p_attribute_category in varchar2
363 ,p_attribute1 in varchar2
364 ,p_attribute2 in varchar2
365 ,p_attribute3 in varchar2
366 ,p_attribute4 in varchar2
367 ,p_attribute5 in varchar2
368 ,p_attribute6 in varchar2
369 ,p_attribute7 in varchar2
370 ,p_attribute8 in varchar2
371 ,p_attribute9 in varchar2
372 ,p_attribute10 in varchar2
373 ,p_attribute11 in varchar2
374 ,p_attribute12 in varchar2
375 ,p_attribute13 in varchar2
376 ,p_attribute14 in varchar2
377 ,p_attribute15 in varchar2
378 ,p_attribute16 in varchar2
379 ,p_attribute17 in varchar2
380 ,p_attribute18 in varchar2
381 ,p_attribute19 in varchar2
382 ,p_attribute20 in varchar2
383 ,p_maternity_id in number
384 ,p_sickness_start_date in date
385 ,p_sickness_end_date in date
386 ,p_pregnancy_related_illness in varchar2
387 ,p_reason_for_notification_dela in varchar2
388 ,p_accept_late_notification_fla in varchar2
389 ,p_linked_absence_id in number
390 ,p_abs_information_category in varchar2
391 ,p_abs_information1 in varchar2
392 ,p_abs_information2 in varchar2
393 ,p_abs_information3 in varchar2
394 ,p_abs_information4 in varchar2
395 ,p_abs_information5 in varchar2
396 ,p_abs_information6 in varchar2
397 ,p_abs_information7 in varchar2
398 ,p_abs_information8 in varchar2
399 ,p_abs_information9 in varchar2
400 ,p_abs_information10 in varchar2
401 ,p_abs_information11 in varchar2
402 ,p_abs_information12 in varchar2
403 ,p_abs_information13 in varchar2
404 ,p_abs_information14 in varchar2
405 ,p_abs_information15 in varchar2
406 ,p_abs_information16 in varchar2
407 ,p_abs_information17 in varchar2
408 ,p_abs_information18 in varchar2
409 ,p_abs_information19 in varchar2
410 ,p_abs_information20 in varchar2
411 ,p_abs_information21 in varchar2
412 ,p_abs_information22 in varchar2
413 ,p_abs_information23 in varchar2
414 ,p_abs_information24 in varchar2
415 ,p_abs_information25 in varchar2
416 ,p_abs_information26 in varchar2
417 ,p_abs_information27 in varchar2
418 ,p_abs_information28 in varchar2
419 ,p_abs_information29 in varchar2
420 ,p_abs_information30 in varchar2
421 ,p_absence_case_id in number
422 ,p_batch_id in number
423 ,p_object_version_number in number
424 )
425 Return g_rec_type;
426 --
427 end per_abs_shd;