140: ln_appraisal_id number;
141: --
142: begin
143:
144: g_debug := hr_utility.debug_enabled;
145:
146: IF g_debug THEN
147: l_proc := gv_package||'start_transaction';
148: hr_utility.set_location('Entering:'|| l_proc, 5);
144: g_debug := hr_utility.debug_enabled;
145:
146: IF g_debug THEN
147: l_proc := gv_package||'start_transaction';
148: hr_utility.set_location('Entering:'|| l_proc, 5);
149: END IF;
150: ln_login_person_id := wf_engine.getitemattrnumber(itemtype,itemkey,'CREATOR_PERSON_ID',true);
151: ln_assignment_id := wf_engine.getitemattrnumber(itemtype,itemkey,'ASSIGNMENT_ID',true);
152: ln_appraisal_id:= wf_engine.GetItemAttrNumber(itemtype,itemkey,'APPRAISAL_ID',true);
198: l_main_appraiser_user_name wf_users.name%type;
199: l_display_name wf_users.display_name%type;
200:
201: begin
202: hr_utility.set_location('Entered:'|| gv_package || '.create_hr_transaction', 1);
203: -- get the appraisal_id from the item attribute , APPRAISAL_ID
204: l_appraisal_id:= wf_engine.GetItemAttrNumber (itemtype => p_itemtype ,
205: itemkey => p_itemkey ,
206: aname => 'APPRAISAL_ID',
268: setAppraisalSystemParams(p_itemtype,p_itemkey, p_actid, p_funcmode, p_result );
269: p_result:= wf_engine.eng_trans_default;
270:
271:
272: hr_utility.set_location('Leaving:'|| gv_package || '.create_hr_transaction', 10);
273:
274: EXCEPTION
275: WHEN OTHERS THEN
276: wf_core.Context(gv_package, '.create_hr_transaction', p_itemtype, p_itemkey, p_actid, p_funcmode);
273:
274: EXCEPTION
275: WHEN OTHERS THEN
276: wf_core.Context(gv_package, '.create_hr_transaction', p_itemtype, p_itemkey, p_actid, p_funcmode);
277: hr_utility.trace(' exception in '||gv_package||'.create_hr_transaction : ' || sqlerrm);
278: raise;
279:
280: end create_hr_transaction;
281:
296: lv_addtnlParams VARCHAR2(30) ;
297:
298:
299: begin
300: g_debug := hr_utility.debug_enabled;
301: if g_debug then
302: hr_utility.set_location('Entering:'|| gv_package||'.'||c_proc, 1);
303: end if;
304:
298:
299: begin
300: g_debug := hr_utility.debug_enabled;
301: if g_debug then
302: hr_utility.set_location('Entering:'|| gv_package||'.'||c_proc, 1);
303: end if;
304:
305: -- get the itemtype and item key for the notification id
306: hr_workflow_ss.get_item_type_and_key(document_id,lv_item_type,lv_item_key);
331: from fnd_form_functions_vl
332: where function_name=lv_pageFunc;
333: exception
334: when no_data_found then
335: hr_utility.set_location('Unable to retrieve function details,web_html_call and parameters for:'||lv_pageFunc||' '|| gv_package||'.'||c_proc, 10);
336: when others then
337: raise;
338: end;
339: -- set the out variables
352: -- document := null;
353: -- end if;
354:
355: if g_debug then
356: hr_utility.set_location('Leaving:'|| gv_package||'.'||c_proc, 30);
357: end if;
358:
359: exception
360: when others then
359: exception
360: when others then
361: document := null;
362: document_type :=null;
363: hr_utility.set_location('hr_workflow_ss.build_edit_link errored : '||SQLERRM ||' '||to_char(SQLCODE), 20);
364: Wf_Core.Context('hr_workflow_ss', 'build_edit_link', document_id, display_type);
365: raise;
366: end build_link;
367:
804: begin
805: ln_appr_main_block_id := wf_engine.getitemattrnumber(getApprovalBlockId.p_itemType,getApprovalBlockId.p_itemKey,'HR_APPRAI_MAIN_BLOCK_ID_ATTR');
806: ln_appr_particp_block_id:= wf_engine.getitemattrnumber(getApprovalBlockId.p_itemType,getApprovalBlockId.p_itemKey,'HR_APPRAI_PARTCI_BLOCK_ID_ATTR');
807: begin
808: if(hr_utility.debug_enabled) then
809: -- write debug statements
810: hr_utility.set_location('Querying WF_ITEM_ACTIVITY_STATUSES for notified activity:'||lv_procedure_name||'with itemtype:', 3);
811: end if;
812:
806: ln_appr_particp_block_id:= wf_engine.getitemattrnumber(getApprovalBlockId.p_itemType,getApprovalBlockId.p_itemKey,'HR_APPRAI_PARTCI_BLOCK_ID_ATTR');
807: begin
808: if(hr_utility.debug_enabled) then
809: -- write debug statements
810: hr_utility.set_location('Querying WF_ITEM_ACTIVITY_STATUSES for notified activity:'||lv_procedure_name||'with itemtype:', 3);
811: end if;
812:
813: SELECT process_activity
814: into ln_appr_approval_block_id
820: (getApprovalBlockId.ln_appr_main_block_id,getApprovalBlockId.ln_appr_particp_block_id);
821:
822: exception
823: when no_data_found then
824: if(hr_utility.debug_enabled) then
825: -- write debug statements
826: hr_utility.set_location('no notified activity found in WF_ITEM_ACTIVITY_STATUSES for itemtype:'|| p_itemType||' and item key:'||p_itemType, 4);
827: end if;
828: ln_appr_approval_block_id := null;
822: exception
823: when no_data_found then
824: if(hr_utility.debug_enabled) then
825: -- write debug statements
826: hr_utility.set_location('no notified activity found in WF_ITEM_ACTIVITY_STATUSES for itemtype:'|| p_itemType||' and item key:'||p_itemType, 4);
827: end if;
828: ln_appr_approval_block_id := null;
829: when others then
830: ln_appr_approval_block_id := null;
843: end if;
844: exception
845: when no_data_found then
846: wf_core.Context(gv_package, '.getApprovalBlockId', p_itemtype, p_itemkey);
847: hr_utility.trace(' exception in '||gv_package||'.getApprovalBlockId : ' || sqlerrm);
848: when others then
849: raise;
850: end;
851: p_blockId := ln_appr_approval_block_id;
851: p_blockId := ln_appr_approval_block_id;
852: exception
853: when others then
854: wf_core.Context(gv_package, '.getApprovalBlockId', p_itemtype, p_itemkey);
855: hr_utility.trace(' exception in '||gv_package||'.getApprovalBlockId : ' || sqlerrm);
856: raise;
857: end getApprovalBlockId;
858:
859:
872: l_role_name varchar2(320);
873: l_role_displayname varchar2(360);
874:
875: begin
876: hr_utility.set_location('Entered:'|| gv_package || '.reset_main_appraiser', 1);
877: -- get the appraisal_id from the item attribute , APPRAISAL_ID
878: l_appraisal_id:= wf_engine.GetItemAttrNumber (itemtype => p_itemtype ,
879: itemkey => p_itemkey ,
880: aname => 'APPRAISAL_ID',
920: p_result := wf_engine.eng_trans_default;
921:
922:
923:
924: hr_utility.set_location('Leaving:'|| gv_package || '.reset_main_appraiser', 10);
925:
926: EXCEPTION
927: WHEN OTHERS THEN
928: wf_core.Context(gv_package, '.reset_main_appraiser', p_itemtype, p_itemkey, p_actid, p_funcmode);
925:
926: EXCEPTION
927: WHEN OTHERS THEN
928: wf_core.Context(gv_package, '.reset_main_appraiser', p_itemtype, p_itemkey, p_actid, p_funcmode);
929: hr_utility.trace(' exception in '||gv_package||'.reset_main_appraiser : ' || sqlerrm);
930: raise;
931:
932: end reset_main_appraiser;
933:
942: -- local variables
943: l_appraisal_id per_appraisals.appraisal_id%type;
944: lv_result varchar2(3);
945: begin
946: hr_utility.set_location('Entered:'|| gv_package || '.commit_transaction', 1);
947: hr_utility.set_location('calling hr_complete_appraisal_ss.complete_appr', 2);
948: hr_complete_appraisal_ss.complete_appr(p_itemtype,p_itemkey,lv_result);
949: hr_utility.set_location('returned from hr_complete_appraisal_ss.complete_appr with result:'
950: ||lv_result, 3);
943: l_appraisal_id per_appraisals.appraisal_id%type;
944: lv_result varchar2(3);
945: begin
946: hr_utility.set_location('Entered:'|| gv_package || '.commit_transaction', 1);
947: hr_utility.set_location('calling hr_complete_appraisal_ss.complete_appr', 2);
948: hr_complete_appraisal_ss.complete_appr(p_itemtype,p_itemkey,lv_result);
949: hr_utility.set_location('returned from hr_complete_appraisal_ss.complete_appr with result:'
950: ||lv_result, 3);
951: /*
945: begin
946: hr_utility.set_location('Entered:'|| gv_package || '.commit_transaction', 1);
947: hr_utility.set_location('calling hr_complete_appraisal_ss.complete_appr', 2);
948: hr_complete_appraisal_ss.complete_appr(p_itemtype,p_itemkey,lv_result);
949: hr_utility.set_location('returned from hr_complete_appraisal_ss.complete_appr with result:'
950: ||lv_result, 3);
951: /*
952: E : Error -- ntf to MA, HR/Sysadmin
953: W : Warning -- ntf MA
957: p_result:= 'COMPLETE:SUCCESS';
958: else
959: p_result:= 'COMPLETE:APPLICATION_ERROR';
960: end if;
961: hr_utility.set_location('Leaving:'|| gv_package || '.commit_transaction', 10);
962:
963: EXCEPTION
964: WHEN OTHERS THEN
965: wf_core.Context(gv_package, '.commit_transaction', p_itemtype, p_itemkey, p_actid, p_funcmode);
962:
963: EXCEPTION
964: WHEN OTHERS THEN
965: wf_core.Context(gv_package, '.commit_transaction', p_itemtype, p_itemkey, p_actid, p_funcmode);
966: hr_utility.trace(' exception in '||gv_package||'.commit_transaction : ' || sqlerrm);
967: raise;
968:
969: end commit_transaction;
970:
982: l_object_version_number per_appraisals.object_version_number%type;
983: l_system_params per_appraisals.system_params%type;
984:
985: begin
986: hr_utility.set_location('Entered:'|| gv_package || '.update_appraisal_system_status', 1);
987: -- get the appraisal_id from the item attribute , APPRAISAL_ID
988: if(hr_utility.debug_enabled) then
989: -- write debug statements
990: hr_utility.set_location('Calling wf_engine.GetItemAttrNumber for APPRAISAL_ID with itemtype:itemkey '||p_itemtype||':'||p_itemkey,2);
984:
985: begin
986: hr_utility.set_location('Entered:'|| gv_package || '.update_appraisal_system_status', 1);
987: -- get the appraisal_id from the item attribute , APPRAISAL_ID
988: if(hr_utility.debug_enabled) then
989: -- write debug statements
990: hr_utility.set_location('Calling wf_engine.GetItemAttrNumber for APPRAISAL_ID with itemtype:itemkey '||p_itemtype||':'||p_itemkey,2);
991: end if;
992: l_appraisal_id:= wf_engine.GetItemAttrNumber (itemtype => p_itemtype ,
986: hr_utility.set_location('Entered:'|| gv_package || '.update_appraisal_system_status', 1);
987: -- get the appraisal_id from the item attribute , APPRAISAL_ID
988: if(hr_utility.debug_enabled) then
989: -- write debug statements
990: hr_utility.set_location('Calling wf_engine.GetItemAttrNumber for APPRAISAL_ID with itemtype:itemkey '||p_itemtype||':'||p_itemkey,2);
991: end if;
992: l_appraisal_id:= wf_engine.GetItemAttrNumber (itemtype => p_itemtype ,
993: itemkey => p_itemkey ,
994: aname => 'APPRAISAL_ID',
1004: when others then
1005: raise;
1006: end;
1007: -- call the api to update the system status
1008: if(hr_utility.debug_enabled) then
1009: -- write debug statements
1010: hr_utility.set_location('Calling hr_appraisals_api.update_appraisal with p_appraisal_id:
1011: p_object_version_number:p_appraiser_person_id:p_appraisal_system_status '
1012: || l_appraisal_id||':'||l_object_version_number||':'
1006: end;
1007: -- call the api to update the system status
1008: if(hr_utility.debug_enabled) then
1009: -- write debug statements
1010: hr_utility.set_location('Calling hr_appraisals_api.update_appraisal with p_appraisal_id:
1011: p_object_version_number:p_appraiser_person_id:p_appraisal_system_status '
1012: || l_appraisal_id||':'||l_object_version_number||':'
1013: ||l_appraiser_person_id||p_status,3);
1014: end if;
1020: p_appraisal_system_status=>p_status --7210916 Bug Fix ,
1021: --p_system_params => l_system_params
1022: );
1023:
1024: hr_utility.set_location('Leaving:'|| gv_package || '.update_appraisal_system_status', 10);
1025:
1026: EXCEPTION
1027: WHEN OTHERS THEN
1028: wf_core.Context(gv_package, '.update_appraisal_system_status', p_itemtype, p_itemkey);
1025:
1026: EXCEPTION
1027: WHEN OTHERS THEN
1028: wf_core.Context(gv_package, '.update_appraisal_system_status', p_itemtype, p_itemkey);
1029: hr_utility.trace(' exception in '||gv_package||'.update_appraisal_system_status : ' || sqlerrm);
1030: raise;
1031:
1032: end update_appraisal_system_status;
1033:
1041: is
1042: -- local variables
1043:
1044: begin
1045: hr_utility.set_location('Entered:'|| gv_package || '.set_appraisal_rfc_status', 1);
1046:
1047: -- call the update_appraisal_system_status with proper status
1048: update_appraisal_system_status(p_itemtype=>p_itemtype, p_itemkey=>p_itemkey,p_status=>'RFC');
1049:
1046:
1047: -- call the update_appraisal_system_status with proper status
1048: update_appraisal_system_status(p_itemtype=>p_itemtype, p_itemkey=>p_itemkey,p_status=>'RFC');
1049:
1050: hr_utility.set_location('Leaving:'|| gv_package || '.set_appraisal_rfc_status', 10);
1051:
1052: EXCEPTION
1053: WHEN OTHERS THEN
1054: wf_core.Context(gv_package, '.set_appraisal_rfc_status', p_itemtype, p_itemkey, p_actid, p_funcmode);
1051:
1052: EXCEPTION
1053: WHEN OTHERS THEN
1054: wf_core.Context(gv_package, '.set_appraisal_rfc_status', p_itemtype, p_itemkey, p_actid, p_funcmode);
1055: hr_utility.trace(' exception in '||gv_package||'.set_appraisal_rfc_status : ' || sqlerrm);
1056: raise;
1057:
1058: end set_appraisal_rfc_status;
1059:
1067: is
1068: -- local variables
1069:
1070: begin
1071: hr_utility.set_location('Entered:'|| gv_package || '.set_appraisal_reject_status', 1);
1072:
1073: -- call the update_appraisal_system_status with proper status
1074: update_appraisal_system_status(p_itemtype=>p_itemtype, p_itemkey=>p_itemkey,p_status=>'ONGOING');
1075: -- set the our param as *
1075: -- set the our param as *
1076: p_result:='COMPLETE:*';
1077: wf_engine.SetItemAttrText(p_itemtype,p_itemkey,'TRAN_SUBMIT','N');
1078:
1079: hr_utility.set_location('Leaving:'|| gv_package || '.set_appraisal_reject_status', 10);
1080:
1081: EXCEPTION
1082: WHEN OTHERS THEN
1083: wf_core.Context(gv_package, '.set_appraisal_reject_status', p_itemtype, p_itemkey, p_actid, p_funcmode);
1080:
1081: EXCEPTION
1082: WHEN OTHERS THEN
1083: wf_core.Context(gv_package, '.set_appraisal_reject_status', p_itemtype, p_itemkey, p_actid, p_funcmode);
1084: hr_utility.trace(' exception in '||gv_package||'.set_appraisal_reject_status : ' || sqlerrm);
1085: raise;
1086:
1087: end set_appraisal_reject_status;
1088:
1096: is
1097: -- local variables
1098:
1099: begin
1100: hr_utility.set_location('Entered:'|| gv_package || '.notify_appraisee_on_completion', 1);
1101: --bug 4403850, to support old appraisals on upgrade, set the appraisal system status to COMPLETED,
1102: -- if APPRFEEDBACK
1103: appraisee_commit_aft_feedback(p_itemtype, p_itemkey, p_actid, p_funcmode, p_result);
1104: hr_complete_appraisal_ss.send_notification(p_itemtype,
1103: appraisee_commit_aft_feedback(p_itemtype, p_itemkey, p_actid, p_funcmode, p_result);
1104: hr_complete_appraisal_ss.send_notification(p_itemtype,
1105: p_itemkey,
1106: p_result);
1107: hr_utility.set_location('Leaving:'|| gv_package || '.set_appraisal_commit_status', 10);
1108:
1109:
1110: EXCEPTION
1111: WHEN OTHERS THEN
1109:
1110: EXCEPTION
1111: WHEN OTHERS THEN
1112: wf_core.Context(gv_package, '.notify_appraisee_on_completion', p_itemtype, p_itemkey, p_actid, p_funcmode);
1113: hr_utility.trace(' exception in '||gv_package||'.notify_appraisee_on_completion : ' || sqlerrm);
1114: raise;
1115:
1116: end notify_appraisee_on_completion;
1117:
1123: c_proc varchar2(30) default 'build_ma_compl_log_msg';
1124: lv_item_type wf_item_activity_statuses.item_type%type;
1125: lv_item_key wf_item_activity_statuses.item_key%type;
1126: begin
1127: g_debug := hr_utility.debug_enabled;
1128: if g_debug then
1129: hr_utility.set_location('Entering:'|| gv_package||'.'||c_proc, 1);
1130: end if;
1131: -- get the itemtype and item key for the notification id
1125: lv_item_key wf_item_activity_statuses.item_key%type;
1126: begin
1127: g_debug := hr_utility.debug_enabled;
1128: if g_debug then
1129: hr_utility.set_location('Entering:'|| gv_package||'.'||c_proc, 1);
1130: end if;
1131: -- get the itemtype and item key for the notification id
1132: hr_workflow_ss.get_item_type_and_key(document_id,lv_item_type,lv_item_key);
1133: -- build the log message, the log is restricted to 32k
1152: -- set the document type
1153: document_type := wf_notification.doc_html;
1154:
1155: if g_debug then
1156: hr_utility.set_location('Leaving:'|| gv_package||'.'||c_proc, 30);
1157: end if;
1158:
1159: exception
1160: when others then
1159: exception
1160: when others then
1161: document := null;
1162: document_type :=null;
1163: hr_utility.set_location('hr_appraisal_workflow_ss.build_ma_compl_log_msg errored : '
1164: ||SQLERRM ||' '||to_char(SQLCODE), 20);
1165: Wf_Core.Context('hr_workflow_ss', 'build_ma_compl_log_msg',
1166: document_id, display_type);
1167: raise;
1197: l_log varchar2(4000);
1198: lv_chg_appr_status_log wf_item_attributes.text_default%TYPE;
1199: chg_appr_status varchar2(2);
1200: begin
1201: hr_utility.set_location('Entered:'|| gv_package || '.appraisee_feedback_allowed', 1);
1202:
1203: l_appraisal_id := wf_engine.GetItemAttrNumber (itemtype => p_itemtype ,
1204: itemkey => p_itemkey ,
1205: aname => 'APPRAISAL_ID',
1206: ignore_notfound=>true);
1207:
1208: if l_appraisal_id is null then
1209: l_log := l_log || 'Error: No Appraisal Id for this WorkFlow Transaction';
1210: hr_utility.trace(l_log);
1211: end if;
1212:
1213:
1214: hr_utility.trace('calling isAppraiseeFeebackAllowed');
1210: hr_utility.trace(l_log);
1211: end if;
1212:
1213:
1214: hr_utility.trace('calling isAppraiseeFeebackAllowed');
1215: chg_appr_status := isAppraiseeFeebackAllowed(p_appraisal_id => l_appraisal_id);
1216: hr_utility.trace('returned from isAppraiseeFeebackAllowed with result:'
1217: ||chg_appr_status);
1218:
1212:
1213:
1214: hr_utility.trace('calling isAppraiseeFeebackAllowed');
1215: chg_appr_status := isAppraiseeFeebackAllowed(p_appraisal_id => l_appraisal_id);
1216: hr_utility.trace('returned from isAppraiseeFeebackAllowed with result:'
1217: ||chg_appr_status);
1218:
1219: if ( chg_appr_status = 'Y' ) then
1220: p_result := 'COMPLETE:'||'Y' ; -- TBD shud be made 'Y' for testing
1222: p_result := 'COMPLETE:'||'N' ;
1223: end if;
1224:
1225:
1226: hr_utility.set_location('Exiting:'|| gv_package || '.appraisee_feedback_allowed', 1);
1227:
1228:
1229: exception
1230: when others then
1229: exception
1230: when others then
1231: wf_core.Context(gv_package,'.appraisee_feedback_allowed',p_itemtype, p_itemkey
1232: , p_actid,p_funcmode );
1233: hr_utility.trace('Exception in ' || gv_package || '.appraisee_feedback_allowed' ||
1234: sqlerrm );
1235: raise ;
1236: end appraisee_feedback_allowed;
1237:
1249: l_log varchar2(4000);
1250: lv_chg_appr_status_log wf_item_attributes.text_default%TYPE;
1251: chg_appr_status varchar2(2);
1252: begin
1253: hr_utility.set_location('Entered:'|| gv_package || '.appraisee_commit_aft_feedback', 1);
1254:
1255: l_appraisal_id := wf_engine.GetItemAttrNumber (itemtype => p_itemtype ,
1256: itemkey => p_itemkey ,
1257: aname => 'APPRAISAL_ID',
1261: l_log := l_log || 'No Appraisal Id for this WorkFlow Transaction';
1262: --raise ; -- Should raise an Exception ?????
1263: end if;
1264:
1265: hr_utility.set_location('calling hr_complete_appraisal_ss.change_appr_status', 2);
1266: hr_complete_appraisal_ss.change_appr_status(l_appraisal_id, p_itemtype,p_itemkey,
1267: lv_chg_appr_status_log,chg_appr_status);
1268:
1269:
1267: lv_chg_appr_status_log,chg_appr_status);
1268:
1269:
1270: p_result := 'COMPLETE:SUCCESS';
1271: hr_utility.set_location('Exiting:'|| gv_package || '.appraisee_commit_aft_feedback', 1);
1272:
1273: exception
1274: when others then
1275: wf_core.Context(gv_package,'.appraisee_commit_aft_feedback',p_itemtype, p_itemkey
1273: exception
1274: when others then
1275: wf_core.Context(gv_package,'.appraisee_commit_aft_feedback',p_itemtype, p_itemkey
1276: , p_actid,p_funcmode );
1277: hr_utility.trace('Exception in ' || gv_package || '.appraisee_commit_aft_feedback' ||
1278: sqlerrm );
1279: raise ;
1280: end appraisee_commit_aft_feedback ;
1281: