DBA Data[Home] [Help]

PACKAGE: APPS.BEN_ESH_SHD

Source


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