DBA Data[Home] [Help]

PACKAGE: APPS.BEN_BEP_SHD

Source


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