23: ln_ovn NUMBER ;
24:
25: BEGIN
26:
27: hr_utility.set_location(' Entering:' || l_proc,5);
28: hr_util_misc_web.validate_session(p_person_id => lv_creator_person_id);
29:
30: ln_transaction_id := hr_transaction_ss.get_transaction_id
31: (p_Item_Type => p_item_type
34:
35: IF ln_transaction_id IS NULL
36: THEN
37:
38: hr_utility.set_location(l_proc,10);
39: hr_transaction_ss.start_transaction
40: (itemtype => p_item_type
41: ,itemkey => p_item_key
42: ,actid => p_act_id
59:
60:
61: IF ln_transaction_step_id IS NULL THEN
62:
63: hr_utility.set_location(l_proc,15);
64:
65: --There is no transaction step for this transaction.
66: --Create a step within this new transaction
67:
96: p_transaction_id := ln_transaction_id ;
97: p_transaction_step_id := ln_transaction_step_id ;
98:
99:
100: hr_utility.set_location(' Leaving:' || l_proc,20);
101:
102: EXCEPTION
103:
104: WHEN OTHERS THEN
101:
102: EXCEPTION
103:
104: WHEN OTHERS THEN
105: hr_utility.trace(' hr_caed.create_transaction: ' || SQLERRM);
106: hr_utility.set_location(' Leaving:' || l_proc,555);
107:
108: raise ;
109: return ;
102: EXCEPTION
103:
104: WHEN OTHERS THEN
105: hr_utility.trace(' hr_caed.create_transaction: ' || SQLERRM);
106: hr_utility.set_location(' Leaving:' || l_proc,555);
107:
108: raise ;
109: return ;
110: commit ;
128:
129: BEGIN
130:
131:
132: hr_utility.set_location(' Entering:' || l_proc,5);
133: hr_util_misc_web.validate_session(p_person_id => lv_creator_person_id);
134:
135:
136:
204: p_name => 'P_REVIEW_PROC_CALL' ,
205: p_value =>p_review_proc_call ) ;
206:
207:
208: hr_utility.set_location(' Leaving:' || l_proc,10);
209:
210: EXCEPTION
211: WHEN OTHERS THEN
212: hr_utility.trace(' HR_CAED_SS.write_transaction ' || SQLERRM );
208: hr_utility.set_location(' Leaving:' || l_proc,10);
209:
210: EXCEPTION
211: WHEN OTHERS THEN
212: hr_utility.trace(' HR_CAED_SS.write_transaction ' || SQLERRM );
213: hr_utility.set_location(' Leaving:' || l_proc,555);
214: raise ;
215:
216: END WRITE_TRANSACTION ;
209:
210: EXCEPTION
211: WHEN OTHERS THEN
212: hr_utility.trace(' HR_CAED_SS.write_transaction ' || SQLERRM );
213: hr_utility.set_location(' Leaving:' || l_proc,555);
214: raise ;
215:
216: END WRITE_TRANSACTION ;
217:
234: ln_transaction_step_id NUMBER := NULL ;
235:
236: BEGIN
237:
238: hr_utility.set_location(' Entering:' || l_proc,5);
239: open c_txn_steps ;
240: fetch c_txn_steps into ln_transaction_step_id ;
241: close c_txn_steps ;
242: p_transaction_step_id := ln_transaction_step_id ;
242: p_transaction_step_id := ln_transaction_step_id ;
243:
244: -- Reset OUT parameters for nocopy.
245:
246: hr_utility.set_location(' Leaving:' || l_proc,10);
247: EXCEPTION
248: WHEN OTHERS THEN
249: hr_utility.set_location(' Leaving:' || l_proc,555);
250: p_transaction_step_id := null;
245:
246: hr_utility.set_location(' Leaving:' || l_proc,10);
247: EXCEPTION
248: WHEN OTHERS THEN
249: hr_utility.set_location(' Leaving:' || l_proc,555);
250: p_transaction_step_id := null;
251: RAISE;
252:
253: END get_transaction_step ;
277:
278:
279: BEGIN
280:
281: hr_utility.set_location(' Entering:' || l_proc,5);
282: ---------------------------------------------------------------------------
283: -- p_validate = 1 means validate mode, do not update to the database.
284: -- p_validate = 0 means non-validate mode, update to the database.
285: ---------------------------------------------------------------------------
283: -- p_validate = 1 means validate mode, do not update to the database.
284: -- p_validate = 0 means non-validate mode, update to the database.
285: ---------------------------------------------------------------------------
286: IF p_validate = 1 THEN
287: hr_utility.set_location(l_proc,10);
288: savepoint grant_access ;
289: END IF ;
290:
291: hr_security_internal.grant_access_to_person (
292: p_person_id=> p_emp_person_id,
293: p_granted_user_id => p_granted_user_id ) ;
294:
295: IF p_validate = 1 THEN
296: hr_utility.set_location(l_proc,15);
297: ROLLBACK to grant_access ;
298: END IF ;
299:
300: -- Successfully calling api in validate mode, now call create_transaction
322:
323: p_transaction_id := ln_transaction_id;
324: p_transaction_step_id := ln_transaction_step_id;
325:
326: hr_utility.set_location(' Leaving:' || l_proc,20);
327:
328:
329: EXCEPTION
330: WHEN OTHERS THEN
327:
328:
329: EXCEPTION
330: WHEN OTHERS THEN
331: hr_utility.set_location(' Leaving:' || l_proc,555);
332: RAISE ;
333: END grant_access ;
334:
335:
358: ln_transaction_step_id number default null;
359:
360: BEGIN
361:
362: hr_utility.set_location(' Entering:' || l_proc,5);
363: ---------------------------------------------------------------------------
364: -- p_validate = 1 means validate mode, do not update to the database.
365: -- p_validate = 0 means non-validate mode, update to the database.
366: ---------------------------------------------------------------------------
364: -- p_validate = 1 means validate mode, do not update to the database.
365: -- p_validate = 0 means non-validate mode, update to the database.
366: ---------------------------------------------------------------------------
367: IF p_validate = 1 THEN
368: hr_utility.set_location(l_proc,10);
369: savepoint revoke_access ;
370: END IF ;
371:
372: hr_security_internal.revoke_access_from_person (
373: p_person_id => p_emp_person_id ,
374: p_granted_user_id => p_granted_user_id ) ;
375:
376: IF p_validate = 1 THEN
377: hr_utility.set_location(l_proc,15);
378: ROLLBACK to revoke_access ;
379: END IF ;
380:
381: -- Successfully calling api in validate mode, now call create_transaction
403:
404: p_transaction_id := ln_transaction_id;
405: p_transaction_step_id := ln_transaction_step_id;
406:
407: hr_utility.set_location(' Leaving:' || l_proc,20);
408:
409:
410: EXCEPTION
411: WHEN OTHERS THEN
408:
409:
410: EXCEPTION
411: WHEN OTHERS THEN
412: hr_utility.set_location(' Leaving:' || l_proc,555);
413: RAISE ;
414: END revoke_access ;
415:
416:
431: ln_deleted_emp_user_id NUMBER ;
432:
433: BEGIN
434:
435: hr_utility.set_location(' Entering:' || l_proc,5);
436: lv_action_type := hr_transaction_api.get_varchar2_value(
437: p_transaction_step_id => p_transaction_step_id,
438: p_name =>'p_action_type');
439:
464: IF lv_action_type = 'Insert'
465: THEN
466: IF p_validate
467: THEN
468: hr_utility.set_location(l_proc,10);
469: savepoint grant_access ;
470: END IF ;
471: hr_utility.set_location(l_proc,15);
472: hr_security_internal.grant_access_to_person (
467: THEN
468: hr_utility.set_location(l_proc,10);
469: savepoint grant_access ;
470: END IF ;
471: hr_utility.set_location(l_proc,15);
472: hr_security_internal.grant_access_to_person (
473: p_person_id => ln_emp_person_id,
474: p_granted_user_id => ln_granted_user_id ) ;
475:
474: p_granted_user_id => ln_granted_user_id ) ;
475:
476: IF p_validate
477: THEN
478: hr_utility.set_location(l_proc,20);
479: ROLLBACK to grant_access ;
480: END IF ;
481: END IF;
482:
484: IF lv_action_type = 'Delete'
485: THEN
486: IF p_validate
487: THEN
488: hr_utility.set_location(l_proc,25);
489: savepoint revoke_access ;
490: END IF ;
491:
492: hr_utility.set_location(l_proc,30);
488: hr_utility.set_location(l_proc,25);
489: savepoint revoke_access ;
490: END IF ;
491:
492: hr_utility.set_location(l_proc,30);
493: hr_security_internal.revoke_access_from_person (
494: p_person_id => ln_emp_person_id,
495: p_granted_user_id => ln_deleted_emp_user_id) ;
496:
495: p_granted_user_id => ln_deleted_emp_user_id) ;
496:
497: IF p_validate
498: THEN
499: hr_utility.set_location(l_proc,35);
500: ROLLBACK to revoke_access ;
501: END IF ;
502: END IF;
503:
501: END IF ;
502: END IF;
503:
504:
505: hr_utility.set_location(' Leaving:' || l_proc,40);
506:
507: EXCEPTION
508: WHEN OTHERS THEN
509: hr_utility.set_location(' Leaving:' || l_proc,555);
505: hr_utility.set_location(' Leaving:' || l_proc,40);
506:
507: EXCEPTION
508: WHEN OTHERS THEN
509: hr_utility.set_location(' Leaving:' || l_proc,555);
510: RAISE ;
511:
512: END PROCESS_API;
513: