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: -- ----------------------------------------------------------------------------
2214: -- first purge all the orphan transaction records if any
2215: BEGIN
2216: for rec in defunct_tx_ids loop
2217: begin
2218: hr_utility.set_location('START : Processing defunct transaction ID : '||rec.transaction_id,400);
2219:
2220: l_offer_id := null;
2221: l_applicant_assignment_id := null;
2222: l_offer_status := null;
2230: begin
2231: /* To check if it is the approval process for an offer. If yes, close the offer*/
2232: if l_offer_id is not null then
2233:
2234: hr_utility.set_location ('Closing Offer...',415);
2235: hr_utility.set_location ('Offer ID : '||l_offer_id,430);
2236: hr_utility.set_location ('Applicant Assignment ID : '||l_applicant_assignment_id,445);
2237: hr_utility.set_location ('Offer Status : '||l_offer_status,460);
2238:
2231: /* To check if it is the approval process for an offer. If yes, close the offer*/
2232: if l_offer_id is not null then
2233:
2234: hr_utility.set_location ('Closing Offer...',415);
2235: hr_utility.set_location ('Offer ID : '||l_offer_id,430);
2236: hr_utility.set_location ('Applicant Assignment ID : '||l_applicant_assignment_id,445);
2237: hr_utility.set_location ('Offer Status : '||l_offer_status,460);
2238:
2239: irc_offers_api.close_offer(p_effective_date => sysdate
2232: if l_offer_id is not null then
2233:
2234: hr_utility.set_location ('Closing Offer...',415);
2235: hr_utility.set_location ('Offer ID : '||l_offer_id,430);
2236: hr_utility.set_location ('Applicant Assignment ID : '||l_applicant_assignment_id,445);
2237: hr_utility.set_location ('Offer Status : '||l_offer_status,460);
2238:
2239: irc_offers_api.close_offer(p_effective_date => sysdate
2240: , p_applicant_assignment_id => l_applicant_assignment_id
2233:
2234: hr_utility.set_location ('Closing Offer...',415);
2235: hr_utility.set_location ('Offer ID : '||l_offer_id,430);
2236: hr_utility.set_location ('Applicant Assignment ID : '||l_applicant_assignment_id,445);
2237: hr_utility.set_location ('Offer Status : '||l_offer_status,460);
2238:
2239: irc_offers_api.close_offer(p_effective_date => sysdate
2240: , p_applicant_assignment_id => l_applicant_assignment_id
2241: , p_offer_id => l_offer_id
2242: , p_change_reason => 'MANUAL_CLOSURE'
2243: , p_note_text => 'Closed from Complete Defunct Workflow Process');
2244: end if;
2245: --
2246: hr_utility.set_location ('Offer successfully closed ',480);
2247: exception
2248: when others then
2249: hr_utility.set_location ('Error occurred while closing offer : '||substr(SQLERRM,1,2000),500);
2250: end;
2245: --
2246: hr_utility.set_location ('Offer successfully closed ',480);
2247: exception
2248: when others then
2249: hr_utility.set_location ('Error occurred while closing offer : '||substr(SQLERRM,1,2000),500);
2250: end;
2251: exception
2252: when others then
2253: wf_core.Context(g_package, 'remove_defunct_process : Error Running defunct_tx_ids' );
2251: exception
2252: when others then
2253: wf_core.Context(g_package, 'remove_defunct_process : Error Running defunct_tx_ids' );
2254: end;
2255: hr_utility.set_location('END : Processing defunct transaction ID : '||rec.transaction_id,400);
2256: end loop;
2257: exception
2258: when others then
2259: wf_core.Context(g_package, 'remove_defunct_process : Error Running defunct_tx_ids loop' );
2465: -- --------------------------------------------------------------------------
2466: -- check if the p_transaction_age has value
2467: --
2468: if (p_transaction_age is NULL) then
2469: hr_utility.set_message(800,'HR_NULL_TRANSACTION_AGE');
2470: hr_utility.raise_error;
2471: return;
2472: end if;
2473:
2466: -- check if the p_transaction_age has value
2467: --
2468: if (p_transaction_age is NULL) then
2469: hr_utility.set_message(800,'HR_NULL_TRANSACTION_AGE');
2470: hr_utility.raise_error;
2471: return;
2472: end if;
2473:
2474:
2478: (p_item_type => l_item_type
2479: ,p_process_name => l_process_name) then
2480: -- supply HR error message, p_process_name either does not exist or
2481: -- is NOT a runnable process
2482: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
2483: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
2484: hr_utility.set_message_token('PROCESS_NAME', p_process_name);
2485: hr_utility.raise_error;
2486: end if;
2479: ,p_process_name => l_process_name) then
2480: -- supply HR error message, p_process_name either does not exist or
2481: -- is NOT a runnable process
2482: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
2483: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
2484: hr_utility.set_message_token('PROCESS_NAME', p_process_name);
2485: hr_utility.raise_error;
2486: end if;
2487: -- Get the next item key from the sequence
2480: -- supply HR error message, p_process_name either does not exist or
2481: -- is NOT a runnable process
2482: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
2483: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
2484: hr_utility.set_message_token('PROCESS_NAME', p_process_name);
2485: hr_utility.raise_error;
2486: end if;
2487: -- Get the next item key from the sequence
2488: select hr_workflow_item_key_s.nextval
2481: -- is NOT a runnable process
2482: hr_utility.set_message(800,'HR_52958_WKF2TSK_INC_PROCESS');
2483: hr_utility.set_message_token('ITEM_TYPE', l_item_type);
2484: hr_utility.set_message_token('PROCESS_NAME', p_process_name);
2485: hr_utility.raise_error;
2486: end if;
2487: -- Get the next item key from the sequence
2488: select hr_workflow_item_key_s.nextval
2489: into l_item_key