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