6148: l_approver_notify boolean;
6149: l_employee_notify boolean;
6150: l_init_notify boolean;
6151: l_frp_notify boolean;
6152: t_wf_roles t_varchar2_400_type;
6153: t_person_id t_num_15_type;
6154: l_template_name varchar2(240);
6155: l_distribution_source varchar2(260);
6156: l_time_period_name varchar2(100);
6173:
6174: cursor get_frp_wf_names is
6175: select distinct wf.name,
6176: wf.orig_system_id
6177: from wf_roles wf,
6178: psp_report_templates_h h,
6179: psp_report_template_details_h dtl
6180: where wf.orig_system = 'PER'
6181: and to_char(wf.orig_system_id) = dtl.criteria_value1
6189:
6190: cursor get_init_wf_names is
6191: select distinct wf.name,
6192: wf.orig_system_id
6193: from wf_roles wf,
6194: psp_report_templates_h h
6195: where wf.orig_system = 'PER'
6196: and wf.orig_system_id = h.initiator_person_id
6197: and h.request_id in ( select -person_id
6203:
6204: cursor get_per_wf_names is
6205: select distinct wf.name,
6206: er.person_id
6207: from wf_roles wf,
6208: psp_eff_reports er,
6209: psp_report_templates_h h
6210: where wf.orig_system = 'PER'
6211: and wf.orig_system_id = er.person_id
6415: close get_superceding_source;
6416:
6417: if l_init_notify then
6418: open get_init_wf_names;
6419: fetch get_init_wf_names bulk collect into t_wf_roles, t_person_id;
6420: close get_init_wf_names;
6421:
6422: for i in 1..t_wf_roles.count
6423: loop
6418: open get_init_wf_names;
6419: fetch get_init_wf_names bulk collect into t_wf_roles, t_person_id;
6420: close get_init_wf_names;
6421:
6422: for i in 1..t_wf_roles.count
6423: loop
6424: CALL_WF(p_supercede_reqid_str,
6425: t_wf_roles(i),
6426: p_SandT_reqid,
6421:
6422: for i in 1..t_wf_roles.count
6423: loop
6424: CALL_WF(p_supercede_reqid_str,
6425: t_wf_roles(i),
6426: p_SandT_reqid,
6427: t_person_id(i),
6428: 'INIT',
6429: l_template_name,
6437: end if;
6438:
6439: if l_frp_notify then
6440: open get_frp_wf_names;
6441: fetch get_frp_wf_names bulk collect into t_wf_roles, t_person_id;
6442: close get_frp_wf_names;
6443:
6444: for i in 1..t_wf_roles.count
6445: loop
6440: open get_frp_wf_names;
6441: fetch get_frp_wf_names bulk collect into t_wf_roles, t_person_id;
6442: close get_frp_wf_names;
6443:
6444: for i in 1..t_wf_roles.count
6445: loop
6446: CALL_WF(p_supercede_reqid_str,
6447: t_wf_roles(i),
6448: p_SandT_reqid,
6443:
6444: for i in 1..t_wf_roles.count
6445: loop
6446: CALL_WF(p_supercede_reqid_str,
6447: t_wf_roles(i),
6448: p_SandT_reqid,
6449: t_person_id(i),
6450: 'FRP',
6451: l_template_name,
6460:
6461:
6462: if l_employee_notify then
6463: open get_per_wf_names;
6464: fetch get_per_wf_names bulk collect into t_wf_roles, t_person_id;
6465: close get_per_wf_names;
6466:
6467: for i in 1..t_wf_roles.count
6468: loop
6463: open get_per_wf_names;
6464: fetch get_per_wf_names bulk collect into t_wf_roles, t_person_id;
6465: close get_per_wf_names;
6466:
6467: for i in 1..t_wf_roles.count
6468: loop
6469: CALL_WF(p_supercede_reqid_str,
6470: t_wf_roles(i),
6471: p_SandT_reqid,
6466:
6467: for i in 1..t_wf_roles.count
6468: loop
6469: CALL_WF(p_supercede_reqid_str,
6470: t_wf_roles(i),
6471: p_SandT_reqid,
6472: t_person_id(i),
6473: 'EMP',
6474: l_template_name,
6483:
6484: hr_utility.trace( 'SandT_Supercede-->send_notifications--> has dynamic part for approver start');
6485: if l_approver_notify then
6486: open get_app_wf_names;
6487: fetch get_app_wf_names bulk collect into t_wf_roles;
6488: close get_app_wf_names;
6489: for i in 1..t_wf_roles.count
6490: loop
6491: CALL_WF(p_supercede_reqid_str,
6485: if l_approver_notify then
6486: open get_app_wf_names;
6487: fetch get_app_wf_names bulk collect into t_wf_roles;
6488: close get_app_wf_names;
6489: for i in 1..t_wf_roles.count
6490: loop
6491: CALL_WF(p_supercede_reqid_str,
6492: t_wf_roles(i),
6493: p_SandT_reqid,
6488: close get_app_wf_names;
6489: for i in 1..t_wf_roles.count
6490: loop
6491: CALL_WF(p_supercede_reqid_str,
6492: t_wf_roles(i),
6493: p_SandT_reqid,
6494: null,
6495: 'APP',
6496: l_template_name,