[Home] [Help]
PACKAGE BODY: APPS.PER_EVENTS_API
Source
1 Package Body per_events_api as
2 /* $Header: peevtapi.pkb 115.8 2002/12/11 10:37:02 pkakar noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' per_events_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-----------------------------< create_event >-----------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_event
13
14 (p_validate in BOOLEAN default FALSE
15 ,p_date_start in DATE
16 ,p_type in VARCHAR2
17 ,p_business_group_id in NUMBER default NULL --HR/TCA merge
18 ,p_location_id in NUMBER default NULL
19 ,p_internal_contact_person_id in NUMBER default NULL
20 ,p_organization_run_by_id in NUMBER default NULL
21 ,p_assignment_id in NUMBER default NULL
22 ,p_contact_telephone_number in VARCHAR2 default NULL
23 ,p_date_end in DATE default NULL
24 ,p_emp_or_apl in VARCHAR2 default NULL
25 ,p_event_or_interview in VARCHAR2 default NULL
26 ,p_external_contact in VARCHAR2 default NULL
27 ,p_time_end in VARCHAR2 default NULL
28 ,p_time_start in VARCHAR2 default NULL
29 ,p_attribute_category in VARCHAR2 default NULL
30 ,p_attribute1 in VARCHAR2 default NULL
31 ,p_attribute2 in VARCHAR2 default NULL
32 ,p_attribute3 in VARCHAR2 default NULL
33 ,p_attribute4 in VARCHAR2 default NULL
34 ,p_attribute5 in VARCHAR2 default NULL
35 ,p_attribute6 in VARCHAR2 default NULL
36 ,p_attribute7 in VARCHAR2 default NULL
37 ,p_attribute8 in VARCHAR2 default NULL
38 ,p_attribute9 in VARCHAR2 default NULL
39 ,p_attribute10 in VARCHAR2 default NULL
40 ,p_attribute11 in VARCHAR2 default NULL
41 ,p_attribute12 in VARCHAR2 default NULL
42 ,p_attribute13 in VARCHAR2 default NULL
43 ,p_attribute14 in VARCHAR2 default NULL
44 ,p_attribute15 in VARCHAR2 default NULL
45 ,p_attribute16 in VARCHAR2 default NULL
46 ,p_attribute17 in VARCHAR2 default NULL
47 ,p_attribute18 in VARCHAR2 default NULL
48 ,p_attribute19 in VARCHAR2 default NULL
49 ,p_attribute20 in VARCHAR2 default NULL
50 ,p_party_id in NUMBER default NULL
51 ,p_event_id out nocopy NUMBER
52 ,p_object_version_number out nocopy NUMBER
53 ) is
54
55 --
56 -- Declare cursors and local variables
57 --
58
59 l_proc varchar2(72) := g_package||'create_event';
60 l_event_id number;
61 l_object_version_number number;
62 l_date_start date;
63 l_date_end date;
64
65 begin
66 hr_utility.set_location('Entering:'|| l_proc, 10);
67 --
68 -- Issue a savepoint
69 --
70 savepoint create_event;
71 --
72 -- Truncate the time portion from all IN date parameters
73 --
74 l_date_start := trunc(p_date_start);
75 l_date_end := trunc(p_date_end);
76
77 --
78 -- Call Before Process User Hook
79 --
80 begin
81 per_events_bk1.create_event_b
82 (p_date_start => l_date_start
83 ,p_business_group_id => p_business_group_id
84 ,p_type => p_type
85 ,p_location_id => p_location_id
86 ,p_internal_contact_person_id => p_internal_contact_person_id
87 ,p_organization_run_by_id => p_organization_run_by_id
88 ,p_assignment_id => p_assignment_id
89 ,p_contact_telephone_number => p_contact_telephone_number
90 ,p_date_end => l_date_end
91 ,p_emp_or_apl => p_emp_or_apl
92 ,p_event_or_interview => p_event_or_interview
93 ,p_external_contact => p_external_contact
94 ,p_time_end => p_time_end
95 ,p_time_start => p_time_start
96 ,p_attribute_category => p_attribute_category
97 ,p_attribute1 => p_attribute1
98 ,p_attribute2 => p_attribute2
99 ,p_attribute3 => p_attribute3
100 ,p_attribute4 => p_attribute4
101 ,p_attribute5 => p_attribute5
102 ,p_attribute6 => p_attribute6
103 ,p_attribute7 => p_attribute7
104 ,p_attribute8 => p_attribute8
105 ,p_attribute9 => p_attribute9
106 ,p_attribute10 => p_attribute10
107 ,p_attribute11 => p_attribute11
108 ,p_attribute12 => p_attribute12
109 ,p_attribute13 => p_attribute13
110 ,p_attribute14 => p_attribute14
111 ,p_attribute15 => p_attribute15
112 ,p_attribute16 => p_attribute16
113 ,p_attribute17 => p_attribute17
114 ,p_attribute18 => p_attribute18
115 ,p_attribute19 => p_attribute19
116 ,p_attribute20 => p_attribute20
117 ,p_party_id => p_party_id --HR/TCA merge
118 );
119 exception
120 when hr_api.cannot_find_prog_unit then
121 hr_api.cannot_find_prog_unit_error
122 (p_module_name => 'create_event'
123 ,p_hook_type => 'BP'
124 );
125 end;
126
127 --
128 -- Process Logic
129 --
130 per_evt_ins.ins
131 (p_date_start => p_date_start
132 ,p_business_group_id => p_business_group_id
133 ,p_type => p_type
134 ,p_location_id => p_location_id
135 ,p_internal_contact_person_id => p_internal_contact_person_id
136 ,p_organization_run_by_id => p_organization_run_by_id
137 ,p_assignment_id => p_assignment_id
138 ,p_contact_telephone_number => p_contact_telephone_number
139 ,p_date_end => p_date_end
140 ,p_emp_or_apl => p_emp_or_apl
141 ,p_event_or_interview => p_event_or_interview
142 ,p_external_contact => p_external_contact
143 ,p_time_end => p_time_end
144 ,p_time_start => p_time_start
145 ,p_attribute_category => p_attribute_category
146 ,p_attribute1 => p_attribute1
147 ,p_attribute2 => p_attribute2
148 ,p_attribute3 => p_attribute3
149 ,p_attribute4 => p_attribute4
150 ,p_attribute5 => p_attribute5
151 ,p_attribute6 => p_attribute6
152 ,p_attribute7 => p_attribute7
153 ,p_attribute8 => p_attribute8
154 ,p_attribute9 => p_attribute9
155 ,p_attribute10 => p_attribute10
156 ,p_attribute11 => p_attribute11
157 ,p_attribute12 => p_attribute12
158 ,p_attribute13 => p_attribute13
159 ,p_attribute14 => p_attribute14
160 ,p_attribute15 => p_attribute15
161 ,p_attribute16 => p_attribute16
162 ,p_attribute17 => p_attribute17
163 ,p_attribute18 => p_attribute18
164 ,p_attribute19 => p_attribute19
165 ,p_attribute20 => p_attribute20
166 ,p_party_id => p_party_id --HR/TCA merge
167 ,p_event_id => l_event_id
168 ,p_object_version_number => l_object_version_number
169 );
170
171 --
172 -- Call After Process User Hook
173 --
174 begin
175 per_events_bk1.create_event_a
176 (p_date_start => p_date_start
177 ,p_business_group_id => p_business_group_id
178 ,p_type => p_type
179 ,p_location_id => p_location_id
180 ,p_internal_contact_person_id => p_internal_contact_person_id
181 ,p_organization_run_by_id => p_organization_run_by_id
182 ,p_assignment_id => p_assignment_id
183 ,p_contact_telephone_number => p_contact_telephone_number
184 ,p_date_end => p_date_end
185 ,p_emp_or_apl => p_emp_or_apl
186 ,p_event_or_interview => p_event_or_interview
187 ,p_external_contact => p_external_contact
188 ,p_time_end => p_time_end
189 ,p_time_start => p_time_start
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_party_id => p_party_id -- HR/TCA merge
212 );
213 exception
214 when hr_api.cannot_find_prog_unit then
215 hr_api.cannot_find_prog_unit_error
216 (p_module_name => 'create_event'
217 ,p_hook_type => 'AP'
218 );
219 end;
220 --
221 -- When in validation only mode raise the Validate_Enabled exception
222 --
223 if p_validate then
224 raise hr_api.validate_enabled;
225 end if;
226 --
227 -- Set all output arguments
228 --
229 p_event_id := l_event_id;
230 p_object_version_number := l_object_version_number;
231 --
232 hr_utility.set_location(' Leaving:'||l_proc, 70);
233 exception
234 when hr_api.validate_enabled then
235 --
236 -- As the Validate_Enabled exception has been raised
237 -- we must rollback to the savepoint
238 --
239 rollback to create_event;
240 --
241 -- Only set output warning arguments
242 -- (Any key or derived arguments must be set to null
243 -- when validation only mode is being used.)
244 --
245 p_event_id := null;
246 p_object_version_number := null;
247 hr_utility.set_location(' Leaving:'||l_proc, 80);
248 when others then
249 --
250 -- A validation or unexpected error has occured
251 --
252 rollback to create_event;
253 --
254 -- set in out parameters and set out parameters
255 --
256 p_event_id := null;
257 p_object_version_number := null;
258 hr_utility.set_location(' Leaving:'||l_proc, 90);
259 raise;
260 end create_event;
261
262 --
263 -- ----------------------------------------------------------------------------
264 -- |-----------------------------< update_event >-----------------------------|
265 -- ----------------------------------------------------------------------------
266 --
267 procedure update_event
268 (p_validate in BOOLEAN default FALSE
269 ,p_location_id in NUMBER default hr_api.g_number
270 ,p_business_group_id in NUMBER default hr_api.g_number
271 ,p_internal_contact_person_id in NUMBER default hr_api.g_number
272 ,p_organization_run_by_id in NUMBER default hr_api.g_number
273 ,p_assignment_id in NUMBER default hr_api.g_number
274 ,p_contact_telephone_number in VARCHAR2 default hr_api.g_varchar2
275 ,p_date_end in DATE default hr_api.g_date
276 ,p_emp_or_apl in VARCHAR2 default hr_api.g_varchar2
277 ,p_event_or_interview in VARCHAR2 default hr_api.g_varchar2
278 ,p_external_contact in VARCHAR2 default hr_api.g_varchar2
279 ,p_time_end in VARCHAR2 default hr_api.g_varchar2
280 ,p_time_start in VARCHAR2 default hr_api.g_varchar2
281 ,p_attribute_category in VARCHAR2 default hr_api.g_varchar2
282 ,p_attribute1 in VARCHAR2 default hr_api.g_varchar2
283 ,p_attribute2 in VARCHAR2 default hr_api.g_varchar2
284 ,p_attribute3 in VARCHAR2 default hr_api.g_varchar2
285 ,p_attribute4 in VARCHAR2 default hr_api.g_varchar2
286 ,p_attribute5 in VARCHAR2 default hr_api.g_varchar2
287 ,p_attribute6 in VARCHAR2 default hr_api.g_varchar2
288 ,p_attribute7 in VARCHAR2 default hr_api.g_varchar2
289 ,p_attribute8 in VARCHAR2 default hr_api.g_varchar2
290 ,p_attribute9 in VARCHAR2 default hr_api.g_varchar2
291 ,p_attribute10 in VARCHAR2 default hr_api.g_varchar2
292 ,p_attribute11 in VARCHAR2 default hr_api.g_varchar2
293 ,p_attribute12 in VARCHAR2 default hr_api.g_varchar2
294 ,p_attribute13 in VARCHAR2 default hr_api.g_varchar2
295 ,p_attribute14 in VARCHAR2 default hr_api.g_varchar2
296 ,p_attribute15 in VARCHAR2 default hr_api.g_varchar2
297 ,p_attribute16 in VARCHAR2 default hr_api.g_varchar2
298 ,p_attribute17 in VARCHAR2 default hr_api.g_varchar2
299 ,p_attribute18 in VARCHAR2 default hr_api.g_varchar2
300 ,p_attribute19 in VARCHAR2 default hr_api.g_varchar2
301 ,p_attribute20 in VARCHAR2 default hr_api.g_varchar2
302 ,p_date_start in DATE default hr_api.g_date
303 ,p_type in VARCHAR2 default hr_api.g_varchar2
304 ,p_party_id in NUMBER default hr_api.g_number
305 ,p_event_id in out nocopy NUMBER
306 ,p_object_version_number in out nocopy NUMBER
307 ) is
308 --
309 -- Declare cursors and local variables
310 --
311
312 l_proc varchar2(72) := g_package||'update_event';
313 l_event_id number;
314 l_object_version_number number;
315 l_date_start date;
316 l_date_end date; l_ovn number := p_object_version_number;
320 hr_utility.set_location('Entering:'|| l_proc, 10);
317 l_temp_event_id number := p_event_id;
318
319 begin
321 --
322 -- Issue a savepoint
323 --
324 savepoint update_event;
325 --
326 -- Truncate the time portion from all IN date parameters
327 --
328 l_date_start := trunc(p_date_start);
329 l_date_end := trunc(p_date_end);
330
331 --
332 -- Call Before Process User Hook
333 --
334 begin
335 per_events_bk2.update_event_b
336 (p_event_id => p_event_id
337 ,p_type => p_type
338 ,p_location_id => p_location_id
339 ,p_internal_contact_person_id => p_internal_contact_person_id
340 ,p_organization_run_by_id => p_organization_run_by_id
341 ,p_assignment_id => p_assignment_id
342 ,p_contact_telephone_number => p_contact_telephone_number
343 ,p_date_end => l_date_end
344 ,p_emp_or_apl => p_emp_or_apl
345 ,p_event_or_interview => p_event_or_interview
346 ,p_external_contact => p_external_contact
347 ,p_time_end => p_time_end
348 ,p_time_start => p_time_start
349 ,p_attribute_category => p_attribute_category
350 ,p_attribute1 => p_attribute1
351 ,p_attribute2 => p_attribute2
352 ,p_attribute3 => p_attribute3
353 ,p_attribute4 => p_attribute4
354 ,p_attribute5 => p_attribute5
355 ,p_attribute6 => p_attribute6
356 ,p_attribute7 => p_attribute7
357 ,p_attribute8 => p_attribute8
358 ,p_attribute9 => p_attribute9
359 ,p_attribute10 => p_attribute10
360 ,p_attribute11 => p_attribute11
361 ,p_attribute12 => p_attribute12
362 ,p_attribute13 => p_attribute13
363 ,p_attribute14 => p_attribute14
364 ,p_attribute15 => p_attribute15
365 ,p_attribute16 => p_attribute16
366 ,p_attribute17 => p_attribute17
367 ,p_attribute18 => p_attribute18
368 ,p_attribute19 => p_attribute19
369 ,p_attribute20 => p_attribute20
370 ,p_party_id => p_party_id
371 );
372 exception
373 when hr_api.cannot_find_prog_unit then
374 hr_api.cannot_find_prog_unit_error
375 (p_module_name => 'update_event'
376 ,p_hook_type => 'BP'
377 );
378 end;
379 --
380 -- Validation in addition to Row Handlers
381 --
382
383 -- None
384
385 --
386 -- Process Logic
387 --
388 l_object_version_number := p_object_version_number;
389 l_event_id := p_event_id;
390 per_evt_upd.upd
391 (p_event_id => l_event_id
392 ,p_object_version_number => l_object_version_number
393 ,p_date_start => p_date_start
394 ,p_type => p_type
395 ,p_business_group_id => p_business_group_id
396 ,p_location_id => p_location_id
397 ,p_internal_contact_person_id => p_internal_contact_person_id
398 ,p_organization_run_by_id => p_organization_run_by_id
399 ,p_assignment_id => p_assignment_id
400 ,p_contact_telephone_number => p_contact_telephone_number
401 ,p_date_end => p_date_end
402 ,p_emp_or_apl => p_emp_or_apl
403 ,p_event_or_interview => p_event_or_interview
404 ,p_external_contact => p_external_contact
405 ,p_time_end => p_time_end
406 ,p_time_start => p_time_start
407 ,p_attribute_category => p_attribute_category
408 ,p_attribute1 => p_attribute1
409 ,p_attribute2 => p_attribute2
410 ,p_attribute3 => p_attribute3
411 ,p_attribute4 => p_attribute4
412 ,p_attribute5 => p_attribute5
413 ,p_attribute6 => p_attribute6
414 ,p_attribute7 => p_attribute7
415 ,p_attribute8 => p_attribute8
416 ,p_attribute9 => p_attribute9
417 ,p_attribute10 => p_attribute10
418 ,p_attribute11 => p_attribute11
419 ,p_attribute12 => p_attribute12
420 ,p_attribute13 => p_attribute13
421 ,p_attribute14 => p_attribute14
422 ,p_attribute15 => p_attribute15
423 ,p_attribute16 => p_attribute16
424 ,p_attribute17 => p_attribute17
425 ,p_attribute18 => p_attribute18
426 ,p_attribute19 => p_attribute19
427 ,p_attribute20 => p_attribute20
428 ,p_party_id => p_party_id -- HR/TCA merge
429 );
430
431 --
432 -- Call After Process User Hook
433 --
437 ,p_type => p_type
434 begin
435 per_events_bk2.update_event_a
436 (p_event_id => p_event_id
438 ,p_location_id => p_location_id
439 ,p_internal_contact_person_id => p_internal_contact_person_id
440 ,p_organization_run_by_id => p_organization_run_by_id
441 ,p_assignment_id => p_assignment_id
442 ,p_contact_telephone_number => p_contact_telephone_number
443 ,p_date_end => p_date_end
444 ,p_emp_or_apl => p_emp_or_apl
445 ,p_event_or_interview => p_event_or_interview
446 ,p_external_contact => p_external_contact
447 ,p_time_end => p_time_end
448 ,p_time_start => p_time_start
449 ,p_attribute_category => p_attribute_category
450 ,p_attribute1 => p_attribute1
451 ,p_attribute2 => p_attribute2
452 ,p_attribute3 => p_attribute3
453 ,p_attribute4 => p_attribute4
454 ,p_attribute5 => p_attribute5
455 ,p_attribute6 => p_attribute6
456 ,p_attribute7 => p_attribute7
457 ,p_attribute8 => p_attribute8
458 ,p_attribute9 => p_attribute9
459 ,p_attribute10 => p_attribute10
460 ,p_attribute11 => p_attribute11
461 ,p_attribute12 => p_attribute12
462 ,p_attribute13 => p_attribute13
463 ,p_attribute14 => p_attribute14
464 ,p_attribute15 => p_attribute15
465 ,p_attribute16 => p_attribute16
466 ,p_attribute17 => p_attribute17
467 ,p_attribute18 => p_attribute18
468 ,p_attribute19 => p_attribute19
469 ,p_attribute20 => p_attribute20
470 ,p_party_id => p_party_id -- HR/TCA merge
471 );
472 exception
473 when hr_api.cannot_find_prog_unit then
474 hr_api.cannot_find_prog_unit_error
475 (p_module_name => 'update_event'
476 ,p_hook_type => 'AP'
477 );
478 end;
479 --
480 -- When in validation only mode raise the Validate_Enabled exception
481 --
482 if p_validate then
483 raise hr_api.validate_enabled;
484 end if;
485 --
486 -- Set all output arguments
487 --
488 p_event_id := l_event_id;
489 p_object_version_number := l_object_version_number;
490 --
491 hr_utility.set_location(' Leaving:'||l_proc, 70);
492 exception
493 when hr_api.validate_enabled then
494 --
495 -- As the Validate_Enabled exception has been raised
496 -- we must rollback to the savepoint
497 --
498 rollback to update_event;
499 --
500 -- Only set output warning arguments
501 -- (Any key or derived arguments must be set to null
502 -- when validation only mode is being used.)
503 --
504 p_event_id := null;
505 p_object_version_number := null;
506 hr_utility.set_location(' Leaving:'||l_proc, 80);
507 when others then
508 --
509 -- A validation or unexpected error has occured
510 --
511 rollback to update_event;
512 --
513 -- set in out parameters and set out parameters
514 --
515 p_event_id := l_temp_event_id;
516 p_object_version_number := l_ovn;
517 hr_utility.set_location(' Leaving:'||l_proc, 90);
518 raise;
519 end update_event;
520
521 --
522 -- ----------------------------------------------------------------------------
523 -- |-----------------------------< delete_event >-----------------------------|
524 -- ----------------------------------------------------------------------------
525 --
526 procedure delete_event
527 (p_validate in boolean default false
528 ,p_event_id in number
529 ,p_object_version_number in number
530 ) is
531 --
532 -- Declare cursors and local variables
533 --
534
535 l_proc varchar2(72) := g_package||'delete_event';
536 l_event_id number;
537 l_object_version_number number;
538 begin
539 hr_utility.set_location('Entering:'|| l_proc, 10);
540 --
541 -- Issue a savepoint
542 --
543 savepoint delete_event;
544
545 --
546 -- Call Before Process User Hook
547 --
548 begin
549 per_events_bk3.delete_event_b
550 (p_event_id => p_event_id
551 ,p_object_version_number => p_object_version_number
552 );
553 exception
554 when hr_api.cannot_find_prog_unit then
555 hr_api.cannot_find_prog_unit_error
556 (p_module_name => 'delete_event'
557 ,p_hook_type => 'BP'
558 );
559 end;
560 --
561 -- Validation in addition to Row Handlers
562 --
563
564 -- NONE
565
566 --
567 -- Process Logic
568 --
569 per_evt_del.del
570 (p_event_id => p_event_id
571 ,p_object_version_number => p_object_version_number);
572
573 --
574 -- Call After Process User Hook
575 --
576 begin
577 per_events_bk3.delete_event_a
578 (p_event_id => p_event_id
579 ,p_object_version_number => p_object_version_number
580 );
581 exception
582 when hr_api.cannot_find_prog_unit then
583 hr_api.cannot_find_prog_unit_error
584 (p_module_name => 'delete_event'
585 ,p_hook_type => 'AP'
586 );
587 end;
588 --
589 -- When in validation only mode raise the Validate_Enabled exception
590 --
591 if p_validate then
592 raise hr_api.validate_enabled;
593 end if;
594 hr_utility.set_location(' Leaving:'||l_proc, 70);
595
596 exception
597 when hr_api.validate_enabled then
598 --
599 -- As the Validate_Enabled exception has been raised
600 -- we must rollback to the savepoint
601 --
602 rollback to delete_event;
603 --
604 -- Only set output warning arguments
605 -- (Any key or derived arguments must be set to null
606 -- when validation only mode is being used.)
607 --
608 hr_utility.set_location(' Leaving:'||l_proc, 80);
609 when others then
610 --
611 -- A validation or unexpected error has occured
612 --
613 rollback to delete_event;
614 hr_utility.set_location(' Leaving:'||l_proc, 90);
615 raise;
616 end delete_event;
617
618 --
619 end per_events_api;