DBA Data[Home] [Help]

PACKAGE: APPS.BEN_VEP_SHD

Source


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