49: if csr_wiav%notfound then
50: --
51: -- item attribute does not exist so create it
52: if g_debug then
53: hr_utility.set_location('calling wf_engine.additemattr for aname:'||aname,2);
54: end if;
55: wf_engine.additemattr
56: (itemtype => itemtype
57: ,itemkey => itemkey
51: -- item attribute does not exist so create it
52: if g_debug then
53: hr_utility.set_location('calling wf_engine.additemattr for aname:'||aname,2);
54: end if;
55: wf_engine.additemattr
56: (itemtype => itemtype
57: ,itemkey => itemkey
58: ,aname => aname
59: ,text_value=>text_value
65: if csr_wiav%found then
66: -- set the values as per the type
67: if(text_value is not null) then
68: if g_debug then
69: hr_utility.set_location('calling wf_engine.setitemattrtext for text_value:'|| text_value,3);
70: end if;
71: wf_engine.setitemattrtext(itemtype,itemkey,aname,text_value);
72: end if;
73:
67: if(text_value is not null) then
68: if g_debug then
69: hr_utility.set_location('calling wf_engine.setitemattrtext for text_value:'|| text_value,3);
70: end if;
71: wf_engine.setitemattrtext(itemtype,itemkey,aname,text_value);
72: end if;
73:
74: if(number_value is not null) then
75: if g_debug then
72: end if;
73:
74: if(number_value is not null) then
75: if g_debug then
76: hr_utility.set_location('calling wf_engine.setitemattrnumber for text_value:'|| number_value,4);
77: end if;
78: wf_engine.setitemattrnumber(itemtype,itemkey,aname,number_value);
79: end if;
80:
74: if(number_value is not null) then
75: if g_debug then
76: hr_utility.set_location('calling wf_engine.setitemattrnumber for text_value:'|| number_value,4);
77: end if;
78: wf_engine.setitemattrnumber(itemtype,itemkey,aname,number_value);
79: end if;
80:
81: if(date_value is not null) then
82: if g_debug then
79: end if;
80:
81: if(date_value is not null) then
82: if g_debug then
83: hr_utility.set_location('calling wf_engine.setitemattrDate for text_value:'|| date_value,5);
84: end if;
85: wf_engine.setitemattrDate(itemtype,itemkey,aname,date_value);
86: end if;
87:
81: if(date_value is not null) then
82: if g_debug then
83: hr_utility.set_location('calling wf_engine.setitemattrDate for text_value:'|| date_value,5);
84: end if;
85: wf_engine.setitemattrDate(itemtype,itemkey,aname,date_value);
86: end if;
87:
88: end if;
89:
208: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
209: end if;
210:
211: -- get the transaction id of the sshr transaction
212: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
213: itemkey => p_item_key,
214: aname => 'TRANSACTION_ID',
215: ignore_notfound=>true);
216:
217: if ( funmode = 'RESPOND' ) then
218: select text_value
219: into lv_result_code
220: from wf_notification_attributes
221: where notification_id=wf_engine.context_nid
222: and name='RESULT';
223:
224: begin
225: hr_sflutil_ss.closeopensflnotification(c_transaction_id);
234: begin
235: select text_value
236: into lv_comments
237: from wf_notification_attributes
238: where notification_id=wf_engine.context_nid
239: and name='WF_NOTE';
240: exception
241: when others then
242: null;
242: null;
243: end;
244:
245: if g_debug then
246: hr_utility.set_location('processing notification response, notification_id:'||wf_engine.context_nid,2);
247: hr_utility.set_location('lv_result_code:'||lv_result_code,3);
248: end if;
249:
250: -- possible actions
265: hr_utility.set_location('calling hr_trans_history_api.archive_approve',4);
266: end if;
267: -- use the new routing api's to handle archive
268: hr_trans_history_api.archive_approve(c_transaction_id,
269: wf_engine.context_nid,
270: wf_engine.context_user,
271: lv_comments);
272:
273: elsif(lv_result_code='RESUBMIT') then
266: end if;
267: -- use the new routing api's to handle archive
268: hr_trans_history_api.archive_approve(c_transaction_id,
269: wf_engine.context_nid,
270: wf_engine.context_user,
271: lv_comments);
272:
273: elsif(lv_result_code='RESUBMIT') then
274: if g_debug then
275: hr_utility.set_location('calling hr_trans_history_api.archive_approve',4);
276: end if;
277: -- use the new routing api's to handle archive
278: hr_trans_history_api.archive_resubmit(c_transaction_id,
279: wf_engine.context_nid,
280: wf_engine.context_user,
281: wf_engine.GetItemAttrText(
282: p_item_type
283: ,p_item_key
276: end if;
277: -- use the new routing api's to handle archive
278: hr_trans_history_api.archive_resubmit(c_transaction_id,
279: wf_engine.context_nid,
280: wf_engine.context_user,
281: wf_engine.GetItemAttrText(
282: p_item_type
283: ,p_item_key
284: ,'APPROVAL_COMMENT_COPY'));
277: -- use the new routing api's to handle archive
278: hr_trans_history_api.archive_resubmit(c_transaction_id,
279: wf_engine.context_nid,
280: wf_engine.context_user,
281: wf_engine.GetItemAttrText(
282: p_item_type
283: ,p_item_key
284: ,'APPROVAL_COMMENT_COPY'));
285: elsif(lv_result_code='REJECTED') then
288: hr_utility.set_location('calling hr_trans_history_api.archive_reject',5);
289: end if;
290: -- archive the action to history
291: hr_trans_history_api.archive_reject(c_transaction_id,
292: wf_engine.context_nid,
293: wf_engine.context_user,
294: lv_comments);
295: elsif(lv_result_code='RETURNEDFORCORRECTION') then
296: if g_debug then
289: end if;
290: -- archive the action to history
291: hr_trans_history_api.archive_reject(c_transaction_id,
292: wf_engine.context_nid,
293: wf_engine.context_user,
294: lv_comments);
295: elsif(lv_result_code='RETURNEDFORCORRECTION') then
296: if g_debug then
297: hr_utility.set_location('calling hr_trans_history_api.archive_rfc',6);
297: hr_utility.set_location('calling hr_trans_history_api.archive_rfc',6);
298: end if;
299: -- archive the action to history
300: hr_trans_history_api.archive_rfc(c_transaction_id,
301: wf_engine.context_nid,
302: wf_engine.context_user,
303: lv_comments);
304: --wf_engine.context_user_comment);
305: elsif(lv_result_code='DEL') then
298: end if;
299: -- archive the action to history
300: hr_trans_history_api.archive_rfc(c_transaction_id,
301: wf_engine.context_nid,
302: wf_engine.context_user,
303: lv_comments);
304: --wf_engine.context_user_comment);
305: elsif(lv_result_code='DEL') then
306: if g_debug then
300: hr_trans_history_api.archive_rfc(c_transaction_id,
301: wf_engine.context_nid,
302: wf_engine.context_user,
303: lv_comments);
304: --wf_engine.context_user_comment);
305: elsif(lv_result_code='DEL') then
306: if g_debug then
307: hr_utility.set_location('calling hr_trans_history_api.archive_delete',7);
308: end if;
307: hr_utility.set_location('calling hr_trans_history_api.archive_delete',7);
308: end if;
309: -- archive the action to history
310: hr_trans_history_api.archive_delete(c_transaction_id,
311: wf_engine.context_nid,
312: wf_engine.context_user,
313: lv_comments);
314: end if;
315: exception
308: end if;
309: -- archive the action to history
310: hr_trans_history_api.archive_delete(c_transaction_id,
311: wf_engine.context_nid,
312: wf_engine.context_user,
313: lv_comments);
314: end if;
315: exception
316: when others then
318: end;
319: elsif( funmode = 'FORWARD' ) then
320: -- FORWARD - When a notification recipient forwards the notification.
321: hr_trans_history_api.archive_forward(c_transaction_id,
322: wf_engine.context_nid,
323: wf_engine.context_user,
324: wf_engine.context_user_comment);
325: null;
326: elsif( funmode = 'TRANSFER' ) then
319: elsif( funmode = 'FORWARD' ) then
320: -- FORWARD - When a notification recipient forwards the notification.
321: hr_trans_history_api.archive_forward(c_transaction_id,
322: wf_engine.context_nid,
323: wf_engine.context_user,
324: wf_engine.context_user_comment);
325: null;
326: elsif( funmode = 'TRANSFER' ) then
327: -- TRANSFER - When a notification recipient transfers the notification.
320: -- FORWARD - When a notification recipient forwards the notification.
321: hr_trans_history_api.archive_forward(c_transaction_id,
322: wf_engine.context_nid,
323: wf_engine.context_user,
324: wf_engine.context_user_comment);
325: null;
326: elsif( funmode = 'TRANSFER' ) then
327: -- TRANSFER - When a notification recipient transfers the notification.
328: hr_trans_history_api.archive_transfer(c_transaction_id,
325: null;
326: elsif( funmode = 'TRANSFER' ) then
327: -- TRANSFER - When a notification recipient transfers the notification.
328: hr_trans_history_api.archive_transfer(c_transaction_id,
329: wf_engine.context_nid,
330: wf_engine.context_user,
331: wf_engine.context_user_comment);
332: -- QUESTION
333: elsif( funmode = 'QUESTION' ) then
326: elsif( funmode = 'TRANSFER' ) then
327: -- TRANSFER - When a notification recipient transfers the notification.
328: hr_trans_history_api.archive_transfer(c_transaction_id,
329: wf_engine.context_nid,
330: wf_engine.context_user,
331: wf_engine.context_user_comment);
332: -- QUESTION
333: elsif( funmode = 'QUESTION' ) then
334: hr_trans_history_api.archive_req_moreinfo(c_transaction_id,
327: -- TRANSFER - When a notification recipient transfers the notification.
328: hr_trans_history_api.archive_transfer(c_transaction_id,
329: wf_engine.context_nid,
330: wf_engine.context_user,
331: wf_engine.context_user_comment);
332: -- QUESTION
333: elsif( funmode = 'QUESTION' ) then
334: hr_trans_history_api.archive_req_moreinfo(c_transaction_id,
335: wf_engine.context_nid,
331: wf_engine.context_user_comment);
332: -- QUESTION
333: elsif( funmode = 'QUESTION' ) then
334: hr_trans_history_api.archive_req_moreinfo(c_transaction_id,
335: wf_engine.context_nid,
336: wf_engine.context_user,
337: wf_engine.context_user_comment);
338:
339: elsif( funmode = 'ANSWER' ) then
332: -- QUESTION
333: elsif( funmode = 'QUESTION' ) then
334: hr_trans_history_api.archive_req_moreinfo(c_transaction_id,
335: wf_engine.context_nid,
336: wf_engine.context_user,
337: wf_engine.context_user_comment);
338:
339: elsif( funmode = 'ANSWER' ) then
340: hr_trans_history_api.archive_answer_moreinfo(c_transaction_id,
333: elsif( funmode = 'QUESTION' ) then
334: hr_trans_history_api.archive_req_moreinfo(c_transaction_id,
335: wf_engine.context_nid,
336: wf_engine.context_user,
337: wf_engine.context_user_comment);
338:
339: elsif( funmode = 'ANSWER' ) then
340: hr_trans_history_api.archive_answer_moreinfo(c_transaction_id,
341: wf_engine.context_nid,
337: wf_engine.context_user_comment);
338:
339: elsif( funmode = 'ANSWER' ) then
340: hr_trans_history_api.archive_answer_moreinfo(c_transaction_id,
341: wf_engine.context_nid,
342: wf_engine.context_user,
343: wf_engine.context_user_comment);
344: elsif( funmode = 'TIMEOUT' ) then
345: if hr_multi_tenancy_pkg.is_multi_tenant_system then
338:
339: elsif( funmode = 'ANSWER' ) then
340: hr_trans_history_api.archive_answer_moreinfo(c_transaction_id,
341: wf_engine.context_nid,
342: wf_engine.context_user,
343: wf_engine.context_user_comment);
344: elsif( funmode = 'TIMEOUT' ) then
345: if hr_multi_tenancy_pkg.is_multi_tenant_system then
346: l_cpersonId := NVL( wf_engine.getItemAttrText (
339: elsif( funmode = 'ANSWER' ) then
340: hr_trans_history_api.archive_answer_moreinfo(c_transaction_id,
341: wf_engine.context_nid,
342: wf_engine.context_user,
343: wf_engine.context_user_comment);
344: elsif( funmode = 'TIMEOUT' ) then
345: if hr_multi_tenancy_pkg.is_multi_tenant_system then
346: l_cpersonId := NVL( wf_engine.getItemAttrText (
347: itemtype => p_item_type
342: wf_engine.context_user,
343: wf_engine.context_user_comment);
344: elsif( funmode = 'TIMEOUT' ) then
345: if hr_multi_tenancy_pkg.is_multi_tenant_system then
346: l_cpersonId := NVL( wf_engine.getItemAttrText (
347: itemtype => p_item_type
348: ,itemkey => p_item_key
349: ,aname => 'CREATOR_PERSON_ID'),-1);
350:
352: end if;
353: if g_debug then
354: hr_utility.set_location('calling hr_trans_history_api.archive_timeout',7);
355: end if;
356: lv_new_transaction := wf_engine.getitemattrtext(p_item_type,
357: p_item_key,
358: 'HR_NEW_TRANSACTION',true);
359:
360: if( INSTR(lv_new_transaction,'TIMEOUT') > 0) then
363: begin
364: select RECIPIENT_ROLE
365: into lv_recipient
366: from wf_notifications
367: where notification_id=wf_engine.context_nid;
368: exception
369: when others then
370: null;
371: end;
370: null;
371: end;
372: -- archive the action to history
373: hr_trans_history_api.archive_timeout(c_transaction_id,
374: wf_engine.context_nid,
375: lv_recipient,
376: lv_comments);
377: end if;
378: end if;
377: end if;
378: end if;
379:
380: if(lv_result_code is null) then
381: result := wf_engine.eng_null;
382: else
383: result:= 'COMPLETE:'||lv_result_code;
384: end if;
385:
414: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
415: end if;
416: -- get the current forward to approver details
417: l_current_forward_to_id :=
418: nvl(wf_engine.GetItemAttrNumber
419: (itemtype => p_item_type
420: ,itemkey => p_item_key
421: ,aname => 'FORWARD_TO_PERSON_ID'),
422: wf_engine.GetItemAttrNumber
418: nvl(wf_engine.GetItemAttrNumber
419: (itemtype => p_item_type
420: ,itemkey => p_item_key
421: ,aname => 'FORWARD_TO_PERSON_ID'),
422: wf_engine.GetItemAttrNumber
423: (itemtype => p_item_type
424: ,itemkey => p_item_key
425: ,aname => 'CREATOR_PERSON_ID'));
426:
439: ,number_value=>null,
440: date_value=>null
441: );
442:
443: l_current_forward_to_origSys := nvl( wf_engine.GetItemAttrText
444: (itemtype => p_item_type
445: ,itemkey => p_item_key
446: ,aname => 'FORWARD_TO_ORIG_SYS_ATTR'
447: ,ignore_notfound=>true),'PER');
458: ,p_name => l_current_forward_to_username
459: ,p_display_name => l_current_forward_to_disp_name);
460:
461: -- set the passed approver values to the forward to item attributes
462: wf_engine.SetItemAttrText
463: (itemtype => p_item_type
464: ,itemkey => p_item_key
465: ,aname => 'FORWARD_TO_ORIG_SYS_ATTR'
466: ,avalue =>wf_engine.getItemAttrText
462: wf_engine.SetItemAttrText
463: (itemtype => p_item_type
464: ,itemkey => p_item_key
465: ,aname => 'FORWARD_TO_ORIG_SYS_ATTR'
466: ,avalue =>wf_engine.getItemAttrText
467: (itemtype => p_item_type
468: ,itemkey => p_item_key
469: ,aname =>'HR_APR_ORIG_SYSTEM_ATTR'));
470:
467: (itemtype => p_item_type
468: ,itemkey => p_item_key
469: ,aname =>'HR_APR_ORIG_SYSTEM_ATTR'));
470:
471: wf_engine.SetItemAttrNumber
472: (itemtype => p_item_type
473: ,itemkey => p_item_key
474: ,aname => 'FORWARD_TO_PERSON_ID'
475: ,avalue =>wf_engine.getItemAttrNumber
471: wf_engine.SetItemAttrNumber
472: (itemtype => p_item_type
473: ,itemkey => p_item_key
474: ,aname => 'FORWARD_TO_PERSON_ID'
475: ,avalue =>wf_engine.getItemAttrNumber
476: (itemtype => p_item_type
477: ,itemkey => p_item_key
478: ,aname => 'HR_APR_ORIG_SYSTEM_ID_ATTR'));
479: --
476: (itemtype => p_item_type
477: ,itemkey => p_item_key
478: ,aname => 'HR_APR_ORIG_SYSTEM_ID_ATTR'));
479: --
480: wf_engine.SetItemAttrText
481: (itemtype => p_item_type
482: ,itemkey => p_item_key
483: ,aname => 'FORWARD_TO_USERNAME'
484: ,avalue => wf_engine.getItemAttrText
480: wf_engine.SetItemAttrText
481: (itemtype => p_item_type
482: ,itemkey => p_item_key
483: ,aname => 'FORWARD_TO_USERNAME'
484: ,avalue => wf_engine.getItemAttrText
485: (itemtype => p_item_type
486: ,itemkey => p_item_key
487: ,aname => 'HR_APR_NAME_ATTR'));
488:
486: ,itemkey => p_item_key
487: ,aname => 'HR_APR_NAME_ATTR'));
488:
489: --
490: Wf_engine.SetItemAttrText
491: (itemtype => p_item_type
492: ,itemkey => p_item_key
493: ,aname => 'FORWARD_TO_DISPLAY_NAME'
494: ,avalue => wf_engine.getItemAttrText
490: Wf_engine.SetItemAttrText
491: (itemtype => p_item_type
492: ,itemkey => p_item_key
493: ,aname => 'FORWARD_TO_DISPLAY_NAME'
494: ,avalue => wf_engine.getItemAttrText
495: (itemtype => p_item_type
496: ,itemkey => p_item_key
497: ,aname => 'HR_APR_DISPLAY_NAME_ATTR'));
498:
495: (itemtype => p_item_type
496: ,itemkey => p_item_key
497: ,aname => 'HR_APR_DISPLAY_NAME_ATTR'));
498:
499: /* Wf_engine.SetItemAttrText
500: (itemtype => p_item_type
501: ,itemkey => p_item_key
502: ,aname => 'FORWARD_TO_USER'
503: ,avalue => getToString(p_item_key) || wf_engine.getItemAttrText
499: /* Wf_engine.SetItemAttrText
500: (itemtype => p_item_type
501: ,itemkey => p_item_key
502: ,aname => 'FORWARD_TO_USER'
503: ,avalue => getToString(p_item_key) || wf_engine.getItemAttrText
504: (itemtype => p_item_type
505: ,itemkey => p_item_key
506: ,aname => 'HR_APR_DISPLAY_NAME_ATTR'));*/
507:
508:
509: create_item_attrib_if_notexist(itemtype => p_item_type
510: ,itemkey => p_item_key
511: ,aname => 'FORWARD_TO_USER'
512: ,text_value=>getToString(p_item_key) || wf_engine.getItemAttrText
513: (itemtype => p_item_type
514: ,itemkey => p_item_key
515: ,aname => 'HR_APR_DISPLAY_NAME_ATTR')
516: ,number_value=>null,
518: );
519: --
520: -- set forward from to old forward to
521: --
522: wf_engine.SetItemAttrNumber
523: (itemtype => p_item_type
524: ,itemkey => p_item_key
525: ,aname => 'FORWARD_FROM_PERSON_ID'
526: ,avalue => l_current_forward_to_id);
525: ,aname => 'FORWARD_FROM_PERSON_ID'
526: ,avalue => l_current_forward_to_id);
527:
528: -- FORWARD_FROM_ORIG_SYS_ATTR
529: wf_engine.SetItemAttrText
530: (itemtype => p_item_type
531: ,itemkey => p_item_key
532: ,aname => 'FORWARD_FROM_ORIG_SYS_ATTR'
533: ,avalue => l_current_forward_to_origSys);
545: ,p_orig_system_id => l_current_forward_to_id
546: ,p_name => l_current_forward_to_username
547: ,p_display_name => l_current_forward_to_disp_name);
548: --
549: wf_engine.SetItemAttrText
550: (itemtype => p_item_type
551: ,itemkey => p_item_key
552: ,aname => 'FORWARD_FROM_USERNAME'
553: ,avalue => l_current_forward_to_username);
551: ,itemkey => p_item_key
552: ,aname => 'FORWARD_FROM_USERNAME'
553: ,avalue => l_current_forward_to_username);
554: --
555: wf_engine.SetItemAttrText
556: (itemtype => p_item_type
557: ,itemkey => p_item_key
558: ,aname => 'FORWARD_FROM_DISPLAY_NAME'
559: ,avalue => l_current_forward_to_disp_name);
563: -- FORWARD_TO_ITEM_CLASS_ATTR
564: create_item_attrib_if_notexist(itemtype => p_item_type
565: ,itemkey => p_item_key
566: ,aname => 'FORWARD_TO_ITEM_CLASS_ATTR'
567: ,text_value=>wf_engine.getItemAttrText
568: (itemtype => p_item_type
569: ,itemkey => p_item_key
570: ,aname => 'HR_APR_ITEM_CLASS_ATTR')
571: ,number_value=>null,
576: -- FORWARD_TO_ITEM_ID_ATTR
577: create_item_attrib_if_notexist(itemtype => p_item_type
578: ,itemkey => p_item_key
579: ,aname => 'FORWARD_TO_ITEM_ID_ATTR'
580: ,text_value=>wf_engine.getItemAttrText
581: (itemtype => p_item_type
582: ,itemkey => p_item_key
583: ,aname => 'HR_APR_ITEM_ID_ATTR')
584: ,number_value=>null,
590: create_item_attrib_if_notexist(itemtype => p_item_type
591: ,itemkey => p_item_key
592: ,aname => 'FORWARD_TO_GROUPORCHAINID'
593: ,text_value=>null
594: ,number_value=>wf_engine.getItemAttrNumber
595: (itemtype => p_item_type
596: ,itemkey => p_item_key
597: ,aname => 'HR_APR_GRPORCHN_ID_ATTR'),
598: date_value=>null
602: -- FORWARD_TO_ACTIONTYPEID_ATTR
603: create_item_attrib_if_notexist(itemtype => p_item_type
604: ,itemkey => p_item_key
605: ,aname => 'FORWARD_TO_ACTIONTYPEID_ATTR'
606: ,text_value=>wf_engine.getItemAttrText
607: (itemtype => p_item_type
608: ,itemkey => p_item_key
609: ,aname => 'HR_APR_ACTION_TYPE_ID_ATTR')
610: ,number_value=>null,
635: end if;
636:
637: -- set the passed approver values to the forward to item attributes
638:
639: l_current_forward_to_username := wf_engine.getItemAttrText
640: (itemtype => p_item_type
641: ,itemkey => p_item_key
642: ,aname => 'FORWARD_FROM_ROLE_NAME'
643: ,ignore_notfound=>true);
661: end if;
662:
663:
664:
665: wf_engine.SetItemAttrText
666: (itemtype => p_item_type
667: ,itemkey => p_item_key
668: ,aname => 'FORWARD_FROM_USERNAME'
669: ,avalue => l_current_forward_to_username);
667: ,itemkey => p_item_key
668: ,aname => 'FORWARD_FROM_USERNAME'
669: ,avalue => l_current_forward_to_username);
670: --
671: wf_engine.SetItemAttrText
672: (itemtype => p_item_type
673: ,itemkey => p_item_key
674: ,aname => 'FORWARD_FROM_DISPLAY_NAME'
675: ,avalue => l_current_forward_to_disp_name);
673: ,itemkey => p_item_key
674: ,aname => 'FORWARD_FROM_DISPLAY_NAME'
675: ,avalue => l_current_forward_to_disp_name);
676:
677: wf_engine.SetItemAttrText
678: (itemtype => p_item_type
679: ,itemkey => p_item_key
680: ,aname => 'FORWARD_TO_USERNAME'
681: ,avalue => wf_engine.getItemAttrText
677: wf_engine.SetItemAttrText
678: (itemtype => p_item_type
679: ,itemkey => p_item_key
680: ,aname => 'FORWARD_TO_USERNAME'
681: ,avalue => wf_engine.getItemAttrText
682: (itemtype => p_item_type
683: ,itemkey => p_item_key
684: ,aname => 'HR_APR_NAME_ATTR'));
685:
682: (itemtype => p_item_type
683: ,itemkey => p_item_key
684: ,aname => 'HR_APR_NAME_ATTR'));
685:
686: Wf_engine.SetItemAttrText
687: (itemtype => p_item_type
688: ,itemkey => p_item_key
689: ,aname => 'FORWARD_TO_DISPLAY_NAME'
690: ,avalue => wf_engine.getItemAttrText
686: Wf_engine.SetItemAttrText
687: (itemtype => p_item_type
688: ,itemkey => p_item_key
689: ,aname => 'FORWARD_TO_DISPLAY_NAME'
690: ,avalue => wf_engine.getItemAttrText
691: (itemtype => p_item_type
692: ,itemkey => p_item_key
693: ,aname => 'HR_APR_DISPLAY_NAME_ATTR'));
694:
691: (itemtype => p_item_type
692: ,itemkey => p_item_key
693: ,aname => 'HR_APR_DISPLAY_NAME_ATTR'));
694:
695: wf_engine.SetItemAttrText
696: (itemtype => p_item_type
697: ,itemkey => p_item_key
698: ,aname => 'FORWARD_TO_USER'
699: ,avalue => null);
743: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
744: end if;
745:
746: --
747: l_creator_person_id := wf_engine.GetItemAttrNumber
748: (itemtype => p_item_type
749: ,itemkey => p_item_key
750: ,aname => 'CREATOR_PERSON_ID');
751: --
748: (itemtype => p_item_type
749: ,itemkey => p_item_key
750: ,aname => 'CREATOR_PERSON_ID');
751: --
752: l_forward_to_person_id := wf_engine.GetItemAttrNumber
753: (itemtype => p_item_type
754: ,itemkey => p_item_key
755: ,aname =>'FORWARD_TO_PERSON_ID');
756:
755: ,aname =>'FORWARD_TO_PERSON_ID');
756:
757: -- get the current forward to person
758: l_current_forward_to_id :=
759: nvl(wf_engine.GetItemAttrNumber
760: (itemtype => p_item_type
761: ,itemkey => p_item_key
762: ,aname => 'FORWARD_TO_PERSON_ID'),
763: wf_engine.GetItemAttrNumber
759: nvl(wf_engine.GetItemAttrNumber
760: (itemtype => p_item_type
761: ,itemkey => p_item_key
762: ,aname => 'FORWARD_TO_PERSON_ID'),
763: wf_engine.GetItemAttrNumber
764: (itemtype => p_item_type
765: ,itemkey => p_item_key
766: ,aname => 'CREATOR_PERSON_ID'));
767:
777: (p_item_type => p_item_type
778: ,p_item_key => p_item_key
779: ,p_name => 'LAST_DEFAULT_APPROVER');
780:
781: wf_engine.SetItemAttrNumber
782: (itemtype => p_item_type,
783: itemkey => p_item_key,
784: aname => 'LAST_DEFAULT_APPROVER',
785: avalue => NULL);
788: CLOSE csr_wiav;
789:
790:
791: -- 'LAST_DEFAULT_APPROVER'
792: ln_last_def_approver:= wf_engine.GetItemAttrNumber
793: (itemtype => p_item_type,
794: itemkey => p_item_key,
795: aname => 'LAST_DEFAULT_APPROVER'
796: );
819: FETCH csr_wiav into l_dummy;
820: IF csr_wiav%notfound THEN
821: ln_approval_level := 0;
822: ELSE
823: ln_approval_level := wf_engine.GetItemAttrNumber
824: (itemtype => p_item_type,
825: itemkey => p_item_key,
826: aname => 'APPROVAL_LEVEL');
827: END IF; -- for csr_wiav%notfound
837: FETCH csr_wiav into l_dummy;
838: IF csr_wiav%notfound THEN
839: NULL;
840: ELSE
841: ln_curr_def_appr_index := wf_engine.GetItemAttrNumber
842: (itemtype => p_item_type,
843: itemkey => p_item_key,
844: aname => 'CURRENT_DEF_APPR_INDEX');
845: END IF;-- for csr_wiav%notfound
878: ln_addntl_approvers:= null;
879: ln_current_approver_index:=null;
880: -- get the current forward from person
881: l_current_forward_from_id :=
882: nvl(wf_engine.GetItemAttrNumber
883: (itemtype => p_item_type
884: ,itemkey => p_item_key
885: ,aname => 'FORWARD_FROM_PERSON_ID'),
886: wf_engine.GetItemAttrNumber
882: nvl(wf_engine.GetItemAttrNumber
883: (itemtype => p_item_type
884: ,itemkey => p_item_key
885: ,aname => 'FORWARD_FROM_PERSON_ID'),
886: wf_engine.GetItemAttrNumber
887: (itemtype => p_item_type
888: ,itemkey => p_item_key
889: ,aname => 'CREATOR_PERSON_ID'));
890: -- get the current forward to person
888: ,itemkey => p_item_key
889: ,aname => 'CREATOR_PERSON_ID'));
890: -- get the current forward to person
891: l_current_forward_to_id :=
892: nvl(wf_engine.GetItemAttrNumber
893: (itemtype => p_item_type
894: ,itemkey => p_item_key
895: ,aname => 'FORWARD_TO_PERSON_ID'),
896: wf_engine.GetItemAttrNumber
892: nvl(wf_engine.GetItemAttrNumber
893: (itemtype => p_item_type
894: ,itemkey => p_item_key
895: ,aname => 'FORWARD_TO_PERSON_ID'),
896: wf_engine.GetItemAttrNumber
897: (itemtype => p_item_type
898: ,itemkey => p_item_key
899: ,aname => 'CREATOR_PERSON_ID'));
900:
899: ,aname => 'CREATOR_PERSON_ID'));
900:
901:
902: -- get the total number of additional approvers for this transaction
903: ln_addntl_approvers := NVL(wf_engine.GetItemAttrNumber
904: (itemtype => p_item_type
905: ,itemkey => p_item_key
906: ,aname => 'ADDITIONAL_APPROVERS_NUMBER'),
907: 0);
917: (p_item_type => p_item_type
918: ,p_item_key => p_item_key
919: ,p_name => 'CURRENT_APPROVER_INDEX');
920:
921: wf_engine.SetItemAttrNumber
922: (itemtype => p_item_type,
923: itemkey => p_item_key,
924: aname => 'CURRENT_APPROVER_INDEX',
925: avalue => NULL);
931:
932:
933:
934: -- get the current_approver_index
935: ln_current_approver_index := NVL(wf_engine.GetItemAttrNumber
936: (itemtype => p_item_type
937: ,itemkey => p_item_key
938: ,aname => 'CURRENT_APPROVER_INDEX'),
939: 0);
949: IF csr_wiav%notfound THEN
950: lv_exists := 'N';
951: ELSE
952: lv_exists := 'Y';
953: lv_isvalid := wf_engine.GetItemAttrText
954: (itemtype => p_item_type,
955: itemkey => p_item_key,
956: aname => lv_item_name);
957: lv_isvalid := NVL(lv_isvalid,' ');
964:
965:
966: IF lv_exists <>'N' AND lv_isvalid <>'DELETED' THEN
967: l_forward_to_person_id :=
968: wf_engine.GetItemAttrNumber
969: (itemtype => p_item_type,
970: itemkey => p_item_key,
971: aname => lv_item_name
972: );
973:
974: ELSE
975: -- get the last default approver index
976:
977: ln_last_default_approver_id := wf_engine.GetItemAttrNumber
978: (itemtype => p_item_type,
979: itemkey => p_item_key,
980: aname => 'LAST_DEFAULT_APPROVER');
981:
987: -- now the from column will show the last approver approved.
988: l_forward_to_person_id :=
989: hr_approval_custom.Get_Next_Approver
990: (p_person_id => NVL(ln_last_default_approver_id,
991: wf_engine.GetItemAttrNumber
992: (itemtype => p_item_type
993: ,itemkey => p_item_key
994: ,aname => 'CREATOR_PERSON_ID')));
995: -- set the last default approver id
993: ,itemkey => p_item_key
994: ,aname => 'CREATOR_PERSON_ID')));
995: -- set the last default approver id
996: -- 'LAST_DEFAULT_APPROVER'
997: wf_engine.SetItemAttrNumber
998: (itemtype => p_item_type,
999: itemkey => p_item_key,
1000: aname => 'LAST_DEFAULT_APPROVER',
1001: avalue => l_forward_to_person_id);
1008: (p_item_type => p_item_type
1009: ,p_item_key => p_item_key
1010: ,p_name => 'CURRENT_DEF_APPR_INDEX');
1011:
1012: wf_engine.SetItemAttrNumber
1013: (itemtype => p_item_type,
1014: itemkey => p_item_key,
1015: aname => 'CURRENT_DEF_APPR_INDEX',
1016: avalue => 0);
1015: aname => 'CURRENT_DEF_APPR_INDEX',
1016: avalue => 0);
1017: ELSE
1018: ln_curr_def_appr_index :=
1019: wf_engine.GetItemAttrNumber
1020: (itemtype => p_item_type,
1021: itemkey => p_item_key,
1022: aname => 'CURRENT_DEF_APPR_INDEX'
1023: );
1022: aname => 'CURRENT_DEF_APPR_INDEX'
1023: );
1024: -- increment it and update the item attribute value
1025: ln_curr_def_appr_index := ln_curr_def_appr_index + 1;
1026: wf_engine.SetItemAttrNumber
1027: (itemtype => p_item_type,
1028: itemkey => p_item_key,
1029: aname => 'CURRENT_DEF_APPR_INDEX',
1030: avalue => ln_curr_def_appr_index);
1033:
1034: END IF;
1035:
1036: -- set the current_approver_index
1037: wf_engine.SetItemAttrNumber (itemtype => p_item_type
1038: ,itemkey => p_item_key
1039: ,aname => 'CURRENT_APPROVER_INDEX'
1040: ,avalue => (ln_current_approver_index + 1));
1041:
1495:
1496: if g_debug then
1497: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
1498: end if;
1499: if ( funmode = wf_engine.eng_run ) then
1500: -- HR_APR_CATEGORY_ATTR
1501: lv_current_approver_category :=wf_engine.GetItemAttrText(itemtype => p_item_type ,
1502: itemkey => p_item_key,
1503: aname => 'HR_APR_CATEGORY_ATTR',
1497: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
1498: end if;
1499: if ( funmode = wf_engine.eng_run ) then
1500: -- HR_APR_CATEGORY_ATTR
1501: lv_current_approver_category :=wf_engine.GetItemAttrText(itemtype => p_item_type ,
1502: itemkey => p_item_key,
1503: aname => 'HR_APR_CATEGORY_ATTR',
1504: ignore_notfound=>true);
1505: -- default approvals
1504: ignore_notfound=>true);
1505: -- default approvals
1506: lv_current_approver_category := nvl(lv_current_approver_category,'A');
1507: if(lv_current_approver_category='A') then
1508: l_is_parallel := wf_engine.GetItemAttrText(itemtype => p_item_type ,
1509: itemkey => p_item_key,
1510: aname => 'HR_PARALLEL_ATTR',
1511: ignore_notfound=>true);
1512: if(l_is_parallel = 'PARALLEL') then
1522: result := 'COMPLETE:APPROVAL';
1523: else
1524:
1525: l_current_forward_to_disp_name :=
1526: nvl(wf_engine.GetItemAttrText
1527: (itemtype => p_item_type
1528: ,itemkey => p_item_key
1529: ,aname => 'FORWARD_TO_DISPLAY_NAME'),
1530: wf_engine.GetItemAttrText
1526: nvl(wf_engine.GetItemAttrText
1527: (itemtype => p_item_type
1528: ,itemkey => p_item_key
1529: ,aname => 'FORWARD_TO_DISPLAY_NAME'),
1530: wf_engine.GetItemAttrText
1531: (itemtype => p_item_type
1532: ,itemkey => p_item_key
1533: ,aname => 'CREATOR_PERSON_DISPLAY_NAME'));
1534:
1532: ,itemkey => p_item_key
1533: ,aname => 'CREATOR_PERSON_DISPLAY_NAME'));
1534:
1535: l_current_forward_to_username :=
1536: nvl(wf_engine.GetItemAttrText
1537: (itemtype => p_item_type
1538: ,itemkey => p_item_key
1539: ,aname => 'FORWARD_TO_USERNAME'),
1540: wf_engine.GetItemAttrText
1536: nvl(wf_engine.GetItemAttrText
1537: (itemtype => p_item_type
1538: ,itemkey => p_item_key
1539: ,aname => 'FORWARD_TO_USERNAME'),
1540: wf_engine.GetItemAttrText
1541: (itemtype => p_item_type
1542: ,itemkey => p_item_key
1543: ,aname => 'CREATOR_PERSON_USERNAME'));
1544:
1542: ,itemkey => p_item_key
1543: ,aname => 'CREATOR_PERSON_USERNAME'));
1544:
1545:
1546: wf_engine.SetItemAttrText
1547: (itemtype => p_item_type
1548: ,itemkey => p_item_key
1549: ,aname => 'FORWARD_FROM_USERNAME'
1550: ,avalue => l_current_forward_to_username);
1548: ,itemkey => p_item_key
1549: ,aname => 'FORWARD_FROM_USERNAME'
1550: ,avalue => l_current_forward_to_username);
1551: --
1552: wf_engine.SetItemAttrText
1553: (itemtype => p_item_type
1554: ,itemkey => p_item_key
1555: ,aname => 'FORWARD_FROM_DISPLAY_NAME'
1556: ,avalue => l_current_forward_to_disp_name);
1580: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
1581: end if;
1582:
1583: -- call the initialize code
1584: --HR_DYNAMIC_APPROVAL_WEB.INITIALIZE_ITEM_ATTRIBUTES(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
1585:
1586:
1587: -- check if we need to go through this cycle or completed
1588: HR_DYNAMIC_APPROVAL_WEB.CHECK_ONSUBMIT_NOTIFIER(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
1584: --HR_DYNAMIC_APPROVAL_WEB.INITIALIZE_ITEM_ATTRIBUTES(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
1585:
1586:
1587: -- check if we need to go through this cycle or completed
1588: HR_DYNAMIC_APPROVAL_WEB.CHECK_ONSUBMIT_NOTIFIER(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
1589:
1590: if(lv_result='COMPLETE:N') then
1591: HR_DYNAMIC_APPROVAL_WEB.GET_ONSUBMIT_NOTIFIER(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
1592:
1587: -- check if we need to go through this cycle or completed
1588: HR_DYNAMIC_APPROVAL_WEB.CHECK_ONSUBMIT_NOTIFIER(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
1589:
1590: if(lv_result='COMPLETE:N') then
1591: HR_DYNAMIC_APPROVAL_WEB.GET_ONSUBMIT_NOTIFIER(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
1592:
1593: -- ONSUB_FWD_TO_USERNAME
1594: create_item_attrib_if_notexist(itemtype=>p_item_type,
1595: itemkey=>p_item_key,
1593: -- ONSUB_FWD_TO_USERNAME
1594: create_item_attrib_if_notexist(itemtype=>p_item_type,
1595: itemkey=>p_item_key,
1596: aname=>'HR_APR_NAME_ATTR',
1597: text_value=>wf_engine.GetItemAttrText(itemtype => p_item_type ,
1598: itemkey => p_item_key,
1599: aname => 'ONSUB_FWD_TO_USERNAME',
1600: ignore_notfound=>true),
1601: number_value=>null,
1627: ,text_value=>null
1628: ,number_value=>null,
1629: date_value=>null
1630: );
1631: wf_engine.SetItemAttrNumber
1632: (itemtype => p_item_type
1633: ,itemkey => p_item_key
1634: ,aname => 'HR_APR_ORIG_SYSTEM_ID_ATTR'
1635: ,avalue=>null);
1664: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
1665: end if;
1666:
1667: -- fyiApproverCategory
1668: HR_DYNAMIC_APPROVAL_WEB.CHECK_ONAPPROVAL_NOTIFIER(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
1669:
1670: if(lv_result='COMPLETE:N') then
1671:
1672: HR_DYNAMIC_APPROVAL_WEB.GET_ONAPPROVAL_NOTIFIER(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
1668: HR_DYNAMIC_APPROVAL_WEB.CHECK_ONAPPROVAL_NOTIFIER(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
1669:
1670: if(lv_result='COMPLETE:N') then
1671:
1672: HR_DYNAMIC_APPROVAL_WEB.GET_ONAPPROVAL_NOTIFIER(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
1673:
1674: -- ONAPPR_FWD_TO_USERNAME
1675:
1676: create_item_attrib_if_notexist(itemtype=>p_item_type,
1675:
1676: create_item_attrib_if_notexist(itemtype=>p_item_type,
1677: itemkey=>p_item_key,
1678: aname=>'HR_APR_NAME_ATTR',
1679: text_value=>wf_engine.GetItemAttrText(itemtype => p_item_type ,
1680: itemkey => p_item_key,
1681: aname => 'ONAPPR_FWD_TO_USERNAME',
1682: ignore_notfound=>true),
1683: number_value=>null,
1708: ,text_value=>null
1709: ,number_value=>null,
1710: date_value=>null
1711: );
1712: wf_engine.SetItemAttrNumber
1713: (itemtype => p_item_type
1714: ,itemkey => p_item_key
1715: ,aname => 'HR_APR_ORIG_SYSTEM_ID_ATTR'
1716: ,avalue=>null);
1836: if g_debug then
1837: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
1838: end if;
1839:
1840: error_message_text := wf_engine.GetItemAttrText(itemtype => p_item_type ,
1841: itemkey => p_item_key,
1842: aname => 'ERROR_MESSAGE_TEXT',
1843: ignore_notfound=>true);
1844:
1844:
1845:
1846: if(error_message_text is not null) then
1847:
1848: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_MESSAGE_TEXT',null);
1849: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_TYPE',null);
1850: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_KEY',null);
1851:
1852: end if;
1845:
1846: if(error_message_text is not null) then
1847:
1848: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_MESSAGE_TEXT',null);
1849: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_TYPE',null);
1850: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_KEY',null);
1851:
1852: end if;
1853:
1846: if(error_message_text is not null) then
1847:
1848: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_MESSAGE_TEXT',null);
1849: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_TYPE',null);
1850: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_KEY',null);
1851:
1852: end if;
1853:
1854: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
1850: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_KEY',null);
1851:
1852: end if;
1853:
1854: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
1855: itemkey => p_item_key,
1856: aname => 'HR_AME_TRAN_TYPE_ATTR');
1857:
1858: if ( funmode = 'RUN' ) then
1890: result := 'COMPLETE:'||'N';
1891: return;
1892: end if;
1893:
1894: c_application_id :=wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
1895: itemkey => p_item_key,
1896: aname => 'HR_AME_APP_ID_ATTR');
1897: c_application_id := nvl(c_application_id,800);
1898: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
1894: c_application_id :=wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
1895: itemkey => p_item_key,
1896: aname => 'HR_AME_APP_ID_ATTR');
1897: c_application_id := nvl(c_application_id,800);
1898: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
1899: itemkey => p_item_key,
1900: aname => 'TRANSACTION_ID');
1901: if(c_transaction_type is not null) then
1902: begin
2065: result := 'COMPLETE:'||'N';
2066: return;
2067: end if;
2068: else
2069: l_is_parallel := wf_engine.GetItemAttrText(itemtype => p_item_type ,
2070: itemkey => p_item_key,
2071: aname => 'HR_PARALLEL_ATTR',
2072: ignore_notfound=>true);
2073:
2119:
2120: if g_debug then
2121: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
2122: end if;
2123: if ( funmode = wf_engine.eng_run ) then
2124: -- call PQH_SS_HISTORY.transfer_approval_to_history
2125: if g_debug then
2126: hr_utility.set_location('calling PQH_SS_HISTORY.transfer_approval_to_history ',2);
2127: hr_utility.set_location('p_item_type:'|| p_item_type,3);
2156: lv_role_orig_sys_id wf_roles.orig_system_id%type;
2157: begin
2158:
2159: -- FORWARD_TO_PERSON_ID
2160: lv_role_orig_sys_id:=wf_engine.getitemattrnumber(p_item_type,p_item_key,'FORWARD_TO_PERSON_ID',true);
2161:
2162: if(lv_role_orig_sys_id is not null) then
2163: -- need to revisit with role based support in SSHR transaction
2164: lv_role_orig_system := nvl( wf_engine.GetItemAttrText
2160: lv_role_orig_sys_id:=wf_engine.getitemattrnumber(p_item_type,p_item_key,'FORWARD_TO_PERSON_ID',true);
2161:
2162: if(lv_role_orig_sys_id is not null) then
2163: -- need to revisit with role based support in SSHR transaction
2164: lv_role_orig_system := nvl( wf_engine.GetItemAttrText
2165: (itemtype => p_item_type
2166: ,itemkey => p_item_key
2167: ,aname => 'FORWARD_TO_ORIG_SYS_ATTR'
2168: ,ignore_notfound=>true),'PER');
2224:
2225: if g_debug then
2226: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
2227: end if;
2228: if ( funmode = wf_engine.eng_run ) then
2229: -- check if it is AME or custom approvals
2230: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2231: itemkey => p_item_key,
2232: aname => 'HR_AME_APP_ID_ATTR'),800);
2226: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
2227: end if;
2228: if ( funmode = wf_engine.eng_run ) then
2229: -- check if it is AME or custom approvals
2230: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2231: itemkey => p_item_key,
2232: aname => 'HR_AME_APP_ID_ATTR'),800);
2233:
2234: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2230: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2231: itemkey => p_item_key,
2232: aname => 'HR_AME_APP_ID_ATTR'),800);
2233:
2234: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2235: itemkey => p_item_key,
2236: aname => 'TRANSACTION_ID');
2237:
2238: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
2234: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2235: itemkey => p_item_key,
2236: aname => 'TRANSACTION_ID');
2237:
2238: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
2239: itemkey => p_item_key,
2240: aname => 'HR_AME_TRAN_TYPE_ATTR');
2241: if(c_transaction_type is not null) then
2242: hr_utility.set_location('In(if ( if(c_transaction_type is not null))): '|| c_proc,2);
2240: aname => 'HR_AME_TRAN_TYPE_ATTR');
2241: if(c_transaction_type is not null) then
2242: hr_utility.set_location('In(if ( if(c_transaction_type is not null))): '|| c_proc,2);
2243:
2244: notification_rec.notification_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2245: itemkey => p_item_key,
2246: aname => 'HR_CONTEXT_NID_ATTR');
2247: notification_rec.user_comments := wf_notification.getattrtext(
2248: notification_rec.notification_id
2247: notification_rec.user_comments := wf_notification.getattrtext(
2248: notification_rec.notification_id
2249: ,'WF_NOTE');
2250:
2251: l_is_parallel := wf_engine.GetItemAttrText(itemtype => p_item_type ,
2252: itemkey => p_item_key,
2253: aname => 'HR_PARALLEL_ATTR',
2254: ignore_notfound=>true);
2255:
2262: if(notification_rec.notification_id is not null) then
2263:
2264: select ORIGINAL_RECIPIENT into original_forward_to_user from wf_notifications where notification_id = notification_rec.notification_id;
2265:
2266: prll_ntf := wf_engine.getitemattrtext(p_item_type,
2267: p_item_key,
2268: 'PRLL_TRNSFR_DET',true);
2269:
2270: if( INSTR(prll_ntf,notification_rec.notification_id) > 0) then
2302:
2303: end if;
2304:
2305: else
2306: l_current_forward_to_username:= Wf_engine.GetItemAttrText(itemtype => p_item_type
2307: ,itemkey => p_item_key
2308: ,aname => 'FORWARD_TO_USERNAME');
2309: end if;
2310:
2307: ,itemkey => p_item_key
2308: ,aname => 'FORWARD_TO_USERNAME');
2309: end if;
2310:
2311: l_current_forward_to_username := nvl(l_current_forward_to_username,wf_engine.GetItemAttrText(itemtype => p_item_type ,
2312: itemkey => p_item_key,
2313: aname => 'RETURN_TO_USERNAME'));
2314:
2315: if g_debug then
2338: notificationIn => notification_rec,
2339: forwardeeIn =>ame_util.emptyApproverRecord2,
2340: updateItemIn =>false);
2341:
2342: wf_engine.SetItemAttrText
2343: (itemtype => p_item_type
2344: ,itemkey => p_item_key
2345: ,aname => 'FORWARD_FROM_ROLE_NAME'
2346: ,avalue => l_current_forward_to_username);
2344: ,itemkey => p_item_key
2345: ,aname => 'FORWARD_FROM_ROLE_NAME'
2346: ,avalue => l_current_forward_to_username);
2347:
2348: l_role_name := wf_engine.getItemAttrText
2349: (itemtype => p_item_type
2350: ,itemkey => p_item_key
2351: ,aname => 'FORWARD_FROM_ROLE_NAME'
2352: ,ignore_notfound=>true);
2362: hr_utility.set_location('Error in updateApproveStatus SQLERRM' ||' '||to_char(SQLCODE),10);
2363: end if;
2364: hr_utility.trace('ORCL error '||SQLERRM);
2365: --start code fix for bug 13610627
2366: --result := wf_engine.eng_trans_default;
2367: handleApprovalErrors(p_item_type, p_item_key, sqlerrm);
2368: result := 'COMPLETE:'||'FAILURE';
2369: --end code fix for bug 13610627
2370: return;
2373: if g_debug then
2374: hr_utility.set_location('returned from calling ame_api2.updateApprovalStatus2', 8);
2375: end if;
2376:
2377: --result := wf_engine.eng_trans_default;
2378: result := 'COMPLETE:'||'SUCCESS';
2379: else
2380: null;
2381: end if;
2422: end if;
2423:
2424: -- get the current approver category
2425: -- HR_APR_CATEGORY_ATTR
2426: lv_current_approver_category:= wf_engine.GetItemAttrText(itemtype => p_item_type ,
2427: itemkey => p_item_key,
2428: aname => 'HR_APR_CATEGORY_ATTR',
2429: ignore_notfound=>true);
2430: --HR_APR_SUB_LST_ORD_NUM_ATTR
2427: itemkey => p_item_key,
2428: aname => 'HR_APR_CATEGORY_ATTR',
2429: ignore_notfound=>true);
2430: --HR_APR_SUB_LST_ORD_NUM_ATTR
2431: ln_sublist_order_number:=wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2432: itemkey => p_item_key,
2433: aname => 'HR_APR_SUB_LST_ORD_NUM_ATTR',
2434: ignore_notfound=>true);
2435: -- default approvals
2483:
2484: if g_debug then
2485: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
2486: end if;
2487: if ( funmode = wf_engine.eng_run ) then
2488: -- check if it is AME or custom approvals
2489: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2490: itemkey => p_item_key,
2491: aname => 'HR_AME_APP_ID_ATTR'),800);
2485: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
2486: end if;
2487: if ( funmode = wf_engine.eng_run ) then
2488: -- check if it is AME or custom approvals
2489: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2490: itemkey => p_item_key,
2491: aname => 'HR_AME_APP_ID_ATTR'),800);
2492:
2493: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2489: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2490: itemkey => p_item_key,
2491: aname => 'HR_AME_APP_ID_ATTR'),800);
2492:
2493: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2494: itemkey => p_item_key,
2495: aname => 'TRANSACTION_ID');
2496:
2497: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
2493: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2494: itemkey => p_item_key,
2495: aname => 'TRANSACTION_ID');
2496:
2497: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
2498: itemkey => p_item_key,
2499: aname => 'HR_AME_TRAN_TYPE_ATTR');
2500: if(c_transaction_type is not null) then
2501: hr_utility.set_location('In(if ( if(c_transaction_type is not null))): '|| c_proc,15);
2499: aname => 'HR_AME_TRAN_TYPE_ATTR');
2500: if(c_transaction_type is not null) then
2501: hr_utility.set_location('In(if ( if(c_transaction_type is not null))): '|| c_proc,15);
2502:
2503: l_is_parallel := wf_engine.GetItemAttrText(itemtype => p_item_type ,
2504: itemkey => p_item_key,
2505: aname => 'HR_PARALLEL_ATTR',
2506: ignore_notfound=>true);
2507: if(l_is_parallel = 'PARALLEL') then
2526: transactionTypeIn =>c_transaction_type,
2527: transactionIdIn=>c_transaction_id,
2528: approvalStatusIn =>ame_util.notifiedStatus,
2529: approverNameIn =>c_next_approvers(l_index).name,
2530: itemClassIn => wf_engine.GetItemAttrText(itemtype => p_item_type ,
2531: itemkey => p_item_key,
2532: aname => 'HR_APR_ITEM_CLASS_ATTR'),
2533: -- HR_APR_ITEM_ID_ATTR
2534: itemIdIn =>wf_engine.GetItemAttrText(itemtype => p_item_type ,
2530: itemClassIn => wf_engine.GetItemAttrText(itemtype => p_item_type ,
2531: itemkey => p_item_key,
2532: aname => 'HR_APR_ITEM_CLASS_ATTR'),
2533: -- HR_APR_ITEM_ID_ATTR
2534: itemIdIn =>wf_engine.GetItemAttrText(itemtype => p_item_type ,
2535: itemkey => p_item_key,
2536: aname => 'HR_APR_ITEM_ID_ATTR'),
2537: -- HR_APR_ACTION_TYPE_ID_ATTR
2538: actionTypeIdIn=> wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2534: itemIdIn =>wf_engine.GetItemAttrText(itemtype => p_item_type ,
2535: itemkey => p_item_key,
2536: aname => 'HR_APR_ITEM_ID_ATTR'),
2537: -- HR_APR_ACTION_TYPE_ID_ATTR
2538: actionTypeIdIn=> wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2539: itemkey => p_item_key,
2540: aname => 'HR_APR_ACTION_TYPE_ID_ATTR'),
2541: -- HR_APR_GRPORCHN_ID_ATTR
2542: groupOrChainIdIn =>wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2538: actionTypeIdIn=> wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2539: itemkey => p_item_key,
2540: aname => 'HR_APR_ACTION_TYPE_ID_ATTR'),
2541: -- HR_APR_GRPORCHN_ID_ATTR
2542: groupOrChainIdIn =>wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2543: itemkey => p_item_key,
2544: aname => 'HR_APR_GRPORCHN_ID_ATTR'),
2545: occurrenceIn =>null,
2546: forwardeeIn =>ame_util.emptyApproverRecord2,
2553:
2554:
2555: else
2556:
2557: l_current_forward_to_username:= Wf_engine.GetItemAttrText(itemtype => p_item_type
2558: ,itemkey => p_item_key
2559: ,aname => 'HR_APR_NAME_ATTR');
2560: l_curr_fwd_to_orig_system_id :=wf_engine.getItemAttrNumber
2561: (itemtype => p_item_type
2556:
2557: l_current_forward_to_username:= Wf_engine.GetItemAttrText(itemtype => p_item_type
2558: ,itemkey => p_item_key
2559: ,aname => 'HR_APR_NAME_ATTR');
2560: l_curr_fwd_to_orig_system_id :=wf_engine.getItemAttrNumber
2561: (itemtype => p_item_type
2562: ,itemkey => p_item_key
2563: ,aname => 'HR_APR_ORIG_SYSTEM_ID_ATTR');
2564: if(l_curr_fwd_to_orig_system_id is not null) then
2576: transactionTypeIn =>c_transaction_type,
2577: transactionIdIn=>c_transaction_id,
2578: approvalStatusIn =>ame_util.notifiedStatus,
2579: approverNameIn =>l_current_forward_to_username,
2580: itemClassIn => wf_engine.GetItemAttrText(itemtype => p_item_type ,
2581: itemkey => p_item_key,
2582: aname => 'HR_APR_ITEM_CLASS_ATTR'),
2583: -- HR_APR_ITEM_ID_ATTR
2584: itemIdIn =>wf_engine.GetItemAttrText(itemtype => p_item_type ,
2580: itemClassIn => wf_engine.GetItemAttrText(itemtype => p_item_type ,
2581: itemkey => p_item_key,
2582: aname => 'HR_APR_ITEM_CLASS_ATTR'),
2583: -- HR_APR_ITEM_ID_ATTR
2584: itemIdIn =>wf_engine.GetItemAttrText(itemtype => p_item_type ,
2585: itemkey => p_item_key,
2586: aname => 'HR_APR_ITEM_ID_ATTR'),
2587: -- HR_APR_ACTION_TYPE_ID_ATTR
2588: actionTypeIdIn=> wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2584: itemIdIn =>wf_engine.GetItemAttrText(itemtype => p_item_type ,
2585: itemkey => p_item_key,
2586: aname => 'HR_APR_ITEM_ID_ATTR'),
2587: -- HR_APR_ACTION_TYPE_ID_ATTR
2588: actionTypeIdIn=> wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2589: itemkey => p_item_key,
2590: aname => 'HR_APR_ACTION_TYPE_ID_ATTR'),
2591: -- HR_APR_GRPORCHN_ID_ATTR
2592: groupOrChainIdIn =>wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2588: actionTypeIdIn=> wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2589: itemkey => p_item_key,
2590: aname => 'HR_APR_ACTION_TYPE_ID_ATTR'),
2591: -- HR_APR_GRPORCHN_ID_ATTR
2592: groupOrChainIdIn =>wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2593: itemkey => p_item_key,
2594: aname => 'HR_APR_GRPORCHN_ID_ATTR'),
2595: occurrenceIn =>null,
2596: forwardeeIn =>ame_util.emptyApproverRecord2,
2597: updateItemIn =>false);
2598: end if;
2599: end if;
2600:
2601: result := wf_engine.eng_trans_default;
2602: else
2603: null;
2604: end if;
2605: end if;
2644:
2645: if g_debug then
2646: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
2647: end if;
2648: if ( funmode = wf_engine.eng_run ) then
2649: -- check if it is AME or custom approvals
2650: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2651: itemkey => p_item_key,
2652: aname => 'HR_AME_APP_ID_ATTR'),800);
2646: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
2647: end if;
2648: if ( funmode = wf_engine.eng_run ) then
2649: -- check if it is AME or custom approvals
2650: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2651: itemkey => p_item_key,
2652: aname => 'HR_AME_APP_ID_ATTR'),800);
2653:
2654: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2650: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2651: itemkey => p_item_key,
2652: aname => 'HR_AME_APP_ID_ATTR'),800);
2653:
2654: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2655: itemkey => p_item_key,
2656: aname => 'TRANSACTION_ID');
2657:
2658: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
2654: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
2655: itemkey => p_item_key,
2656: aname => 'TRANSACTION_ID');
2657:
2658: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
2659: itemkey => p_item_key,
2660: aname => 'HR_AME_TRAN_TYPE_ATTR');
2661: if(c_transaction_type is not null) then
2662: hr_utility.set_location('In(if ( if(c_transaction_type is not null))): '|| c_proc,15);
2661: if(c_transaction_type is not null) then
2662: hr_utility.set_location('In(if ( if(c_transaction_type is not null))): '|| c_proc,15);
2663:
2664:
2665: l_is_parallel := wf_engine.GetItemAttrText(itemtype => p_item_type ,
2666: itemkey => p_item_key,
2667: aname => 'HR_PARALLEL_ATTR',
2668: ignore_notfound=>true);
2669:
2728: end if;
2729:
2730:
2731: else
2732: l_current_forward_to_username:= Wf_engine.GetItemAttrText(itemtype => p_item_type
2733: ,itemkey => p_item_key
2734: ,aname => 'FORWARD_TO_USERNAME');
2735: if g_debug then
2736: hr_utility.set_location('calling ame_api2.updateApprovalStatus2', 2);
2756:
2757: end if;
2758:
2759:
2760: result := wf_engine.eng_trans_default;
2761: else
2762: result := wf_engine.eng_trans_default;
2763: end if;
2764: pqh_ss_workflow.set_txn_approve_status(p_item_type,p_item_key,p_act_id,funmode,result);
2758:
2759:
2760: result := wf_engine.eng_trans_default;
2761: else
2762: result := wf_engine.eng_trans_default;
2763: end if;
2764: pqh_ss_workflow.set_txn_approve_status(p_item_type,p_item_key,p_act_id,funmode,result);
2765: end if;
2766:
2770:
2771:
2772: exception
2773: when others then
2774: result := wf_engine.eng_trans_default;
2775: return;
2776: end updateNoResponseStatus;
2777:
2778: procedure setRespondedUserContext( p_item_type in varchar2,
2798: create_item_attrib_if_notexist(itemtype=>p_item_type,
2799: itemkey=>p_item_key,
2800: aname=>'HR_CONTEXT_NID_ATTR',
2801: text_value=>null,
2802: number_value=>wf_engine.context_nid,
2803: date_value=>null);
2804: create_item_attrib_if_notexist(itemtype=>p_item_type,
2805: itemkey=>p_item_key,
2806: aname=>'HR_CONTEXT_USER_ATTR',
2803: date_value=>null);
2804: create_item_attrib_if_notexist(itemtype=>p_item_type,
2805: itemkey=>p_item_key,
2806: aname=>'HR_CONTEXT_USER_ATTR',
2807: text_value=>wf_engine.context_user,
2808: number_value=>null,
2809: date_value=>null);
2810: create_item_attrib_if_notexist(itemtype=>p_item_type,
2811: itemkey=>p_item_key,
2809: date_value=>null);
2810: create_item_attrib_if_notexist(itemtype=>p_item_type,
2811: itemkey=>p_item_key,
2812: aname=>'HR_CONTEXT_RECIPIENT_ROLE_ATTR',
2813: text_value=>wf_engine.context_recipient_role,
2814: number_value=>null,
2815: date_value=>null);
2816:
2817: create_item_attrib_if_notexist(itemtype=>p_item_type,
2816:
2817: create_item_attrib_if_notexist(itemtype=>p_item_type,
2818: itemkey=>p_item_key,
2819: aname=>'HR_CONTEXT_ORIG_RECIPIENT_ATTR',
2820: text_value=>wf_engine.context_original_recipient,
2821: number_value=>null,
2822: date_value=>null);
2823:
2824: create_item_attrib_if_notexist(itemtype=>p_item_type,
2823:
2824: create_item_attrib_if_notexist(itemtype=>p_item_type,
2825: itemkey=>p_item_key,
2826: aname=>'HR_CONTEXT_FROM_ROLE_ATTR',
2827: text_value=>wf_engine.context_from_role,
2828: number_value=>null,
2829: date_value=>null);
2830: create_item_attrib_if_notexist(itemtype=>p_item_type,
2831: itemkey=>p_item_key,
2829: date_value=>null);
2830: create_item_attrib_if_notexist(itemtype=>p_item_type,
2831: itemkey=>p_item_key,
2832: aname=>'HR_CONTEXT_NEW_ROLE_ATTR',
2833: text_value=>wf_engine.context_new_role,
2834: number_value=>null,
2835: date_value=>null);
2836: create_item_attrib_if_notexist(itemtype=>p_item_type,
2837: itemkey=>p_item_key,
2835: date_value=>null);
2836: create_item_attrib_if_notexist(itemtype=>p_item_type,
2837: itemkey=>p_item_key,
2838: aname=>'HR_CONTEXT_MORE_INFO_ROLE_ATTR',
2839: text_value=>wf_engine.context_more_info_role,
2840: number_value=>null,
2841: date_value=>null);
2842: create_item_attrib_if_notexist(itemtype=>p_item_type,
2843: itemkey=>p_item_key,
2841: date_value=>null);
2842: create_item_attrib_if_notexist(itemtype=>p_item_type,
2843: itemkey=>p_item_key,
2844: aname=>'HR_CONTEXT_USER_KEY_ATTR',
2845: text_value=>wf_engine.context_user_key,
2846: number_value=>null,
2847: date_value=>null);
2848:
2849: create_item_attrib_if_notexist(itemtype=>p_item_type,
2848:
2849: create_item_attrib_if_notexist(itemtype=>p_item_type,
2850: itemkey=>p_item_key,
2851: aname=>'HR_CONTEXT_PROXY_ATTR',
2852: text_value=>wf_engine.context_proxy,
2853: number_value=>null,
2854: date_value=>null);
2855:
2856: result := 'COMPLETE';
2897:
2898: if g_debug then
2899: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
2900: end if;
2901: if ( funmode = wf_engine.eng_run ) then
2902: -- Creating attribute to check the new transaction
2903: create_item_attrib_if_notexist(itemtype => p_item_type
2904: ,itemkey => p_item_key
2905: ,aname => 'HR_NEW_TRANSACTION'
2910:
2911: create_item_attrib_if_notexist(itemtype => p_item_type
2912: ,itemkey => p_item_key
2913: ,aname => 'SUBMIT_COMMENTS'
2914: ,text_value=>wf_engine.getitemattrtext(p_item_type,p_item_key,'APPROVAL_COMMENT_COPY',true)
2915: ,number_value=>null,
2916: date_value=>null
2917: );
2918: -- check if the transaction needs to be submitted for approval
2916: date_value=>null
2917: );
2918: -- check if the transaction needs to be submitted for approval
2919: -- get the transaction status
2920: lv_transaction_status:=wf_engine.getItemAttrText(itemtype=> p_item_type,
2921: itemkey => p_item_key,
2922: aname => 'TRAN_SUBMIT');
2923: if(lv_transaction_status<>'Y') then
2924: -- result := 'COMPLETE:'||'E';
2925: --return;
2926: raise g_transaction_status_invalid;
2927: end if;
2928: if(lv_transaction_status='Y') then
2929: lv_approval_required:= wf_engine.GetItemAttrText(itemtype => p_item_type,
2930: itemkey => p_item_key,
2931: aname => 'HR_RUNTIME_APPROVAL_REQ_FLAG');
2932: lv_approval_required := nvl(lv_approval_required,'N0');
2933: if(lv_approval_required in ('YES_DYNAMIC','YES','Y','YD')) then
2942: end if;
2943: -- PQH_SS_HISTORY.transfer_submit_to_history(p_item_type,p_item_key,p_act_id,funmode,result);
2944: -- use the new history API's
2945: -- add the code plugin transfer history
2946: c_transaction_id := wf_engine.getitemattrnumber(p_item_type,p_item_key,'TRANSACTION_ID');
2947: lv_comments := wf_engine.getitemattrtext(p_item_type,p_item_key,'APPROVAL_COMMENT_COPY');
2948: hr_trans_history_api.archive_submit(c_transaction_id,
2949: null,
2950: fnd_global.user_name,
2943: -- PQH_SS_HISTORY.transfer_submit_to_history(p_item_type,p_item_key,p_act_id,funmode,result);
2944: -- use the new history API's
2945: -- add the code plugin transfer history
2946: c_transaction_id := wf_engine.getitemattrnumber(p_item_type,p_item_key,'TRANSACTION_ID');
2947: lv_comments := wf_engine.getitemattrtext(p_item_type,p_item_key,'APPROVAL_COMMENT_COPY');
2948: hr_trans_history_api.archive_submit(c_transaction_id,
2949: null,
2950: fnd_global.user_name,
2951: lv_comments);
2956: hr_utility.set_location('p_item_type:'|| p_item_type, 6);
2957: hr_utility.set_location('p_item_key:'|| p_item_key, 7);
2958: end if;
2959:
2960: HR_DYNAMIC_APPROVAL_WEB.INITIALIZE_ITEM_ATTRIBUTES(p_item_type,p_item_key,null,wf_engine.eng_run,lv_result);
2961: HR_APPROVAL_WF.INITIALIZE_ITEM_ATTRIBUTES(p_item_type,p_item_key,p_act_id,funmode,result);
2962:
2963: -- PQH_SS_WORKFLOW.set_image_source
2964: if g_debug then
3076: begin
3077: select text_value
3078: into lv_result_code
3079: from wf_notification_attributes
3080: where notification_id=wf_engine.context_nid
3081: and name='RESULT';
3082:
3083: if(funmode='RESPOND' and lv_result_code='RESUBMIT') Then
3084:
3081: and name='RESULT';
3082:
3083: if(funmode='RESPOND' and lv_result_code='RESUBMIT') Then
3084:
3085: WF_ENGINE.SetItemAttrText(p_item_type,p_item_key,'WF_NOTE',wf_engine.GetItemAttrText( p_item_type
3086: ,p_item_key
3087: ,'APPROVAL_COMMENT_COPY'));
3088:
3089: end if;
3094: end;
3095: --sturlapa coding ends for bug 3866581
3096:
3097: --- added by KMG
3098: c_transaction_id := wf_engine.getitemattrnumber(p_item_type,p_item_key,'TRANSACTION_ID');
3099:
3100: OPEN csr_txn(c_transaction_id);
3101: FETCH csr_txn INTO l_transaction_ref_table,l_transaction_ref_id;
3102: CLOSE csr_txn;
3158: l_new_fwd_display_name varchar2(360);
3159: l_is_parallel varchar2(10) := null;
3160:
3161: cursor get_person_info is
3162: select orig_system,orig_system_id,display_name from wf_roles where name = wf_engine.context_new_role;
3163:
3164: /* cursor get_name_info is
3165: select last_name,first_name from per_all_people_f where
3166: person_id = l_new_fwd_person_id;*/
3171:
3172: if ( funmode = 'TRANSFER' ) then
3173: -- TRANSFER - When a notification recipient transfers the notification.
3174: -- check if it is AME or custom approvals
3175: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
3176: itemkey => p_item_key,
3177: aname => 'HR_AME_APP_ID_ATTR'),800);
3178:
3179: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
3175: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
3176: itemkey => p_item_key,
3177: aname => 'HR_AME_APP_ID_ATTR'),800);
3178:
3179: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
3180: itemkey => p_item_key,
3181: aname => 'TRANSACTION_ID');
3182:
3183: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3179: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
3180: itemkey => p_item_key,
3181: aname => 'TRANSACTION_ID');
3182:
3183: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3184: itemkey => p_item_key,
3185: aname => 'HR_AME_TRAN_TYPE_ATTR');
3186:
3187: if(c_transaction_type is not null) then
3187: if(c_transaction_type is not null) then
3188: hr_utility.set_location('In(if ( if(c_transaction_type is not null))): '|| c_proc,2);
3189:
3190: /*
3191: l_current_forward_to_username:= Wf_engine.GetItemAttrText(itemtype => p_item_type
3192: ,itemkey => p_item_key
3193: ,aname => 'HR_CONTEXT_USER_ATTR');
3194:
3195: */
3194:
3195: */
3196:
3197: --Start - Fix for Bug 14794335
3198: l_is_parallel := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3199: itemkey => p_item_key,
3200: aname => 'HR_PARALLEL_ATTR',
3201: ignore_notfound=>true);
3202: if(l_is_parallel = 'PARALLEL') then
3199: itemkey => p_item_key,
3200: aname => 'HR_PARALLEL_ATTR',
3201: ignore_notfound=>true);
3202: if(l_is_parallel = 'PARALLEL') then
3203: l_current_forward_to_username := wf_engine.context_user;
3204: else
3205: l_current_forward_to_username:= Wf_engine.GetItemAttrText(itemtype => p_item_type
3206: ,itemkey => p_item_key
3207: ,aname => 'FORWARD_TO_USERNAME');
3201: ignore_notfound=>true);
3202: if(l_is_parallel = 'PARALLEL') then
3203: l_current_forward_to_username := wf_engine.context_user;
3204: else
3205: l_current_forward_to_username:= Wf_engine.GetItemAttrText(itemtype => p_item_type
3206: ,itemkey => p_item_key
3207: ,aname => 'FORWARD_TO_USERNAME');
3208: end if;
3209: --End - Fix for Bug 14794335
3208: end if;
3209: --End - Fix for Bug 14794335
3210:
3211:
3212: l_current_forward_to_username := nvl(l_current_forward_to_username,wf_engine.GetItemAttrText(itemtype => p_item_type ,
3213: itemkey => p_item_key,
3214: aname => 'RETURN_TO_USERNAME'));
3215: if g_debug then
3216: hr_utility.set_location('calling ame_api2.updateApprovalStatus2', 3);
3217: hr_utility.set_location('c_application_id:'|| c_application_id, 4);
3218: hr_utility.set_location('c_transaction_type:'|| c_transaction_type, 5);
3219: hr_utility.set_location('approvalStatusIn:'|| ame_util.approvedStatus, 6);
3220: hr_utility.set_location('approverNameIn:'|| l_current_forward_to_username, 7);
3221: hr_utility.set_location('new approver:'|| wf_engine.context_new_role, 7);
3222: end if;
3223:
3224: begin
3225:
3226: open get_person_info;
3227: fetch get_person_info into l_new_orig_system,l_new_fwd_person_id,l_new_fwd_display_name;
3228: CLOSe get_person_info;
3229:
3230: rec_forwardee.name:= wf_engine.context_new_role;
3231: rec_forwardee.orig_system :=l_new_orig_system;
3232: rec_forwardee.orig_system_id :=l_new_fwd_person_id;
3233: rec_forwardee.display_name :=l_new_fwd_display_name;
3234: --rec_forwardee.api_insertion:='Y';
3251: updateItemIn =>false);
3252:
3253: --reset wf attributes
3254:
3255: wf_engine.setItemAttrNumber(p_item_type,p_item_key,'FORWARD_TO_PERSON_ID',rec_forwardee.orig_system_id);
3256: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_USERNAME',wf_engine.context_new_role);
3257: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_DISPLAY_NAME',wf_directory.GetRoleDisplayName(wf_engine.context_new_role));
3258: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_USER',getToString(p_item_key) || wf_directory.GetRoleDisplayName(wf_engine.context_new_role));
3259:
3252:
3253: --reset wf attributes
3254:
3255: wf_engine.setItemAttrNumber(p_item_type,p_item_key,'FORWARD_TO_PERSON_ID',rec_forwardee.orig_system_id);
3256: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_USERNAME',wf_engine.context_new_role);
3257: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_DISPLAY_NAME',wf_directory.GetRoleDisplayName(wf_engine.context_new_role));
3258: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_USER',getToString(p_item_key) || wf_directory.GetRoleDisplayName(wf_engine.context_new_role));
3259:
3260: if g_debug then
3253: --reset wf attributes
3254:
3255: wf_engine.setItemAttrNumber(p_item_type,p_item_key,'FORWARD_TO_PERSON_ID',rec_forwardee.orig_system_id);
3256: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_USERNAME',wf_engine.context_new_role);
3257: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_DISPLAY_NAME',wf_directory.GetRoleDisplayName(wf_engine.context_new_role));
3258: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_USER',getToString(p_item_key) || wf_directory.GetRoleDisplayName(wf_engine.context_new_role));
3259:
3260: if g_debug then
3261: hr_utility.set_location('calling ame_api2.getNextApprovers4 ',4);
3254:
3255: wf_engine.setItemAttrNumber(p_item_type,p_item_key,'FORWARD_TO_PERSON_ID',rec_forwardee.orig_system_id);
3256: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_USERNAME',wf_engine.context_new_role);
3257: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_DISPLAY_NAME',wf_directory.GetRoleDisplayName(wf_engine.context_new_role));
3258: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_USER',getToString(p_item_key) || wf_directory.GetRoleDisplayName(wf_engine.context_new_role));
3259:
3260: if g_debug then
3261: hr_utility.set_location('calling ame_api2.getNextApprovers4 ',4);
3262: hr_utility.set_location('c_application_id:'||c_application_id,5);
3289: end if;
3290:
3291:
3292:
3293: result := wf_engine.eng_trans_default;
3294: else
3295: null;
3296: end if;
3297:
3348: end if;
3349:
3350: -- added for bug 13485539
3351: if hr_multi_tenancy_pkg.is_multi_tenant_system then
3352: l_cpersonId := NVL( wf_engine.getItemAttrText (
3353: itemtype => p_item_type
3354: ,itemkey => p_item_key
3355: ,aname => 'CREATOR_PERSON_ID'),-1);
3356:
3368: -- bug 5414392
3369:
3370: if ( funmode = 'TRANSFER' ) then
3371:
3372: l_is_parallel := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3373: itemkey => p_item_key,
3374: aname => 'HR_PARALLEL_ATTR',
3375: ignore_notfound=>true);
3376: if(l_is_parallel = 'PARALLEL') then
3379: if g_debug then
3380: hr_utility.set_location('Approval mode is parallel', 1);
3381: end if;
3382:
3383: l_notification_id := wf_engine.context_nid;
3384: l_current_forward_to_username:= wf_engine.context_original_recipient;
3385:
3386: prll_ntf := wf_engine.getitemattrtext(p_item_type,
3387: p_item_key,
3380: hr_utility.set_location('Approval mode is parallel', 1);
3381: end if;
3382:
3383: l_notification_id := wf_engine.context_nid;
3384: l_current_forward_to_username:= wf_engine.context_original_recipient;
3385:
3386: prll_ntf := wf_engine.getitemattrtext(p_item_type,
3387: p_item_key,
3388: 'PRLL_TRNSFR_DET',true);
3382:
3383: l_notification_id := wf_engine.context_nid;
3384: l_current_forward_to_username:= wf_engine.context_original_recipient;
3385:
3386: prll_ntf := wf_engine.getitemattrtext(p_item_type,
3387: p_item_key,
3388: 'PRLL_TRNSFR_DET',true);
3389:
3390: create_item_attrib_if_notexist(itemtype => p_item_type
3399: else
3400: if g_debug then
3401: hr_utility.set_location('Approval mode is serial', 1);
3402: end if;
3403: lv_new_transaction := wf_engine.getitemattrtext(p_item_type,
3404: p_item_key,
3405: 'HR_NEW_TRANSACTION',true);
3406:
3407:
3465: hr_utility.set_location('Entering:'||l_proc, 1);
3466: END IF;
3467:
3468:
3469: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
3470: itemkey => p_item_key,
3471: aname => 'TRANSACTION_ID',
3472: ignore_notfound=>true);
3473: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3469: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
3470: itemkey => p_item_key,
3471: aname => 'TRANSACTION_ID',
3472: ignore_notfound=>true);
3473: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3474: itemkey => p_item_key,
3475: aname => 'HR_AME_TRAN_TYPE_ATTR',
3476: ignore_notfound=>true);
3477: c_application_id :=wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
3473: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3474: itemkey => p_item_key,
3475: aname => 'HR_AME_TRAN_TYPE_ATTR',
3476: ignore_notfound=>true);
3477: c_application_id :=wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
3478: itemkey => p_item_key,
3479: aname => 'HR_AME_APP_ID_ATTR',
3480: ignore_notfound=>true);
3481: c_application_id := nvl(c_application_id,800);
3479: aname => 'HR_AME_APP_ID_ATTR',
3480: ignore_notfound=>true);
3481: c_application_id := nvl(c_application_id,800);
3482:
3483: notification_rec.notification_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
3484: itemkey => p_item_key,
3485: aname => 'HR_CONTEXT_NID_ATTR');
3486: notification_rec.user_comments := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3487: itemkey => p_item_key,
3482:
3483: notification_rec.notification_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
3484: itemkey => p_item_key,
3485: aname => 'HR_CONTEXT_NID_ATTR');
3486: notification_rec.user_comments := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3487: itemkey => p_item_key,
3488: aname => 'NOTE_FROM_APPR');
3489:
3490: if(c_transaction_type is not null) then
3499: transactionTypeIn =>c_transaction_type,
3500: transactionIdIn => c_transaction_id,
3501: approvalProcessCompleteYNOut =>c_approvalprocesscompleteynout,
3502: approversOut =>c_all_approvers);
3503: c_creator_user := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3504: itemkey => p_item_key,
3505: aname => 'CREATOR_PERSON_USERNAME');
3506: c_return_user := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3507: itemkey => p_item_key,
3502: approversOut =>c_all_approvers);
3503: c_creator_user := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3504: itemkey => p_item_key,
3505: aname => 'CREATOR_PERSON_USERNAME');
3506: c_return_user := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3507: itemkey => p_item_key,
3508: aname => 'RETURN_TO_USERNAME',
3509: ignore_notfound=>true);
3510:
3508: aname => 'RETURN_TO_USERNAME',
3509: ignore_notfound=>true);
3510:
3511:
3512: l_is_parallel := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3513: itemkey => p_item_key,
3514: aname => 'HR_PARALLEL_ATTR',
3515: ignore_notfound=>true);
3516:
3514: aname => 'HR_PARALLEL_ATTR',
3515: ignore_notfound=>true);
3516:
3517: if(l_is_parallel = 'PARALLEL') then
3518: c_rfc_user := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3519: itemkey => p_item_key,
3520: aname => 'FORWARD_FROM_ROLE_NAME',
3521: ignore_notfound=>true);
3522: else
3519: itemkey => p_item_key,
3520: aname => 'FORWARD_FROM_ROLE_NAME',
3521: ignore_notfound=>true);
3522: else
3523: c_rfc_user := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3524: itemkey => p_item_key,
3525: aname => 'FORWARD_TO_USERNAME',
3526: ignore_notfound=>true);
3527: end if;
3638: -- reset the AME approval state
3639: reset_ame_to_rfc_state(p_item_type,p_item_key);
3640:
3641: -- reset the item attrtibutes
3642: c_return_user:= wf_engine.GetItemAttrText(itemtype => p_item_type ,
3643: itemkey => p_item_key,
3644: aname => 'RETURN_TO_USERNAME',
3645: ignore_notfound=>true);
3646: c_creator_user := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3642: c_return_user:= wf_engine.GetItemAttrText(itemtype => p_item_type ,
3643: itemkey => p_item_key,
3644: aname => 'RETURN_TO_USERNAME',
3645: ignore_notfound=>true);
3646: c_creator_user := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3647: itemkey => p_item_key,
3648: aname => 'CREATOR_PERSON_USERNAME');
3649:
3650: c_return_user := nvl(c_return_user,c_creator_user);
3655:
3656: -- get the return to user orig system and sys id
3657: wf_directory.GetRoleInfo2(c_return_user,c_return_user_role_info_tbl);
3658:
3659: l_is_parallel := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3660: itemkey => p_item_key,
3661: aname => 'HR_PARALLEL_ATTR',
3662: ignore_notfound=>true);
3663:
3661: aname => 'HR_PARALLEL_ATTR',
3662: ignore_notfound=>true);
3663:
3664: if(l_is_parallel = 'PARALLEL') then
3665: l_curr_approver_role := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3666: itemkey => p_item_key,
3667: aname => 'FORWARD_FROM_ROLE_NAME',
3668: ignore_notfound=>true);
3669: wf_engine.SetItemAttrText
3665: l_curr_approver_role := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3666: itemkey => p_item_key,
3667: aname => 'FORWARD_FROM_ROLE_NAME',
3668: ignore_notfound=>true);
3669: wf_engine.SetItemAttrText
3670: (itemtype => p_item_type
3671: ,itemkey => p_item_key
3672: ,aname => 'HR_PARALLEL_ATTR'
3673: ,avalue => 'SERIAL');
3672: ,aname => 'HR_PARALLEL_ATTR'
3673: ,avalue => 'SERIAL');
3674:
3675: else
3676: l_curr_approver_role := wf_engine.GetItemAttrText(itemtype => p_item_type ,
3677: itemkey => p_item_key,
3678: aname => 'FORWARD_TO_USERNAME',
3679: ignore_notfound=>true);
3680: end if;
3775: * CAUTION: IF this procedure is invoked from somewhere else (apart from RFC) then this needs
3776: * to be checked for that condition too.
3777: */
3778:
3779: l_approvalProcessVersion := wf_engine.GetItemAttrText(
3780: itemtype => p_item_Type,
3781: itemkey => p_item_Key,
3782: aname => 'HR_APPROVAL_PRC_VERSION',
3783: ignore_notfound=>true);
3782: aname => 'HR_APPROVAL_PRC_VERSION',
3783: ignore_notfound=>true);
3784:
3785: IF ( NVL(l_approvalProcessversion,'X') <> 'V5' OR
3786: wf_engine.GetItemAttrText(
3787: itemtype => p_item_Type, itemkey => p_item_Key,
3788: aname => 'HR_AME_TRAN_TYPE_ATTR') IS NOT NULL) THEN
3789:
3790: -- CURRENT_APPROVER_INDEX
3855: g_debug := hr_utility.debug_enabled;
3856: if g_debug then
3857: hr_utility.set_location('Entering:'|| g_package||'.'||c_proc, 1);
3858: end if;
3859: if ( funmode = wf_engine.eng_run ) then
3860:
3861: PQH_SS_WORKFLOW.set_txn_rfc_status(p_item_type,p_item_key,p_act_id,funmode,result);
3862: -- fix for bug 4454439
3863: begin
3867: ,p_item_type=>p_item_type
3868: ,p_item_key=>p_item_key);
3869:
3870: if hr_workflow_ss.getOrganizationManagersubject(p_item_type,p_item_key) is not null then
3871: wf_engine.setItemAttrText (
3872: itemtype => p_item_type
3873: ,itemkey => p_item_Key
3874: ,aname => 'CURRENT_PERSON_DISPLAY_NAME'
3875: ,avalue => hr_workflow_ss.getOrganizationManagersubject(p_item_type,p_item_key));
3884: -- HR_CUSTOM_RETURN_FOR_CORR
3885: if g_debug then
3886: hr_utility.set_location('checking product specific custom RFC',2);
3887: end if;
3888: lv_customRFC:=wf_engine.getitemattrtext(p_item_type,p_item_key,'HR_CUSTOM_RETURN_FOR_CORR',true);
3889: lv_customRFC:= nvl(lv_customRFC,'N');
3890: if g_debug then
3891: hr_utility.set_location('lv_customRFC:'||lv_customRFC,3);
3892: end if;
3892: end if;
3893:
3894: if(lv_customRFC='Y') then
3895: -- no more processing return to delete the transaction
3896: result := wf_engine.eng_completed||':N';
3897: return;
3898: end if;
3899:
3900: -- call PQH_SS_HISTORY.transfer_approval_to_history
3929: --
3930: begin
3931: -- finally see if we have any module specific call backs
3932: -- 'HR_RFC_CB_ATTR'
3933: lv_queryProcedure := wf_engine.getitemattrtext(p_item_type,p_item_key,'HR_RFC_CB_ATTR',true);
3934:
3935: if(lv_queryProcedure is not null or lv_queryProcedure<>'') then
3936:
3937: if g_debug then
3964: end;
3965:
3966: -- check if the RFC is to Initiator or Approver
3967: -- CREATOR_PERSON_USERNAME
3968: lv_creatorUserName:=wf_engine.getitemattrtext(p_item_type,p_item_key,'CREATOR_PERSON_USERNAME',true);
3969: -- RETURN_TO_USERNAME
3970: lv_rfcUserName:=wf_engine.getitemattrtext(p_item_type,p_item_key,'RETURN_TO_USERNAME',true);
3971: -- Compare
3972:
3966: -- check if the RFC is to Initiator or Approver
3967: -- CREATOR_PERSON_USERNAME
3968: lv_creatorUserName:=wf_engine.getitemattrtext(p_item_type,p_item_key,'CREATOR_PERSON_USERNAME',true);
3969: -- RETURN_TO_USERNAME
3970: lv_rfcUserName:=wf_engine.getitemattrtext(p_item_type,p_item_key,'RETURN_TO_USERNAME',true);
3971: -- Compare
3972:
3973: if (lv_creatorUserName is null or lv_rfcUserName is null) then
3974: result := wf_engine.eng_completed||':YES_APPROVER';
3970: lv_rfcUserName:=wf_engine.getitemattrtext(p_item_type,p_item_key,'RETURN_TO_USERNAME',true);
3971: -- Compare
3972:
3973: if (lv_creatorUserName is null or lv_rfcUserName is null) then
3974: result := wf_engine.eng_completed||':YES_APPROVER';
3975: elsif (lv_creatorUserName < lv_rfcUserName) then
3976: result := wf_engine.eng_completed||':YES_APPROVER';
3977: elsif (lv_creatorUserName > lv_rfcUserName) then
3978: result := wf_engine.eng_completed||':YES_APPROVER';
3972:
3973: if (lv_creatorUserName is null or lv_rfcUserName is null) then
3974: result := wf_engine.eng_completed||':YES_APPROVER';
3975: elsif (lv_creatorUserName < lv_rfcUserName) then
3976: result := wf_engine.eng_completed||':YES_APPROVER';
3977: elsif (lv_creatorUserName > lv_rfcUserName) then
3978: result := wf_engine.eng_completed||':YES_APPROVER';
3979: elsif (lv_creatorUserName = lv_rfcUserName) then
3980: result := wf_engine.eng_completed||':YES_INIT';
3974: result := wf_engine.eng_completed||':YES_APPROVER';
3975: elsif (lv_creatorUserName < lv_rfcUserName) then
3976: result := wf_engine.eng_completed||':YES_APPROVER';
3977: elsif (lv_creatorUserName > lv_rfcUserName) then
3978: result := wf_engine.eng_completed||':YES_APPROVER';
3979: elsif (lv_creatorUserName = lv_rfcUserName) then
3980: result := wf_engine.eng_completed||':YES_INIT';
3981: end if;
3982:
3976: result := wf_engine.eng_completed||':YES_APPROVER';
3977: elsif (lv_creatorUserName > lv_rfcUserName) then
3978: result := wf_engine.eng_completed||':YES_APPROVER';
3979: elsif (lv_creatorUserName = lv_rfcUserName) then
3980: result := wf_engine.eng_completed||':YES_INIT';
3981: end if;
3982:
3983: if g_debug then
3984: hr_utility.set_location('leaving with resultcode :'|| result,9);
4291: date_value =>null );
4292:
4293: -- Set the notes for RFC notification.
4294: -- NOTE_FROM_APPR
4295: wf_engine.setItemAttrText (
4296: itemtype => p_item_type
4297: ,itemkey => p_item_Key
4298: ,aname => 'NOTE_FROM_APPR'
4299: ,avalue => p_rfc_comments );
4296: itemtype => p_item_type
4297: ,itemkey => p_item_Key
4298: ,aname => 'NOTE_FROM_APPR'
4299: ,avalue => p_rfc_comments );
4300: wf_engine.setItemAttrText (
4301: itemtype => p_item_type
4302: ,itemkey => p_item_Key
4303: ,aname => 'WF_NOTE'
4304: ,avalue => null );
4364: ,aname => '#FROM_ROLE'
4365: ,avalue => fnd_global.user_name );
4366: -- processing logic for non AME
4367: begin
4368: IF (wf_engine.GetItemAttrText(itemtype => p_item_Type ,
4369: itemkey => p_item_key,
4370: aname => 'HR_AME_TRAN_TYPE_ATTR') IS NULL) THEN
4371: --
4372: -- set the attribute value to null
4369: itemkey => p_item_key,
4370: aname => 'HR_AME_TRAN_TYPE_ATTR') IS NULL) THEN
4371: --
4372: -- set the attribute value to null
4373: wf_engine.SetItemAttrNumber(
4374: itemtype => p_item_Type ,
4375: itemkey => p_item_key,
4376: aname => 'CURRENT_APPROVER_INDEX',
4377: avalue => p_approverIndex);
4423:
4424: CLOSE cur_add_appr;
4425:
4426: IF ( l_lastDefaultApprover IS NOT NULL ) THEN
4427: wf_engine.SetItemAttrNumber(
4428: itemtype => p_item_Type ,
4429: itemkey => p_item_key,
4430: aname => 'LAST_DEFAULT_APPROVER',
4431: avalue => l_lastDefaultApprover);
4470: null;
4471: end;
4472:
4473:
4474: lv_creator_role := wf_engine.getitemattrtext(lv_item_type,
4475: lv_item_key,
4476: 'CREATOR_PERSON_USERNAME');
4477: -- get the orig sys info
4478: wf_directory.getroleorigsysinfo(lv_creator_role,
4479: lv_creator_orig_system,
4480: lv_creator_orig_sys_id);
4481:
4482: handleRFCAction(p_approval_notification_id =>p_approval_notification_id,
4483: p_transaction_id =>wf_engine.getitemattrnumber
4484: (lv_item_type,
4485: lv_item_key,
4486: 'TRANSACTION_ID'),
4487: p_item_type =>lv_item_type,
4503: lv_role_orig_sys_id wf_roles.orig_system_id%type;
4504: begin
4505:
4506: -- CREATOR_PERSON_ID
4507: lv_role_orig_sys_id:=wf_engine.getitemattrnumber(p_item_type,p_item_key,'CREATOR_PERSON_ID',true);
4508:
4509: if(lv_role_orig_sys_id is not null) then
4510: -- need to revisit with role based support in SSHR transaction
4511: lv_role_orig_system := 'PER';
4547: lv_role_orig_sys_id wf_roles.orig_system_id%type;
4548: begin
4549:
4550: -- CURRENT_PERSON_ID
4551: lv_role_orig_sys_id:=wf_engine.getitemattrnumber(p_item_type,p_item_key,'CURRENT_PERSON_ID',true);
4552:
4553: if(lv_role_orig_sys_id is not null) then
4554: -- need to revisit with role based support in SSHR transaction
4555: lv_role_orig_system := 'PER';
4586: lv_role_orig_sys_id wf_roles.orig_system_id%type;
4587: begin
4588:
4589: -- FORWARD_FROM_PERSON_ID
4590: lv_role_orig_sys_id:=wf_engine.getitemattrnumber(p_item_type,p_item_key,'FORWARD_FROM_PERSON_ID',true);
4591:
4592: if(lv_role_orig_sys_id is not null) then
4593: -- need to revisit with role based support in SSHR transaction
4594: lv_role_orig_system := nvl( wf_engine.GetItemAttrText
4590: lv_role_orig_sys_id:=wf_engine.getitemattrnumber(p_item_type,p_item_key,'FORWARD_FROM_PERSON_ID',true);
4591:
4592: if(lv_role_orig_sys_id is not null) then
4593: -- need to revisit with role based support in SSHR transaction
4594: lv_role_orig_system := nvl( wf_engine.GetItemAttrText
4595: (itemtype => p_item_type
4596: ,itemkey => p_item_key
4597: ,aname => 'FORWARD_FROM_ORIG_SYS_ATTR'
4598: ,ignore_notfound=>true),'PER');
4633: lv_role_orig_sys_id wf_roles.orig_system_id%type;
4634: begin
4635:
4636: -- RETURN_TO_USER_ORIG_SYS_ID
4637: lv_role_orig_sys_id:=wf_engine.getitemattrnumber(p_item_type,p_item_key,'RETURN_TO_USER_ORIG_SYS_ID',true);
4638:
4639: if(lv_role_orig_sys_id is not null) then
4640: -- need to revisit with role based support in SSHR transaction
4641: lv_role_orig_system := wf_engine.GetItemAttrText
4637: lv_role_orig_sys_id:=wf_engine.getitemattrnumber(p_item_type,p_item_key,'RETURN_TO_USER_ORIG_SYS_ID',true);
4638:
4639: if(lv_role_orig_sys_id is not null) then
4640: -- need to revisit with role based support in SSHR transaction
4641: lv_role_orig_system := wf_engine.GetItemAttrText
4642: (itemtype => p_item_type
4643: ,itemkey => p_item_key
4644: ,aname => 'RETURN_TO_USER_ORIG_SYS'
4645: ,ignore_notfound=>true);
4675: l_appraisee_person_id per_appraisals.appraisee_person_id%type;
4676: begin
4677:
4678: -- get the appraisal id
4679: l_appraisal_id:= wf_engine.GetItemAttrNumber (itemtype => p_item_type ,
4680: itemkey => p_item_key ,
4681: aname => 'APPRAISAL_ID',
4682: ignore_notfound=>true);
4683:
4834: --local variables
4835:
4836: begin
4837: -- Do nothing in cancel or timeout mode
4838: if (funmode <> wf_engine.eng_run) then
4839: result := wf_engine.eng_null;
4840: return;
4841: end if;
4842: -- set the item attribute value with the current activity id
4835:
4836: begin
4837: -- Do nothing in cancel or timeout mode
4838: if (funmode <> wf_engine.eng_run) then
4839: result := wf_engine.eng_null;
4840: return;
4841: end if;
4842: -- set the item attribute value with the current activity id
4843: -- this will be used when the notification is sent.
5121: end;
5122: end if;
5123:
5124: -- Create the Workflow Process
5125: wf_engine.CreateProcess
5126: (itemtype => lr_transaction_rec.item_type
5127: ,itemkey => p_item_key
5128: ,process => lr_transaction_rec.process_name);
5129:
5130: -- check the process status before setting
5131: -- other mandatory attributes
5132: -- check the state of the workflow
5133: -- we need to check if the flow is in error state or not
5134: wf_engine.iteminfo(lr_transaction_rec.item_type,
5135: p_item_key,
5136: p_status,
5137: lv_result,
5138: lv_errorActid,
5189: l_current_person_name := getpersonnamefromid(lr_transaction_rec.creator_person_id);
5190: end if;
5191: l_current_person_name := l_current_person_name||'('||lr_transaction_rec.api_addtnl_info||')';
5192:
5193: wf_engine.setItemattrtext(lr_transaction_rec.item_type,p_item_key,'CURRENT_PERSON_DISPLAY_NAME',l_current_person_name);
5194: end if;
5195:
5196: -- Get Applicant name if the transaction is related to offers
5197:
5196: -- Get Applicant name if the transaction is related to offers
5197:
5198: if lr_transaction_rec.transaction_ref_table ='IRC_OFFERS' then
5199: l_current_person_name := lr_transaction_rec.api_addtnl_info;
5200: wf_engine.setItemattrtext(lr_transaction_rec.item_type,p_item_key,'CURRENT_PERSON_DISPLAY_NAME',l_current_person_name);
5201: end if;
5202: -- Create Item Attributes for those passed in
5203: --
5204: l_index := 1;
5241: END IF;
5242: -- ---------------------------------------------------
5243: -- Set the Item Owner
5244: -- ---------------------------------------------------
5245: wf_engine.setItemOwner
5246: (itemtype => lr_transaction_rec.item_type
5247: ,itemkey => p_item_key
5248: ,owner => l_role_name);
5249:
5281: );
5282:
5283: -- now start the process
5284: -- Start the WF runtime process
5285: wf_engine.startprocess
5286: (itemtype => lr_transaction_rec.item_type
5287: ,itemkey => p_item_key);
5288:
5289: -- check the wf status before returning the status back to caller
5287: ,itemkey => p_item_key);
5288:
5289: -- check the wf status before returning the status back to caller
5290: -- we need to check if the flow is in error state or not
5291: wf_engine.iteminfo(lr_transaction_rec.item_type,
5292: p_item_key,
5293: p_status,
5294: lv_result,
5295: lv_errorActid,
5352: ,p_orig_system_id => fnd_global.employee_id
5353: ,p_name => lv_loginPersonUserName
5354: ,p_display_name => lv_loginPersonDispName);
5355: --HR_APPRAISAL_FROM_USER_ATTR
5356: wf_engine.setitemattrtext(lr_hr_api_transaction_rec.item_type
5357: ,lr_hr_api_transaction_rec.item_key
5358: ,'HR_APPRAISAL_FROM_USER_ATTR',
5359: fnd_global.user_name);
5360: -- HR_APPRAISAL_FROM_NAME_ATTR
5357: ,lr_hr_api_transaction_rec.item_key
5358: ,'HR_APPRAISAL_FROM_USER_ATTR',
5359: fnd_global.user_name);
5360: -- HR_APPRAISAL_FROM_NAME_ATTR
5361: wf_engine.setitemattrtext(lr_hr_api_transaction_rec.item_type
5362: ,lr_hr_api_transaction_rec.item_key
5363: ,'HR_APPRAISAL_FROM_NAME_ATTR'
5364: ,lv_loginPersonDispName);
5365:
5373: ln_activity_id);
5374: else
5375: -- generic approval process initial block id attribute
5376: --HR_APPROVAL_BLOCK_ID_ATTR
5377: ln_activity_id:=wf_engine.getitemattrnumber(lr_hr_api_transaction_rec.item_type,
5378: lr_hr_api_transaction_rec.item_key,
5379: 'HR_APPROVAL_BLOCK_ID_ATTR',true);
5380: end if;
5381: end if;
5450: if(ln_activity_id is null) then
5451: null; -- raise error
5452: end if;
5453: -- set the workflow status TRAN_SUBMIT to Y
5454: wf_engine.setitemattrtext(lr_hr_api_transaction_rec.item_type
5455: ,lr_hr_api_transaction_rec.item_key
5456: ,'TRAN_SUBMIT'
5457: ,'Y');
5458:
5462:
5463: -- now transition the workflow to process approval notifications
5464: if(lr_hr_api_transaction_rec.status in('YS','RI','RIS','RO','RIS')) then
5465: -- complete the flow in resubmit mode
5466: wf_engine.CompleteActivity(
5467: lr_hr_api_transaction_rec.item_type
5468: , lr_hr_api_transaction_rec.item_key
5469: , wf_engine.getactivitylabel(ln_activity_id)
5470: , 'RESUBMIT') ;
5465: -- complete the flow in resubmit mode
5466: wf_engine.CompleteActivity(
5467: lr_hr_api_transaction_rec.item_type
5468: , lr_hr_api_transaction_rec.item_key
5469: , wf_engine.getactivitylabel(ln_activity_id)
5470: , 'RESUBMIT') ;
5471:
5472:
5473: else
5471:
5472:
5473: else
5474: -- else intial submit
5475: wf_engine.CompleteActivity(
5476: lr_hr_api_transaction_rec.item_type
5477: , lr_hr_api_transaction_rec.item_key
5478: , wf_engine.getactivitylabel(ln_activity_id)
5479: , wf_engine.eng_trans_default) ;
5474: -- else intial submit
5475: wf_engine.CompleteActivity(
5476: lr_hr_api_transaction_rec.item_type
5477: , lr_hr_api_transaction_rec.item_key
5478: , wf_engine.getactivitylabel(ln_activity_id)
5479: , wf_engine.eng_trans_default) ;
5480: end if;
5481: end if;
5482:
5475: wf_engine.CompleteActivity(
5476: lr_hr_api_transaction_rec.item_type
5477: , lr_hr_api_transaction_rec.item_key
5478: , wf_engine.getactivitylabel(ln_activity_id)
5479: , wf_engine.eng_trans_default) ;
5480: end if;
5481: end if;
5482:
5483: if (g_debug ) then
5570: if(lr_hr_api_transaction_rec.status in ('Y','YS','RI','RIS','RO','RIS')) then
5571: -- approver edit and submit case
5572: ln_notification_id:= getApproverNtfId(p_transaction_id);
5573:
5574: wf_engine.setitemattrtext(lr_hr_api_transaction_rec.item_type,lr_hr_api_transaction_rec.item_key,
5575: 'APPROVAL_COMMENT_COPY',p_approval_comments);
5576:
5577: -- check if not null value
5578: if(ln_notification_id is not null) then
5638: ,number_value=>null,
5639: date_value=>null
5640: );
5641:
5642: WF_ENGINE.SetItemAttrText(lr_hr_api_transaction_rec.item_type,lr_hr_api_transaction_rec.item_key,
5643: 'WF_NOTE',p_approval_comments);
5644:
5645: -- else intial submit
5646: wf_engine.CompleteActivity(
5642: WF_ENGINE.SetItemAttrText(lr_hr_api_transaction_rec.item_type,lr_hr_api_transaction_rec.item_key,
5643: 'WF_NOTE',p_approval_comments);
5644:
5645: -- else intial submit
5646: wf_engine.CompleteActivity(
5647: lr_hr_api_transaction_rec.item_type
5648: , lr_hr_api_transaction_rec.item_key
5649: , wf_engine.getactivitylabel(ln_activity_id)
5650: , wf_engine.eng_trans_default) ;
5645: -- else intial submit
5646: wf_engine.CompleteActivity(
5647: lr_hr_api_transaction_rec.item_type
5648: , lr_hr_api_transaction_rec.item_key
5649: , wf_engine.getactivitylabel(ln_activity_id)
5650: , wf_engine.eng_trans_default) ;
5651:
5652: end if;
5653: end;
5646: wf_engine.CompleteActivity(
5647: lr_hr_api_transaction_rec.item_type
5648: , lr_hr_api_transaction_rec.item_key
5649: , wf_engine.getactivitylabel(ln_activity_id)
5650: , wf_engine.eng_trans_default) ;
5651:
5652: end if;
5653: end;
5654:
5710: raise g_wf_not_initialzed;
5711: end if;
5712: -- check if the flow is used for page navigation
5713: -- HR_OAF_NAVIGATION_ATTR
5714: lv_oaf_nav_attr := wf_engine.getitemattrtext(lv_item_type,lv_item_key,'HR_OAF_NAVIGATION_ATTR',true);
5715: if(lv_oaf_nav_attr='Y') then
5716: -- process page navigation based wf approval submit
5717: processPageNavWFSubmit(p_transaction_id,p_approval_comments );
5718: else
5780: if(lr_hr_api_transaction_rec.status<>'W') then
5781: if(lr_hr_api_transaction_rec.item_key is not null) then
5782: -- check if the flow uses wf for page navigation
5783: -- HR_OAF_NAVIGATION_ATTR
5784: lv_oaf_nav_attr := wf_engine.getitemattrtext(lr_hr_api_transaction_rec.item_type,
5785: lr_hr_api_transaction_rec.item_key,
5786: 'HR_OAF_NAVIGATION_ATTR',
5787: true);
5788: if(lv_oaf_nav_attr='Y') then
5789: -- for wf page navigation need to reset the wf state
5790: -- S, RIS,ROS,YS reset the state to saved page actid
5791: -- Y,RO,RI reset to first page activity id
5792: if(lr_hr_api_transaction_rec.status in ('S','RIS','ROS','YS')) then
5793: ln_activity_id := wf_engine.getitemattrnumber(lr_hr_api_transaction_rec.item_type,
5794: lr_hr_api_transaction_rec.item_key,
5795: 'SAVED_ACTIVITY_ID',
5796: true);
5797: elsif(lr_hr_api_transaction_rec.status in ('RI','RO','Y')) then
5794: lr_hr_api_transaction_rec.item_key,
5795: 'SAVED_ACTIVITY_ID',
5796: true);
5797: elsif(lr_hr_api_transaction_rec.status in ('RI','RO','Y')) then
5798: ln_activity_id := wf_engine.getitemattrnumber(lr_hr_api_transaction_rec.item_type,
5799: lr_hr_api_transaction_rec.item_key,
5800: 'HR_FIRST_ACTIVITY_ID',
5801: true);
5802:
5801: true);
5802:
5803: end if;
5804:
5805: -- finally call wf engine handle to reset the state
5806: -- need to do only if the current activity id is not
5807: -- same as the ln_activity_id
5808: ln_oaf_page_act_id := hr_approval_ss.getoafpageactid(
5809: lr_hr_api_transaction_rec.item_type,
5808: ln_oaf_page_act_id := hr_approval_ss.getoafpageactid(
5809: lr_hr_api_transaction_rec.item_type,
5810: lr_hr_api_transaction_rec.item_key);
5811: if(ln_activity_id is not null and ln_activity_id<>ln_oaf_page_act_id ) then
5812: WF_ENGINE.handleError(
5813: itemType => lr_hr_api_transaction_rec.item_type
5814: ,itemKey => lr_hr_api_transaction_rec.item_type
5815: ,activity => WF_ENGINE.GetActivityLabel(ln_activity_id)
5816: ,command => 'RETRY' ) ;
5811: if(ln_activity_id is not null and ln_activity_id<>ln_oaf_page_act_id ) then
5812: WF_ENGINE.handleError(
5813: itemType => lr_hr_api_transaction_rec.item_type
5814: ,itemKey => lr_hr_api_transaction_rec.item_type
5815: ,activity => WF_ENGINE.GetActivityLabel(ln_activity_id)
5816: ,command => 'RETRY' ) ;
5817: end if;
5818: end if;
5819: end if;
5897:
5898:
5899: begin
5900:
5901: c_application_id :=wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
5902: itemkey => p_item_key,
5903: aname => 'HR_AME_APP_ID_ATTR');
5904: c_application_id := nvl(c_application_id,800);
5905: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
5901: c_application_id :=wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
5902: itemkey => p_item_key,
5903: aname => 'HR_AME_APP_ID_ATTR');
5904: c_application_id := nvl(c_application_id,800);
5905: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
5906: itemkey => p_item_key,
5907: aname => 'TRANSACTION_ID');
5908: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5909: itemkey => p_item_key,
5904: c_application_id := nvl(c_application_id,800);
5905: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
5906: itemkey => p_item_key,
5907: aname => 'TRANSACTION_ID');
5908: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5909: itemkey => p_item_key,
5910: aname => 'HR_AME_TRAN_TYPE_ATTR');
5911:
5912: ame_api2.getadminapprover(applicationidin => c_application_id
5915:
5916: l_aprv_routing_username := c_approver_to_notify_rec.name;
5917:
5918: if(l_aprv_routing_username is null) then
5919: l_aprv_routing_username := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5920: itemkey => p_item_key,
5921: aname => 'CREATOR_PERSON_USERNAME');
5922: end if;
5923: wf_engine.setitemattrtext(p_item_type,p_item_key,'APPROVAL_ROUTING_USERNAME1',l_aprv_routing_username);
5919: l_aprv_routing_username := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5920: itemkey => p_item_key,
5921: aname => 'CREATOR_PERSON_USERNAME');
5922: end if;
5923: wf_engine.setitemattrtext(p_item_type,p_item_key,'APPROVAL_ROUTING_USERNAME1',l_aprv_routing_username);
5924:
5925: l_forward_from_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5926: itemkey => p_item_key,
5927: aname => 'FORWARD_FROM_DISPLAY_NAME');
5921: aname => 'CREATOR_PERSON_USERNAME');
5922: end if;
5923: wf_engine.setitemattrtext(p_item_type,p_item_key,'APPROVAL_ROUTING_USERNAME1',l_aprv_routing_username);
5924:
5925: l_forward_from_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5926: itemkey => p_item_key,
5927: aname => 'FORWARD_FROM_DISPLAY_NAME');
5928: if(l_forward_from_display_name is null) then
5929: l_forward_from_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5925: l_forward_from_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5926: itemkey => p_item_key,
5927: aname => 'FORWARD_FROM_DISPLAY_NAME');
5928: if(l_forward_from_display_name is null) then
5929: l_forward_from_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5930: itemkey => p_item_key,
5931: aname => 'CREATOR_PERSON_DISPLAY_NAME');
5932: end if;
5933: wf_engine.setitemattrtext(p_item_type,p_item_key,'FORWARD_FROM_DISPLAY_NAME',l_forward_from_display_name);
5929: l_forward_from_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5930: itemkey => p_item_key,
5931: aname => 'CREATOR_PERSON_DISPLAY_NAME');
5932: end if;
5933: wf_engine.setitemattrtext(p_item_type,p_item_key,'FORWARD_FROM_DISPLAY_NAME',l_forward_from_display_name);
5934:
5935: l_forward_to_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5936: itemkey => p_item_key,
5937: aname => 'FORWARD_TO_DISPLAY_NAME');
5931: aname => 'CREATOR_PERSON_DISPLAY_NAME');
5932: end if;
5933: wf_engine.setitemattrtext(p_item_type,p_item_key,'FORWARD_FROM_DISPLAY_NAME',l_forward_from_display_name);
5934:
5935: l_forward_to_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5936: itemkey => p_item_key,
5937: aname => 'FORWARD_TO_DISPLAY_NAME');
5938: if(l_forward_to_display_name is null) then
5939: l_forward_to_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5935: l_forward_to_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5936: itemkey => p_item_key,
5937: aname => 'FORWARD_TO_DISPLAY_NAME');
5938: if(l_forward_to_display_name is null) then
5939: l_forward_to_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5940: itemkey => p_item_key,
5941: aname => 'CREATOR_PERSON_DISPLAY_NAME');
5942: end if;
5943: wf_engine.setitemattrtext(p_item_type,p_item_key,'FORWARD_TO_DISPLAY_NAME',l_forward_to_display_name);
5939: l_forward_to_display_name := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5940: itemkey => p_item_key,
5941: aname => 'CREATOR_PERSON_DISPLAY_NAME');
5942: end if;
5943: wf_engine.setitemattrtext(p_item_type,p_item_key,'FORWARD_TO_DISPLAY_NAME',l_forward_to_display_name);
5944:
5945:
5946: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_MESSAGE_TEXT',error_message_text);
5947: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_TYPE',p_item_type);
5942: end if;
5943: wf_engine.setitemattrtext(p_item_type,p_item_key,'FORWARD_TO_DISPLAY_NAME',l_forward_to_display_name);
5944:
5945:
5946: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_MESSAGE_TEXT',error_message_text);
5947: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_TYPE',p_item_type);
5948: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_KEY',p_item_key);
5949:
5950:
5943: wf_engine.setitemattrtext(p_item_type,p_item_key,'FORWARD_TO_DISPLAY_NAME',l_forward_to_display_name);
5944:
5945:
5946: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_MESSAGE_TEXT',error_message_text);
5947: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_TYPE',p_item_type);
5948: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_KEY',p_item_key);
5949:
5950:
5951: lv_ntf_sub_msg := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5944:
5945:
5946: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_MESSAGE_TEXT',error_message_text);
5947: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_TYPE',p_item_type);
5948: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_KEY',p_item_key);
5949:
5950:
5951: lv_ntf_sub_msg := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5952: itemkey => p_item_key,
5947: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_TYPE',p_item_type);
5948: wf_engine.setitemattrtext(p_item_type,p_item_key,'ERROR_ITEM_KEY',p_item_key);
5949:
5950:
5951: lv_ntf_sub_msg := wf_engine.GetItemAttrText(itemtype => p_item_type ,
5952: itemkey => p_item_key,
5953: aname => 'HR_NTF_SUB_FND_MSG_ATTR',
5954: ignore_notfound=>true);
5955:
6035: return;
6036: end if;
6037:
6038:
6039: if ( funmode = wf_engine.eng_run ) then
6040: -- check if it is AME or custom approvals
6041: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
6042: itemkey => p_item_key,
6043: aname => 'HR_AME_APP_ID_ATTR'),800);
6037:
6038:
6039: if ( funmode = wf_engine.eng_run ) then
6040: -- check if it is AME or custom approvals
6041: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
6042: itemkey => p_item_key,
6043: aname => 'HR_AME_APP_ID_ATTR'),800);
6044:
6045: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
6041: c_application_id :=nvl(wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
6042: itemkey => p_item_key,
6043: aname => 'HR_AME_APP_ID_ATTR'),800);
6044:
6045: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
6046: itemkey => p_item_key,
6047: aname => 'TRANSACTION_ID');
6048:
6049: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
6045: c_transaction_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
6046: itemkey => p_item_key,
6047: aname => 'TRANSACTION_ID');
6048:
6049: c_transaction_type := wf_engine.GetItemAttrText(itemtype => p_item_type ,
6050: itemkey => p_item_key,
6051: aname => 'HR_AME_TRAN_TYPE_ATTR');
6052: if(c_transaction_type is not null) then
6053: hr_utility.set_location('In(if ( if(c_transaction_type is not null))): '|| c_proc,2);
6051: aname => 'HR_AME_TRAN_TYPE_ATTR');
6052: if(c_transaction_type is not null) then
6053: hr_utility.set_location('In(if ( if(c_transaction_type is not null))): '|| c_proc,2);
6054:
6055: notification_rec.notification_id := wf_engine.GetItemAttrNumber(itemtype => p_item_type ,
6056: itemkey => p_item_key,
6057: aname => 'HR_CONTEXT_NID_ATTR');
6058: notification_rec.user_comments := wf_notification.getattrtext(
6059: notification_rec.notification_id
6058: notification_rec.user_comments := wf_notification.getattrtext(
6059: notification_rec.notification_id
6060: ,'WF_NOTE');
6061:
6062: l_is_parallel := wf_engine.GetItemAttrText(itemtype => p_item_type ,
6063: itemkey => p_item_key,
6064: aname => 'HR_PARALLEL_ATTR',
6065: ignore_notfound=>true);
6066:
6072: if(notification_rec.notification_id is not null) then
6073:
6074: select ORIGINAL_RECIPIENT into original_forward_to_user from wf_notifications where notification_id = notification_rec.notification_id;
6075:
6076: prll_ntf := wf_engine.getitemattrtext(p_item_type,
6077: p_item_key,
6078: 'PRLL_TRNSFR_DET',true);
6079:
6080: if( INSTR(prll_ntf,notification_rec.notification_id) > 0) then
6113:
6114: end if;
6115:
6116: else
6117: l_current_forward_to_username:= Wf_engine.GetItemAttrText(itemtype => p_item_type
6118: ,itemkey => p_item_key
6119: ,aname => 'FORWARD_TO_USERNAME');
6120: end if;
6121:
6118: ,itemkey => p_item_key
6119: ,aname => 'FORWARD_TO_USERNAME');
6120: end if;
6121:
6122: l_current_forward_to_username := nvl(l_current_forward_to_username,wf_engine.GetItemAttrText(itemtype => p_item_type ,
6123: itemkey => p_item_key,
6124: aname => 'RETURN_TO_USERNAME'));
6125:
6126:
6160: hr_utility.set_location('returned from calling ame_api2.updateApprovalStatus2', 8);
6161: end if;
6162:
6163: if(l_is_parallel = 'PARALLEL') then
6164: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_DISPLAY_NAME',wf_directory.GetRoleDisplayName(l_current_forward_to_username1));
6165: end if;
6166:
6167: result := wf_engine.eng_trans_default;
6168: else
6163: if(l_is_parallel = 'PARALLEL') then
6164: wf_engine.setItemAttrText(p_item_type,p_item_key,'FORWARD_TO_DISPLAY_NAME',wf_directory.GetRoleDisplayName(l_current_forward_to_username1));
6165: end if;
6166:
6167: result := wf_engine.eng_trans_default;
6168: else
6169: null;
6170: end if;
6171: /*