DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_OBJ_DEL

Source


1 Package Body per_obj_del as
2 /* $Header: peobjrhi.pkb 120.20 2011/12/19 10:22:22 kgowripe ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_obj_del.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< delete_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml delete logic. The functions of
20 --   2) To trap any constraint violations that may have occurred.
17 --   this procedure are as follows:
18 --   1) To delete the specified row from the schema using the primary key in
19 --      the predicates.
21 --   3) To raise any other errors.
22 --
23 -- Pre Conditions:
24 --   This is an internal private procedure which must be called from the del
25 --   procedure.
26 --
27 -- In Parameters:
28 --   A Pl/Sql record structre.
29 --
30 -- Post Success:
31 --   The specified row will be delete from the schema.
32 --
33 -- Post Failure:
34 --   If a child integrity constraint violation is raised the
35 --   constraint_error procedure will be called.
36 --
37 -- Developer Implementation Notes:
38 --   None.
39 --
40 -- Access Status:
41 --   Internal Table Handler Use Only.
42 --
43 -- {End Of Comments}
44 -- ----------------------------------------------------------------------------
45 Procedure delete_dml(p_rec in per_obj_shd.g_rec_type) is
46 --
47   l_proc  varchar2(72) := g_package||'delete_dml';
48 --
49 Begin
50   hr_utility.set_location('Entering:'||l_proc, 5);
51   --
52   -- Delete the per_objectives row.
53   --
54   delete from per_objectives
55   where objective_id = p_rec.objective_id;
56   --
57   --
58   hr_utility.set_location(' Leaving:'||l_proc, 10);
59 --
60 Exception
61   When hr_api.child_integrity_violated then
62     -- Child integrity has been violated
63     per_obj_shd.constraint_error
64       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
65   When Others Then
66     Raise;
67 End delete_dml;
68 --
69 -- ----------------------------------------------------------------------------
70 -- |------------------------------< pre_delete >------------------------------|
71 -- ----------------------------------------------------------------------------
72 -- {Start Of Comments}
73 --
74 -- Description:
75 --   This private procedure contains any processing which is required before
76 --   the delete dml.
77 --
78 -- Pre Conditions:
79 --   This is an internal procedure which is called from the del procedure.
80 --
81 -- In Parameters:
82 --   A Pl/Sql record structre.
83 --
84 -- Post Success:
85 --   Processing continues.
86 --
87 -- Post Failure:
88 --   If an error has occurred, an error message and exception will be raised
89 --   but not handled.
90 --
91 -- Developer Implementation Notes:
92 --   Any pre-processing required before the delete dml is issued should be
93 --   coded within this procedure. It is important to note that any 3rd party
94 --   maintenance should be reviewed before placing in this procedure.
95 --
96 -- Access Status:
97 --   Internal Table Handler Use Only.
98 --
99 -- {End Of Comments}
100 -- ----------------------------------------------------------------------------
101 Procedure pre_delete(p_rec in per_obj_shd.g_rec_type) is
102 --
103   l_proc  varchar2(72) := g_package||'pre_delete';
104 --
105 Begin
106   hr_utility.set_location('Entering:'||l_proc, 5);
107   --
108   hr_utility.set_location(' Leaving:'||l_proc, 10);
109 End pre_delete;
110 --
111 -- ----------------------------------------------------------------------------
112 -- |-----------------------------< post_delete >------------------------------|
113 -- ----------------------------------------------------------------------------
114 -- {Start Of Comments}
115 --
116 -- Description:
117 --   This private procedure contains any processing which is required after the
118 --   delete dml.
119 --
120 -- Pre Conditions:
121 --   This is an internal procedure which is called from the del procedure.
122 --
123 -- In Parameters:
124 --   A Pl/Sql record structre.
125 --
126 -- Post Success:
127 --   Processing continues.
128 --
129 -- Post Failure:
130 --   If an error has occurred, an error message and exception will be raised
131 --   but not handled.
132 --
133 -- Developer Implementation Notes:
134 --   Any post-processing required after the delete dml is issued should be
135 --   coded within this procedure. It is important to note that any 3rd party
136 --   maintenance should be reviewed before placing in this procedure.
137 --
138 -- Access Status:
139 --   Internal table Handler Use Only.
140 --
141 -- {End Of Comments}
142 -- ----------------------------------------------------------------------------
143 Procedure post_delete(p_rec in per_obj_shd.g_rec_type) is
144 --
145   l_proc  varchar2(72) := g_package||'post_delete';
146 --
147 Begin
148   hr_utility.set_location('Entering:'||l_proc, 5);
149   --
150   -- Start of API User Hook for post_delete.
151   begin
152     per_obj_rkd.after_delete
153       (
154        p_objective_id                  => p_rec.objective_id,
155        p_name_o                        => per_obj_shd.g_old_rec.name,
156        p_target_date_o                 => per_obj_shd.g_old_rec.target_date,
157        p_start_date_o                  => per_obj_shd.g_old_rec.start_date,
158        p_business_group_id_o           => per_obj_shd.g_old_rec.business_group_id,
159        p_object_version_number_o       => per_obj_shd.g_old_rec.object_version_number,
160        p_owning_person_id_o            => per_obj_shd.g_old_rec.owning_person_id,
161        p_achievement_date_o            => per_obj_shd.g_old_rec.achievement_date,
165        p_appraisal_id_o                => per_obj_shd.g_old_rec.appraisal_id,
162        p_detail_o                      => per_obj_shd.g_old_rec.detail,
163        p_comments_o                    => per_obj_shd.g_old_rec.comments,
164        p_success_criteria_o            => per_obj_shd.g_old_rec.success_criteria,
166        p_attribute_category_o          => per_obj_shd.g_old_rec.attribute_category,
167        p_attribute1_o                  => per_obj_shd.g_old_rec.attribute1,
168        p_attribute2_o                  => per_obj_shd.g_old_rec.attribute2,
169        p_attribute3_o                  => per_obj_shd.g_old_rec.attribute3,
170        p_attribute4_o                  => per_obj_shd.g_old_rec.attribute4,
171        p_attribute5_o                  => per_obj_shd.g_old_rec.attribute5,
172        p_attribute6_o                  => per_obj_shd.g_old_rec.attribute6,
173        p_attribute7_o                  => per_obj_shd.g_old_rec.attribute7,
174        p_attribute8_o                  => per_obj_shd.g_old_rec.attribute8,
175        p_attribute9_o                  => per_obj_shd.g_old_rec.attribute9,
176        p_attribute10_o                 => per_obj_shd.g_old_rec.attribute10,
177        p_attribute11_o                 => per_obj_shd.g_old_rec.attribute11,
178        p_attribute12_o                 => per_obj_shd.g_old_rec.attribute12,
179        p_attribute13_o                 => per_obj_shd.g_old_rec.attribute13,
180        p_attribute14_o                 => per_obj_shd.g_old_rec.attribute14,
181        p_attribute15_o                 => per_obj_shd.g_old_rec.attribute15,
182        p_attribute16_o                 => per_obj_shd.g_old_rec.attribute16,
183        p_attribute17_o                 => per_obj_shd.g_old_rec.attribute17,
184        p_attribute18_o                 => per_obj_shd.g_old_rec.attribute18,
185        p_attribute19_o                 => per_obj_shd.g_old_rec.attribute19,
186        p_attribute20_o                 => per_obj_shd.g_old_rec.attribute20,
187 
188        p_attribute21_o                 => per_obj_shd.g_old_rec.attribute21,
189        p_attribute22_o                 => per_obj_shd.g_old_rec.attribute22,
190        p_attribute23_o                 => per_obj_shd.g_old_rec.attribute23,
191        p_attribute24_o                 => per_obj_shd.g_old_rec.attribute24,
192        p_attribute25_o                 => per_obj_shd.g_old_rec.attribute25,
193        p_attribute26_o                 => per_obj_shd.g_old_rec.attribute26,
194        p_attribute27_o                 => per_obj_shd.g_old_rec.attribute27,
195        p_attribute28_o                 => per_obj_shd.g_old_rec.attribute28,
196        p_attribute29_o                 => per_obj_shd.g_old_rec.attribute29,
197        p_attribute30_o                 => per_obj_shd.g_old_rec.attribute30,
198 
199 
200        p_scorecard_id_o	  	        => per_obj_shd.g_old_rec.scorecard_id,
201        p_copied_from_library_id_o	=> per_obj_shd.g_old_rec.copied_from_library_id,
202        p_copied_from_objective_id_o	=> per_obj_shd.g_old_rec.copied_from_objective_id,
203        p_aligned_with_objective_id_o	=> per_obj_shd.g_old_rec.aligned_with_objective_id,
204 
205        p_next_review_date_o		=> per_obj_shd.g_old_rec.next_review_date,
206        p_group_code_o			=> per_obj_shd.g_old_rec.group_code,
207        p_priority_code_o		=> per_obj_shd.g_old_rec.priority_code,
208        p_appraise_flag_o		=> per_obj_shd.g_old_rec.appraise_flag,
209        p_verified_flag_o		=> per_obj_shd.g_old_rec.verified_flag,
210 
211        p_target_value_o			=> per_obj_shd.g_old_rec.target_value,
212        p_actual_value_o			=> per_obj_shd.g_old_rec.actual_value,
213        p_weighting_percent_o		=> per_obj_shd.g_old_rec.weighting_percent,
214        p_complete_percent_o		=> per_obj_shd.g_old_rec.complete_percent,
215        p_uom_code_o			=> per_obj_shd.g_old_rec.uom_code,
216 
217        p_measurement_style_code_o	=> per_obj_shd.g_old_rec.measurement_style_code,
218        p_measure_name_o			=> per_obj_shd.g_old_rec.measure_name,
219        p_measure_type_code_o		=> per_obj_shd.g_old_rec.measure_type_code,
220        p_measure_comments_o 		=> per_obj_shd.g_old_rec.measure_comments ,
221        p_sharing_access_code_o		=> per_obj_shd.g_old_rec.sharing_access_code
222 
223 
224       );
225   exception
226     when hr_api.cannot_find_prog_unit then
227       hr_api.cannot_find_prog_unit_error
228         (p_module_name => 'PER_OBJECTIVES'
229         ,p_hook_type   => 'AD'
230         );
231   end;
232   -- End of API User Hook for post_delete.
233   --
234   hr_utility.set_location(' Leaving:'||l_proc, 10);
235 End post_delete;
236 --
237 -- ----------------------------------------------------------------------------
238 -- |---------------------------------< del >----------------------------------|
239 -- ----------------------------------------------------------------------------
240 Procedure del
241   (
242   p_rec	      in per_obj_shd.g_rec_type,
243   p_validate  in boolean default false
244   ) is
245 --
246   l_proc  varchar2(72) := g_package||'del';
247 --
248 Begin
249   hr_utility.set_location('Entering:'||l_proc, 5);
250   --
251   -- Determine if the business process is to be validated.
252   --
253   If p_validate then
254     --
255     -- Issue the savepoint.
256     --
257     SAVEPOINT del_per_obj;
258   End If;
259   --
260   -- We must lock the row which we need to delete.
261   --
262   per_obj_shd.lck
263 	(
264 	p_rec.objective_id,
265 	p_rec.object_version_number
266 	);
267   --
268   -- Call the supporting delete validate operation
269   --
270   per_obj_bus.delete_validate(p_rec);
271   --
272         hr_multi_message.end_validation_set;
273   --
274 
275   --
276   -- Call the supporting pre-delete operation
277   --
278   pre_delete(p_rec);
279   --
280   -- Delete the row.
281   --
282   delete_dml(p_rec);
283   --
284   -- Call the supporting post-delete operation
285   --
286   post_delete(p_rec);
287   --
288         hr_multi_message.end_validation_set;
289   --
290   --
291   -- If we are validating then raise the Validate_Enabled exception
292   --
293   If p_validate then
294     Raise HR_Api.Validate_Enabled;
295   End If;
296   --
297   hr_utility.set_location(' Leaving:'||l_proc, 10);
298 Exception
299   When HR_Api.Validate_Enabled Then
300     --
301     -- As the Validate_Enabled exception has been raised
302     -- we must rollback to the savepoint
303     --
304     ROLLBACK TO del_per_obj;
305 End del;
306 --
307 -- ----------------------------------------------------------------------------
308 -- |---------------------------------< del >----------------------------------|
309 -- ----------------------------------------------------------------------------
310 Procedure del
311   (
312   p_objective_id                       in number,
313   p_object_version_number              in number,
314   p_validate                           in boolean default false
315   ) is
316 --
317   l_rec	  per_obj_shd.g_rec_type;
318   l_proc  varchar2(72) := g_package||'del';
319 --
320 Begin
321   hr_utility.set_location('Entering:'||l_proc, 5);
322   --
323   -- As the delete procedure accepts a plsql record structure we do need to
324   -- convert the  arguments into the record structure.
325   -- We don't need to call the supplied conversion argument routine as we
326   -- only need a few attributes.
327   --
328   l_rec.objective_id:= p_objective_id;
329   l_rec.object_version_number := p_object_version_number;
330   --
331   -- Having converted the arguments into the per_obj_rec
332   -- plsql record structure we must call the corresponding entity
333   -- business process
334   --
335   del(l_rec, p_validate);
336   --
337   hr_utility.set_location(' Leaving:'||l_proc, 10);
338 End del;
339 --
340 end per_obj_del;