DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PAT_DEL

Source


1 Package Body per_pat_del as
2 /* $Header: pepatrhi.pkb 120.6 2012/01/10 10:39:57 srannama ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_pat_del.';  -- Global package name
9 g_debug   boolean      := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------------< delete_dml >------------------------------|
13 -- ----------------------------------------------------------------------------
14 -- {Start Of Comments}
15 --
16 -- Description:
17 --   This procedure controls the actual dml delete logic. The functions of
18 --   this procedure are as follows:
19 --   1) To set and unset the g_api_dml status as required (as we are about to
20 --      perform dml).
21 --   2) To delete the specified row from the schema using the primary key in
22 --      the predicates.
23 --   3) To trap any constraint violations that may have occurred.
24 --   4) To raise any other errors.
25 --
26 -- Prerequisites:
27 --   This is an internal private procedure which must be called from the del
28 --   procedure.
29 --
30 -- In Parameters:
31 --   A Pl/Sql record structre.
32 --
33 -- Post Success:
34 --   The specified row will be delete from the schema.
35 --
36 -- Post Failure:
37 --   On the delete dml failure it is important to note that we always reset the
38 --   g_api_dml status to false.
39 --   If a child integrity constraint violation is raised the
40 --   constraint_error procedure will be called.
41 --   If any other error is reported, the error will be raised after the
42 --   g_api_dml status is reset.
43 --
44 -- Developer Implementation Notes:
45 --   None.
46 --
47 -- Access Status:
48 --   Internal Row Handler Use Only.
49 --
50 -- {End Of Comments}
51 -- ----------------------------------------------------------------------------
52 Procedure delete_dml
53   (p_rec in per_pat_shd.g_rec_type
54   ) is
55 --
56   l_proc  varchar2(72) := g_package||'delete_dml';
57 --
58 Begin
59   hr_utility.set_location('Entering:'||l_proc, 5);
60   --
61   --
62   --
63   -- Delete the per_allocated_tasks row.
64   --
65   delete from per_allocated_tasks
66   where allocated_task_id = p_rec.allocated_task_id;
67   --
68   --
69   --
70   hr_utility.set_location(' Leaving:'||l_proc, 10);
71 --
72 Exception
73   When hr_api.child_integrity_violated then
74     -- Child integrity has been violated
75     --
76     per_pat_shd.constraint_error
77       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
78   When Others Then
79     --
80     Raise;
81 End delete_dml;
82 --
83 -- ----------------------------------------------------------------------------
84 -- |------------------------------< pre_delete >------------------------------|
85 -- ----------------------------------------------------------------------------
86 -- {Start Of Comments}
87 --
88 -- Description:
89 --   This private procedure contains any processing which is required before
90 --   the delete dml.
91 --
92 -- Prerequisites:
93 --   This is an internal procedure which is called from the del procedure.
94 --
95 -- In Parameters:
96 --   A Pl/Sql record structre.
97 --
98 -- Post Success:
99 --   Processing continues.
100 --
101 -- Post Failure:
102 --   If an error has occurred, an error message and exception will be raised
106 --   Any pre-processing required before the delete dml is issued should be
103 --   but not handled.
104 --
105 -- Developer Implementation Notes:
107 --   coded within this procedure. It is important to note that any 3rd party
108 --   maintenance should be reviewed before placing in this procedure.
109 --
110 -- Access Status:
111 --   Internal Row Handler Use Only.
112 --
113 -- {End Of Comments}
114 -- ----------------------------------------------------------------------------
115 Procedure pre_delete(p_rec in per_pat_shd.g_rec_type) is
116 --
117   l_proc  varchar2(72) := g_package||'pre_delete';
118 --
119 Begin
120   hr_utility.set_location('Entering:'||l_proc, 5);
121   --
122   hr_utility.set_location(' Leaving:'||l_proc, 10);
123 End pre_delete;
124 --
125 -- ----------------------------------------------------------------------------
126 -- |-----------------------------< post_delete >------------------------------|
127 -- ----------------------------------------------------------------------------
128 -- {Start Of Comments}
129 --
130 -- Description:
131 --   This private procedure contains any processing which is required after
132 --   the delete dml.
133 --
134 -- Prerequistes:
135 --   This is an internal procedure which is called from the del procedure.
136 --
137 -- In Parameters:
138 --   A Pl/Sql record structure.
139 --
140 -- Post Success:
141 --   Processing continues.
142 --
143 -- Post Failure:
144 --   If an error has occurred, an error message and exception will be raised
145 --   but not handled.
146 --
147 -- Developer Implementation Notes:
148 --   Any post-processing required after the delete dml is issued should be
149 --   coded within this procedure. It is important to note that any 3rd party
150 --   maintenance should be reviewed before placing in this procedure.
151 --
152 -- Access Status:
153 --   Internal Row Handler Use Only.
154 --
155 -- {End Of Comments}
156 -- -----------------------------------------------------------------------------
157 Procedure post_delete(p_rec in per_pat_shd.g_rec_type) is
158 --
159   l_proc  varchar2(72) := g_package||'post_delete';
160 --
161 Begin
162   hr_utility.set_location('Entering:'||l_proc, 5);
163   begin
164     --
165     per_pat_rkd.after_delete
166       (p_allocated_task_id
167       => p_rec.allocated_task_id
168       ,p_allocated_checklist_id_o
169       => per_pat_shd.g_old_rec.allocated_checklist_id
170       ,p_task_name_o
171       => per_pat_shd.g_old_rec.task_name
172       ,p_description_o
173       => per_pat_shd.g_old_rec.description
174       ,p_performer_orig_system_o
175       => per_pat_shd.g_old_rec.performer_orig_system
176       ,p_performer_orig_sys_id_o
177       => per_pat_shd.g_old_rec.performer_orig_sys_id
178       ,p_task_owner_person_id_o
179       => per_pat_shd.g_old_rec.task_owner_person_id
180       ,p_task_sequence_o
181       => per_pat_shd.g_old_rec.task_sequence
182       ,p_target_start_date_o
183       => per_pat_shd.g_old_rec.target_start_date
184       ,p_target_end_date_o
185       => per_pat_shd.g_old_rec.target_end_date
186       ,p_actual_start_date_o
187       => per_pat_shd.g_old_rec.actual_start_date
188       ,p_actual_end_date_o
189       => per_pat_shd.g_old_rec.actual_end_date
190       ,p_action_url_o
194       ,p_status_o
191       => per_pat_shd.g_old_rec.action_url
192       ,p_mandatory_flag_o
193       => per_pat_shd.g_old_rec.mandatory_flag
195       => per_pat_shd.g_old_rec.status
196       ,p_object_version_number_o
197       => per_pat_shd.g_old_rec.object_version_number
198       ,p_attribute_category_o
199       => per_pat_shd.g_old_rec.attribute_category
200       ,p_attribute1_o
201       => per_pat_shd.g_old_rec.attribute1
202       ,p_attribute2_o
203       => per_pat_shd.g_old_rec.attribute2
204       ,p_attribute3_o
205       => per_pat_shd.g_old_rec.attribute3
206       ,p_attribute4_o
207       => per_pat_shd.g_old_rec.attribute4
208       ,p_attribute5_o
209       => per_pat_shd.g_old_rec.attribute5
210       ,p_attribute6_o
211       => per_pat_shd.g_old_rec.attribute6
212       ,p_attribute7_o
213       => per_pat_shd.g_old_rec.attribute7
214       ,p_attribute8_o
215       => per_pat_shd.g_old_rec.attribute8
216       ,p_attribute9_o
217       => per_pat_shd.g_old_rec.attribute9
218       ,p_attribute10_o
219       => per_pat_shd.g_old_rec.attribute10
220       ,p_attribute11_o
221       => per_pat_shd.g_old_rec.attribute11
222       ,p_attribute12_o
223       => per_pat_shd.g_old_rec.attribute12
224       ,p_attribute13_o
225       => per_pat_shd.g_old_rec.attribute13
226       ,p_attribute14_o
227       => per_pat_shd.g_old_rec.attribute14
228       ,p_attribute15_o
229       => per_pat_shd.g_old_rec.attribute15
230       ,p_attribute16_o
231       => per_pat_shd.g_old_rec.attribute16
232       ,p_attribute17_o
233       => per_pat_shd.g_old_rec.attribute17
234       ,p_attribute18_o
235       => per_pat_shd.g_old_rec.attribute18
236       ,p_attribute19_o
237       => per_pat_shd.g_old_rec.attribute19
238       ,p_attribute20_o
239       => per_pat_shd.g_old_rec.attribute20
240       ,p_information_category_o
241       => per_pat_shd.g_old_rec.information_category
242       ,p_information1_o
243       => per_pat_shd.g_old_rec.information1
244       ,p_information2_o
245       => per_pat_shd.g_old_rec.information2
246       ,p_information3_o
247       => per_pat_shd.g_old_rec.information3
248       ,p_information4_o
249       => per_pat_shd.g_old_rec.information4
250       ,p_information5_o
251       => per_pat_shd.g_old_rec.information5
252       ,p_information6_o
253       => per_pat_shd.g_old_rec.information6
254       ,p_information7_o
255       => per_pat_shd.g_old_rec.information7
256       ,p_information8_o
257       => per_pat_shd.g_old_rec.information8
258       ,p_information9_o
259       => per_pat_shd.g_old_rec.information9
260       ,p_information10_o
261       => per_pat_shd.g_old_rec.information10
262       ,p_information11_o
263       => per_pat_shd.g_old_rec.information11
264       ,p_information12_o
265       => per_pat_shd.g_old_rec.information12
266       ,p_information13_o
267       => per_pat_shd.g_old_rec.information13
268       ,p_information14_o
269       => per_pat_shd.g_old_rec.information14
270       ,p_information15_o
271       => per_pat_shd.g_old_rec.information15
272       ,p_information16_o
273       => per_pat_shd.g_old_rec.information16
274       ,p_information17_o
275       => per_pat_shd.g_old_rec.information17
276       ,p_information18_o
277       => per_pat_shd.g_old_rec.information18
278       ,p_information19_o
279       => per_pat_shd.g_old_rec.information19
280       ,p_information20_o
281       => per_pat_shd.g_old_rec.information20
282       );
283     --
284   exception
285     --
286     when hr_api.cannot_find_prog_unit then
287       --
288       hr_api.cannot_find_prog_unit_error
289         (p_module_name => 'PER_ALLOCATED_TASKS'
290         ,p_hook_type   => 'AD');
291       --
292   end;
293   --
294   hr_utility.set_location(' Leaving:'||l_proc, 10);
295 End post_delete;
296 --
297 -- ----------------------------------------------------------------------------
298 -- |---------------------------------< del >----------------------------------|
299 -- ----------------------------------------------------------------------------
300 Procedure del
301   (p_rec              in per_pat_shd.g_rec_type
302   ) is
303 --
304   l_proc  varchar2(72) := g_package||'del';
305 --
306 Begin
307   hr_utility.set_location('Entering:'||l_proc, 5);
308   --
309   -- We must lock the row which we need to delete.
310   --
311   per_pat_shd.lck
312     (p_rec.allocated_task_id
313     ,p_rec.object_version_number
314     );
315   --
316   -- Call the supporting delete validate operation
317   --
318   per_pat_bus.delete_validate(p_rec);
319   --
320   -- Call to raise any errors on multi-message list
321   hr_multi_message.end_validation_set;
322   --
323   -- Call the supporting pre-delete operation
324   --
325   per_pat_del.pre_delete(p_rec);
326   --
327   -- Delete the row.
328   --
329   per_pat_del.delete_dml(p_rec);
330   --
331   -- Call the supporting post-delete operation
332   --
333   per_pat_del.post_delete(p_rec);
334   --
335   -- Call to raise any errors on multi-message list
336   hr_multi_message.end_validation_set;
337   --
338 End del;
339 --
343 Procedure del
340 -- ----------------------------------------------------------------------------
341 -- |---------------------------------< del >----------------------------------|
342 -- ----------------------------------------------------------------------------
344   (p_allocated_task_id                    in     number
345   ,p_object_version_number                in     number
346   ) is
347 --
348   l_rec   per_pat_shd.g_rec_type;
349   l_proc  varchar2(72) := g_package||'del';
350 --
351 Begin
352   hr_utility.set_location('Entering:'||l_proc, 5);
353   --
354   -- As the delete procedure accepts a plsql record structure we do need to
355   -- convert the  arguments into the record structure.
359   l_rec.allocated_task_id := p_allocated_task_id;
356   -- We don't need to call the supplied conversion argument routine as we
357   -- only need a few attributes.
358   --
360   l_rec.object_version_number := p_object_version_number;
361   --
362   -- Having converted the arguments into the per_pat_rec
363   -- plsql record structure we must call the corresponding entity
364   -- business process
365   --
366   per_pat_del.del(l_rec);
367   --
368   hr_utility.set_location(' Leaving:'||l_proc, 10);
369 End del;
370 --
371 end per_pat_del;