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