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