DBA Data[Home] [Help]

PACKAGE: APPS.BEN_JRT_SHD

Source


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