[Home] [Help]
PACKAGE BODY: APPS.OTA_OFFERING_API
Source
1 PACKAGE BODY OTA_OFFERING_API as
2 /* $Header: otoffapi.pkb 120.1.12000000.2 2007/02/06 15:27:35 vkkolla noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' OTA_OFFERING_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-------------------------< CREATE_OFFERING >------------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_offering(
13 p_validate in boolean default false
14 ,p_effective_date in date
15 ,p_business_group_id in number
16 ,p_name in varchar2
17 ,p_start_date in date
18 ,p_activity_version_id in number default null
19 ,p_end_date in date default null
20 ,p_owner_id in number default null
21 ,p_delivery_mode_id in number default null
22 ,p_language_id in number default null
23 ,p_duration in number default null
24 ,p_duration_units in varchar2 default null
25 ,p_learning_object_id in number default null
26 ,p_player_toolbar_flag in varchar2 default null
27 ,p_player_toolbar_bitset in number default null
28 ,p_player_new_window_flag in varchar2 default null
29 ,p_maximum_attendees in number default null
30 ,p_maximum_internal_attendees in number default null
31 ,p_minimum_attendees in number default null
32 ,p_actual_cost in number default null
33 ,p_budget_cost in number default null
34 ,p_budget_currency_code in varchar2 default null
35 ,p_price_basis in varchar2 default null
36 ,p_currency_code in varchar2 default null
37 ,p_standard_price in number default null
38 ,p_attribute_category in varchar2 default null
39 ,p_attribute1 in varchar2 default null
40 ,p_attribute2 in varchar2 default null
41 ,p_attribute3 in varchar2 default null
42 ,p_attribute4 in varchar2 default null
43 ,p_attribute5 in varchar2 default null
44 ,p_attribute6 in varchar2 default null
45 ,p_attribute7 in varchar2 default null
46 ,p_attribute8 in varchar2 default null
47 ,p_attribute9 in varchar2 default null
48 ,p_attribute10 in varchar2 default null
49 ,p_attribute11 in varchar2 default null
50 ,p_attribute12 in varchar2 default null
51 ,p_attribute13 in varchar2 default null
52 ,p_attribute14 in varchar2 default null
53 ,p_attribute15 in varchar2 default null
54 ,p_attribute16 in varchar2 default null
55 ,p_attribute17 in varchar2 default null
56 ,p_attribute18 in varchar2 default null
57 ,p_attribute19 in varchar2 default null
58 ,p_attribute20 in varchar2 default null
59 ,p_offering_id out nocopy number
60 ,p_object_version_number out nocopy number
61 ,p_data_source in varchar2 default null
62 ,p_vendor_id in number default null
63 ,p_description in varchar2 default null
64 ,p_competency_update_level in varchar2 default null
65 ,p_language_code in varchar2 default null -- 2733966
66 ) is
67 --
68 -- Declare cursors and local variables
69 --bug 5435877 l_proc variable changed from 'Create Training Plan' to 'Create Offering'
70 l_proc varchar2(72) := g_package||' Create Offering';
71 l_offering_id number;
72 l_object_version_number number;
73 l_effective_date date;
74 l_name varchar2(80);
75 begin
76 hr_utility.set_location('Entering:'|| l_proc, 10);
77 --
78 -- Issue a savepoint
79 --
80 savepoint CREATE_OFFERING;
81 --
82 -- Truncate the time portion from all IN date parameters
83 --
84 l_effective_date := trunc(p_effective_date);
85
86 l_name := rtrim(p_name);
87 --
88 -- Call Before Process User Hook
89 --
90
91 begin
92 ota_offering_bk1.create_offering_b
93 (p_effective_date => l_effective_date
94 ,p_business_group_id => p_business_group_id
95 ,p_name => l_name
96 ,p_start_date => p_start_date
97 ,p_activity_version_id => p_activity_version_id
98 ,p_end_date => p_end_date
99 ,p_owner_id => p_owner_id
100 ,p_delivery_mode_id => p_delivery_mode_id
101 ,p_language_id => p_language_id
102 ,p_duration => p_duration
103 ,p_duration_units => p_duration_units
104 ,p_learning_object_id => p_learning_object_id
105 ,p_player_toolbar_flag => p_player_toolbar_flag
106 ,p_player_toolbar_bitset => p_player_toolbar_bitset
107 ,p_player_new_window_flag => p_player_new_window_flag
108 ,p_maximum_attendees => p_maximum_attendees
109 ,p_maximum_internal_attendees => p_maximum_internal_attendees
110 ,p_minimum_attendees => p_minimum_attendees
111 ,p_actual_cost => p_actual_cost
112 ,p_budget_cost => p_budget_cost
113 ,p_budget_currency_code => p_budget_currency_code
114 ,p_price_basis => p_price_basis
115 ,p_currency_code => p_currency_code
116 ,p_standard_price => p_standard_price
117 ,p_attribute_category => p_attribute_category
118 ,p_attribute1 => p_attribute1
119 ,p_attribute2 => p_attribute2
120 ,p_attribute3 => p_attribute3
121 ,p_attribute4 => p_attribute4
122 ,p_attribute5 => p_attribute5
123 ,p_attribute6 => p_attribute6
124 ,p_attribute7 => p_attribute7
125 ,p_attribute8 => p_attribute8
126 ,p_attribute9 => p_attribute9
127 ,p_attribute10 => p_attribute10
128 ,p_attribute11 => p_attribute11
129 ,p_attribute12 => p_attribute12
130 ,p_attribute13 => p_attribute13
131 ,p_attribute14 => p_attribute14
132 ,p_attribute15 => p_attribute15
133 ,p_attribute16 => p_attribute16
134 ,p_attribute17 => p_attribute17
135 ,p_attribute18 => p_attribute18
136 ,p_attribute19 => p_attribute19
137 ,p_attribute20 => p_attribute20
138 ,p_data_source => p_data_source
139 ,p_vendor_id => p_vendor_id
140 ,p_description => p_description
141 ,p_competency_update_level => p_competency_update_level
142 ,p_language_code => p_language_code -- 2733966
143 );
144 exception
145 when hr_api.cannot_find_prog_unit then
146 hr_api.cannot_find_prog_unit_error
147 (p_module_name => 'CREATE_OFFERING'
148 ,p_hook_type => 'BP'
149 );
150 end;
151 --
152
153 -- Validation in addition to Row Handlers
154 --
155 --
156 -- Process Logic
157 --
158 /*
159 l_end_date := END_DATE(
160 p_start_date ,
161 p_end_date ,
162 p_duration ,
163 p_duration_units );
164 */
165 ota_off_ins.ins
166 ( p_effective_date => l_effective_date
167 ,p_business_group_id => p_business_group_id
168 ,p_name => l_name
169 ,p_start_date => p_start_date
170 ,p_activity_version_id => p_activity_version_id
171 ,p_end_date => p_end_date
172 ,p_owner_id => p_owner_id
173 ,p_delivery_mode_id => p_delivery_mode_id
174 ,p_language_id => p_language_id
175 ,p_duration => p_duration
176 ,p_duration_units => p_duration_units
177 ,p_learning_object_id => p_learning_object_id
178 ,p_player_toolbar_flag => p_player_toolbar_flag
179 ,p_player_toolbar_bitset => p_player_toolbar_bitset
180 ,p_player_new_window_flag => p_player_new_window_flag
181 ,p_maximum_attendees => p_maximum_attendees
182 ,p_maximum_internal_attendees => p_maximum_internal_attendees
183 ,p_minimum_attendees => p_minimum_attendees
184 ,p_actual_cost => p_actual_cost
185 ,p_budget_cost => p_budget_cost
186 ,p_budget_currency_code => p_budget_currency_code
187 ,p_price_basis => p_price_basis
188 ,p_currency_code => p_currency_code
189 ,p_standard_price => p_standard_price
190 ,p_attribute_category => p_attribute_category
191 ,p_attribute1 => p_attribute1
192 ,p_attribute2 => p_attribute2
193 ,p_attribute3 => p_attribute3
194 ,p_attribute4 => p_attribute4
195 ,p_attribute5 => p_attribute5
196 ,p_attribute6 => p_attribute6
197 ,p_attribute7 => p_attribute7
198 ,p_attribute8 => p_attribute8
199 ,p_attribute9 => p_attribute9
200 ,p_attribute10 => p_attribute10
201 ,p_attribute11 => p_attribute11
202 ,p_attribute12 => p_attribute12
203 ,p_attribute13 => p_attribute13
204 ,p_attribute14 => p_attribute14
205 ,p_attribute15 => p_attribute15
206 ,p_attribute16 => p_attribute16
207 ,p_attribute17 => p_attribute17
208 ,p_attribute18 => p_attribute18
209 ,p_attribute19 => p_attribute19
210 ,p_attribute20 => p_attribute20
211 ,p_offering_id => l_offering_id
212 ,p_object_version_number => p_object_version_number
213 ,p_data_source => p_data_source
214 ,p_vendor_id => p_vendor_id
215 ,p_competency_update_level => p_competency_update_level
216 ,p_language_code => p_language_code -- 2733966
217 );
218
219 ota_ont_ins.ins_tl
220 (p_effective_date => l_effective_date
221 ,p_language_code => USERENV('LANG')
222 ,p_offering_id => l_offering_id
223 ,p_name => l_name
224 ,p_description => p_description);
225 --
226 -- Call After Process User Hook
227 --
228
229 begin
230 ota_offering_bk1.create_offering_a
231 (p_effective_date => l_effective_date
232 ,p_business_group_id => p_business_group_id
233 ,p_name => l_name
234 ,p_start_date => p_start_date
235 ,p_activity_version_id => p_activity_version_id
236 ,p_end_date => p_end_date
237 ,p_owner_id => p_owner_id
238 ,p_delivery_mode_id => p_delivery_mode_id
239 ,p_language_id => p_language_id
240 ,p_duration => p_duration
241 ,p_duration_units => p_duration_units
242 ,p_learning_object_id => p_learning_object_id
243 ,p_player_toolbar_flag => p_player_toolbar_flag
244 ,p_player_toolbar_bitset => p_player_toolbar_bitset
245 ,p_player_new_window_flag => p_player_new_window_flag
246 ,p_maximum_attendees => p_maximum_attendees
247 ,p_maximum_internal_attendees => p_maximum_internal_attendees
248 ,p_minimum_attendees => p_minimum_attendees
249 ,p_actual_cost => p_actual_cost
250 ,p_budget_cost => p_budget_cost
251 ,p_budget_currency_code => p_budget_currency_code
252 ,p_price_basis => p_price_basis
253 ,p_currency_code => p_currency_code
254 ,p_standard_price => p_standard_price
255 ,p_attribute_category => p_attribute_category
256 ,p_attribute1 => p_attribute1
257 ,p_attribute2 => p_attribute2
258 ,p_attribute3 => p_attribute3
259 ,p_attribute4 => p_attribute4
260 ,p_attribute5 => p_attribute5
261 ,p_attribute6 => p_attribute6
262 ,p_attribute7 => p_attribute7
263 ,p_attribute8 => p_attribute8
264 ,p_attribute9 => p_attribute9
265 ,p_attribute10 => p_attribute10
266 ,p_attribute11 => p_attribute11
267 ,p_attribute12 => p_attribute12
268 ,p_attribute13 => p_attribute13
269 ,p_attribute14 => p_attribute14
270 ,p_attribute15 => p_attribute15
271 ,p_attribute16 => p_attribute16
272 ,p_attribute17 => p_attribute17
273 ,p_attribute18 => p_attribute18
274 ,p_attribute19 => p_attribute19
275 ,p_attribute20 => p_attribute20
276 ,p_offering_id => l_offering_id
277 ,p_object_version_number => p_object_version_number
278 ,p_data_source => p_data_source
279 ,p_vendor_id => p_vendor_id
280 ,p_description => p_description
281 ,p_competency_update_level => p_competency_update_level
282 ,p_language_code => p_language_code -- 2733966
283 );
284 exception
285 when hr_api.cannot_find_prog_unit then
286 hr_api.cannot_find_prog_unit_error
287 (p_module_name => 'CREATE_OFFERING'
288 ,p_hook_type => 'AP'
289 );
290 end;
291
292 --
293 -- When in validation only mode raise the Validate_Enabled exception
294 --
295 if p_validate then
296 raise hr_api.validate_enabled;
297 end if;
298 --
299 -- Set all output arguments
300 --
301 p_offering_id := l_offering_id;
302 p_object_version_number := l_object_version_number;
303
304
305 hr_utility.set_location(' Leaving:'||l_proc, 70);
306 exception
307 when hr_api.validate_enabled then
308 --
309 -- As the Validate_Enabled exception has been raised
310 -- we must rollback to the savepoint
311 --
312 rollback to CREATE_OFFERING;
313 --
314 -- Only set output warning arguments
315 -- (Any key or derived arguments must be set to null
316 -- when validation only mode is being used.)
317 --
318 p_offering_id := null;
319 p_object_version_number := null;
320 hr_utility.set_location(' Leaving:'||l_proc, 80);
321 when others then
322 --
323 -- A validation or unexpected error has occured
324 --
325 rollback to CREATE_OFFERING;
326 p_offering_id := null;
327 p_object_version_number := null;
328 hr_utility.set_location(' Leaving:'||l_proc, 90);
329 raise;
330 end create_offering;
331 -- ----------------------------------------------------------------------------
332 -- |----------------------------< update_offering >---------------------------|
333 -- ----------------------------------------------------------------------------
334 --
335 procedure update_offering
336 (p_validate in boolean default false
340 ,p_business_group_id in number default hr_api.g_number
337 ,p_effective_date in date
338 ,p_offering_id in number
339 ,p_object_version_number in out nocopy number
341 ,p_name in varchar2 default hr_api.g_varchar2
342 ,p_start_date in date default hr_api.g_date
343 ,p_activity_version_id in number default hr_api.g_number
344 ,p_end_date in date default hr_api.g_date
345 ,p_owner_id in number default hr_api.g_number
346 ,p_delivery_mode_id in number default hr_api.g_number
347 ,p_language_id in number default hr_api.g_number
348 ,p_duration in number default hr_api.g_number
349 ,p_duration_units in varchar2 default hr_api.g_varchar2
350 ,p_learning_object_id in number default hr_api.g_number
351 ,p_player_toolbar_flag in varchar2 default hr_api.g_varchar2
352 ,p_player_toolbar_bitset in number default hr_api.g_number
353 ,p_player_new_window_flag in varchar2 default hr_api.g_varchar2
354 ,p_maximum_attendees in number default hr_api.g_number
355 ,p_maximum_internal_attendees in number default hr_api.g_number
356 ,p_minimum_attendees in number default hr_api.g_number
357 ,p_actual_cost in number default hr_api.g_number
358 ,p_budget_cost in number default hr_api.g_number
359 ,p_budget_currency_code in varchar2 default hr_api.g_varchar2
360 ,p_price_basis in varchar2 default hr_api.g_varchar2
361 ,p_currency_code in varchar2 default hr_api.g_varchar2
362 ,p_standard_price in number default hr_api.g_number
363 ,p_attribute_category in varchar2 default hr_api.g_varchar2
364 ,p_attribute1 in varchar2 default hr_api.g_varchar2
365 ,p_attribute2 in varchar2 default hr_api.g_varchar2
366 ,p_attribute3 in varchar2 default hr_api.g_varchar2
367 ,p_attribute4 in varchar2 default hr_api.g_varchar2
368 ,p_attribute5 in varchar2 default hr_api.g_varchar2
369 ,p_attribute6 in varchar2 default hr_api.g_varchar2
370 ,p_attribute7 in varchar2 default hr_api.g_varchar2
371 ,p_attribute8 in varchar2 default hr_api.g_varchar2
372 ,p_attribute9 in varchar2 default hr_api.g_varchar2
373 ,p_attribute10 in varchar2 default hr_api.g_varchar2
374 ,p_attribute11 in varchar2 default hr_api.g_varchar2
375 ,p_attribute12 in varchar2 default hr_api.g_varchar2
376 ,p_attribute13 in varchar2 default hr_api.g_varchar2
377 ,p_attribute14 in varchar2 default hr_api.g_varchar2
378 ,p_attribute15 in varchar2 default hr_api.g_varchar2
379 ,p_attribute16 in varchar2 default hr_api.g_varchar2
380 ,p_attribute17 in varchar2 default hr_api.g_varchar2
381 ,p_attribute18 in varchar2 default hr_api.g_varchar2
382 ,p_attribute19 in varchar2 default hr_api.g_varchar2
383 ,p_attribute20 in varchar2 default hr_api.g_varchar2
384 ,p_data_source in varchar2 default hr_api.g_varchar2
385 ,p_vendor_id in number default hr_api.g_number
386 ,p_description in varchar2 default hr_api.g_varchar2
387 ,p_competency_update_level in varchar2 default hr_api.g_varchar2
388 ,p_language_code in varchar2 default hr_api.g_varchar2 -- 2733966
389 ) is
390 --
391 -- Declare cursors and local variables
392 --bug 5435877 l_proc variable changed from 'Update Training Plan' to 'Update Offering'
393 l_proc varchar2(72) := g_package||' Update Offering';
394 l_effective_date date;
395 l_object_version_number number := p_object_version_number;
396 l_name varchar2(80);
397 begin
398 hr_utility.set_location('Entering:'|| l_proc, 10);
399 --
400 -- Issue a savepoint
401 --
402 savepoint UPDATE_OFFERING;
403 --
404 -- Truncate the time portion from all IN date parameters
405 --
406 l_effective_date := trunc(p_effective_date);
407 l_name := rtrim(p_name);
408 --
409 -- Call Before Process User Hook
410 --
411
412 begin
413 ota_offering_bk2.update_offering_b
414 (p_effective_date => l_effective_date
415 ,p_business_group_id => p_business_group_id
416 ,p_name => l_name
417 ,p_start_date => p_start_date
418 ,p_activity_version_id => p_activity_version_id
419 ,p_end_date => p_end_date
420 ,p_owner_id => p_owner_id
421 ,p_delivery_mode_id => p_delivery_mode_id
422 ,p_language_id => p_language_id
423 ,p_duration => p_duration
424 ,p_duration_units => p_duration_units
425 ,p_learning_object_id => p_learning_object_id
426 ,p_player_toolbar_flag => p_player_toolbar_flag
427 ,p_player_toolbar_bitset => p_player_toolbar_bitset
431 ,p_minimum_attendees => p_minimum_attendees
428 ,p_player_new_window_flag => p_player_new_window_flag
429 ,p_maximum_attendees => p_maximum_attendees
430 ,p_maximum_internal_attendees => p_maximum_internal_attendees
432 ,p_actual_cost => p_actual_cost
433 ,p_budget_cost => p_budget_cost
434 ,p_budget_currency_code => p_budget_currency_code
435 ,p_price_basis => p_price_basis
436 ,p_currency_code => p_currency_code
437 ,p_standard_price => p_standard_price
438 ,p_attribute_category => p_attribute_category
439 ,p_attribute1 => p_attribute1
440 ,p_attribute2 => p_attribute2
441 ,p_attribute3 => p_attribute3
442 ,p_attribute4 => p_attribute4
443 ,p_attribute5 => p_attribute5
444 ,p_attribute6 => p_attribute6
445 ,p_attribute7 => p_attribute7
446 ,p_attribute8 => p_attribute8
447 ,p_attribute9 => p_attribute9
448 ,p_attribute10 => p_attribute10
449 ,p_attribute11 => p_attribute11
450 ,p_attribute12 => p_attribute12
451 ,p_attribute13 => p_attribute13
452 ,p_attribute14 => p_attribute14
453 ,p_attribute15 => p_attribute15
454 ,p_attribute16 => p_attribute16
455 ,p_attribute17 => p_attribute17
456 ,p_attribute18 => p_attribute18
457 ,p_attribute19 => p_attribute19
458 ,p_attribute20 => p_attribute20
459 ,p_offering_id => p_offering_id
460 ,p_object_version_number => p_object_version_number
461 ,p_data_source => p_data_source
462 ,p_vendor_id => p_vendor_id
463 ,p_description => p_description
464 ,p_competency_update_level => p_competency_update_level
465 ,p_language_code => p_language_code -- 2733966
466 );
467 exception
468 when hr_api.cannot_find_prog_unit then
469 hr_api.cannot_find_prog_unit_error
470 (p_module_name => 'UPDATE_OFFERING'
471 ,p_hook_type => 'BP'
472 );
473 end;
474 --
475 -- Validation in addition to Row Handlers
476 --
477 --
478 -- Process Logic
479 --
480
481 ota_off_upd.upd
482 (p_effective_date => p_effective_date
483 ,p_offering_id => p_offering_id
484 ,p_object_version_number => p_object_version_number
485 ,p_business_group_id => p_business_group_id
486 ,p_name => l_name
487 ,p_start_date => p_start_date
488 ,p_activity_version_id => p_activity_version_id
489 ,p_end_date => p_end_date
490 ,p_owner_id => p_owner_id
491 ,p_delivery_mode_id => p_delivery_mode_id
492 ,p_language_id => p_language_id
493 ,p_duration => p_duration
494 ,p_duration_units => p_duration_units
495 ,p_learning_object_id => p_learning_object_id
496 ,p_player_toolbar_flag => p_player_toolbar_flag
497 ,p_player_toolbar_bitset => p_player_toolbar_bitset
498 ,p_player_new_window_flag => p_player_new_window_flag
499 ,p_maximum_attendees => p_maximum_attendees
500 ,p_maximum_internal_attendees => p_maximum_internal_attendees
501 ,p_minimum_attendees => p_minimum_attendees
502 ,p_actual_cost => p_actual_cost
503 ,p_budget_cost => p_budget_cost
504 ,p_budget_currency_code => p_budget_currency_code
505 ,p_price_basis => p_price_basis
506 ,p_currency_code => p_currency_code
507 ,p_standard_price => p_standard_price
508 ,p_attribute_category => p_attribute_category
509 ,p_attribute1 => p_attribute1
510 ,p_attribute2 => p_attribute2
511 ,p_attribute3 => p_attribute3
512 ,p_attribute4 => p_attribute4
513 ,p_attribute5 => p_attribute5
514 ,p_attribute6 => p_attribute6
515 ,p_attribute7 => p_attribute7
516 ,p_attribute8 => p_attribute8
517 ,p_attribute9 => p_attribute9
518 ,p_attribute10 => p_attribute10
519 ,p_attribute11 => p_attribute11
520 ,p_attribute12 => p_attribute12
521 ,p_attribute13 => p_attribute13
522 ,p_attribute14 => p_attribute14
523 ,p_attribute15 => p_attribute15
524 ,p_attribute16 => p_attribute16
525 ,p_attribute17 => p_attribute17
526 ,p_attribute18 => p_attribute18
527 ,p_attribute19 => p_attribute19
528 ,p_attribute20 => p_attribute20
529 ,p_data_source => p_data_source
530 ,p_vendor_id => p_vendor_id
531 ,p_competency_update_level => p_competency_update_level
532 ,p_language_code => p_language_code -- 2733966
533 );
534
538 ,p_name => l_name
535 ota_ont_upd.upd_tl(p_effective_date => p_effective_date
536 ,p_language_code => USERENV('LANG')
537 ,p_offering_id => p_offering_id
539 ,p_description => p_description
540 );
541 --
542 -- Call After Process User Hook
543 --
544 begin
545 ota_offering_bk2.update_offering_a
546 (p_effective_date => l_effective_date
547 ,p_business_group_id => p_business_group_id
548 ,p_name => l_name
549 ,p_start_date => p_start_date
550 ,p_activity_version_id => p_activity_version_id
551 ,p_end_date => p_end_date
552 ,p_owner_id => p_owner_id
553 ,p_delivery_mode_id => p_delivery_mode_id
554 ,p_language_id => p_language_id
555 ,p_duration => p_duration
556 ,p_duration_units => p_duration_units
557 ,p_learning_object_id => p_learning_object_id
558 ,p_player_toolbar_flag => p_player_toolbar_flag
559 ,p_player_toolbar_bitset => p_player_toolbar_bitset
560 ,p_player_new_window_flag => p_player_new_window_flag
561 ,p_maximum_attendees => p_maximum_attendees
562 ,p_maximum_internal_attendees => p_maximum_internal_attendees
563 ,p_minimum_attendees => p_minimum_attendees
564 ,p_actual_cost => p_actual_cost
565 ,p_budget_cost => p_budget_cost
566 ,p_budget_currency_code => p_budget_currency_code
567 ,p_price_basis => p_price_basis
568 ,p_currency_code => p_currency_code
569 ,p_standard_price => p_standard_price
570 ,p_attribute_category => p_attribute_category
571 ,p_attribute1 => p_attribute1
572 ,p_attribute2 => p_attribute2
573 ,p_attribute3 => p_attribute3
574 ,p_attribute4 => p_attribute4
575 ,p_attribute5 => p_attribute5
576 ,p_attribute6 => p_attribute6
577 ,p_attribute7 => p_attribute7
578 ,p_attribute8 => p_attribute8
579 ,p_attribute9 => p_attribute9
580 ,p_attribute10 => p_attribute10
581 ,p_attribute11 => p_attribute11
582 ,p_attribute12 => p_attribute12
583 ,p_attribute13 => p_attribute13
584 ,p_attribute14 => p_attribute14
585 ,p_attribute15 => p_attribute15
586 ,p_attribute16 => p_attribute16
587 ,p_attribute17 => p_attribute17
588 ,p_attribute18 => p_attribute18
589 ,p_attribute19 => p_attribute19
590 ,p_attribute20 => p_attribute20
591 ,p_offering_id => p_offering_id
592 ,p_object_version_number => p_object_version_number
593 ,p_data_source => p_data_source
594 ,p_vendor_id => p_vendor_id
595 ,p_description => p_description
596 ,p_competency_update_level => p_competency_update_level
597 ,p_language_code => p_language_code -- 2733966
598 );
599 exception
600 when hr_api.cannot_find_prog_unit then
601 hr_api.cannot_find_prog_unit_error
602 (p_module_name => 'UPDATE_OFFERING'
603 ,p_hook_type => 'AP'
604 );
605 end;
606
607 --
608 -- When in validation only mode raise the Validate_Enabled exception
609 --
610 if p_validate then
611 raise hr_api.validate_enabled;
612 end if;
613 --
614 -- Set all output arguments
615 --
616 hr_utility.set_location(' Leaving:'||l_proc, 70);
617 exception
618 when hr_api.validate_enabled then
619 --
620 -- As the Validate_Enabled exception has been raised
621 -- we must rollback to the savepoint
622 --
623 rollback to UPDATE_OFFERING;
624 --
625 -- Only set output warning arguments
626 -- (Any key or derived arguments must be set to null
627 -- when validation only mode is being used.)
628 --
629 p_object_version_number := null;
630 hr_utility.set_location(' Leaving:'||l_proc, 80);
631 when others then
632 --
633 -- A validation or unexpected error has occured
634 --
635 rollback to UPDATE_OFFERING;
636 p_object_version_number := l_object_version_number;
637 hr_utility.set_location(' Leaving:'||l_proc, 90);
638 raise;
639 end update_offering;
640 --
641 -- ----------------------------------------------------------------------------
642 -- |-------------------------< DELETE_OFFERING >------------------------------|
643 -- ----------------------------------------------------------------------------
644 --
645 procedure delete_offering
646 (p_validate in boolean default false
647 ,p_offering_id in number
648 ,p_object_version_number in number
649 ) is
650 --
651 -- Declare cursors and local variables
652 --bug 5435877 l_proc variable changed from 'Delete Training Plan' to 'Delete Offering'
653 l_proc varchar2(72) := g_package||' Delete Offering';
654 l_object_version_id number;
655 --
656 --
657 begin
658 hr_utility.set_location('Entering:'|| l_proc, 10);
659 --
660 -- Issue a savepoint
661 --
662 savepoint DELETE_OFFERING;
663 --
664 -- Truncate the time portion from all IN date parameters
665 --
666 --
667
668 -- Call Before Process User Hook
669 --
670 begin
671 ota_offering_bk3.delete_offering_b
672 (p_offering_id => p_offering_id
673 ,p_object_version_number => p_object_version_number
674 );
675 exception
676 when hr_api.cannot_find_prog_unit then
677 hr_api.cannot_find_prog_unit_error
678 (p_module_name => 'DELETE_OFFERING'
679 ,p_hook_type => 'BP'
680 );
681 end;
682 --
683 -- Validation in addition to Row Handlers
684 --
685 --
686 -- Process Logic
687 --
688 ota_off_del.del
689 (p_offering_id => p_offering_id
690 ,p_object_version_number => p_object_version_number
691 );
692
693 ota_ont_del.del_tl
694 (p_offering_id => p_offering_id
695 --,p_language => USERENV('LANG')
696 );
697 --
698 -- Call After Process User Hook
699 --
700 begin
701 ota_offering_bk3.delete_offering_a
702 (p_offering_id => p_offering_id
703 ,p_object_version_number => p_object_version_number
704 );
705 exception
706 when hr_api.cannot_find_prog_unit then
707 hr_api.cannot_find_prog_unit_error
708 (p_module_name => 'DELETE_OFFERING'
709 ,p_hook_type => 'AP'
710 );
711 end;
712
713 --
714 -- When in validation only mode raise the Validate_Enabled exception
715 --
716 if p_validate then
717 raise hr_api.validate_enabled;
718 end if;
719 --
720 -- Set all output arguments
721 --
722 --
723 hr_utility.set_location(' Leaving:'||l_proc, 170);
724 exception
725 when hr_api.validate_enabled then
726 --
727 -- As the Validate_Enabled exception has been raised
728 -- we must rollback to the savepoint
729 --
730 rollback to DELETE_OFFERING;
731 --
732 -- Only set output warning arguments
733 -- (Any key or derived arguments must be set to null
734 -- when validation only mode is being used.)
735 --
736 hr_utility.set_location(' Leaving:'||l_proc, 180);
737 when others then
738 --
739 -- A validation or unexpected error has occured
740 --
741 rollback to DELETE_OFFERING;
742 hr_utility.set_location(' Leaving:'||l_proc, 190);
743 raise;
744 end delete_offering;
745 --
746
747
748 end ota_offering_api;