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