82: pragma exception_init(e_validation_error, -20001);
83:
84: begin
85:
86: hr_utility.set_location('Entering:'|| l_proc, 10);
87:
88: --
89: -- Issue a savepoint
90: --
88: --
89: -- Issue a savepoint
90: --
91: savepoint AUTO_ENROLL_FROM_WAITLIST;
92: hr_utility.set_location(l_proc, 20);
93:
94: --
95: -- Call Before Process User Hook
96: --
106: ,p_hook_type => 'BP'
107: );
108: end;
109:
110: hr_utility.set_location(l_proc, 30);
111: --
112: -- Validation in addition to Row Handlers
113: --
114:
113: --
114:
115:
116:
117: hr_utility.set_location(l_proc, 40);
118: --
119: -- Process Logic
120: --
121:
188:
189: if t_waitlist_table(i).number_of_places <= l_vacancies or
190: l_vacancies is null then
191: --
192: hr_utility.set_location('UPDATING DETAILS FOR BOOKING #'||to_char(t_waitlist_table(i).booking_id), 41);
193: begin
194: --
195: l_dummy := ota_tdb_bus2.other_bookings_clash(to_char(t_waitlist_table(i).delegate_person_id),
196: to_char(t_waitlist_table(i).delegate_contact_id),
196: to_char(t_waitlist_table(i).delegate_contact_id),
197: p_event_id,
198: l_status_type_id);
199:
200: hr_utility.set_location('NEW STATUS = '||to_char(l_status_type_id), 42);
201:
202: ota_tdb_api_upd2.update_enrollment(
203: p_booking_id => t_waitlist_table(i).booking_id
204: ,p_object_version_number => t_waitlist_table(i).object_version_number
213:
214: --
215: exception
216: when e_validation_error then
217: hr_utility.set_location('ENROLLMENT ERROR BEING HANDLED', 49);
218:
219: --
220: -- This exception handler is executed following any application
221: -- error encountered when attempting to enroll a delegate from
237: --
238: end if;
239:
240:
241: hr_utility.set_location(l_proc, 50);
242: --
243: -- Call After Process User Hook
244: --
245: begin
253: (p_module_name => 'AUTO_ENROLL_FROM_WAITLIST'
254: ,p_hook_type => 'AP'
255: );
256: end;
257: hr_utility.set_location(l_proc, 60);
258: --
259: -- When in validation only mode raise the Validate_Enabled exception
260: --
261: if p_validate then
261: if p_validate then
262: raise hr_api.validate_enabled;
263: end if;
264: --
265: hr_utility.set_location(' Leaving:'||l_proc, 70);
266: exception
267: when hr_api.validate_enabled then
268: --
269: -- As the Validate_Enabled exception has been raised
270: -- we must rollback to the savepoint
271: --
272: rollback to AUTO_ENROLL_FROM_WAITLIST;
273: --
274: hr_utility.set_location(' Leaving:'||l_proc, 80);
275: when others then
276: --
277: -- A validation or unexpected error has occured
278: --
276: --
277: -- A validation or unexpected error has occured
278: --
279: rollback to AUTO_ENROLL_FROM_WAITLIST;
280: hr_utility.set_location(' Leaving:'||l_proc, 90);
281: raise;
282: end AUTO_ENROLL_FROM_WAITLIST;
283: --
284: end OTA_TDB_WAITLIST_API;