DBA Data[Home] [Help]

PACKAGE BODY: APPS.PE_JEI_DEL

Source


1 Package Body pe_jei_del as
2 /* $Header: pejeirhi.pkb 115.8 2002/12/06 10:38:05 pkakar ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pe_jei_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 delete the specified row from the schema using the primary key in
19 --      the predicates.
20 --   2) To trap any constraint violations that may have occurred.
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 pe_jei_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   --
53   -- Delete the per_job_extra_info row.
54   --
55   delete from per_job_extra_info
56   where job_extra_info_id = p_rec.job_extra_info_id;
57   --
58   --
59   hr_utility.set_location(' Leaving:'||l_proc, 10);
60 --
61 Exception
62   When hr_api.child_integrity_violated then
63     -- Child integrity has been violated
64     pe_jei_shd.constraint_error
65       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
66   When Others Then
67     Raise;
68 End delete_dml;
69 --
70 -- ----------------------------------------------------------------------------
71 -- |------------------------------< pre_delete >------------------------------|
72 -- ----------------------------------------------------------------------------
73 -- {Start Of Comments}
74 --
75 -- Description:
76 --   This private procedure contains any processing which is required before
77 --   the delete dml.
78 --
79 -- Pre Conditions:
80 --   This is an internal procedure which is called from the del procedure.
81 --
82 -- In Parameters:
83 --   A Pl/Sql record structre.
84 --
85 -- Post Success:
86 --   Processing continues.
87 --
88 -- Post Failure:
89 --   If an error has occurred, an error message and exception will be raised
90 --   but not handled.
91 --
92 -- Developer Implementation Notes:
93 --   Any pre-processing required before the delete dml is issued should be
94 --   coded within this procedure. It is important to note that any 3rd party
95 --   maintenance should be reviewed before placing in this procedure.
96 --
97 -- Access Status:
98 --   Internal Table Handler Use Only.
99 --
100 -- {End Of Comments}
101 -- ----------------------------------------------------------------------------
102 Procedure pre_delete(p_rec in pe_jei_shd.g_rec_type) is
103 --
104   l_proc  varchar2(72) := g_package||'pre_delete';
105 --
106 Begin
107   hr_utility.set_location('Entering:'||l_proc, 5);
108   --
109   hr_utility.set_location(' Leaving:'||l_proc, 10);
110 End pre_delete;
111 --
112 -- ----------------------------------------------------------------------------
113 -- |-----------------------------< post_delete >------------------------------|
114 -- ----------------------------------------------------------------------------
115 -- {Start Of Comments}
116 --
117 -- Description:
118 --   This private procedure contains any processing which is required after the
119 --   delete dml.
120 --
121 -- Pre Conditions:
122 --   This is an internal procedure which is called from the del procedure.
123 --
124 -- In Parameters:
125 --   A Pl/Sql record structre.
126 --
127 -- Post Success:
128 --   Processing continues.
129 --
130 -- Post Failure:
131 --   If an error has occurred, an error message and exception will be raised
132 --   but not handled.
133 --
134 -- Developer Implementation Notes:
135 --   Any post-processing required after the delete dml is issued should be
136 --   coded within this procedure. It is important to note that any 3rd party
137 --   maintenance should be reviewed before placing in this procedure.
138 --
139 -- Access Status:
140 --   Internal table Handler Use Only.
141 --
142 -- {End Of Comments}
143 -- ----------------------------------------------------------------------------
144 Procedure post_delete(p_rec in pe_jei_shd.g_rec_type) is
145 --
146   l_proc  varchar2(72) := g_package||'post_delete';
147 --
148 Begin
149   hr_utility.set_location('Entering:'||l_proc, 5);
150   --
151   -- This is a hook point and the user hook for post_delete is called here.
152   --
153   begin
154      pe_jei_rkd.after_delete	(
155 	p_job_extra_info_id_o		=>	pe_jei_shd.g_old_rec.job_extra_info_id		,
156 	p_information_type_o		=>	pe_jei_shd.g_old_rec.information_type		,
157 	p_job_id_o				=>	pe_jei_shd.g_old_rec.job_id				,
158 	p_request_id_o			=>	pe_jei_shd.g_old_rec.request_id			,
159 	p_program_application_id_o	=>	pe_jei_shd.g_old_rec.program_application_id	,
160 	p_program_id_o			=>	pe_jei_shd.g_old_rec.program_id			,
161 	p_program_update_date_o		=>	pe_jei_shd.g_old_rec.program_update_date		,
162 	p_jei_attribute_category_o	=>	pe_jei_shd.g_old_rec.jei_attribute_category	,
163 	p_jei_attribute1_o		=>	pe_jei_shd.g_old_rec.jei_attribute1			,
164 	p_jei_attribute2_o		=>	pe_jei_shd.g_old_rec.jei_attribute2			,
165 	p_jei_attribute3_o		=>	pe_jei_shd.g_old_rec.jei_attribute3			,
166 	p_jei_attribute4_o		=>	pe_jei_shd.g_old_rec.jei_attribute4			,
167 	p_jei_attribute5_o		=>	pe_jei_shd.g_old_rec.jei_attribute5			,
168 	p_jei_attribute6_o		=>	pe_jei_shd.g_old_rec.jei_attribute6			,
169 	p_jei_attribute7_o		=>	pe_jei_shd.g_old_rec.jei_attribute7			,
170 	p_jei_attribute8_o		=>	pe_jei_shd.g_old_rec.jei_attribute8			,
171 	p_jei_attribute9_o		=>	pe_jei_shd.g_old_rec.jei_attribute9			,
172 	p_jei_attribute10_o		=>	pe_jei_shd.g_old_rec.jei_attribute10		,
173 	p_jei_attribute11_o		=>	pe_jei_shd.g_old_rec.jei_attribute11		,
174 	p_jei_attribute12_o		=>	pe_jei_shd.g_old_rec.jei_attribute12		,
175 	p_jei_attribute13_o		=>	pe_jei_shd.g_old_rec.jei_attribute13		,
176 	p_jei_attribute14_o		=>	pe_jei_shd.g_old_rec.jei_attribute14		,
177 	p_jei_attribute15_o		=>	pe_jei_shd.g_old_rec.jei_attribute15		,
178 	p_jei_attribute16_o		=>	pe_jei_shd.g_old_rec.jei_attribute16		,
179 	p_jei_attribute17_o		=>	pe_jei_shd.g_old_rec.jei_attribute17		,
180 	p_jei_attribute18_o		=>	pe_jei_shd.g_old_rec.jei_attribute18		,
181 	p_jei_attribute19_o		=>	pe_jei_shd.g_old_rec.jei_attribute19		,
182 	p_jei_attribute20_o		=>	pe_jei_shd.g_old_rec.jei_attribute20		,
183 	p_jei_information_category_o	=>	pe_jei_shd.g_old_rec.jei_information_category	,
184 	p_jei_information1_o		=>	pe_jei_shd.g_old_rec.jei_information1		,
185 	p_jei_information2_o		=>	pe_jei_shd.g_old_rec.jei_information2		,
186 	p_jei_information3_o		=>	pe_jei_shd.g_old_rec.jei_information3		,
187 	p_jei_information4_o		=>	pe_jei_shd.g_old_rec.jei_information4		,
188 	p_jei_information5_o		=>	pe_jei_shd.g_old_rec.jei_information5		,
189 	p_jei_information6_o		=>	pe_jei_shd.g_old_rec.jei_information6		,
190 	p_jei_information7_o		=>	pe_jei_shd.g_old_rec.jei_information7		,
191 	p_jei_information8_o		=>	pe_jei_shd.g_old_rec.jei_information8		,
192 	p_jei_information9_o		=>	pe_jei_shd.g_old_rec.jei_information9		,
193 	p_jei_information10_o		=>	pe_jei_shd.g_old_rec.jei_information10		,
194 	p_jei_information11_o		=>	pe_jei_shd.g_old_rec.jei_information11		,
195 	p_jei_information12_o		=>	pe_jei_shd.g_old_rec.jei_information12		,
196 	p_jei_information13_o		=>	pe_jei_shd.g_old_rec.jei_information13		,
197 	p_jei_information14_o		=>	pe_jei_shd.g_old_rec.jei_information14		,
198 	p_jei_information15_o		=>	pe_jei_shd.g_old_rec.jei_information15		,
199 	p_jei_information16_o		=>	pe_jei_shd.g_old_rec.jei_information16		,
200 	p_jei_information17_o		=>	pe_jei_shd.g_old_rec.jei_information17		,
201 	p_jei_information18_o		=>	pe_jei_shd.g_old_rec.jei_information18		,
202 	p_jei_information19_o		=>	pe_jei_shd.g_old_rec.jei_information19		,
203 	p_jei_information20_o		=>	pe_jei_shd.g_old_rec.jei_information20		,
204 	p_jei_information21_o		=>	pe_jei_shd.g_old_rec.jei_information21		,
205 	p_jei_information22_o		=>	pe_jei_shd.g_old_rec.jei_information22		,
206 	p_jei_information23_o		=>	pe_jei_shd.g_old_rec.jei_information23		,
207 	p_jei_information24_o		=>	pe_jei_shd.g_old_rec.jei_information24		,
208 	p_jei_information25_o		=>	pe_jei_shd.g_old_rec.jei_information25		,
209 	p_jei_information26_o		=>	pe_jei_shd.g_old_rec.jei_information26		,
210 	p_jei_information27_o		=>	pe_jei_shd.g_old_rec.jei_information27		,
211 	p_jei_information28_o		=>	pe_jei_shd.g_old_rec.jei_information28		,
212 	p_jei_information29_o		=>	pe_jei_shd.g_old_rec.jei_information29		,
213 	p_jei_information30_o		=>	pe_jei_shd.g_old_rec.jei_information30
214 	);
215      exception
216         when hr_api.cannot_find_prog_unit then
217              hr_api.cannot_find_prog_unit_error
218 		 (	p_module_name => 'PER_JOB_EXTRA_INFO'
219 			,p_hook_type  => 'AD'
220 	        );
221   end;
222   -- End of API User Hook for post_delete.
223   hr_utility.set_location(' Leaving:'||l_proc, 10);
224 End post_delete;
225 --
226 -- ----------------------------------------------------------------------------
227 -- |---------------------------------< del >----------------------------------|
228 -- ----------------------------------------------------------------------------
229 Procedure del
230   (
231   p_rec	      in pe_jei_shd.g_rec_type,
232   p_validate  in boolean default false
233   ) is
234 --
235   l_proc  varchar2(72) := g_package||'del';
236 --
237 Begin
238   hr_utility.set_location('Entering:'||l_proc, 5);
239   --
240   -- Determine if the business process is to be validated.
241   --
242   If p_validate then
243     --
244     -- Issue the savepoint.
245     --
246     SAVEPOINT del_pe_jei;
247   End If;
248   --
249   -- We must lock the row which we need to delete.
250   --
251   pe_jei_shd.lck
252 	(
253 	p_rec.job_extra_info_id,
254 	p_rec.object_version_number
255 	);
256   --
257   -- Call the supporting delete validate operation
258   --
259   pe_jei_bus.delete_validate(p_rec);
260   --
261   -- Call the supporting pre-delete operation
262   --
263   pre_delete(p_rec);
264   --
265   -- Delete the row.
266   --
267   delete_dml(p_rec);
268   --
269   -- Call the supporting post-delete operation
270   --
271   post_delete(p_rec);
272   --
273   -- If we are validating then raise the Validate_Enabled exception
274   --
275   If p_validate then
276     Raise HR_Api.Validate_Enabled;
277   End If;
278   --
279   hr_utility.set_location(' Leaving:'||l_proc, 10);
280 Exception
281   When HR_Api.Validate_Enabled Then
282     --
283     -- As the Validate_Enabled exception has been raised
284     -- we must rollback to the savepoint
285     --
286     ROLLBACK TO del_pe_jei;
287 End del;
288 --
289 -- ----------------------------------------------------------------------------
290 -- |---------------------------------< del >----------------------------------|
291 -- ----------------------------------------------------------------------------
292 Procedure del
293   (
294   p_job_extra_info_id                  in number,
295   p_object_version_number              in number,
296   p_validate                           in boolean default false
297   ) is
298 --
299   l_rec	  pe_jei_shd.g_rec_type;
300   l_proc  varchar2(72) := g_package||'del';
301 --
302 Begin
303   hr_utility.set_location('Entering:'||l_proc, 5);
304   --
305   -- As the delete procedure accepts a plsql record structure we do need to
306   -- convert the  arguments into the record structure.
307   -- We don't need to call the supplied conversion argument routine as we
308   -- only need a few attributes.
309   --
310   l_rec.job_extra_info_id:= p_job_extra_info_id;
311   l_rec.object_version_number := p_object_version_number;
312   --
313   -- Having converted the arguments into the pe_jei_rec
314   -- plsql record structure we must call the corresponding entity
315   -- business process
316   --
317   del(l_rec, p_validate);
318   --
319   hr_utility.set_location(' Leaving:'||l_proc, 10);
320 End del;
321 --
322 end pe_jei_del;