DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_APT_UPD

Source


1 Package Body per_apt_upd as
2 /* $Header: peaptrhi.pkb 120.4.12010000.3 2008/08/06 08:57:55 ubhat ship $ */
3 
4 -- ---------------------------------------------------------------------------+
5 -- |                     Private Global Definitions                           |
6 -- ---------------------------------------------------------------------------+
7 
8 g_package  varchar2(33)	:= '  per_apt_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_apt_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_appraisal_templates Row
60 
61   update per_appraisal_templates
62   set
63   appraisal_template_id             = p_rec.appraisal_template_id,
64   object_version_number             = p_rec.object_version_number,
65   name                              = p_rec.name,
66   description                       = p_rec.description,
67   instructions                      = p_rec.instructions,
68   date_from                         = p_rec.date_from,
69   date_to                           = p_rec.date_to,
70   assessment_type_id                = p_rec.assessment_type_id,
71   rating_scale_id                   = p_rec.rating_scale_id,
72   questionnaire_template_id         = p_rec.questionnaire_template_id,
73   attribute_category                = p_rec.attribute_category,
74   attribute1                        = p_rec.attribute1,
75   attribute2                        = p_rec.attribute2,
76   attribute3                        = p_rec.attribute3,
77   attribute4                        = p_rec.attribute4,
78   attribute5                        = p_rec.attribute5,
79   attribute6                        = p_rec.attribute6,
80   attribute7                        = p_rec.attribute7,
81   attribute8                        = p_rec.attribute8,
82   attribute9                        = p_rec.attribute9,
83   attribute10                       = p_rec.attribute10,
84   attribute11                       = p_rec.attribute11,
85   attribute12                       = p_rec.attribute12,
86   attribute13                       = p_rec.attribute13,
87   attribute14                       = p_rec.attribute14,
88   attribute15                       = p_rec.attribute15,
89   attribute16                       = p_rec.attribute16,
90   attribute17                       = p_rec.attribute17,
91   attribute18                       = p_rec.attribute18,
92   attribute19                       = p_rec.attribute19,
93   attribute20                       = p_rec.attribute20,
94   objective_asmnt_type_id         = p_rec.objective_asmnt_type_id,
95   ma_quest_template_id            = p_rec.ma_quest_template_id,
96   link_appr_to_learning_path      = p_rec.link_appr_to_learning_path,
97   final_score_formula_id          = p_rec.final_score_formula_id,
98   update_personal_comp_profile    = p_rec.update_personal_comp_profile,
99   comp_profile_source_type        = p_rec.comp_profile_source_type,
100   show_competency_ratings         = p_rec.show_competency_ratings,
101   show_objective_ratings          = p_rec.show_objective_ratings,
102   show_overall_ratings            = p_rec.show_overall_ratings,
103   show_overall_comments           = p_rec.show_overall_comments,
104   provide_overall_feedback        = p_rec.provide_overall_feedback,
105   show_participant_details        = p_rec.show_participant_details,
106   allow_add_participant           = p_rec.allow_add_participant,
107   show_additional_details         = p_rec.show_additional_details,
108   show_participant_names          = p_rec.show_participant_names,
109   show_participant_ratings        = p_rec.show_participant_ratings,
110   available_flag                  = p_rec.available_flag,
111   show_questionnaire_info        = p_rec.show_questionnaire_info,
112   ma_off_template_code			     = p_rec.ma_off_template_code,
113   appraisee_off_template_code		  =	p_rec.appraisee_off_template_code,
114   other_part_off_template_code	  =	p_rec.other_part_off_template_code,
115   part_app_off_template_code	  	=	p_rec.part_app_off_template_code,
116   part_rev_off_template_code		  = p_rec.part_rev_off_template_code
117   where appraisal_template_id = p_rec.appraisal_template_id;
118 
119   hr_utility.set_location(' Leaving:'||l_proc, 10);
120 
121 Exception
122   When hr_api.check_integrity_violated Then
123     -- A check constraint has been violated
124     per_apt_shd.constraint_error
125       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
126   When hr_api.parent_integrity_violated Then
127     -- Parent integrity has been violated
128     per_apt_shd.constraint_error
129       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
130   When hr_api.unique_integrity_violated Then
131     -- Unique integrity has been violated
132     per_apt_shd.constraint_error
133       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
134   When Others Then
135     Raise;
136 End update_dml;
137 
138 -- ---------------------------------------------------------------------------+
139 -- |------------------------------< pre_update >------------------------------|
140 -- ---------------------------------------------------------------------------+
141 -- {Start Of Comments}
142 
143 -- Description:
144 --   This private procedure contains any processing which is required before
145 --   the update dml.
146 
147 -- Pre Conditions:
148 --   This is an internal procedure which is called from the upd procedure.
149 
150 -- In Parameters:
151 --   A Pl/Sql record structre.
152 
153 -- Post Success:
154 --   Processing continues.
155 
156 -- Post Failure:
157 --   If an error has occurred, an error message and exception will be raised
158 --   but not handled.
159 
160 -- Developer Implementation Notes:
161 --   Any pre-processing required before the update dml is issued should be
162 --   coded within this procedure. It is important to note that any 3rd party
163 --   maintenance should be reviewed before placing in this procedure.
164 
165 -- Access Status:
166 --   Internal Table Handler Use Only.
167 
168 -- {End Of Comments}
169 -- ---------------------------------------------------------------------------+
170 Procedure pre_update(p_rec in per_apt_shd.g_rec_type) is
171 
172   l_proc  varchar2(72) := g_package||'pre_update';
173 
174 Begin
175   hr_utility.set_location('Entering:'||l_proc, 5);
176 
177   hr_utility.set_location(' Leaving:'||l_proc, 10);
178 End pre_update;
179 
180 -- ---------------------------------------------------------------------------+
181 -- |-----------------------------< post_update >------------------------------|
182 -- ---------------------------------------------------------------------------+
183 -- {Start Of Comments}
184 
185 -- Description:
186 --   This private procedure contains any processing which is required after the
187 --   update dml.
188 
189 -- Pre Conditions:
190 --   This is an internal procedure which is called from the upd procedure.
191 
192 -- In Parameters:
193 --   A Pl/Sql record structre.
194 
195 -- Post Success:
196 --   Processing continues.
197 
198 -- Post Failure:
199 --   If an error has occurred, an error message and exception will be raised
200 --   but not handled.
201 
202 -- Developer Implementation Notes:
203 --   Any post-processing required after the update dml is issued should be
204 --   coded within this procedure. It is important to note that any 3rd party
205 --   maintenance should be reviewed before placing in this procedure.
206 
207 -- Access Status:
208 --   Internal Table Handler Use Only.
209 
210 -- {End Of Comments}
211 -- ---------------------------------------------------------------------------+
212 Procedure post_update(p_rec in per_apt_shd.g_rec_type) is
213 
214   l_proc  varchar2(72) := g_package||'post_update';
215 
216 Begin
217   hr_utility.set_location('Entering:'||l_proc, 5);
218 
219   -- This is a hook point and the user hook for post_update is called here.
220 
221   begin
222      per_apt_rku.after_update	(
223        p_appraisal_template_id        => p_rec.appraisal_template_id  ,
224        p_business_group_id            => p_rec.business_group_id      ,
225        p_object_version_number        => p_rec.object_version_number  ,
226        p_name                         => p_rec.name                   ,
227        p_description                  => p_rec.description            ,
228        p_instructions                 => p_rec.instructions           ,
229        p_date_from                    => p_rec.date_from              ,
230        p_date_to                      => p_rec.date_to                ,
231        p_assessment_type_id           => p_rec.assessment_type_id        ,
232        p_rating_scale_id              => p_rec.rating_scale_id           ,
233        p_questionnaire_template_id    => p_rec.questionnaire_template_id ,
234        p_attribute_category           => p_rec.attribute_category        ,
235        p_attribute1                   => p_rec.attribute1   ,
236        p_attribute2                   => p_rec.attribute2   ,
237        p_attribute3                   => p_rec.attribute3   ,
238        p_attribute4                   => p_rec.attribute4   ,
239        p_attribute5                   => p_rec.attribute5   ,
240        p_attribute6                   => p_rec.attribute6   ,
241        p_attribute7                   => p_rec.attribute7   ,
242        p_attribute8                   => p_rec.attribute8   ,
243        p_attribute9                   => p_rec.attribute9   ,
244        p_attribute10                  => p_rec.attribute10  ,
245        p_attribute11                  => p_rec.attribute11  ,
246        p_attribute12                  => p_rec.attribute12  ,
247        p_attribute13                  => p_rec.attribute13  ,
248        p_attribute14                  => p_rec.attribute14  ,
249        p_attribute15                  => p_rec.attribute15  ,
250        p_attribute16                  => p_rec.attribute16  ,
251        p_attribute17                  => p_rec.attribute17  ,
252        p_attribute18                  => p_rec.attribute18  ,
253        p_attribute19                  => p_rec.attribute19  ,
254        p_attribute20                  => p_rec.attribute20  ,
255        p_objective_asmnt_type_id      => p_rec.objective_asmnt_type_id,
256        p_ma_quest_template_id      => p_rec.ma_quest_template_id,
257        p_link_appr_to_learning_path      => p_rec.link_appr_to_learning_path,
258        p_final_score_formula_id      => p_rec.final_score_formula_id,
259        p_update_personal_comp_profile      => p_rec.update_personal_comp_profile,
260        p_comp_profile_source_type      => p_rec.comp_profile_source_type,
261        p_show_competency_ratings      => p_rec.show_competency_ratings,
262        p_show_objective_ratings      => p_rec.show_objective_ratings,
263        p_show_overall_ratings      => p_rec.show_overall_ratings,
264        p_show_overall_comments      => p_rec.show_overall_comments,
265        p_provide_overall_feedback      => p_rec.provide_overall_feedback,
266        p_show_participant_details      => p_rec.show_participant_details,
267        p_allow_add_participant      => p_rec.allow_add_participant,
268        p_show_additional_details      => p_rec.show_additional_details,
269        p_show_participant_names      => p_rec.show_participant_names,
270        p_show_participant_ratings      => p_rec.show_participant_ratings,
271        p_available_flag      => p_rec.available_flag,
272        p_show_questionnaire_info      => p_rec.show_questionnaire_info,
273        p_ma_off_template_code			  => p_rec.ma_off_template_code,
274        p_appraisee_off_template_code	  => p_rec.appraisee_off_template_code,
275        p_other_part_off_template_code	  => p_rec.other_part_off_template_code,
276        p_part_app_off_template_code	  => p_rec.part_app_off_template_code,
277        p_part_rev_off_template_code	  => p_rec.part_rev_off_template_code,
278        p_business_group_id_o         => per_apt_shd.g_old_rec.business_group_id     ,
279        p_object_version_number_o     => per_apt_shd.g_old_rec.object_version_number ,
280        p_name_o                      => per_apt_shd.g_old_rec.name          ,
281        p_description_o               => per_apt_shd.g_old_rec.description   ,
282        p_instructions_o              => per_apt_shd.g_old_rec.instructions  ,
283        p_date_from_o                 => per_apt_shd.g_old_rec.date_from     ,
284        p_date_to_o                   => per_apt_shd.g_old_rec.date_to       ,
285        p_assessment_type_id_o        => per_apt_shd.g_old_rec.assessment_type_id        ,
286        p_rating_scale_id_o           => per_apt_shd.g_old_rec.rating_scale_id           ,
287        p_questionnaire_template_id_o => per_apt_shd.g_old_rec.questionnaire_template_id ,
288        p_attribute_category_o        => per_apt_shd.g_old_rec.attribute_category        ,
289        p_attribute1_o                => per_apt_shd.g_old_rec.attribute1   ,
290        p_attribute2_o                => per_apt_shd.g_old_rec.attribute2   ,
291        p_attribute3_o                => per_apt_shd.g_old_rec.attribute3   ,
292        p_attribute4_o                => per_apt_shd.g_old_rec.attribute4   ,
293        p_attribute5_o                => per_apt_shd.g_old_rec.attribute5   ,
294        p_attribute6_o                => per_apt_shd.g_old_rec.attribute6   ,
295        p_attribute7_o                => per_apt_shd.g_old_rec.attribute7   ,
296        p_attribute8_o                => per_apt_shd.g_old_rec.attribute8   ,
297        p_attribute9_o                => per_apt_shd.g_old_rec.attribute9   ,
298        p_attribute10_o               => per_apt_shd.g_old_rec.attribute10   ,
299        p_attribute11_o               => per_apt_shd.g_old_rec.attribute11   ,
300        p_attribute12_o               => per_apt_shd.g_old_rec.attribute12   ,
301        p_attribute13_o               => per_apt_shd.g_old_rec.attribute13   ,
302        p_attribute14_o               => per_apt_shd.g_old_rec.attribute14   ,
303        p_attribute15_o               => per_apt_shd.g_old_rec.attribute15   ,
304        p_attribute16_o               => per_apt_shd.g_old_rec.attribute16   ,
305        p_attribute17_o               => per_apt_shd.g_old_rec.attribute17   ,
306        p_attribute18_o               => per_apt_shd.g_old_rec.attribute18   ,
307        p_attribute19_o               => per_apt_shd.g_old_rec.attribute19   ,
308        p_attribute20_o               => per_apt_shd.g_old_rec.attribute20 ,
309        p_objective_asmnt_type_id_o      => per_apt_shd.g_old_rec.objective_asmnt_type_id,
310        p_ma_quest_template_id_o      => per_apt_shd.g_old_rec.ma_quest_template_id,
311        p_link_appr_to_learning_path_o      => per_apt_shd.g_old_rec.link_appr_to_learning_path,
312        p_final_score_formula_id_o      => per_apt_shd.g_old_rec.final_score_formula_id,
313        p_update_personal_comp_profi_o      => per_apt_shd.g_old_rec.update_personal_comp_profile,
314        p_comp_profile_source_type_o      => per_apt_shd.g_old_rec.comp_profile_source_type,
315        p_show_competency_ratings_o      => per_apt_shd.g_old_rec.show_competency_ratings,
316        p_show_objective_ratings_o      => per_apt_shd.g_old_rec.show_objective_ratings,
317        p_show_overall_ratings_o      => per_apt_shd.g_old_rec.show_overall_ratings,
318        p_show_overall_comments_o      => per_apt_shd.g_old_rec.show_overall_comments,
319        p_provide_overall_feedback_o      => per_apt_shd.g_old_rec.provide_overall_feedback,
320        p_show_participant_details_o      => per_apt_shd.g_old_rec.show_participant_details,
321        p_allow_add_participant_o      => per_apt_shd.g_old_rec.allow_add_participant,
322        p_show_additional_details_o      => per_apt_shd.g_old_rec.show_additional_details,
323        p_show_participant_names_o      => per_apt_shd.g_old_rec.show_participant_names,
324        p_show_participant_ratings_o      => per_apt_shd.g_old_rec.show_participant_ratings,
325        p_available_flag_o      => per_apt_shd.g_old_rec.available_flag,
326        p_show_questionnaire_info_o => per_apt_shd.g_old_rec.show_questionnaire_info,
327        p_ma_off_template_cd_o			  => per_apt_shd.g_old_rec.ma_off_template_code,
328        p_appraisee_off_template_cd_o	  => per_apt_shd.g_old_rec.appraisee_off_template_code,
329        p_other_part_off_template_cd_o	  => per_apt_shd.g_old_rec.other_part_off_template_code,
330        p_part_app_off_template_cd_o	  	  => per_apt_shd.g_old_rec.part_app_off_template_code,
331        p_part_rev_off_template_cd_o	  	  => per_apt_shd.g_old_rec.part_rev_off_template_code
332        );
333 
334      exception
335         when hr_api.cannot_find_prog_unit then
336              hr_api.cannot_find_prog_unit_error
337 		 (	p_module_name => 'PER_APPRAISAL_TEMPLATES'
338 		 	,p_hook_type  => 'AU'
339 	        );
340   end;
341   -- End of API User Hook for post_update
342 
343   hr_utility.set_location(' Leaving:'||l_proc, 10);
344 End post_update;
345 
346 -- ---------------------------------------------------------------------------+
347 -- |-----------------------------< convert_defs >-----------------------------|
348 -- ---------------------------------------------------------------------------+
349 -- {Start Of Comments}
350 
351 -- Description:
352 --   The Convert_Defs procedure has one very important function:
353 --   It must return the record structure for the row with all system defaulted
354 --   values converted into its corresponding parameter value for update. When
355 --   we attempt to update a row through the Upd process , certain
356 --   parameters can be defaulted which enables flexibility in the calling of
357 --   the upd process (e.g. only attributes which need to be updated need to be
358 --   specified). For the upd process to determine which attributes
359 --   have NOT been specified we need to check if the parameter has a reserved
360 --   system default value. Therefore, for all parameters which have a
361 --   corresponding reserved system default mechanism specified we need to
362 --   check if a system default is being used. If a system default is being
363 --   used then we convert the defaulted value into its corresponding attribute
364 --   value held in the g_old_rec data structure.
365 
366 -- Pre Conditions:
367 --   This private function can only be called from the upd process.
368 
369 -- In Parameters:
370 --   A Pl/Sql record structre.
371 
372 -- Post Success:
373 --   The record structure will be returned with all system defaulted parameter
374 --   values converted into its current row attribute value.
375 
376 -- Post Failure:
377 --   No direct error handling is required within this function. Any possible
378 --   errors within this procedure will be a PL/SQL value error due to conversion
379 
380 --   of datatypes or data lengths.
381 
382 -- Developer Implementation Notes:
383 --   None.
384 
385 -- Access Status:
386 --   Internal Table Handler Use Only.
387 
388 -- {End Of Comments}
389 -- ---------------------------------------------------------------------------+
390 Procedure convert_defs(p_rec in out nocopy per_apt_shd.g_rec_type) is
391 
392   l_proc  varchar2(72) := g_package||'convert_defs';
393 
394 Begin
395 
396   hr_utility.set_location('Entering:'||l_proc, 5);
397 
398   -- We must now examine each argument value in the
399   -- p_rec plsql record structure
400   -- to see if a system default is being used. If a system default
401   -- is being used then we must set to the 'current' argument value.
402 
403   If (p_rec.business_group_id = hr_api.g_number) then
404     p_rec.business_group_id :=
405     per_apt_shd.g_old_rec.business_group_id;
406   End If;
407   If (p_rec.name = hr_api.g_varchar2) then
408     p_rec.name :=
409     per_apt_shd.g_old_rec.name;
410   End If;
411   If (p_rec.description = hr_api.g_varchar2) then
412     p_rec.description :=
413     per_apt_shd.g_old_rec.description;
414   End If;
415   If (p_rec.instructions = hr_api.g_varchar2) then
416     p_rec.instructions :=
417     per_apt_shd.g_old_rec.instructions;
418   End If;
419   If (p_rec.date_from = hr_api.g_date) then
420     p_rec.date_from :=
421     per_apt_shd.g_old_rec.date_from;
422   End If;
423   If (p_rec.date_to = hr_api.g_date) then
424     p_rec.date_to :=
425     per_apt_shd.g_old_rec.date_to;
426   End If;
427   If (p_rec.assessment_type_id = hr_api.g_number) then
428     p_rec.assessment_type_id :=
429     per_apt_shd.g_old_rec.assessment_type_id;
430   End If;
431   If (p_rec.rating_scale_id = hr_api.g_number) then
432     p_rec.rating_scale_id :=
433     per_apt_shd.g_old_rec.rating_scale_id;
434   End If;
435   If (p_rec.questionnaire_template_id = hr_api.g_number) then
436     p_rec.questionnaire_template_id :=
437     per_apt_shd.g_old_rec.questionnaire_template_id;
438   End If;
439   If (p_rec.attribute_category = hr_api.g_varchar2) then
440     p_rec.attribute_category :=
441     per_apt_shd.g_old_rec.attribute_category;
442   End If;
443   If (p_rec.attribute1 = hr_api.g_varchar2) then
444     p_rec.attribute1 :=
445     per_apt_shd.g_old_rec.attribute1;
446   End If;
447   If (p_rec.attribute2 = hr_api.g_varchar2) then
448     p_rec.attribute2 :=
449     per_apt_shd.g_old_rec.attribute2;
450   End If;
451   If (p_rec.attribute3 = hr_api.g_varchar2) then
452     p_rec.attribute3 :=
453     per_apt_shd.g_old_rec.attribute3;
454   End If;
455   If (p_rec.attribute4 = hr_api.g_varchar2) then
456     p_rec.attribute4 :=
457     per_apt_shd.g_old_rec.attribute4;
458   End If;
459   If (p_rec.attribute5 = hr_api.g_varchar2) then
460     p_rec.attribute5 :=
461     per_apt_shd.g_old_rec.attribute5;
462   End If;
463   If (p_rec.attribute6 = hr_api.g_varchar2) then
464     p_rec.attribute6 :=
465     per_apt_shd.g_old_rec.attribute6;
466   End If;
467   If (p_rec.attribute7 = hr_api.g_varchar2) then
468     p_rec.attribute7 :=
469     per_apt_shd.g_old_rec.attribute7;
470   End If;
471   If (p_rec.attribute8 = hr_api.g_varchar2) then
472     p_rec.attribute8 :=
473     per_apt_shd.g_old_rec.attribute8;
474   End If;
475   If (p_rec.attribute9 = hr_api.g_varchar2) then
476     p_rec.attribute9 :=
477     per_apt_shd.g_old_rec.attribute9;
478   End If;
479   If (p_rec.attribute10 = hr_api.g_varchar2) then
480     p_rec.attribute10 :=
481     per_apt_shd.g_old_rec.attribute10;
482   End If;
483   If (p_rec.attribute11 = hr_api.g_varchar2) then
484     p_rec.attribute11 :=
485     per_apt_shd.g_old_rec.attribute11;
486   End If;
487   If (p_rec.attribute12 = hr_api.g_varchar2) then
488     p_rec.attribute12 :=
489     per_apt_shd.g_old_rec.attribute12;
490   End If;
491   If (p_rec.attribute13 = hr_api.g_varchar2) then
492     p_rec.attribute13 :=
493     per_apt_shd.g_old_rec.attribute13;
494   End If;
495   If (p_rec.attribute14 = hr_api.g_varchar2) then
496     p_rec.attribute14 :=
497     per_apt_shd.g_old_rec.attribute14;
498   End If;
499   If (p_rec.attribute15 = hr_api.g_varchar2) then
500     p_rec.attribute15 :=
501     per_apt_shd.g_old_rec.attribute15;
502   End If;
503   If (p_rec.attribute16 = hr_api.g_varchar2) then
504     p_rec.attribute16 :=
505     per_apt_shd.g_old_rec.attribute16;
506   End If;
507   If (p_rec.attribute17 = hr_api.g_varchar2) then
508     p_rec.attribute17 :=
509     per_apt_shd.g_old_rec.attribute17;
510   End If;
511   If (p_rec.attribute18 = hr_api.g_varchar2) then
512     p_rec.attribute18 :=
513     per_apt_shd.g_old_rec.attribute18;
514   End If;
515   If (p_rec.attribute19 = hr_api.g_varchar2) then
516     p_rec.attribute19 :=
517     per_apt_shd.g_old_rec.attribute19;
518   End If;
519   If (p_rec.attribute20 = hr_api.g_varchar2) then
520     p_rec.attribute20 :=
521     per_apt_shd.g_old_rec.attribute20;
522   End If;
523    If (p_rec.objective_asmnt_type_id = hr_api.g_number) then
524     p_rec.objective_asmnt_type_id :=
525     per_apt_shd.g_old_rec.objective_asmnt_type_id;
526   End If;
527   If (p_rec.ma_quest_template_id = hr_api.g_number) then
528     p_rec.ma_quest_template_id :=
529     per_apt_shd.g_old_rec.ma_quest_template_id;
530   End If;
531   If (p_rec.link_appr_to_learning_path = hr_api.g_varchar2) then
532     p_rec.link_appr_to_learning_path :=
533     per_apt_shd.g_old_rec.link_appr_to_learning_path;
534   End If;
535   If (p_rec.final_score_formula_id = hr_api.g_number) then
536     p_rec.final_score_formula_id :=
537     per_apt_shd.g_old_rec.final_score_formula_id;
538   End If;
539   If (p_rec.update_personal_comp_profile = hr_api.g_varchar2) then
540     p_rec.update_personal_comp_profile :=
541     per_apt_shd.g_old_rec.update_personal_comp_profile;
542   End If;
543   If (p_rec.comp_profile_source_type = hr_api.g_varchar2) then
544     p_rec.comp_profile_source_type :=
545     per_apt_shd.g_old_rec.comp_profile_source_type;
546   End If;
547   If (p_rec.show_competency_ratings = hr_api.g_varchar2) then
548     p_rec.show_competency_ratings :=
549     per_apt_shd.g_old_rec.show_competency_ratings;
550   End If;
551   If (p_rec.show_objective_ratings = hr_api.g_varchar2) then
552     p_rec.show_objective_ratings :=
553     per_apt_shd.g_old_rec.show_objective_ratings;
554   End If;
555   If (p_rec.show_overall_ratings = hr_api.g_varchar2) then
556     p_rec.show_overall_ratings :=
557     per_apt_shd.g_old_rec.show_overall_ratings;
558   End If;
559   If (p_rec.show_overall_comments = hr_api.g_varchar2) then
560     p_rec.show_overall_comments :=
561     per_apt_shd.g_old_rec.show_overall_comments;
562   End If;
563   If (p_rec.provide_overall_feedback = hr_api.g_varchar2) then
564     p_rec.provide_overall_feedback :=
565     per_apt_shd.g_old_rec.provide_overall_feedback;
566   End If;
567   If (p_rec.show_participant_details = hr_api.g_varchar2) then
568     p_rec.show_participant_details :=
569     per_apt_shd.g_old_rec.show_participant_details;
570   End If;
571   If (p_rec.allow_add_participant = hr_api.g_varchar2) then
572     p_rec.allow_add_participant :=
573     per_apt_shd.g_old_rec.allow_add_participant;
574   End If;
575   If (p_rec.show_additional_details = hr_api.g_varchar2) then
576     p_rec.show_additional_details :=
577     per_apt_shd.g_old_rec.show_additional_details;
578   End If;
579   If (p_rec.show_participant_names = hr_api.g_varchar2) then
580     p_rec.show_participant_names :=
581     per_apt_shd.g_old_rec.show_participant_names;
582   End If;
583   If (p_rec.show_participant_ratings = hr_api.g_varchar2) then
584     p_rec.show_participant_ratings :=
585     per_apt_shd.g_old_rec.show_participant_ratings;
586   End If;
587   If (p_rec.available_flag = hr_api.g_varchar2) then
588     p_rec.available_flag :=
589     per_apt_shd.g_old_rec.available_flag;
590   End If;
591   If (p_rec.show_questionnaire_info = hr_api.g_varchar2) then
592     p_rec.show_questionnaire_info :=
593     per_apt_shd.g_old_rec.show_questionnaire_info;
594   End If;
595   If (p_rec.ma_off_template_code =hr_api.g_varchar2) then
596   	 p_rec.ma_off_template_code :=
597   	 per_apt_shd.g_old_rec.ma_off_template_code;
598   End If;
599   If (p_rec.appraisee_off_template_code =hr_api.g_varchar2) then
600   	 p_rec.appraisee_off_template_code :=
601   	 per_apt_shd.g_old_rec.appraisee_off_template_code;
602   End If;
603   If (p_rec.other_part_off_template_code =hr_api.g_varchar2) then
604   	 p_rec.other_part_off_template_code :=
605   	 per_apt_shd.g_old_rec.other_part_off_template_code;
606   End If;
607   If (p_rec.part_rev_off_template_code =hr_api.g_varchar2) then
608   	 p_rec.part_rev_off_template_code :=
609   	 per_apt_shd.g_old_rec.part_rev_off_template_code;
610   End If;
611   If (p_rec.part_app_off_template_code  =hr_api.g_varchar2) then
612   	 p_rec.part_app_off_template_code  :=
613   	 per_apt_shd.g_old_rec.part_app_off_template_code ;
614   End If;
615 
616   hr_utility.set_location(' Leaving:'||l_proc, 10);
617 
618 End convert_defs;
619 
620 -- ---------------------------------------------------------------------------+
621 -- |---------------------------------< upd >----------------------------------|
622 -- ---------------------------------------------------------------------------+
623 Procedure upd
624   (
625   p_rec        		in out nocopy per_apt_shd.g_rec_type,
626   p_effective_date	in date,
627   p_validate   		in     boolean default false
628   ) is
629 
630   l_proc  varchar2(72) := g_package||'upd';
631 
632 Begin
633   hr_utility.set_location('Entering:'||l_proc, 5);
634 
635   -- Determine if the business process is to be validated.
636 
637   If p_validate then
638 
639     -- Issue the savepoint.
640 
641     SAVEPOINT upd_per_apt;
642   End If;
643 
644   -- We must lock the row which we need to update.
645 
646   per_apt_shd.lck
647 	(
648 	p_rec.appraisal_template_id,
649 	p_rec.object_version_number
650 	);
651 
652   -- 1. During an update system defaults are used to determine if
653   --    arguments have been defaulted or not. We must therefore
654   --    derive the full record structure values to be updated.
655 
656   -- 2. Call the supporting update validate operations.
657 
658   convert_defs(p_rec);
659   per_apt_bus.update_validate(p_rec,p_effective_date);
660 
661   -- Call the supporting pre-update operation
662 
663   pre_update(p_rec);
664 
665   -- Update the row.
666 
667   update_dml(p_rec);
668 
669   -- Call the supporting post-update operation
670 
671   post_update(p_rec);
672 
673   -- If we are validating then raise the Validate_Enabled exception
674 
675   If p_validate then
676     Raise HR_Api.Validate_Enabled;
677   End If;
678 
679   hr_utility.set_location(' Leaving:'||l_proc, 10);
680 Exception
681   When HR_Api.Validate_Enabled Then
682 
683     -- As the Validate_Enabled exception has been raised
684     -- we must rollback to the savepoint
685 
686     ROLLBACK TO upd_per_apt;
687 End upd;
688 
689 -- ---------------------------------------------------------------------------+
690 -- |---------------------------------< upd >----------------------------------|
691 -- ---------------------------------------------------------------------------+
692 Procedure upd
693   (
694   p_appraisal_template_id        in number,
695   p_object_version_number        in out nocopy number,
696   p_name                         in varchar2         default hr_api.g_varchar2,
697   p_description                  in varchar2         default hr_api.g_varchar2,
698   p_instructions                 in varchar2         default hr_api.g_varchar2,
699   p_date_from                    in date             default hr_api.g_date,
700   p_date_to                      in date             default hr_api.g_date,
701   p_assessment_type_id           in number           default hr_api.g_number,
702   p_rating_scale_id              in number           default hr_api.g_number,
703   p_questionnaire_template_id    in number           default hr_api.g_number,
704   p_attribute_category           in varchar2         default hr_api.g_varchar2,
705   p_attribute1                   in varchar2         default hr_api.g_varchar2,
706   p_attribute2                   in varchar2         default hr_api.g_varchar2,
707   p_attribute3                   in varchar2         default hr_api.g_varchar2,
708   p_attribute4                   in varchar2         default hr_api.g_varchar2,
709   p_attribute5                   in varchar2         default hr_api.g_varchar2,
710   p_attribute6                   in varchar2         default hr_api.g_varchar2,
711   p_attribute7                   in varchar2         default hr_api.g_varchar2,
712   p_attribute8                   in varchar2         default hr_api.g_varchar2,
713   p_attribute9                   in varchar2         default hr_api.g_varchar2,
714   p_attribute10                  in varchar2         default hr_api.g_varchar2,
715   p_attribute11                  in varchar2         default hr_api.g_varchar2,
716   p_attribute12                  in varchar2         default hr_api.g_varchar2,
717   p_attribute13                  in varchar2         default hr_api.g_varchar2,
718   p_attribute14                  in varchar2         default hr_api.g_varchar2,
719   p_attribute15                  in varchar2         default hr_api.g_varchar2,
720   p_attribute16                  in varchar2         default hr_api.g_varchar2,
721   p_attribute17                  in varchar2         default hr_api.g_varchar2,
722   p_attribute18                  in varchar2         default hr_api.g_varchar2,
723   p_attribute19                  in varchar2         default hr_api.g_varchar2,
724   p_attribute20                  in varchar2         default hr_api.g_varchar2,
725   p_objective_asmnt_type_id      in     number    default hr_api.g_number,
726   p_ma_quest_template_id         in     number    default hr_api.g_number,
727   p_link_appr_to_learning_path   in     varchar2  default hr_api.g_varchar2,
728   p_final_score_formula_id       in     number    default hr_api.g_number,
729   p_update_personal_comp_profile in     varchar2  default hr_api.g_varchar2,
730   p_comp_profile_source_type     in     varchar2  default hr_api.g_varchar2,
731   p_show_competency_ratings      in     varchar2  default hr_api.g_varchar2,
732   p_show_objective_ratings       in     varchar2  default hr_api.g_varchar2,
733   p_show_overall_ratings         in     varchar2  default hr_api.g_varchar2,
734   p_show_overall_comments        in     varchar2  default hr_api.g_varchar2,
735   p_provide_overall_feedback     in     varchar2  default hr_api.g_varchar2,
736   p_show_participant_details     in     varchar2  default hr_api.g_varchar2,
737   p_allow_add_participant        in     varchar2  default hr_api.g_varchar2,
738   p_show_additional_details      in     varchar2  default hr_api.g_varchar2,
739   p_show_participant_names       in     varchar2  default hr_api.g_varchar2,
740   p_show_participant_ratings     in     varchar2  default hr_api.g_varchar2,
741   p_available_flag               in     varchar2  default hr_api.g_varchar2,
742   p_show_questionnaire_info     in     varchar2  default hr_api.g_varchar2,
743   p_effective_date		 in date
744   ,p_ma_off_template_code			   in varchar2 	  default hr_api.g_varchar2
745   ,p_appraisee_off_template_code	in varchar2		  default hr_api.g_varchar2
746   ,p_other_part_off_template_code	 in varchar2		  default hr_api.g_varchar2
747   ,p_part_app_off_template_code	  in varchar2		  default hr_api.g_varchar2
748   ,p_part_rev_off_template_code	  in varchar2		  default hr_api.g_varchar2,
749   p_validate                     in boolean      default false
750   ) is
751 
752   l_rec	  per_apt_shd.g_rec_type;
753   l_proc  varchar2(72) := g_package||'upd';
754 
755 Begin
756   hr_utility.set_location('Entering:'||l_proc, 5);
757 
758   -- Call conversion function to turn arguments into the
759   -- l_rec structure.
760 
761   l_rec :=
762   per_apt_shd.convert_args
763   (
764   p_appraisal_template_id,
765   hr_api.g_number,
766   p_object_version_number,
767   p_name,
768   p_description,
769   p_instructions,
770   p_date_from,
771   p_date_to,
772   p_assessment_type_id,
773   p_rating_scale_id,
774   p_questionnaire_template_id,
775   p_attribute_category,
776   p_attribute1,
777   p_attribute2,
778   p_attribute3,
779   p_attribute4,
780   p_attribute5,
781   p_attribute6,
782   p_attribute7,
783   p_attribute8,
784   p_attribute9,
785   p_attribute10,
786   p_attribute11,
787   p_attribute12,
788   p_attribute13,
789   p_attribute14,
790   p_attribute15,
791   p_attribute16,
792   p_attribute17,
793   p_attribute18,
794   p_attribute19,
795   p_attribute20,
796   p_objective_asmnt_type_id,
797   p_ma_quest_template_id,
798   p_link_appr_to_learning_path,
799   p_final_score_formula_id,
800   p_update_personal_comp_profile,
801   p_comp_profile_source_type,
802   p_show_competency_ratings,
803   p_show_objective_ratings,
804   p_show_overall_ratings,
805   p_show_overall_comments,
806   p_provide_overall_feedback,
807   p_show_participant_details,
808   p_allow_add_participant,
809   p_show_additional_details,
810   p_show_participant_names,
811   p_show_participant_ratings,
812   p_available_flag,
813   p_show_questionnaire_info,
814   p_ma_off_template_code,
815   p_appraisee_off_template_code,
816   p_other_part_off_template_code,
817   p_part_app_off_template_code,
818   p_part_rev_off_template_code
819   );
820 
821   -- Having converted the arguments into the
822   -- plsql record structure we call the corresponding record
823   -- business process.
824 
825   upd(l_rec, p_effective_date,p_validate);
826 
827   if not p_validate then
828     p_object_version_number := l_rec.object_version_number;
829   end if;
830 
831   hr_utility.set_location(' Leaving:'||l_proc, 10);
832 End upd;
833 
834 end per_apt_upd;