83: END IF;
84: --
85: EXCEPTION
86: WHEN OTHERS THEN
87: WF_CORE.CONTEXT('HR_UTILITY_WORKFLOW'
88: ,'CHECK_USERNM_EXISTS_SUBJ_APRV'
89: ,itemtype
90: ,itemkey
91: ,to_char(actid)
393: ,p_text_value => l_text_value);
394: --
395: if NOT l_exists then
396: -- supply HR error message, HR_ACTIVITY_TYPE does not exist
397: hr_utility.set_message(800,'HR_52468_NO_ACTIVITY_ATTR');
398: hr_utility.set_message_token('ACTIVITY_ATTRIBUTE', g_hr_activity_type);
399: -- get the activity name
400: get_activity_name
401: (p_item_type => p_item_type
394: --
395: if NOT l_exists then
396: -- supply HR error message, HR_ACTIVITY_TYPE does not exist
397: hr_utility.set_message(800,'HR_52468_NO_ACTIVITY_ATTR');
398: hr_utility.set_message_token('ACTIVITY_ATTRIBUTE', g_hr_activity_type);
399: -- get the activity name
400: get_activity_name
401: (p_item_type => p_item_type
402: ,p_item_key => p_item_key
402: ,p_item_key => p_item_key
403: ,p_actid => p_actid
404: ,p_activity_name => l_activity_name
405: ,p_activity_display_name => l_activity_display_name);
406: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
407: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
408: hr_utility.raise_error;
409: end if;
410: -- check to see if the HR_ACTIVITY_TYPE is NULL
403: ,p_actid => p_actid
404: ,p_activity_name => l_activity_name
405: ,p_activity_display_name => l_activity_display_name);
406: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
407: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
408: hr_utility.raise_error;
409: end if;
410: -- check to see if the HR_ACTIVITY_TYPE is NULL
411: -- note: we are assuming that the value must be of text type
404: ,p_activity_name => l_activity_name
405: ,p_activity_display_name => l_activity_display_name);
406: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
407: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
408: hr_utility.raise_error;
409: end if;
410: -- check to see if the HR_ACTIVITY_TYPE is NULL
411: -- note: we are assuming that the value must be of text type
412: if l_text_value is NULL then
410: -- check to see if the HR_ACTIVITY_TYPE is NULL
411: -- note: we are assuming that the value must be of text type
412: if l_text_value is NULL then
413: -- supply HR error message, HR_ACTIVITY_TYPE cannot be NULL
414: hr_utility.set_message(800,'HR_52469_ACTIVITY_ATTR_NULL');
415: hr_utility.set_message_token('ACTIVITY_ATTRIBUTE', g_hr_activity_type);
416: -- get the activity name
417: get_activity_name
418: (p_item_type => p_item_type
411: -- note: we are assuming that the value must be of text type
412: if l_text_value is NULL then
413: -- supply HR error message, HR_ACTIVITY_TYPE cannot be NULL
414: hr_utility.set_message(800,'HR_52469_ACTIVITY_ATTR_NULL');
415: hr_utility.set_message_token('ACTIVITY_ATTRIBUTE', g_hr_activity_type);
416: -- get the activity name
417: get_activity_name
418: (p_item_type => p_item_type
419: ,p_item_key => p_item_key
419: ,p_item_key => p_item_key
420: ,p_actid => p_actid
421: ,p_activity_name => l_activity_name
422: ,p_activity_display_name => l_activity_display_name);
423: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
424: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
425: hr_utility.raise_error;
426: end if;
427: -- check to see if the HR_ACTIVITY_TYPE_VALUE activity attribute exists
420: ,p_actid => p_actid
421: ,p_activity_name => l_activity_name
422: ,p_activity_display_name => l_activity_display_name);
423: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
424: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
425: hr_utility.raise_error;
426: end if;
427: -- check to see if the HR_ACTIVITY_TYPE_VALUE activity attribute exists
428: get_act_attr_expanded_info
421: ,p_activity_name => l_activity_name
422: ,p_activity_display_name => l_activity_display_name);
423: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
424: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
425: hr_utility.raise_error;
426: end if;
427: -- check to see if the HR_ACTIVITY_TYPE_VALUE activity attribute exists
428: get_act_attr_expanded_info
429: (p_item_type => p_item_type
440: --
441: if NOT l_exists then
442: -- supply HR error message
443: -- supply HR error message, HR_ACTIVITY_TYPE does not exist
444: hr_utility.set_message(800,'HR_52468_NO_ACTIVITY_ATTR');
445: hr_utility.set_message_token('ACTIVITY_ATTRIBUTE', g_hr_activity_type_value);
446: -- get the activity name
447: get_activity_name
448: (p_item_type => p_item_type
441: if NOT l_exists then
442: -- supply HR error message
443: -- supply HR error message, HR_ACTIVITY_TYPE does not exist
444: hr_utility.set_message(800,'HR_52468_NO_ACTIVITY_ATTR');
445: hr_utility.set_message_token('ACTIVITY_ATTRIBUTE', g_hr_activity_type_value);
446: -- get the activity name
447: get_activity_name
448: (p_item_type => p_item_type
449: ,p_item_key => p_item_key
449: ,p_item_key => p_item_key
450: ,p_actid => p_actid
451: ,p_activity_name => l_activity_name
452: ,p_activity_display_name => l_activity_display_name);
453: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
454: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
455: hr_utility.raise_error;
456: end if;
457: -- check to see if the HR_ACTIVITY_TYPE_VALUE is NULL
450: ,p_actid => p_actid
451: ,p_activity_name => l_activity_name
452: ,p_activity_display_name => l_activity_display_name);
453: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
454: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
455: hr_utility.raise_error;
456: end if;
457: -- check to see if the HR_ACTIVITY_TYPE_VALUE is NULL
458: -- note: we are assuming that the value must be of text type
451: ,p_activity_name => l_activity_name
452: ,p_activity_display_name => l_activity_display_name);
453: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
454: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
455: hr_utility.raise_error;
456: end if;
457: -- check to see if the HR_ACTIVITY_TYPE_VALUE is NULL
458: -- note: we are assuming that the value must be of text type
459: if l_text_value is NULL then
457: -- check to see if the HR_ACTIVITY_TYPE_VALUE is NULL
458: -- note: we are assuming that the value must be of text type
459: if l_text_value is NULL then
460: -- supply HR error message, HR_ACTIVITY_TYPE_VALUE cannot be NULL
461: hr_utility.set_message(800,'HR_52469_ACTIVITY_ATTR_NULL');
462: hr_utility.set_message_token('ACTIVITY_ATTRIBUTE', g_hr_activity_type_value);
463: -- get the activity name
464: get_activity_name
465: (p_item_type => p_item_type
458: -- note: we are assuming that the value must be of text type
459: if l_text_value is NULL then
460: -- supply HR error message, HR_ACTIVITY_TYPE_VALUE cannot be NULL
461: hr_utility.set_message(800,'HR_52469_ACTIVITY_ATTR_NULL');
462: hr_utility.set_message_token('ACTIVITY_ATTRIBUTE', g_hr_activity_type_value);
463: -- get the activity name
464: get_activity_name
465: (p_item_type => p_item_type
466: ,p_item_key => p_item_key
466: ,p_item_key => p_item_key
467: ,p_actid => p_actid
468: ,p_activity_name => l_activity_name
469: ,p_activity_display_name => l_activity_display_name);
470: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
471: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
472: hr_utility.raise_error;
473: end if;
474: end check_activity_type_attrs;
467: ,p_actid => p_actid
468: ,p_activity_name => l_activity_name
469: ,p_activity_display_name => l_activity_display_name);
470: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
471: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
472: hr_utility.raise_error;
473: end if;
474: end check_activity_type_attrs;
475: -- ----------------------------------------------------------------------------
468: ,p_activity_name => l_activity_name
469: ,p_activity_display_name => l_activity_display_name);
470: hr_utility.set_message_token('ACTIVITY_NAME', l_activity_display_name);
471: hr_utility.set_message_token('ITEM_TYPE', p_item_type);
472: hr_utility.raise_error;
473: end if;
474: end check_activity_type_attrs;
475: -- ----------------------------------------------------------------------------
476: -- |-----------------------------< hr_web_page >------------------------------|
845: (p_item_type => l_item_type
846: ,p_process_name => l_process_name) then
847: -- supply HR error message, p_process_name either does not exist or
848: -- is NOT a runnable process
849: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
850: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
851: hr_utility.set_message_token('PROCESS_NAME', l_process_name);
852: hr_utility.raise_error;
853: end if;
846: ,p_process_name => l_process_name) then
847: -- supply HR error message, p_process_name either does not exist or
848: -- is NOT a runnable process
849: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
850: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
851: hr_utility.set_message_token('PROCESS_NAME', l_process_name);
852: hr_utility.raise_error;
853: end if;
854: -- Get the next item key from the sequence
847: -- supply HR error message, p_process_name either does not exist or
848: -- is NOT a runnable process
849: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
850: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
851: hr_utility.set_message_token('PROCESS_NAME', l_process_name);
852: hr_utility.raise_error;
853: end if;
854: -- Get the next item key from the sequence
855: select hr_workflow_item_key_s.nextval
848: -- is NOT a runnable process
849: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
850: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
851: hr_utility.set_message_token('PROCESS_NAME', l_process_name);
852: hr_utility.raise_error;
853: end if;
854: -- Get the next item key from the sequence
855: select hr_workflow_item_key_s.nextval
856: into l_item_key
1090: when OTHERS then
1091: -- supply HR error message
1092: -- an error has occurred when attempting to call the stored procedure
1093: -- to generate the web page.
1094: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1095: hr_utility.set_message_token('PROCEDURE', 'hr_workflow_service.display_html');
1096: hr_utility.set_message_token('STEP','10');
1097: hr_utility.raise_error;
1098: end display_html;
1091: -- supply HR error message
1092: -- an error has occurred when attempting to call the stored procedure
1093: -- to generate the web page.
1094: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1095: hr_utility.set_message_token('PROCEDURE', 'hr_workflow_service.display_html');
1096: hr_utility.set_message_token('STEP','10');
1097: hr_utility.raise_error;
1098: end display_html;
1099: -- ----------------------------------------------------------------------------
1092: -- an error has occurred when attempting to call the stored procedure
1093: -- to generate the web page.
1094: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1095: hr_utility.set_message_token('PROCEDURE', 'hr_workflow_service.display_html');
1096: hr_utility.set_message_token('STEP','10');
1097: hr_utility.raise_error;
1098: end display_html;
1099: -- ----------------------------------------------------------------------------
1100: -- |---------------------------< continue_process >---------------------------|
1093: -- to generate the web page.
1094: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1095: hr_utility.set_message_token('PROCEDURE', 'hr_workflow_service.display_html');
1096: hr_utility.set_message_token('STEP','10');
1097: hr_utility.raise_error;
1098: end display_html;
1099: -- ----------------------------------------------------------------------------
1100: -- |---------------------------< continue_process >---------------------------|
1101: -- ----------------------------------------------------------------------------
2192: -- first purge all the orphan transaction records if any
2193: BEGIN
2194: for rec in defunct_tx_ids loop
2195: begin
2196: hr_utility.set_location('START : Processing defunct transaction ID : '||rec.transaction_id,400);
2197:
2198: l_offer_id := null;
2199: l_applicant_assignment_id := null;
2200: l_offer_status := null;
2208: begin
2209: /* To check if it is the approval process for an offer. If yes, close the offer*/
2210: if l_offer_id is not null then
2211:
2212: hr_utility.set_location ('Closing Offer...',415);
2213: hr_utility.set_location ('Offer ID : '||l_offer_id,430);
2214: hr_utility.set_location ('Applicant Assignment ID : '||l_applicant_assignment_id,445);
2215: hr_utility.set_location ('Offer Status : '||l_offer_status,460);
2216:
2209: /* To check if it is the approval process for an offer. If yes, close the offer*/
2210: if l_offer_id is not null then
2211:
2212: hr_utility.set_location ('Closing Offer...',415);
2213: hr_utility.set_location ('Offer ID : '||l_offer_id,430);
2214: hr_utility.set_location ('Applicant Assignment ID : '||l_applicant_assignment_id,445);
2215: hr_utility.set_location ('Offer Status : '||l_offer_status,460);
2216:
2217: irc_offers_api.close_offer(p_effective_date => sysdate
2210: if l_offer_id is not null then
2211:
2212: hr_utility.set_location ('Closing Offer...',415);
2213: hr_utility.set_location ('Offer ID : '||l_offer_id,430);
2214: hr_utility.set_location ('Applicant Assignment ID : '||l_applicant_assignment_id,445);
2215: hr_utility.set_location ('Offer Status : '||l_offer_status,460);
2216:
2217: irc_offers_api.close_offer(p_effective_date => sysdate
2218: , p_applicant_assignment_id => l_applicant_assignment_id
2211:
2212: hr_utility.set_location ('Closing Offer...',415);
2213: hr_utility.set_location ('Offer ID : '||l_offer_id,430);
2214: hr_utility.set_location ('Applicant Assignment ID : '||l_applicant_assignment_id,445);
2215: hr_utility.set_location ('Offer Status : '||l_offer_status,460);
2216:
2217: irc_offers_api.close_offer(p_effective_date => sysdate
2218: , p_applicant_assignment_id => l_applicant_assignment_id
2219: , p_offer_id => l_offer_id
2220: , p_change_reason => 'MANUAL_CLOSURE'
2221: , p_note_text => 'Closed from Complete Defunct Workflow Process');
2222: end if;
2223: --
2224: hr_utility.set_location ('Offer successfully closed ',480);
2225: exception
2226: when others then
2227: hr_utility.set_location ('Error occurred while closing offer : '||substr(SQLERRM,1,2000),500);
2228: end;
2223: --
2224: hr_utility.set_location ('Offer successfully closed ',480);
2225: exception
2226: when others then
2227: hr_utility.set_location ('Error occurred while closing offer : '||substr(SQLERRM,1,2000),500);
2228: end;
2229: exception
2230: when others then
2231: wf_core.Context(g_package, 'remove_defunct_process : Error Running defunct_tx_ids' );
2229: exception
2230: when others then
2231: wf_core.Context(g_package, 'remove_defunct_process : Error Running defunct_tx_ids' );
2232: end;
2233: hr_utility.set_location('END : Processing defunct transaction ID : '||rec.transaction_id,400);
2234: end loop;
2235: exception
2236: when others then
2237: wf_core.Context(g_package, 'remove_defunct_process : Error Running defunct_tx_ids loop' );
2426: -- --------------------------------------------------------------------------
2427: -- check if the p_transaction_age has value
2428: --
2429: if (p_transaction_age is NULL) then
2430: hr_utility.set_message(800,'HR_NULL_TRANSACTION_AGE');
2431: hr_utility.raise_error;
2432: return;
2433: end if;
2434:
2427: -- check if the p_transaction_age has value
2428: --
2429: if (p_transaction_age is NULL) then
2430: hr_utility.set_message(800,'HR_NULL_TRANSACTION_AGE');
2431: hr_utility.raise_error;
2432: return;
2433: end if;
2434:
2435:
2439: (p_item_type => l_item_type
2440: ,p_process_name => l_process_name) then
2441: -- supply HR error message, p_process_name either does not exist or
2442: -- is NOT a runnable process
2443: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
2444: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
2445: hr_utility.set_message_token('PROCESS_NAME', p_process_name);
2446: hr_utility.raise_error;
2447: end if;
2440: ,p_process_name => l_process_name) then
2441: -- supply HR error message, p_process_name either does not exist or
2442: -- is NOT a runnable process
2443: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
2444: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
2445: hr_utility.set_message_token('PROCESS_NAME', p_process_name);
2446: hr_utility.raise_error;
2447: end if;
2448: -- Get the next item key from the sequence
2441: -- supply HR error message, p_process_name either does not exist or
2442: -- is NOT a runnable process
2443: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
2444: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
2445: hr_utility.set_message_token('PROCESS_NAME', p_process_name);
2446: hr_utility.raise_error;
2447: end if;
2448: -- Get the next item key from the sequence
2449: select hr_workflow_item_key_s.nextval
2442: -- is NOT a runnable process
2443: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
2444: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
2445: hr_utility.set_message_token('PROCESS_NAME', p_process_name);
2446: hr_utility.raise_error;
2447: end if;
2448: -- Get the next item key from the sequence
2449: select hr_workflow_item_key_s.nextval
2450: into l_item_key