1 package body irc_iof_del as
2 /* $Header: iriofrhi.pkb 120.20 2011/04/08 12:04:09 amikukum ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | private global definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' irc_iof_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 irc_iof_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 --
62 -- delete the irc_offers row.
63 --
64 delete from irc_offers
65 where offer_id = p_rec.offer_id;
66 --
67 --
68 --
69 hr_utility.set_location(' leaving:'||l_proc, 10);
70 --
71 exception
72 when hr_api.child_integrity_violated then
73 -- child integrity has been violated
74 --
75 irc_iof_shd.constraint_error
76 (p_constraint_name => hr_api.strip_constraint_name(sqlerrm));
77 when others then
78 --
79 raise;
80 end delete_dml;
81 --
82 -- ----------------------------------------------------------------------------
83 -- |------------------------------< pre_delete >------------------------------|
84 -- ----------------------------------------------------------------------------
85 -- {start of comments}
86 --
87 -- description:
88 -- this private procedure contains any processing which is required before
89 -- the delete dml.
90 --
91 -- prerequisites:
92 -- this is an internal procedure which is called from the del procedure.
93 --
94 -- in parameters:
95 -- a pl/sql record structre.
96 --
97 -- post success:
98 -- processing continues.
99 --
100 -- post failure:
101 -- if an error has occurred, an error message and exception will be raised
102 -- but not handled.
103 --
104 -- developer implementation notes:
105 -- any pre-processing required before the delete dml is issued should be
106 -- coded within this procedure. it is important to note that any 3rd party
107 -- maintenance should be reviewed before placing in this procedure.
108 --
109 -- access status:
110 -- internal row handler use only.
111 --
112 -- {end of comments}
113 -- ----------------------------------------------------------------------------
114 procedure pre_delete(p_rec in irc_iof_shd.g_rec_type) is
115 --
116 l_proc varchar2(72) := g_package||'pre_delete';
117 --
118 begin
119 hr_utility.set_location('entering:'||l_proc, 5);
120 --
121 hr_utility.set_location(' leaving:'||l_proc, 10);
122 end pre_delete;
123 --
124 -- ----------------------------------------------------------------------------
125 -- |-----------------------------< post_delete >------------------------------|
126 -- ----------------------------------------------------------------------------
127 -- {start of comments}
128 --
129 -- description:
130 -- this private procedure contains any processing which is required after
131 -- the delete dml.
132 --
133 -- prerequistes:
134 -- this is an internal procedure which is called from the del procedure.
135 --
136 -- in parameters:
137 -- a pl/sql record structure.
138 --
139 -- post success:
140 -- processing continues.
141 --
142 -- post failure:
143 -- if an error has occurred, an error message and exception will be raised
144 -- but not handled.
145 --
146 -- developer implementation notes:
147 -- any post-processing required after the delete dml is issued should be
148 -- coded within this procedure. it is important to note that any 3rd party
149 -- maintenance should be reviewed before placing in this procedure.
153 --
150 --
151 -- access status:
152 -- internal row handler use only.
154 -- {end of comments}
155 -- -----------------------------------------------------------------------------
156 procedure post_delete(p_rec in irc_iof_shd.g_rec_type) is
157 --
158 l_proc varchar2(72) := g_package||'post_delete';
159 --
160 begin
161 hr_utility.set_location('entering:'||l_proc, 5);
162 begin
163 --
164 irc_iof_rkd.after_delete
165 (p_offer_id
166 => p_rec.offer_id
167 ,p_offer_version_o
168 => irc_iof_shd.g_old_rec.offer_version
169 ,p_latest_offer_o
170 => irc_iof_shd.g_old_rec.latest_offer
171 ,p_offer_status_o
172 => irc_iof_shd.g_old_rec.offer_status
173 ,p_discretionary_job_title_o
174 => irc_iof_shd.g_old_rec.discretionary_job_title
175 ,p_offer_extended_method_o
176 => irc_iof_shd.g_old_rec.offer_extended_method
177 ,p_respondent_id_o
178 => irc_iof_shd.g_old_rec.respondent_id
179 ,p_expiry_date_o
180 => irc_iof_shd.g_old_rec.expiry_date
181 ,p_proposed_start_date_o
182 => irc_iof_shd.g_old_rec.proposed_start_date
183 ,p_offer_letter_tracking_code_o
184 => irc_iof_shd.g_old_rec.offer_letter_tracking_code
185 ,p_offer_postal_service_o
186 => irc_iof_shd.g_old_rec.offer_postal_service
187 ,p_offer_shipping_date_o
188 => irc_iof_shd.g_old_rec.offer_shipping_date
189 ,p_vacancy_id_o
190 => irc_iof_shd.g_old_rec.vacancy_id
191 ,p_applicant_assignment_id_o
192 => irc_iof_shd.g_old_rec.applicant_assignment_id
193 ,p_offer_assignment_id_o
194 => irc_iof_shd.g_old_rec.offer_assignment_id
195 ,p_address_id_o
196 => irc_iof_shd.g_old_rec.address_id
197 ,p_template_id_o
198 => irc_iof_shd.g_old_rec.template_id
199 ,p_offer_letter_file_type_o
200 => irc_iof_shd.g_old_rec.offer_letter_file_type
201 ,p_offer_letter_file_name_o
202 => irc_iof_shd.g_old_rec.offer_letter_file_name
203 ,p_attribute_category_o
204 => irc_iof_shd.g_old_rec.attribute_category
205 ,p_attribute1_o
206 => irc_iof_shd.g_old_rec.attribute1
207 ,p_attribute2_o
208 => irc_iof_shd.g_old_rec.attribute2
209 ,p_attribute3_o
210 => irc_iof_shd.g_old_rec.attribute3
211 ,p_attribute4_o
212 => irc_iof_shd.g_old_rec.attribute4
213 ,p_attribute5_o
214 => irc_iof_shd.g_old_rec.attribute5
215 ,p_attribute6_o
216 => irc_iof_shd.g_old_rec.attribute6
217 ,p_attribute7_o
218 => irc_iof_shd.g_old_rec.attribute7
219 ,p_attribute8_o
220 => irc_iof_shd.g_old_rec.attribute8
221 ,p_attribute9_o
222 => irc_iof_shd.g_old_rec.attribute9
223 ,p_attribute10_o
224 => irc_iof_shd.g_old_rec.attribute10
225 ,p_attribute11_o
226 => irc_iof_shd.g_old_rec.attribute11
227 ,p_attribute12_o
228 => irc_iof_shd.g_old_rec.attribute12
229 ,p_attribute13_o
230 => irc_iof_shd.g_old_rec.attribute13
231 ,p_attribute14_o
232 => irc_iof_shd.g_old_rec.attribute14
233 ,p_attribute15_o
234 => irc_iof_shd.g_old_rec.attribute15
235 ,p_attribute16_o
236 => irc_iof_shd.g_old_rec.attribute16
237 ,p_attribute17_o
238 => irc_iof_shd.g_old_rec.attribute17
239 ,p_attribute18_o
240 => irc_iof_shd.g_old_rec.attribute18
241 ,p_attribute19_o
242 => irc_iof_shd.g_old_rec.attribute19
243 ,p_attribute20_o
244 => irc_iof_shd.g_old_rec.attribute20
245 ,p_attribute21_o
246 => irc_iof_shd.g_old_rec.attribute21
247 ,p_attribute22_o
248 => irc_iof_shd.g_old_rec.attribute22
249 ,p_attribute23_o
250 => irc_iof_shd.g_old_rec.attribute23
251 ,p_attribute24_o
252 => irc_iof_shd.g_old_rec.attribute24
253 ,p_attribute25_o
254 => irc_iof_shd.g_old_rec.attribute25
255 ,p_attribute26_o
256 => irc_iof_shd.g_old_rec.attribute26
257 ,p_attribute27_o
258 => irc_iof_shd.g_old_rec.attribute27
259 ,p_attribute28_o
260 => irc_iof_shd.g_old_rec.attribute28
261 ,p_attribute29_o
262 => irc_iof_shd.g_old_rec.attribute29
263 ,p_attribute30_o
264 => irc_iof_shd.g_old_rec.attribute30
265 ,p_object_version_number_o
266 => irc_iof_shd.g_old_rec.object_version_number
267 );
268 --
269 exception
270 --
271 when hr_api.cannot_find_prog_unit then
272 --
273 hr_api.cannot_find_prog_unit_error
274 (p_module_name => 'irc_offers'
275 ,p_hook_type => 'ad');
276 --
277 end;
278 --
279 hr_utility.set_location(' leaving:'||l_proc, 10);
280 end post_delete;
281 --
282 -- ----------------------------------------------------------------------------
283 -- |---------------------------------< del >----------------------------------|
284 -- ----------------------------------------------------------------------------
285 procedure del
286 (p_rec in irc_iof_shd.g_rec_type
287 ) is
288 --
289 l_proc varchar2(72) := g_package||'del';
290 --
291 begin
292 hr_utility.set_location('entering:'||l_proc, 5);
293 --
294 -- we must lock the row which we need to delete.
295 --
296 irc_iof_shd.lck
297 (p_rec.offer_id
298 ,p_rec.object_version_number
299 );
300 --
301 -- call the supporting delete validate operation
302 --
303 irc_iof_bus.delete_validate(p_rec);
304 --
305 -- call to raise any errors on multi-message list
306 hr_multi_message.end_validation_set;
307 --
308 -- call the supporting pre-delete operation
309 --
310 irc_iof_del.pre_delete(p_rec);
311 --
312 -- delete the row.
313 --
314 irc_iof_del.delete_dml(p_rec);
315 --
316 -- call the supporting post-delete operation
317 --
318 irc_iof_del.post_delete(p_rec);
319 --
320 -- call to raise any errors on multi-message list
321 hr_multi_message.end_validation_set;
322 --
323 end del;
324 --
325 -- ----------------------------------------------------------------------------
326 -- |---------------------------------< del >----------------------------------|
327 -- ----------------------------------------------------------------------------
328 procedure del
329 (p_offer_id in number
330 ,p_object_version_number in number
331 ) is
332 --
333 l_rec irc_iof_shd.g_rec_type;
334 l_proc varchar2(72) := g_package||'del';
335 --
336 begin
337 hr_utility.set_location('entering:'||l_proc, 5);
338 --
339 -- as the delete procedure accepts a plsql record structure we do need to
340 -- convert the arguments into the record structure.
341 -- we don't need to call the supplied conversion argument routine as we
342 -- only need a few attributes.
343 --
344 l_rec.offer_id := p_offer_id;
345 l_rec.object_version_number := p_object_version_number;
346 --
347 -- having converted the arguments into the irc_iof_rec
348 -- plsql record structure we must call the corresponding entity
349 -- business process
350 --
351 irc_iof_del.del(l_rec);
352 --
353 hr_utility.set_location(' leaving:'||l_proc, 10);
354 end del;
355 --
356 end irc_iof_del;