56: Fetch C_Seq Into itemkey;
57: Close C_Seq;
58: --
59: -- Create and start the process
60: Wf_Engine.CreateProcess(itemtype, itemkey, process);
61: Wf_Engine.SetItemUserKey(itemtype, itemkey, p_userkey);
62: Wf_Engine.SetItemOwner(itemtype, itemkey, username);
63: --
64: -- Populate "special" attributes, if they exist
57: Close C_Seq;
58: --
59: -- Create and start the process
60: Wf_Engine.CreateProcess(itemtype, itemkey, process);
61: Wf_Engine.SetItemUserKey(itemtype, itemkey, p_userkey);
62: Wf_Engine.SetItemOwner(itemtype, itemkey, username);
63: --
64: -- Populate "special" attributes, if they exist
65: begin
58: --
59: -- Create and start the process
60: Wf_Engine.CreateProcess(itemtype, itemkey, process);
61: Wf_Engine.SetItemUserKey(itemtype, itemkey, p_userkey);
62: Wf_Engine.SetItemOwner(itemtype, itemkey, username);
63: --
64: -- Populate "special" attributes, if they exist
65: begin
66: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'USER_NAME',
62: Wf_Engine.SetItemOwner(itemtype, itemkey, username);
63: --
64: -- Populate "special" attributes, if they exist
65: begin
66: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'USER_NAME',
67: fnd_profile.value('USERNAME'));
68: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'USER_ID',
69: fnd_profile.value('USER_ID'));
70: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'RESP_ID',
64: -- Populate "special" attributes, if they exist
65: begin
66: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'USER_NAME',
67: fnd_profile.value('USERNAME'));
68: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'USER_ID',
69: fnd_profile.value('USER_ID'));
70: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'RESP_ID',
71: fnd_profile.value('RESP_ID'));
72: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'RESP_APPL_ID',
66: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'USER_NAME',
67: fnd_profile.value('USERNAME'));
68: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'USER_ID',
69: fnd_profile.value('USER_ID'));
70: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'RESP_ID',
71: fnd_profile.value('RESP_ID'));
72: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'RESP_APPL_ID',
73: fnd_profile.value('RESP_APPL_ID'));
74: exception
68: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'USER_ID',
69: fnd_profile.value('USER_ID'));
70: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'RESP_ID',
71: fnd_profile.value('RESP_ID'));
72: Wf_Engine.SetItemAttrText(itemtype, itemkey, 'RESP_APPL_ID',
73: fnd_profile.value('RESP_APPL_ID'));
74: exception
75: when others then
76: null;
78: --
79: -- Create and set the special mail-suppression itemattr.
80: -- This attr prevents mail from being sent to process originator.
81: --
82: Wf_Engine.AddItemAttr(itemtype, itemkey, '.MAIL_QUERY');
83: Wf_Engine.SetItemAttrText(itemtype, itemkey, '.MAIL_QUERY',
84: username);
85: --
86: --
79: -- Create and set the special mail-suppression itemattr.
80: -- This attr prevents mail from being sent to process originator.
81: --
82: Wf_Engine.AddItemAttr(itemtype, itemkey, '.MAIL_QUERY');
83: Wf_Engine.SetItemAttrText(itemtype, itemkey, '.MAIL_QUERY',
84: username);
85: --
86: --
87: wf_engine.SetItemAttrText( itemtype => ItemType,
83: Wf_Engine.SetItemAttrText(itemtype, itemkey, '.MAIL_QUERY',
84: username);
85: --
86: --
87: wf_engine.SetItemAttrText( itemtype => ItemType,
88: itemkey => Itemkey,
89: aname => 'PERSON_ID',
90: avalue => to_char(p_person_id));
91: --
88: itemkey => Itemkey,
89: aname => 'PERSON_ID',
90: avalue => to_char(p_person_id));
91: --
92: wf_engine.SetItemAttrText(itemtype => itemtype,
93: itemkey => itemkey,
94: aname => 'EFFECTIVE_DATE',
95: avalue => to_char(p_effective_date, 'DD/MM/YYYY'));
96: --
93: itemkey => itemkey,
94: aname => 'EFFECTIVE_DATE',
95: avalue => to_char(p_effective_date, 'DD/MM/YYYY'));
96: --
97: wf_engine.SetItemAttrText(itemtype => itemtype,
98: itemkey => itemkey,
99: aname => 'BUSINESS_GROUP_ID',
100: avalue => to_char(p_business_group_id));
101: --
98: itemkey => itemkey,
99: aname => 'BUSINESS_GROUP_ID',
100: avalue => to_char(p_business_group_id));
101: --
102: wf_engine.SetItemAttrText(itemtype => itemtype,
103: itemkey => itemkey,
104: aname => 'BEN_IA_CONTEXT_SET',
105: avalue => 'Y');
106: --
103: itemkey => itemkey,
104: aname => 'BEN_IA_CONTEXT_SET',
105: avalue => 'Y');
106: --
107: Wf_Engine.StartProcess(itemtype, itemkey);
108: --
109: -- Commit work so our lovely new process can start grinding away,
110: -- and so the monitor widget can see it.
111: commit;
272: --
273: -- Extract the person_id, effective_date, business_group_id
274: -- from the item type attributes.
275: --
276: l_person_id := wf_engine.GetItemAttrTEXT(
277: itemtype => itemtype,
278: itemkey => itemkey,
279: aname => 'PERSON_ID');
280: --
277: itemtype => itemtype,
278: itemkey => itemkey,
279: aname => 'PERSON_ID');
280: --
281: l_effective_date := wf_engine.GetItemAttrTEXT(
282: itemtype => itemtype,
283: itemkey => itemkey,
284: aname => 'EFFECTIVE_DATE');
285: --
282: itemtype => itemtype,
283: itemkey => itemkey,
284: aname => 'EFFECTIVE_DATE');
285: --
286: l_business_group_id := wf_engine.GetItemAttrTEXT(
287: itemtype => itemtype,
288: itemkey => itemkey,
289: aname => 'BUSINESS_GROUP_ID');
290: --
300: close c_pil;
301: --
302: -- set the item type attributes with the extracted ptnl ler, pil record counts.
303: --
304: wf_engine.SetItemAttrNumber(
305: itemtype => itemtype,
306: itemkey => itemkey,
307: aname => 'BEN_IA_PLE_COUNT',
308: avalue => l_ple_count);
306: itemkey => itemkey,
307: aname => 'BEN_IA_PLE_COUNT',
308: avalue => l_ple_count);
309: --
310: wf_engine.SetItemAttrNumber(
311: itemtype => itemtype,
312: itemkey => itemkey,
313: aname => 'BEN_IA_PIL_COUNT',
314: avalue => l_pil_count);
371: --
372: /* 99999 -- Extract the person_id, effective_date, business_group_id
373: -- from the item type attributes.
374: --
375: l_person_id := wf_engine.GetItemAttrNumber(
376: itemtype => itemtype,
377: itemkey => itemkey,
378: aname => 'PERSON_ID');
379: --
376: itemtype => itemtype,
377: itemkey => itemkey,
378: aname => 'PERSON_ID');
379: --
380: l_effective_date := wf_engine.GetItemAttrDate(
381: itemtype => itemtype,
382: itemkey => itemkey,
383: aname => 'EFFECTIVE_DATE');
384: --
381: itemtype => itemtype,
382: itemkey => itemkey,
383: aname => 'EFFECTIVE_DATE');
384: --
385: l_business_group_id := wf_engine.GetItemAttrNumber(
386: itemtype => itemtype,
387: itemkey => itemkey,
388: aname => 'BUSINESS_GROUP_ID');
389: --
399: close c_pil;
400: --
401: -- set the item type attributes with the extracted ptnl ler, pil record counts.
402: --
403: wf_engine.SetItemAttrNumber(
404: itemtype => itemtype,
405: itemkey => itemkey,
406: aname => 'BEN_IA_PLE_COUNT',
407: avalue => l_ple_count);
405: itemkey => itemkey,
406: aname => 'BEN_IA_PLE_COUNT',
407: avalue => l_ple_count);
408: --
409: wf_engine.SetItemAttrNumber(
410: itemtype => itemtype,
411: itemkey => itemkey,
412: aname => 'BEN_IA_PIL_COUNT',
413: avalue => l_pil_count);
591: --
592: -- Extract the person_id, effective_date, business_group_id
593: -- from the item type attributes.
594: --
595: l_person_id := to_number(wf_engine.GetItemAttrTEXT(
596: itemtype => itemtype,
597: itemkey => itemkey,
598: aname => 'PERSON_ID'));
599: --
596: itemtype => itemtype,
597: itemkey => itemkey,
598: aname => 'PERSON_ID'));
599: --
600: l_effective_date := to_date(wf_engine.GetItemAttrTEXT(
601: itemtype => itemtype,
602: itemkey => itemkey,
603: aname => 'EFFECTIVE_DATE'), 'YYYY/MM/DD HH24:MI:SS');
604: --
601: itemtype => itemtype,
602: itemkey => itemkey,
603: aname => 'EFFECTIVE_DATE'), 'YYYY/MM/DD HH24:MI:SS');
604: --
605: l_business_group_id := to_number(wf_engine.GetItemAttrTEXT(
606: itemtype => itemtype,
607: itemkey => itemkey,
608: aname => 'BUSINESS_GROUP_ID'));
609: --
751: -- Now set all the item attributes for the messaging purpose.
752: --
753: -- Save the ler id for future use.
754: --
755: wf_engine.SetItemAttrNumber(
756: itemtype => itemtype,
757: itemkey => itemkey,
758: aname => 'BEN_IA_LER_ID',
759: avalue => l_ler_id);
761: for i in 1..l_pil_count loop
762: --
763: -- Set item attribute (Life event name, occured date )values.
764: --
765: wf_engine.SetItemAttrTEXT(
766: itemtype => itemtype,
767: itemkey => itemkey,
768: aname => 'BEN_IA_LE_NAME',
769: avalue => l_le_object(l_pil_count).name);
767: itemkey => itemkey,
768: aname => 'BEN_IA_LE_NAME',
769: avalue => l_le_object(l_pil_count).name);
770: --
771: wf_engine.SetItemAttrTEXT(
772: itemtype => itemtype,
773: itemkey => itemkey,
774: aname => 'BEN_IA_LF_EVT_OCRD_DT',
775: avalue => l_le_object(l_pil_count).lf_evt_ocrd_dt);
783: end loop;
784: --
785: -- set the item type attributes with the extracted ptnl ler, pil record counts.
786: --
787: wf_engine.SetItemAttrNumber(
788: itemtype => itemtype,
789: itemkey => itemkey,
790: aname => 'BEN_IA_PLE_COUNT',
791: avalue => l_ple_count);
789: itemkey => itemkey,
790: aname => 'BEN_IA_PLE_COUNT',
791: avalue => l_ple_count);
792: --
793: wf_engine.SetItemAttrNumber(
794: itemtype => itemtype,
795: itemkey => itemkey,
796: aname => 'BEN_IA_PIL_COUNT',
797: avalue => l_pil_count);
799: -- If no life events are detected then set message to No life Events Detected.
800: --
801: if l_pil_count = 0 then
802: --
803: wf_engine.SetItemAttrTEXT(
804: itemtype => itemtype,
805: itemkey => itemkey,
806: aname => 'BEN_IA_LE_NAME',
807: avalue => ' No life Events Detected based on data changes');
815: for i in 1..l_rel_per_count loop
816: --
817: -- Set item attribute with(Related Person name, Life event name, occured date ).
818: --
819: wf_engine.SetItemAttrTEXT(
820: itemtype => itemtype,
821: itemkey => itemkey,
822: aname => 'BEN_IA_REL_PER_LF' || to_char(i),
823: avalue => l_cont_rel_object(i));
830: end loop;
831: --
832: -- Store the thread id and benefit action id's into item attributes.
833: --
834: wf_engine.SetItemAttrTEXT(
835: itemtype => itemtype,
836: itemkey => itemkey,
837: aname => 'BEN_IA_THREAD_ID',
838: avalue => '1');
836: itemkey => itemkey,
837: aname => 'BEN_IA_THREAD_ID',
838: avalue => '1');
839: --
840: wf_engine.SetItemAttrTEXT(
841: itemtype => itemtype,
842: itemkey => itemkey,
843: aname => 'BEN_IA_BENEFIT_ACTION_ID',
844: avalue => l_benefit_action_id);
883: l_mesg := fnd_message.get;
884: --
885: rollback to process_lf_evts;
886: --
887: wf_engine.SetItemAttrText(
888: itemtype => itemtype,
889: itemkey => itemkey,
890: aname => 'BEN_IA_ERROR_TEXT',
891: avalue => l_mesg);
934: --
935: -- Extract the person_id, effective_date, business_group_id
936: -- from the item type attributes.
937: --
938: l_person_id := wf_engine.GetItemAttrTEXT(
939: itemtype => itemtype,
940: itemkey => itemkey,
941: aname => 'PERSON_ID');
942: --
939: itemtype => itemtype,
940: itemkey => itemkey,
941: aname => 'PERSON_ID');
942: --
943: l_effective_date := wf_engine.GetItemAttrTEXT(
944: itemtype => itemtype,
945: itemkey => itemkey,
946: aname => 'EFFECTIVE_DATE');
947: --
944: itemtype => itemtype,
945: itemkey => itemkey,
946: aname => 'EFFECTIVE_DATE');
947: --
948: l_business_group_id := wf_engine.GetItemAttrTEXT(
949: itemtype => itemtype,
950: itemkey => itemkey,
951: aname => 'BUSINESS_GROUP_ID');
952: --
949: itemtype => itemtype,
950: itemkey => itemkey,
951: aname => 'BUSINESS_GROUP_ID');
952: --
953: l_ler_id := wf_engine.GetItemAttrNumber(
954: itemtype => itemtype,
955: itemkey => itemkey,
956: aname => 'BEN_IA_LER_ID');
957: --
978: --
979: --
980: -- Store the thread id and benefit action id's into item attributes.
981: --
982: wf_engine.SetItemAttrTEXT(
983: itemtype => itemtype,
984: itemkey => itemkey,
985: aname => 'BEN_IA_THREAD_ID',
986: avalue => '1');
984: itemkey => itemkey,
985: aname => 'BEN_IA_THREAD_ID',
986: avalue => '1');
987: --
988: wf_engine.SetItemAttrTEXT(
989: itemtype => itemtype,
990: itemkey => itemkey,
991: aname => 'BEN_IA_BENEFIT_ACTION_ID',
992: avalue => to_char(benutils.g_benefit_action_id));
1026: l_mesg := fnd_message.get;
1027: --
1028: rollback to process_lf_evts;
1029: --
1030: wf_engine.SetItemAttrText(
1031: itemtype => itemtype,
1032: itemkey => itemkey,
1033: aname => 'BEN_IA_ERROR_TEXT',
1034: avalue => l_mesg);
1099: --
1100: -- Extract the person_id, effective_date, business_group_id
1101: -- from the item type attributes.
1102: --
1103: l_person_id := wf_engine.GetItemAttrTEXT(
1104: itemtype => itemtype,
1105: itemkey => itemkey,
1106: aname => 'PERSON_ID');
1107: --
1104: itemtype => itemtype,
1105: itemkey => itemkey,
1106: aname => 'PERSON_ID');
1107: --
1108: l_effective_date := wf_engine.GetItemAttrTEXT(
1109: itemtype => itemtype,
1110: itemkey => itemkey,
1111: aname => 'EFFECTIVE_DATE');
1112: --
1109: itemtype => itemtype,
1110: itemkey => itemkey,
1111: aname => 'EFFECTIVE_DATE');
1112: --
1113: l_business_group_id := wf_engine.GetItemAttrTEXT(
1114: itemtype => itemtype,
1115: itemkey => itemkey,
1116: aname => 'BUSINESS_GROUP_ID');
1117: --
1211: --
1212: -- Extract the person_id, effective_date, business_group_id
1213: -- from the item type attributes.
1214: --
1215: l_person_id := wf_engine.GetItemAttrTEXT(
1216: itemtype => itemtype,
1217: itemkey => itemkey,
1218: aname => 'PERSON_ID');
1219: --
1216: itemtype => itemtype,
1217: itemkey => itemkey,
1218: aname => 'PERSON_ID');
1219: --
1220: l_effective_date := wf_engine.GetItemAttrTEXT(
1221: itemtype => itemtype,
1222: itemkey => itemkey,
1223: aname => 'EFFECTIVE_DATE');
1224: --
1221: itemtype => itemtype,
1222: itemkey => itemkey,
1223: aname => 'EFFECTIVE_DATE');
1224: --
1225: l_business_group_id := wf_engine.GetItemAttrTEXT(
1226: itemtype => itemtype,
1227: itemkey => itemkey,
1228: aname => 'BUSINESS_GROUP_ID');
1229: --
1796: -- RUN mode - normal process execution.
1797: --
1798: if (funcmode = 'RUN' ) then
1799: --
1800: l_context_set := wf_engine.GetItemAttrTEXT(
1801: itemtype => itemtype,
1802: itemkey => itemkey,
1803: aname => 'BEN_IA_CONTEXT_SET');
1804: --