DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PMP_DEL

Source


4 -- ----------------------------------------------------------------------------
1 Package Body per_pmp_del as
2 /* $Header: pepmprhi.pkb 120.12.12020000.1 2012/06/29 01:50:28 appldev ship $ */
3 --
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_pmp_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
17 --   this procedure are as follows:
18 --   1) To set and unset the g_api_dml status as required (as we are about to
19 --      perform dml).
20 --   2) To delete the specified row from 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 -- Prerequisites:
26 --   This is an internal private procedure which must be called from the del
27 --   procedure.
28 --
29 -- In Parameters:
30 --   A Pl/Sql record structre.
31 --
32 -- Post Success:
33 --   The specified row will be delete from the schema.
34 --
35 -- Post Failure:
36 --   On the delete dml failure it is important to note that we always reset the
37 --   g_api_dml status to false.
38 --   If a child integrity constraint violation is raised the
39 --   constraint_error procedure will be called.
40 --   If any other error is reported, the error will be raised after the
41 --   g_api_dml status is reset.
42 --
43 -- Developer Implementation Notes:
44 --   None.
45 --
46 -- Access Status:
47 --   Internal Row Handler Use Only.
48 --
49 -- {End Of Comments}
50 -- ----------------------------------------------------------------------------
51 Procedure delete_dml
52   (p_rec in per_pmp_shd.g_rec_type
53   ) is
54 --
55   l_proc  varchar2(72) := g_package||'delete_dml';
56 --
57 Begin
58   hr_utility.set_location('Entering:'||l_proc, 5);
59   --
60   --
61   -- Delete the per_perf_mgmt_plans row.
62   --
63   delete from per_perf_mgmt_plans
64   where plan_id = p_rec.plan_id;
65   --
66   --
67   hr_utility.set_location(' Leaving:'||l_proc, 10);
68 --
69 Exception
73     per_pmp_shd.constraint_error
70   When hr_api.child_integrity_violated then
71     -- Child integrity has been violated
72     --
74       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
75   When Others Then
76     --
77     Raise;
78 End delete_dml;
79 --
80 -- ----------------------------------------------------------------------------
81 -- |------------------------------< pre_delete >------------------------------|
82 -- ----------------------------------------------------------------------------
83 -- {Start Of Comments}
84 --
85 -- Description:
86 --   This private procedure contains any processing which is required before
87 --   the delete dml.
88 --
89 -- Prerequisites:
90 --   This is an internal procedure which is called from the del procedure.
91 --
92 -- In Parameters:
93 --   A Pl/Sql record structre.
94 --
95 -- Post Success:
96 --   Processing continues.
97 --
98 -- Post Failure:
99 --   If an error has occurred, an error message and exception will be raised
100 --   but not handled.
101 --
102 -- Developer Implementation Notes:
103 --   Any pre-processing required before the delete dml is issued should be
104 --   coded within this procedure. It is important to note that any 3rd party
105 --   maintenance should be reviewed before placing in this procedure.
106 --
107 -- Access Status:
108 --   Internal Row Handler Use Only.
109 --
110 -- {End Of Comments}
111 -- ----------------------------------------------------------------------------
112 Procedure pre_delete(p_rec in per_pmp_shd.g_rec_type) is
113 --
114   l_proc  varchar2(72) := g_package||'pre_delete';
115 --
116 Begin
117   hr_utility.set_location('Entering:'||l_proc, 5);
118   --
119   hr_utility.set_location(' Leaving:'||l_proc, 10);
120 End pre_delete;
121 --
122 -- ----------------------------------------------------------------------------
123 -- |-----------------------------< post_delete >------------------------------|
124 -- ----------------------------------------------------------------------------
125 -- {Start Of Comments}
126 --
127 -- Description:
128 --   This private procedure contains any processing which is required after
129 --   the delete dml.
130 --
131 -- Prerequistes:
132 --   This is an internal procedure which is called from the del procedure.
133 --
134 -- In Parameters:
135 --   A Pl/Sql record structure.
136 --
137 -- Post Success:
138 --   Processing continues.
139 --
140 -- Post Failure:
141 --   If an error has occurred, an error message and exception will be raised
142 --   but not handled.
143 --
144 -- Developer Implementation Notes:
145 --   Any post-processing required after the delete dml is issued should be
146 --   coded within this procedure. It is important to note that any 3rd party
147 --   maintenance should be reviewed before placing in this procedure.
148 --
149 -- Access Status:
150 --   Internal Row Handler Use Only.
151 --
152 -- {End Of Comments}
153 -- -----------------------------------------------------------------------------
154 Procedure post_delete(p_rec in per_pmp_shd.g_rec_type) is
155 --
156   l_proc  varchar2(72) := g_package||'post_delete';
157 --
158 Begin
159   hr_utility.set_location('Entering:'||l_proc, 5);
160   begin
161     --
162     per_pmp_rkd.after_delete
163       (p_plan_id
164       => p_rec.plan_id
165       ,p_object_version_number_o
166       => per_pmp_shd.g_old_rec.object_version_number
167       ,p_plan_name_o
168       => per_pmp_shd.g_old_rec.plan_name
169       ,p_administrator_person_id_o
170       => per_pmp_shd.g_old_rec.administrator_person_id
171       ,p_previous_plan_id_o
172       => per_pmp_shd.g_old_rec.previous_plan_id
173       ,p_start_date_o
174       => per_pmp_shd.g_old_rec.start_date
175       ,p_end_date_o
176       => per_pmp_shd.g_old_rec.end_date
177       ,p_status_code_o
178       => per_pmp_shd.g_old_rec.status_code
179       ,p_hierarchy_type_code_o
180       => per_pmp_shd.g_old_rec.hierarchy_type_code
181       ,p_supervisor_id_o
182       => per_pmp_shd.g_old_rec.supervisor_id
183       ,p_supervisor_assignment_id_o
184       => per_pmp_shd.g_old_rec.supervisor_assignment_id
185       ,p_organization_structure_id_o
186       => per_pmp_shd.g_old_rec.organization_structure_id
187       ,p_org_structure_version_id_o
188       => per_pmp_shd.g_old_rec.org_structure_version_id
189       ,p_top_organization_id_o
190       => per_pmp_shd.g_old_rec.top_organization_id
191       ,p_position_structure_id_o
192       => per_pmp_shd.g_old_rec.position_structure_id
193       ,p_pos_structure_version_id_o
194       => per_pmp_shd.g_old_rec.pos_structure_version_id
195       ,p_top_position_id_o
196       => per_pmp_shd.g_old_rec.top_position_id
197       ,p_hierarchy_levels_o
198       => per_pmp_shd.g_old_rec.hierarchy_levels
199       ,p_automatic_enrollment_flag_o
200       => per_pmp_shd.g_old_rec.automatic_enrollment_flag
201       ,p_assignment_types_code_o
202       => per_pmp_shd.g_old_rec.assignment_types_code
203       ,p_primary_asg_only_flag_o
204       => per_pmp_shd.g_old_rec.primary_asg_only_flag
205       ,p_include_obj_setting_flag_o
206       => per_pmp_shd.g_old_rec.include_obj_setting_flag
207       ,p_obj_setting_start_date_o
208       => per_pmp_shd.g_old_rec.obj_setting_start_date
209       ,p_obj_setting_deadline_o
210       => per_pmp_shd.g_old_rec.obj_setting_deadline
211       ,p_obj_set_outside_period_fla_o
212       => per_pmp_shd.g_old_rec.obj_set_outside_period_flag
213       ,p_method_code_o
217       ,p_automatic_allocation_flag_o
214       => per_pmp_shd.g_old_rec.method_code
215       ,p_notify_population_flag_o
216       => per_pmp_shd.g_old_rec.notify_population_flag
218       => per_pmp_shd.g_old_rec.automatic_allocation_flag
219       ,p_copy_past_objectives_flag_o
220       => per_pmp_shd.g_old_rec.copy_past_objectives_flag
221       ,p_sharing_alignment_task_fla_o
222       => per_pmp_shd.g_old_rec.sharing_alignment_task_flag
223       ,p_include_appraisals_flag_o
224       => per_pmp_shd.g_old_rec.include_appraisals_flag
225       ,p_change_sc_status_flag_o
226       => per_pmp_shd.g_old_rec.change_sc_status_flag
227       ,p_attribute_category_o
228       => per_pmp_shd.g_old_rec.attribute_category
229       ,p_attribute1_o
230       => per_pmp_shd.g_old_rec.attribute1
231       ,p_attribute2_o
232       => per_pmp_shd.g_old_rec.attribute2
233       ,p_attribute3_o
234       => per_pmp_shd.g_old_rec.attribute3
235       ,p_attribute4_o
236       => per_pmp_shd.g_old_rec.attribute4
237       ,p_attribute5_o
238       => per_pmp_shd.g_old_rec.attribute5
239       ,p_attribute6_o
240       => per_pmp_shd.g_old_rec.attribute6
241       ,p_attribute7_o
242       => per_pmp_shd.g_old_rec.attribute7
243       ,p_attribute8_o
244       => per_pmp_shd.g_old_rec.attribute8
245       ,p_attribute9_o
246       => per_pmp_shd.g_old_rec.attribute9
247       ,p_attribute10_o
248       => per_pmp_shd.g_old_rec.attribute10
249       ,p_attribute11_o
250       => per_pmp_shd.g_old_rec.attribute11
251       ,p_attribute12_o
252       => per_pmp_shd.g_old_rec.attribute12
253       ,p_attribute13_o
254       => per_pmp_shd.g_old_rec.attribute13
255       ,p_attribute14_o
256       => per_pmp_shd.g_old_rec.attribute14
257       ,p_attribute15_o
258       => per_pmp_shd.g_old_rec.attribute15
259       ,p_attribute16_o
260       => per_pmp_shd.g_old_rec.attribute16
261       ,p_attribute17_o
262       => per_pmp_shd.g_old_rec.attribute17
263       ,p_attribute18_o
264       => per_pmp_shd.g_old_rec.attribute18
265       ,p_attribute19_o
266       => per_pmp_shd.g_old_rec.attribute19
267       ,p_attribute20_o
268       => per_pmp_shd.g_old_rec.attribute20
269       ,p_attribute21_o
270       => per_pmp_shd.g_old_rec.attribute21
271       ,p_attribute22_o
272       => per_pmp_shd.g_old_rec.attribute22
273       ,p_attribute23_o
274       => per_pmp_shd.g_old_rec.attribute23
275       ,p_attribute24_o
276       => per_pmp_shd.g_old_rec.attribute24
277       ,p_attribute25_o
278       => per_pmp_shd.g_old_rec.attribute25
279       ,p_attribute26_o
280       => per_pmp_shd.g_old_rec.attribute26
281       ,p_attribute27_o
282       => per_pmp_shd.g_old_rec.attribute27
283       ,p_attribute28_o
284       => per_pmp_shd.g_old_rec.attribute28
285       ,p_attribute29_o
286       => per_pmp_shd.g_old_rec.attribute29
287       ,p_attribute30_o
288       => per_pmp_shd.g_old_rec.attribute30
289     ,p_update_library_objectives_o
290       => per_pmp_shd.g_old_rec.update_library_objectives  --  8740021 bug fix
291        ,p_automatic_approval_flag_o
292       => per_pmp_shd.g_old_rec.automatic_approval_flag
293       );
294     --
295   exception
296     --
297     when hr_api.cannot_find_prog_unit then
298       --
299       hr_api.cannot_find_prog_unit_error
300         (p_module_name => 'PER_PERF_MGMT_PLANS'
301         ,p_hook_type   => 'AD');
302       --
303   end;
304   --
305   hr_utility.set_location(' Leaving:'||l_proc, 10);
306 End post_delete;
307 --
308 -- ----------------------------------------------------------------------------
309 -- |---------------------------------< del >----------------------------------|
310 -- ----------------------------------------------------------------------------
311 Procedure del
312   (p_rec              in per_pmp_shd.g_rec_type
313   ) is
314 --
315   l_proc  varchar2(72) := g_package||'del';
316 --
317 Begin
318   hr_utility.set_location('Entering:'||l_proc, 5);
319   --
320   -- We must lock the row which we need to delete.
321   --
322   per_pmp_shd.lck
323     (p_rec.plan_id
324     ,p_rec.object_version_number
325     );
326   --
327   -- Call the supporting delete validate operation
328   --
329   per_pmp_bus.delete_validate(p_rec);
330   --
331   -- Call to raise any errors on multi-message list
332   hr_multi_message.end_validation_set;
333   --
334   -- Call the supporting pre-delete operation
335   --
336   per_pmp_del.pre_delete(p_rec);
337   --
338   -- Delete the row.
339   --
340   per_pmp_del.delete_dml(p_rec);
341   --
342   -- Call the supporting post-delete operation
343   --
344   per_pmp_del.post_delete(p_rec);
345   --
346   -- Call to raise any errors on multi-message list
347   hr_multi_message.end_validation_set;
348   --
349 End del;
350 --
351 -- ----------------------------------------------------------------------------
352 -- |---------------------------------< del >----------------------------------|
353 -- ----------------------------------------------------------------------------
354 Procedure del
355   (p_plan_id                              in     number
356   ,p_object_version_number                in     number
357   ) is
358 --
359   l_rec   per_pmp_shd.g_rec_type;
360   l_proc  varchar2(72) := g_package||'del';
361 --
362 Begin
363   hr_utility.set_location('Entering:'||l_proc, 5);
364   --
365   -- As the delete procedure accepts a plsql record structure we do need to
366   -- convert the  arguments into the record structure.
367   -- We don't need to call the supplied conversion argument routine as we
368   -- only need a few attributes.
369   --
370   l_rec.plan_id := p_plan_id;
371   l_rec.object_version_number := p_object_version_number;
372   --
373   -- Having converted the arguments into the per_pmp_rec
374   -- plsql record structure we must call the corresponding entity
375   -- business process
376   --
377   per_pmp_del.del(l_rec);
378   --
379   hr_utility.set_location(' Leaving:'||l_proc, 10);
380 End del;
381 --
382 end per_pmp_del;