[Home] [Help]
PACKAGE BODY: APPS.PER_OBJ_UPD
Source
1 Package Body per_obj_upd as
2 /* $Header: peobjrhi.pkb 120.16.12010000.4 2008/11/05 05:52:10 rvagvala ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_obj_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< update_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the actual dml update logic. The processing of
17 -- this procedure is:
18 -- 1) Increment the object_version_number by 1 if the object_version_number
19 -- is defined as an attribute for this entity.
20 -- 2) To update the specified row in the schema using the primary key in
21 -- the predicates.
22 -- 3) To trap any constraint violations that may have occurred.
23 -- 4) To raise any other errors.
24 --
25 -- Pre Conditions:
26 -- This is an internal private procedure which must be called from the upd
27 -- procedure.
28 --
29 -- In Parameters:
30 -- A Pl/Sql record structre.
31 --
32 -- Post Success:
33 -- The specified row will be updated in the schema.
34 --
35 -- Post Failure:
36 -- If a check, unique or parent integrity constraint violation is raised the
37 -- constraint_error procedure will be called.
38 --
39 -- Developer Implementation Notes:
40 -- The update 'set' attribute list should be modified if any of your
41 -- attributes are not updateable.
42 --
43 -- Access Status:
44 -- Internal Table Handler Use Only.
45 --
46 -- {End Of Comments}
47 -- ----------------------------------------------------------------------------
48 Procedure update_dml(p_rec in out nocopy per_obj_shd.g_rec_type) is
49 --
50 l_proc varchar2(72) := g_package||'update_dml';
51 --
52 Begin
53 hr_utility.set_location('Entering:'||l_proc, 5);
54 --
55 -- Increment the object version
56 --
57 p_rec.object_version_number := p_rec.object_version_number + 1;
58 --
59 -- Update the per_objectives Row
60 --
61 update per_objectives
62 set
63 objective_id = p_rec.objective_id,
64 name = p_rec.name,
65 target_date = p_rec.target_date,
66 start_date = p_rec.start_date,
67 object_version_number = p_rec.object_version_number,
68 achievement_date = p_rec.achievement_date,
69 detail = p_rec.detail,
70 comments = p_rec.comments,
71 success_criteria = p_rec.success_criteria,
72 attribute_category = p_rec.attribute_category,
73 attribute1 = p_rec.attribute1,
74 attribute2 = p_rec.attribute2,
75 attribute3 = p_rec.attribute3,
76 attribute4 = p_rec.attribute4,
77 attribute5 = p_rec.attribute5,
78 attribute6 = p_rec.attribute6,
79 attribute7 = p_rec.attribute7,
80 attribute8 = p_rec.attribute8,
81 attribute9 = p_rec.attribute9,
82 attribute10 = p_rec.attribute10,
83 attribute11 = p_rec.attribute11,
84 attribute12 = p_rec.attribute12,
85 attribute13 = p_rec.attribute13,
86 attribute14 = p_rec.attribute14,
87 attribute15 = p_rec.attribute15,
88 attribute16 = p_rec.attribute16,
89 attribute17 = p_rec.attribute17,
90 attribute18 = p_rec.attribute18,
91 attribute19 = p_rec.attribute19,
92 attribute20 = p_rec.attribute20,
93
94 attribute21 = p_rec.attribute21,
95 attribute22 = p_rec.attribute22,
96 attribute23 = p_rec.attribute23,
97 attribute24 = p_rec.attribute24,
98 attribute25 = p_rec.attribute25,
99 attribute26 = p_rec.attribute26,
100 attribute27 = p_rec.attribute27,
101 attribute28 = p_rec.attribute28,
102 attribute29 = p_rec.attribute29,
103 attribute30 = p_rec.attribute30,
104
105 scorecard_id = p_rec.scorecard_id,
106 copied_from_library_id = p_rec.copied_from_library_id,
107 copied_from_objective_id = p_rec.copied_from_objective_id,
108 aligned_with_objective_id = p_rec.aligned_with_objective_id,
109
110 next_review_date = p_rec.next_review_date,
111 group_code = p_rec.group_code,
112 priority_code = p_rec.priority_code,
113 appraise_flag = p_rec.appraise_flag,
114 verified_flag = p_rec.verified_flag,
115
116 target_value = p_rec.target_value,
117 actual_value = p_rec.actual_value,
118 weighting_percent = p_rec.weighting_percent,
119 complete_percent = p_rec.complete_percent,
120 uom_code = p_rec.uom_code,
121
122 measurement_style_code = p_rec.measurement_style_code,
123 measure_name = p_rec.measure_name,
124 measure_type_code = p_rec.measure_type_code,
125 measure_comments = p_rec.measure_comments,
126 sharing_access_code = p_rec.sharing_access_code,
127 appraisal_id = p_rec.appraisal_id
128
129 where objective_id = p_rec.objective_id;
130 --
131 --
132 hr_utility.set_location(' Leaving:'||l_proc, 10);
133 --
134 Exception
135 When hr_api.check_integrity_violated Then
136 -- A check constraint has been violated
137 per_obj_shd.constraint_error
138 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
139 When hr_api.parent_integrity_violated Then
140 -- Parent integrity has been violated
141 per_obj_shd.constraint_error
142 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
143 When hr_api.unique_integrity_violated Then
144 -- Unique integrity has been violated
145 per_obj_shd.constraint_error
146 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
147 When Others Then
148 Raise;
149 End update_dml;
150 --
151 -- ----------------------------------------------------------------------------
152 -- |------------------------------< pre_update >------------------------------|
153 -- ----------------------------------------------------------------------------
154 -- {Start Of Comments}
155 --
156 -- Description:
157 -- This private procedure contains any processing which is required before
158 -- the update dml.
159 --
160 -- Pre Conditions:
161 -- This is an internal procedure which is called from the upd procedure.
162 --
163 -- In Parameters:
164 -- A Pl/Sql record structre.
165 --
166 -- Post Success:
167 -- Processing continues.
168 --
169 -- Post Failure:
170 -- If an error has occurred, an error message and exception will be raised
171 -- but not handled.
172 --
173 -- Developer Implementation Notes:
174 -- Any pre-processing required before the update dml is issued should be
175 -- coded within this procedure. It is important to note that any 3rd party
176 -- maintenance should be reviewed before placing in this procedure.
177 --
178 -- Access Status:
179 -- Internal Table Handler Use Only.
180 --
181 -- {End Of Comments}
182 -- ----------------------------------------------------------------------------
183 Procedure pre_update(p_rec in per_obj_shd.g_rec_type) is
184 --
185 l_proc varchar2(72) := g_package||'pre_update';
186 --
187 Begin
188 hr_utility.set_location('Entering:'||l_proc, 5);
189 --
190 hr_utility.set_location(' Leaving:'||l_proc, 10);
191 End pre_update;
192 --
193 -- ----------------------------------------------------------------------------
194 -- |-----------------------------< post_update >------------------------------|
195 -- ----------------------------------------------------------------------------
196 -- {Start Of Comments}
197 --
198 -- Description:
199 -- This private procedure contains any processing which is required after the
200 -- update dml.
201 --
202 -- Pre Conditions:
203 -- This is an internal procedure which is called from the upd procedure.
204 --
205 -- In Parameters:
206 -- A Pl/Sql record structre.
207 --
208 -- Post Success:
209 -- Processing continues.
210 --
211 -- Post Failure:
212 -- If an error has occurred, an error message and exception will be raised
213 -- but not handled.
214 --
215 -- Developer Implementation Notes:
216 -- Any post-processing required after the update dml is issued should be
217 -- coded within this procedure. It is important to note that any 3rd party
218 -- maintenance should be reviewed before placing in this procedure.
219 --
220 -- Access Status:
221 -- Internal Table Handler Use Only.
222 --
223 -- {End Of Comments}
224 -- ----------------------------------------------------------------------------
225 Procedure post_update
226 (p_rec in per_obj_shd.g_rec_type,
227 p_effective_date in date,
228 p_weighting_over_100_warning in boolean,
229 p_weighting_appraisal_warning in boolean
230 ) is
231 --
232 l_proc varchar2(72) := g_package||'post_update';
233 --
234 Begin
235 hr_utility.set_location('Entering:'||l_proc, 5);
236 --
237 -- Start of API User Hook for post_update.
238 begin
239 per_obj_rku.after_update
240 (
241 p_objective_id => p_rec.objective_id,
242 p_name => p_rec.name,
243 p_target_date => p_rec.target_date,
244 p_start_date => p_rec.start_date,
245 p_object_version_number => p_rec.object_version_number,
246 p_achievement_date => p_rec.achievement_date,
247 p_detail => p_rec.detail,
248 p_comments => p_rec.comments,
249 p_success_criteria => p_rec.success_criteria,
250 p_attribute_category => p_rec.attribute_category,
251 p_attribute1 => p_rec.attribute1,
252 p_attribute2 => p_rec.attribute2,
253 p_attribute3 => p_rec.attribute3,
254 p_attribute4 => p_rec.attribute4,
255 p_attribute5 => p_rec.attribute5,
256 p_attribute6 => p_rec.attribute6,
257 p_attribute7 => p_rec.attribute7,
258 p_attribute8 => p_rec.attribute8,
259 p_attribute9 => p_rec.attribute9,
260 p_attribute10 => p_rec.attribute10,
261 p_attribute11 => p_rec.attribute11,
262 p_attribute12 => p_rec.attribute12,
263 p_attribute13 => p_rec.attribute13,
264 p_attribute14 => p_rec.attribute14,
265 p_attribute15 => p_rec.attribute15,
266 p_attribute16 => p_rec.attribute16,
267 p_attribute17 => p_rec.attribute17,
268 p_attribute18 => p_rec.attribute18,
269 p_attribute19 => p_rec.attribute19,
270 p_attribute20 => p_rec.attribute20,
271
272 p_attribute21 => p_rec.attribute21,
273 p_attribute22 => p_rec.attribute22,
274 p_attribute23 => p_rec.attribute23,
275 p_attribute24 => p_rec.attribute24,
276 p_attribute25 => p_rec.attribute25,
277 p_attribute26 => p_rec.attribute26,
278 p_attribute27 => p_rec.attribute27,
279 p_attribute28 => p_rec.attribute28,
280 p_attribute29 => p_rec.attribute29,
281 p_attribute30 => p_rec.attribute30,
282 p_effective_date => p_effective_date,
283
284 p_scorecard_id => p_rec.scorecard_id,
285 p_copied_from_library_id => p_rec.copied_from_library_id,
286 p_copied_from_objective_id => p_rec.copied_from_objective_id,
287 p_aligned_with_objective_id => p_rec.aligned_with_objective_id,
288
289 p_next_review_date => p_rec.next_review_date,
290 p_group_code => p_rec.group_code,
291 p_priority_code => p_rec.priority_code,
292 p_appraise_flag => p_rec.appraise_flag,
293 p_verified_flag => p_rec.verified_flag,
294
295 p_target_value => p_rec.target_value,
296 p_actual_value => p_rec.actual_value,
297 p_weighting_percent => p_rec.weighting_percent,
298 p_complete_percent => p_rec.complete_percent,
299 p_uom_code => p_rec.uom_code,
300
301 p_measurement_style_code => p_rec.measurement_style_code,
302 p_measure_name => p_rec.measure_name,
303 p_measure_type_code => p_rec.measure_type_code,
304 p_measure_comments => p_rec.measure_comments ,
305 p_sharing_access_code => p_rec.sharing_access_code,
306
307 p_weighting_over_100_warning => p_weighting_over_100_warning,
308 p_weighting_appraisal_warning => p_weighting_appraisal_warning,
309
310 p_name_o => per_obj_shd.g_old_rec.name,
311 p_target_date_o => per_obj_shd.g_old_rec.target_date,
312 p_start_date_o => per_obj_shd.g_old_rec.start_date,
313 p_business_group_id_o => per_obj_shd.g_old_rec.business_group_id,
314 p_object_version_number_o => per_obj_shd.g_old_rec.object_version_number,
315 p_owning_person_id_o => per_obj_shd.g_old_rec.owning_person_id,
316 p_achievement_date_o => per_obj_shd.g_old_rec.achievement_date,
317 p_detail_o => per_obj_shd.g_old_rec.detail,
318 p_comments_o => per_obj_shd.g_old_rec.comments,
319 p_success_criteria_o => per_obj_shd.g_old_rec.success_criteria,
320 p_appraisal_id_o => per_obj_shd.g_old_rec.appraisal_id,
321 p_attribute_category_o => per_obj_shd.g_old_rec.attribute_category,
322 p_attribute1_o => per_obj_shd.g_old_rec.attribute1,
323 p_attribute2_o => per_obj_shd.g_old_rec.attribute2,
324 p_attribute3_o => per_obj_shd.g_old_rec.attribute3,
325 p_attribute4_o => per_obj_shd.g_old_rec.attribute4,
326 p_attribute5_o => per_obj_shd.g_old_rec.attribute5,
327 p_attribute6_o => per_obj_shd.g_old_rec.attribute6,
328 p_attribute7_o => per_obj_shd.g_old_rec.attribute7,
329 p_attribute8_o => per_obj_shd.g_old_rec.attribute8,
330 p_attribute9_o => per_obj_shd.g_old_rec.attribute9,
331 p_attribute10_o => per_obj_shd.g_old_rec.attribute10,
332 p_attribute11_o => per_obj_shd.g_old_rec.attribute11,
333 p_attribute12_o => per_obj_shd.g_old_rec.attribute12,
334 p_attribute13_o => per_obj_shd.g_old_rec.attribute13,
335 p_attribute14_o => per_obj_shd.g_old_rec.attribute14,
336 p_attribute15_o => per_obj_shd.g_old_rec.attribute15,
337 p_attribute16_o => per_obj_shd.g_old_rec.attribute16,
338 p_attribute17_o => per_obj_shd.g_old_rec.attribute17,
339 p_attribute18_o => per_obj_shd.g_old_rec.attribute18,
340 p_attribute19_o => per_obj_shd.g_old_rec.attribute19,
341 p_attribute20_o => per_obj_shd.g_old_rec.attribute20,
342
343 p_attribute21_o => per_obj_shd.g_old_rec.attribute21,
344 p_attribute22_o => per_obj_shd.g_old_rec.attribute22,
345 p_attribute23_o => per_obj_shd.g_old_rec.attribute23,
346 p_attribute24_o => per_obj_shd.g_old_rec.attribute24,
347 p_attribute25_o => per_obj_shd.g_old_rec.attribute25,
348 p_attribute26_o => per_obj_shd.g_old_rec.attribute26,
349 p_attribute27_o => per_obj_shd.g_old_rec.attribute27,
350 p_attribute28_o => per_obj_shd.g_old_rec.attribute28,
351 p_attribute29_o => per_obj_shd.g_old_rec.attribute29,
352 p_attribute30_o => per_obj_shd.g_old_rec.attribute30,
353
354
355 p_scorecard_id_o => per_obj_shd.g_old_rec.scorecard_id,
356 p_copied_from_library_id_o => per_obj_shd.g_old_rec.copied_from_library_id,
357 p_copied_from_objective_id_o => per_obj_shd.g_old_rec.copied_from_objective_id,
358 p_aligned_with_objective_id_o => per_obj_shd.g_old_rec.aligned_with_objective_id,
359
360 p_next_review_date_o => per_obj_shd.g_old_rec.next_review_date,
361 p_group_code_o => per_obj_shd.g_old_rec.group_code,
362 p_priority_code_o => per_obj_shd.g_old_rec.priority_code,
363 p_appraise_flag_o => per_obj_shd.g_old_rec.appraise_flag,
364 p_verified_flag_o => per_obj_shd.g_old_rec.verified_flag,
365
366 p_target_value_o => per_obj_shd.g_old_rec.target_value,
367 p_actual_value_o => per_obj_shd.g_old_rec.actual_value,
368 p_weighting_percent_o => per_obj_shd.g_old_rec.weighting_percent,
369 p_complete_percent_o => per_obj_shd.g_old_rec.complete_percent,
370 p_uom_code_o => per_obj_shd.g_old_rec.uom_code,
371
372 p_measurement_style_code_o => per_obj_shd.g_old_rec.measurement_style_code,
373 p_measure_name_o => per_obj_shd.g_old_rec.measure_name,
374 p_measure_type_code_o => per_obj_shd.g_old_rec.measure_type_code,
375 p_measure_comments_o => per_obj_shd.g_old_rec.measure_comments ,
376 p_sharing_access_code_o => per_obj_shd.g_old_rec.sharing_access_code
377
378 );
379 exception
380 when hr_api.cannot_find_prog_unit then
381 hr_api.cannot_find_prog_unit_error
382 (p_module_name => 'PER_OBJECTIVES'
383 ,p_hook_type => 'AU'
384 );
385 end;
386 -- End of API User Hook for post_update.
387 --
388 hr_utility.set_location(' Leaving:'||l_proc, 10);
389 End post_update;
390 --
391 -- ----------------------------------------------------------------------------
392 -- |-----------------------------< convert_defs >-----------------------------|
393 -- ----------------------------------------------------------------------------
394 -- {Start Of Comments}
395 --
396 -- Description:
397 -- The Convert_Defs procedure has one very important function:
398 -- It must return the record structure for the row with all system defaulted
399 -- values converted into its corresponding parameter value for update. When
400 -- we attempt to update a row through the Upd process , certain
401 -- parameters can be defaulted which enables flexibility in the calling of
402 -- the upd process (e.g. only attributes which need to be updated need to be
403 -- specified). For the upd process to determine which attributes
404 -- have NOT been specified we need to check if the parameter has a reserved
405 -- system default value. Therefore, for all parameters which have a
406 -- corresponding reserved system default mechanism specified we need to
407 -- check if a system default is being used. If a system default is being
408 -- used then we convert the defaulted value into its corresponding attribute
409 -- value held in the g_old_rec data structure.
410 --
411 -- Pre Conditions:
412 -- This private function can only be called from the upd process.
413 --
414 -- In Parameters:
415 -- A Pl/Sql record structre.
416 --
417 -- Post Success:
418 -- The record structure will be returned with all system defaulted parameter
419 -- values converted into its current row attribute value.
420 --
421 -- Post Failure:
422 -- No direct error handling is required within this function. Any possible
423 -- errors within this procedure will be a PL/SQL value error due to conversion
424
425 -- of datatypes or data lengths.
426 --
427 -- Developer Implementation Notes:
428 -- None.
429 --
430 -- Access Status:
431 -- Internal Table Handler Use Only.
432 --
433 -- {End Of Comments}
434 -- ----------------------------------------------------------------------------
435 Procedure convert_defs(p_rec in out nocopy per_obj_shd.g_rec_type) is
436 --
437 l_proc varchar2(72) := g_package||'convert_defs';
438 --
439 Begin
440 --
441 hr_utility.set_location('Entering:'||l_proc, 5);
442 --
443 -- We must now examine each argument value in the
444 -- p_rec plsql record structure
445 -- to see if a system default is being used. If a system default
446 -- is being used then we must set to the 'current' argument value.
447 --
448 If (p_rec.name = hr_api.g_varchar2) then
449 p_rec.name :=
450 per_obj_shd.g_old_rec.name;
451 End If;
452 If (p_rec.target_date = hr_api.g_date) then
453 p_rec.target_date :=
454 per_obj_shd.g_old_rec.target_date;
455 End If;
456 If (p_rec.start_date = hr_api.g_date) then
457 p_rec.start_date :=
458 per_obj_shd.g_old_rec.start_date;
459 End If;
460 If (p_rec.business_group_id = hr_api.g_number) then
461 p_rec.business_group_id :=
462 per_obj_shd.g_old_rec.business_group_id;
463 End If;
464 If (p_rec.owning_person_id = hr_api.g_number) then
465 p_rec.owning_person_id :=
466 per_obj_shd.g_old_rec.owning_person_id;
467 End If;
468 If (p_rec.achievement_date = hr_api.g_date) then
469 p_rec.achievement_date :=
470 per_obj_shd.g_old_rec.achievement_date;
471 End If;
472 If (p_rec.detail = hr_api.g_varchar2) then
473 p_rec.detail :=
474 per_obj_shd.g_old_rec.detail;
475 End If;
476 If (p_rec.comments = hr_api.g_varchar2) then
477 p_rec.comments :=
478 per_obj_shd.g_old_rec.comments;
479 End If;
480 If (p_rec.success_criteria = hr_api.g_varchar2) then
481 p_rec.success_criteria :=
482 per_obj_shd.g_old_rec.success_criteria;
483 End If;
484 If (p_rec.appraisal_id = hr_api.g_number) then
485 p_rec.appraisal_id :=
486 per_obj_shd.g_old_rec.appraisal_id;
487 End If;
488 If (p_rec.attribute_category = hr_api.g_varchar2) then
489 p_rec.attribute_category :=
490 per_obj_shd.g_old_rec.attribute_category;
491 End If;
492 If (p_rec.attribute1 = hr_api.g_varchar2) then
493 p_rec.attribute1 :=
494 per_obj_shd.g_old_rec.attribute1;
495 End If;
496 If (p_rec.attribute2 = hr_api.g_varchar2) then
497 p_rec.attribute2 :=
498 per_obj_shd.g_old_rec.attribute2;
499 End If;
500 If (p_rec.attribute3 = hr_api.g_varchar2) then
501 p_rec.attribute3 :=
502 per_obj_shd.g_old_rec.attribute3;
503 End If;
504 If (p_rec.attribute4 = hr_api.g_varchar2) then
505 p_rec.attribute4 :=
506 per_obj_shd.g_old_rec.attribute4;
507 End If;
508 If (p_rec.attribute5 = hr_api.g_varchar2) then
509 p_rec.attribute5 :=
510 per_obj_shd.g_old_rec.attribute5;
511 End If;
512 If (p_rec.attribute6 = hr_api.g_varchar2) then
513 p_rec.attribute6 :=
514 per_obj_shd.g_old_rec.attribute6;
515 End If;
516 If (p_rec.attribute7 = hr_api.g_varchar2) then
517 p_rec.attribute7 :=
518 per_obj_shd.g_old_rec.attribute7;
519 End If;
520 If (p_rec.attribute8 = hr_api.g_varchar2) then
521 p_rec.attribute8 :=
522 per_obj_shd.g_old_rec.attribute8;
523 End If;
524 If (p_rec.attribute9 = hr_api.g_varchar2) then
525 p_rec.attribute9 :=
526 per_obj_shd.g_old_rec.attribute9;
527 End If;
528 If (p_rec.attribute10 = hr_api.g_varchar2) then
529 p_rec.attribute10 :=
530 per_obj_shd.g_old_rec.attribute10;
531 End If;
532 If (p_rec.attribute11 = hr_api.g_varchar2) then
533 p_rec.attribute11 :=
534 per_obj_shd.g_old_rec.attribute11;
535 End If;
536 If (p_rec.attribute12 = hr_api.g_varchar2) then
537 p_rec.attribute12 :=
538 per_obj_shd.g_old_rec.attribute12;
539 End If;
540 If (p_rec.attribute13 = hr_api.g_varchar2) then
541 p_rec.attribute13 :=
542 per_obj_shd.g_old_rec.attribute13;
543 End If;
544 If (p_rec.attribute14 = hr_api.g_varchar2) then
545 p_rec.attribute14 :=
546 per_obj_shd.g_old_rec.attribute14;
547 End If;
548 If (p_rec.attribute15 = hr_api.g_varchar2) then
549 p_rec.attribute15 :=
550 per_obj_shd.g_old_rec.attribute15;
551 End If;
552 If (p_rec.attribute16 = hr_api.g_varchar2) then
553 p_rec.attribute16 :=
554 per_obj_shd.g_old_rec.attribute16;
555 End If;
556 If (p_rec.attribute17 = hr_api.g_varchar2) then
557 p_rec.attribute17 :=
558 per_obj_shd.g_old_rec.attribute17;
559 End If;
560 If (p_rec.attribute18 = hr_api.g_varchar2) then
561 p_rec.attribute18 :=
562 per_obj_shd.g_old_rec.attribute18;
563 End If;
564 If (p_rec.attribute19 = hr_api.g_varchar2) then
565 p_rec.attribute19 :=
566 per_obj_shd.g_old_rec.attribute19;
567 End If;
568 If (p_rec.attribute20 = hr_api.g_varchar2) then
569 p_rec.attribute20 :=
570 per_obj_shd.g_old_rec.attribute20;
571 End If;
572 If (p_rec.attribute21 = hr_api.g_varchar2) then
573 p_rec.attribute21 :=
574 per_obj_shd.g_old_rec.attribute21;
575 End If;
576 If (p_rec.attribute22 = hr_api.g_varchar2) then
577 p_rec.attribute22 :=
578 per_obj_shd.g_old_rec.attribute22;
579 End If;
580 If (p_rec.attribute23 = hr_api.g_varchar2) then
581 p_rec.attribute23 :=
582 per_obj_shd.g_old_rec.attribute23;
583 End If;
584 If (p_rec.attribute24 = hr_api.g_varchar2) then
585 p_rec.attribute24 :=
586 per_obj_shd.g_old_rec.attribute24;
587 End If;
588 If (p_rec.attribute25 = hr_api.g_varchar2) then
589 p_rec.attribute25 :=
590 per_obj_shd.g_old_rec.attribute25;
591 End If;
592 If (p_rec.attribute26 = hr_api.g_varchar2) then
593 p_rec.attribute26 :=
594 per_obj_shd.g_old_rec.attribute26;
595 End If;
596 If (p_rec.attribute27 = hr_api.g_varchar2) then
597 p_rec.attribute27 :=
598 per_obj_shd.g_old_rec.attribute27;
599 End If;
600 If (p_rec.attribute28 = hr_api.g_varchar2) then
601 p_rec.attribute28 :=
602 per_obj_shd.g_old_rec.attribute28;
603 End If;
604 If (p_rec.attribute29 = hr_api.g_varchar2) then
605 p_rec.attribute29 :=
606 per_obj_shd.g_old_rec.attribute29;
607 End If;
608 If (p_rec.attribute30 = hr_api.g_varchar2) then
609 p_rec.attribute30 :=
610 per_obj_shd.g_old_rec.attribute30;
611 End If;
612
613 If (p_rec.scorecard_id = hr_api.g_number) then
614 p_rec.scorecard_id :=
615 per_obj_shd.g_old_rec.scorecard_id;
616 End If;
617 If (p_rec.copied_from_library_id = hr_api.g_number) then
618 p_rec.copied_from_library_id :=
619 per_obj_shd.g_old_rec.copied_from_library_id;
620 End If;
621 If (p_rec.copied_from_objective_id = hr_api.g_number) then
622 p_rec.copied_from_objective_id :=
623 per_obj_shd.g_old_rec.copied_from_objective_id;
624 End If;
625 If (p_rec.aligned_with_objective_id = hr_api.g_number) then
626 p_rec.aligned_with_objective_id :=
627 per_obj_shd.g_old_rec.aligned_with_objective_id;
628 End If;
629
630 If (p_rec.next_review_date = hr_api.g_date) then
631 p_rec.next_review_date :=
632 per_obj_shd.g_old_rec.next_review_date;
633 End If;
634 If (p_rec.group_code = hr_api.g_varchar2) then
635 p_rec.group_code :=
636 per_obj_shd.g_old_rec.group_code;
637 End If;
638 If (p_rec.priority_code = hr_api.g_varchar2) then
639 p_rec.priority_code :=
640 per_obj_shd.g_old_rec.priority_code;
641 End If;
642 If (p_rec.appraise_flag = hr_api.g_varchar2) then
643 p_rec.appraise_flag :=
644 per_obj_shd.g_old_rec.appraise_flag;
645 End If;
646 If (p_rec.verified_flag = hr_api.g_varchar2) then
647 p_rec.verified_flag :=
648 per_obj_shd.g_old_rec.verified_flag;
649 End If;
650
651
652 If (p_rec.target_value = hr_api.g_number) then
653 p_rec.target_value :=
654 per_obj_shd.g_old_rec.target_value;
655 End If;
656 If (p_rec.actual_value = hr_api.g_number) then
657 p_rec.actual_value :=
658 per_obj_shd.g_old_rec.actual_value;
659 End If;
660 If (p_rec.weighting_percent = hr_api.g_number) then
661 p_rec.weighting_percent :=
662 per_obj_shd.g_old_rec.weighting_percent;
663 End If;
664 If (p_rec.complete_percent = hr_api.g_number) then
665 p_rec.complete_percent :=
666 per_obj_shd.g_old_rec.complete_percent;
667 End If;
668 If (p_rec.uom_code = hr_api.g_varchar2) then
669 p_rec.uom_code :=
670 per_obj_shd.g_old_rec.uom_code;
671 End If;
672
673 If (p_rec.measurement_style_code = hr_api.g_varchar2) then
674 p_rec.measurement_style_code :=
675 per_obj_shd.g_old_rec.measurement_style_code;
676 End If;
677 If (p_rec.measure_name = hr_api.g_varchar2) then
678 p_rec.measure_name :=
679 per_obj_shd.g_old_rec.measure_name;
680 End If;
681 If (p_rec.measure_type_code = hr_api.g_varchar2) then
682 p_rec.measure_type_code :=
683 per_obj_shd.g_old_rec.measure_type_code;
684 End If;
685 If (p_rec.measure_comments = hr_api.g_varchar2) then
686 p_rec.measure_comments :=
687 per_obj_shd.g_old_rec.measure_comments;
688 End If;
689 If (p_rec.sharing_access_code = hr_api.g_varchar2) then
690 p_rec.sharing_access_code :=
691 per_obj_shd.g_old_rec.sharing_access_code;
692 End If;
693
694
695 --
696 hr_utility.set_location(' Leaving:'||l_proc, 10);
697 --
698 End convert_defs;
699 --
700 -- ----------------------------------------------------------------------------
701 -- |---------------------------------< upd >----------------------------------|
702 -- ----------------------------------------------------------------------------
703 Procedure upd
704 (
705 p_rec in out nocopy per_obj_shd.g_rec_type,
706 p_effective_date in date,
707 p_validate in boolean default false,
708 p_weighting_over_100_warning out nocopy boolean,
709 p_weighting_appraisal_warning out nocopy boolean
710 ) is
711 --
712 l_proc varchar2(72) := g_package||'upd';
713 l_effective_date date;
714 --
715 Begin
716 hr_utility.set_location('Entering:'||l_proc, 5);
717 --
718 -- Determine if the business process is to be validated.
719 --
720 If p_validate then
721 --
722 -- Issue the savepoint.
723 --
724 SAVEPOINT upd_per_obj;
725 End If;
726 --
727 -- We must lock the row which we need to update.
728 --
729 per_obj_shd.lck
730 (
731 p_rec.objective_id,
732 p_rec.object_version_number
733 );
734 --
735 -- 1. During an update system defaults are used to determine if
736 -- arguments have been defaulted or not. We must therefore
737 -- derive the full record structure values to be updated.
738 --
739 -- 2. Call the supporting update validate operations.
740 --
741 convert_defs(p_rec);
742 per_obj_bus.update_validate
743 (p_rec
744 ,p_effective_date
745 ,p_weighting_over_100_warning
746 ,p_weighting_appraisal_warning
747 );
748 --
749 hr_multi_message.end_validation_set;
750 --
751
752 --
753 -- Call the supporting pre-update operation
754 --
755 pre_update(p_rec);
756 --
757 -- Update the row.
758 --
759 update_dml(p_rec);
760 --
761 -- Call the supporting post-update operation
762 --
763 post_update(p_rec
764 ,p_effective_date
765 ,p_weighting_over_100_warning
766 ,p_weighting_appraisal_warning
767 );
768
769 --
770 hr_multi_message.end_validation_set;
771 --
772
773 --
774 -- If we are validating then raise the Validate_Enabled exception
775 --
776 If p_validate then
777 Raise HR_Api.Validate_Enabled;
778 End If;
779 --
780 hr_utility.set_location(' Leaving:'||l_proc, 10);
781 Exception
782 When HR_Api.Validate_Enabled Then
783 --
784 -- As the Validate_Enabled exception has been raised
785 -- we must rollback to the savepoint
786 --
787 ROLLBACK TO upd_per_obj;
788 End upd;
789 --
790 -- ----------------------------------------------------------------------------
791 -- |---------------------------------< upd >----------------------------------|
792 -- ----------------------------------------------------------------------------
793 Procedure upd
794 (
795 p_objective_id in number,
796 p_name in varchar2 default hr_api.g_varchar2,
797 p_target_date in date default hr_api.g_date,
798 p_start_date in date default hr_api.g_date,
799 p_object_version_number in out nocopy number,
800 p_achievement_date in date default hr_api.g_date,
801 p_detail in varchar2 default hr_api.g_varchar2,
802 p_comments in varchar2 default hr_api.g_varchar2,
803 p_success_criteria in varchar2 default hr_api.g_varchar2,
804 p_attribute_category in varchar2 default hr_api.g_varchar2,
805 p_attribute1 in varchar2 default hr_api.g_varchar2,
806 p_attribute2 in varchar2 default hr_api.g_varchar2,
807 p_attribute3 in varchar2 default hr_api.g_varchar2,
808 p_attribute4 in varchar2 default hr_api.g_varchar2,
809 p_attribute5 in varchar2 default hr_api.g_varchar2,
810 p_attribute6 in varchar2 default hr_api.g_varchar2,
811 p_attribute7 in varchar2 default hr_api.g_varchar2,
812 p_attribute8 in varchar2 default hr_api.g_varchar2,
813 p_attribute9 in varchar2 default hr_api.g_varchar2,
814 p_attribute10 in varchar2 default hr_api.g_varchar2,
815 p_attribute11 in varchar2 default hr_api.g_varchar2,
816 p_attribute12 in varchar2 default hr_api.g_varchar2,
817 p_attribute13 in varchar2 default hr_api.g_varchar2,
818 p_attribute14 in varchar2 default hr_api.g_varchar2,
819 p_attribute15 in varchar2 default hr_api.g_varchar2,
820 p_attribute16 in varchar2 default hr_api.g_varchar2,
821 p_attribute17 in varchar2 default hr_api.g_varchar2,
822 p_attribute18 in varchar2 default hr_api.g_varchar2,
823 p_attribute19 in varchar2 default hr_api.g_varchar2,
824 p_attribute20 in varchar2 default hr_api.g_varchar2,
825
826 p_attribute21 in varchar2 default hr_api.g_varchar2,
827 p_attribute22 in varchar2 default hr_api.g_varchar2,
828 p_attribute23 in varchar2 default hr_api.g_varchar2,
829 p_attribute24 in varchar2 default hr_api.g_varchar2,
830 p_attribute25 in varchar2 default hr_api.g_varchar2,
831 p_attribute26 in varchar2 default hr_api.g_varchar2,
832 p_attribute27 in varchar2 default hr_api.g_varchar2,
833 p_attribute28 in varchar2 default hr_api.g_varchar2,
834 p_attribute29 in varchar2 default hr_api.g_varchar2,
835 p_attribute30 in varchar2 default hr_api.g_varchar2,
836
837 p_scorecard_id in number default hr_api.g_number,
838 p_copied_from_library_id in number default hr_api.g_number,
839 p_copied_from_objective_id in number default hr_api.g_number,
840 p_aligned_with_objective_id in number default hr_api.g_number,
841
842 p_next_review_date in date default hr_api.g_date,
843 p_group_code in varchar2 default hr_api.g_varchar2,
844 p_priority_code in varchar2 default hr_api.g_varchar2,
845 p_appraise_flag in varchar2 default hr_api.g_varchar2,
846 p_verified_flag in varchar2 default hr_api.g_varchar2,
847
848 p_target_value in number default hr_api.g_number,
849 p_actual_value in number default hr_api.g_number,
850 p_weighting_percent in number default hr_api.g_number,
851 p_complete_percent in number default hr_api.g_number,
852 p_uom_code in varchar2 default hr_api.g_varchar2,
853
854 p_measurement_style_code in varchar2 default hr_api.g_varchar2,
855 p_measure_name in varchar2 default hr_api.g_varchar2,
856 p_measure_type_code in varchar2 default hr_api.g_varchar2,
857 p_measure_comments in varchar2 default hr_api.g_varchar2,
858 p_sharing_access_code in varchar2 default hr_api.g_varchar2,
859
860 p_weighting_over_100_warning out nocopy boolean,
861 p_weighting_appraisal_warning out nocopy boolean,
862
863 p_effective_date in date,
864 p_validate in boolean default false,
865 p_appraisal_id in number default hr_api.g_number
866 ) is
867 --
868 l_rec per_obj_shd.g_rec_type;
869 l_proc varchar2(72) := g_package||'upd';
870 l_weighting_over_100_warning boolean;
871 l_weighting_appraisal_warning boolean;
872
873 --
874 Begin
875 hr_utility.set_location('Entering:'||l_proc, 5);
876 --
877 -- Call conversion function to turn arguments into the
878 -- l_rec structure.
879 --
880 l_rec :=
881 per_obj_shd.convert_args
882 (
883 p_objective_id,
884 p_name,
885 p_target_date,
886 p_start_date,
887 hr_api.g_number,
888 p_object_version_number,
889 hr_api.g_number,
890 p_achievement_date,
891 p_detail,
892 p_comments,
893 p_success_criteria,
894 p_appraisal_id,
895 p_attribute_category,
896 p_attribute1,
897 p_attribute2,
898 p_attribute3,
899 p_attribute4,
900 p_attribute5,
901 p_attribute6,
902 p_attribute7,
903 p_attribute8,
904 p_attribute9,
905 p_attribute10,
906 p_attribute11,
907 p_attribute12,
908 p_attribute13,
909 p_attribute14,
910 p_attribute15,
911 p_attribute16,
912 p_attribute17,
913 p_attribute18,
914 p_attribute19,
915 p_attribute20,
916
917 p_attribute21,
918 p_attribute22,
919 p_attribute23,
920 p_attribute24,
921 p_attribute25,
922 p_attribute26,
923 p_attribute27,
924 p_attribute28,
925 p_attribute29,
926 p_attribute30,
927
928 p_scorecard_id,
929 p_copied_from_library_id,
930 p_copied_from_objective_id,
931 p_aligned_with_objective_id,
932
933 p_next_review_date,
934 p_group_code,
935 p_priority_code,
936 p_appraise_flag,
937 p_verified_flag,
938
939 p_target_value,
940 p_actual_value,
941 p_weighting_percent,
942 p_complete_percent,
943 p_uom_code,
944
945 p_measurement_style_code,
946 p_measure_name,
947 p_measure_type_code,
948 p_measure_comments ,
949 p_sharing_access_code
950 );
951 --
952 -- Having converted the arguments into the
953 -- plsql record structure we call the corresponding record
954 -- business process.
955 --
956 upd(l_rec
957 ,p_effective_date
958 ,p_validate
959 ,l_weighting_over_100_warning
960 ,l_weighting_appraisal_warning
961 );
962 p_object_version_number := l_rec.object_version_number;
963 p_weighting_over_100_warning := l_weighting_over_100_warning;
964 p_weighting_appraisal_warning := l_weighting_appraisal_warning;
965 --
966 hr_utility.set_location(' Leaving:'||l_proc, 10);
967 End upd;
968 --
969 end per_obj_upd;