121: ( p_index IN NUMBER
122: , p_header_rec IN OE_BULK_ORDER_PVT.HEADER_REC_TYPE
123: )
124: IS
125: l_aname wf_engine.nametabtyp;
126: l_aname2 wf_engine.nametabtyp;
127: l_avalue wf_engine.numtabtyp;
128: l_avaluetext wf_engine.texttabtyp;
129: sales_order VARCHAR2(240);
122: , p_header_rec IN OE_BULK_ORDER_PVT.HEADER_REC_TYPE
123: )
124: IS
125: l_aname wf_engine.nametabtyp;
126: l_aname2 wf_engine.nametabtyp;
127: l_avalue wf_engine.numtabtyp;
128: l_avaluetext wf_engine.texttabtyp;
129: sales_order VARCHAR2(240);
130: --
123: )
124: IS
125: l_aname wf_engine.nametabtyp;
126: l_aname2 wf_engine.nametabtyp;
127: l_avalue wf_engine.numtabtyp;
128: l_avaluetext wf_engine.texttabtyp;
129: sales_order VARCHAR2(240);
130: --
131: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
124: IS
125: l_aname wf_engine.nametabtyp;
126: l_aname2 wf_engine.nametabtyp;
127: l_avalue wf_engine.numtabtyp;
128: l_avaluetext wf_engine.texttabtyp;
129: sales_order VARCHAR2(240);
130: --
131: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
132: --
147: , to_char(p_header_rec.order_number(p_index)));
148: sales_order := substrb(fnd_message.get, 1, 240);
149:
150: -- Create Header Work item
151: WF_ENGINE.CreateProcess(OE_Globals.G_WFI_HDR
152: ,to_char(p_header_rec.header_id(p_index))
153: ,p_header_rec.wf_process_name(p_index)
154: ,sales_order);
155:
153: ,p_header_rec.wf_process_name(p_index)
154: ,sales_order);
155:
156: --Bug 16582023
157: wf_engine.additemattr (oe_globals.g_wfi_hdr,
158: TO_CHAR (p_header_rec.header_id(p_index)),
159: '#WAITFORDETAIL',
160: NULL,
161: 0
171: l_aname(4) := 'ORG_ID';
172: l_avalue(4) := to_number(OE_GLOBALS.G_ORG_ID);
173: l_aname(5) := 'ORDER_NUMBER'; -- Added for bug 6066313
174: l_avalue(5) := p_header_rec.order_number(p_index); -- Added for bug 6066313
175: wf_engine.SetItemAttrNumberArray( OE_GLOBALS.G_WFI_HDR
176: , p_header_rec.header_id(p_index)
177: , l_aname
178: , l_avalue
179: );
181: l_avaluetext(1) := p_header_rec.order_category_code(p_index);
182: l_aname2(2) := 'NOTIFICATION_APPROVER';
183: l_avaluetext(2) := OE_BULK_ORDER_PVT.G_NOTIFICATION_APPROVER;
184:
185: wf_engine.SetItemAttrTextArray( OE_GLOBALS.G_WFI_HDR
186: , p_header_rec.header_id(p_index)
187: , l_aname2
188: , l_avaluetext
189: );
207: l_process_name VARCHAR2(30);
208: l_wf_item_type VARCHAR2(30);
209: l_wf_assigned BOOLEAN;
210: l_order_number NUMBER;
211: l_aname wf_engine.nametabtyp;
212: l_aname2 wf_engine.nametabtyp;
213: l_avalue wf_engine.numtabtyp;
214: l_avaluetext wf_engine.texttabtyp;
215: line VARCHAR2(240);
208: l_wf_item_type VARCHAR2(30);
209: l_wf_assigned BOOLEAN;
210: l_order_number NUMBER;
211: l_aname wf_engine.nametabtyp;
212: l_aname2 wf_engine.nametabtyp;
213: l_avalue wf_engine.numtabtyp;
214: l_avaluetext wf_engine.texttabtyp;
215: line VARCHAR2(240);
216: --
209: l_wf_assigned BOOLEAN;
210: l_order_number NUMBER;
211: l_aname wf_engine.nametabtyp;
212: l_aname2 wf_engine.nametabtyp;
213: l_avalue wf_engine.numtabtyp;
214: l_avaluetext wf_engine.texttabtyp;
215: line VARCHAR2(240);
216: --
217: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
210: l_order_number NUMBER;
211: l_aname wf_engine.nametabtyp;
212: l_aname2 wf_engine.nametabtyp;
213: l_avalue wf_engine.numtabtyp;
214: l_avaluetext wf_engine.texttabtyp;
215: line VARCHAR2(240);
216: --
217: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
218: --
238:
239: line := substrb(fnd_message.get, 1, 240);
240:
241: -- Create Line Work item
242: WF_ENGINE.CreateProcess(OE_Globals.G_WFI_LIN
243: ,to_char(p_line_rec.line_id(p_line_index))
244: ,p_line_rec.wf_process_name(p_line_index)
245: ,line);
246:
254: l_avalue(3) := FND_GLOBAL.RESP_ID;
255: l_aname(4) := 'ORG_ID';
256: l_avalue(4) := to_number(OE_GLOBALS.G_ORG_ID);
257:
258: wf_engine.SetItemAttrNumberArray( OE_GLOBALS.G_WFI_LIN
259: , p_line_rec.line_id(p_line_index)
260: , l_aname
261: , l_avalue
262: );
265: l_avaluetext(1) := p_line_rec.line_category_code(p_line_index);
266: l_aname2(2) := 'NOTIFICATION_APPROVER';
267: l_avaluetext(2) := OE_BULK_ORDER_PVT.G_NOTIFICATION_APPROVER;
268:
269: wf_engine.SetItemAttrTextArray( OE_GLOBALS.G_WFI_LIN
270: , p_line_rec.line_id(p_line_index)
271: , l_aname2
272: , l_avaluetext
273: );
529: l_wf_bulk_api_index NUMBER := 0;
530: l_index_Attr_Txt NUMBER := 0;
531: l_index_Attr_Num NUMBER := 0;
532:
533: l_aname wf_engine.nametabtyp;
534: l_aname2 wf_engine.nametabtyp;
535: l_avalue wf_engine.numtabtyp;
536: l_avaluetext wf_engine.texttabtyp;
537: l_itemkeys_4NAttr wf_engine_bulk.itemkeytabtype;
530: l_index_Attr_Txt NUMBER := 0;
531: l_index_Attr_Num NUMBER := 0;
532:
533: l_aname wf_engine.nametabtyp;
534: l_aname2 wf_engine.nametabtyp;
535: l_avalue wf_engine.numtabtyp;
536: l_avaluetext wf_engine.texttabtyp;
537: l_itemkeys_4NAttr wf_engine_bulk.itemkeytabtype;
538: l_itemkeys_4TAttr wf_engine_bulk.itemkeytabtype;
531: l_index_Attr_Num NUMBER := 0;
532:
533: l_aname wf_engine.nametabtyp;
534: l_aname2 wf_engine.nametabtyp;
535: l_avalue wf_engine.numtabtyp;
536: l_avaluetext wf_engine.texttabtyp;
537: l_itemkeys_4NAttr wf_engine_bulk.itemkeytabtype;
538: l_itemkeys_4TAttr wf_engine_bulk.itemkeytabtype;
539:
532:
533: l_aname wf_engine.nametabtyp;
534: l_aname2 wf_engine.nametabtyp;
535: l_avalue wf_engine.numtabtyp;
536: l_avaluetext wf_engine.texttabtyp;
537: l_itemkeys_4NAttr wf_engine_bulk.itemkeytabtype;
538: l_itemkeys_4TAttr wf_engine_bulk.itemkeytabtype;
539:
540: WF_Api_l_item_keys wf_engine_bulk.itemkeytabtype;
533: l_aname wf_engine.nametabtyp;
534: l_aname2 wf_engine.nametabtyp;
535: l_avalue wf_engine.numtabtyp;
536: l_avaluetext wf_engine.texttabtyp;
537: l_itemkeys_4NAttr wf_engine_bulk.itemkeytabtype;
538: l_itemkeys_4TAttr wf_engine_bulk.itemkeytabtype;
539:
540: WF_Api_l_item_keys wf_engine_bulk.itemkeytabtype;
541: WF_Api_l_user_keys wf_engine_bulk.userkeytabtype;
534: l_aname2 wf_engine.nametabtyp;
535: l_avalue wf_engine.numtabtyp;
536: l_avaluetext wf_engine.texttabtyp;
537: l_itemkeys_4NAttr wf_engine_bulk.itemkeytabtype;
538: l_itemkeys_4TAttr wf_engine_bulk.itemkeytabtype;
539:
540: WF_Api_l_item_keys wf_engine_bulk.itemkeytabtype;
541: WF_Api_l_user_keys wf_engine_bulk.userkeytabtype;
542: WF_Api_l_owner_roles wf_engine_bulk.ownerroletabtype;
536: l_avaluetext wf_engine.texttabtyp;
537: l_itemkeys_4NAttr wf_engine_bulk.itemkeytabtype;
538: l_itemkeys_4TAttr wf_engine_bulk.itemkeytabtype;
539:
540: WF_Api_l_item_keys wf_engine_bulk.itemkeytabtype;
541: WF_Api_l_user_keys wf_engine_bulk.userkeytabtype;
542: WF_Api_l_owner_roles wf_engine_bulk.ownerroletabtype;
543: /* End of WF Bulk API ER #8601238 */
544: --
537: l_itemkeys_4NAttr wf_engine_bulk.itemkeytabtype;
538: l_itemkeys_4TAttr wf_engine_bulk.itemkeytabtype;
539:
540: WF_Api_l_item_keys wf_engine_bulk.itemkeytabtype;
541: WF_Api_l_user_keys wf_engine_bulk.userkeytabtype;
542: WF_Api_l_owner_roles wf_engine_bulk.ownerroletabtype;
543: /* End of WF Bulk API ER #8601238 */
544: --
545: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
538: l_itemkeys_4TAttr wf_engine_bulk.itemkeytabtype;
539:
540: WF_Api_l_item_keys wf_engine_bulk.itemkeytabtype;
541: WF_Api_l_user_keys wf_engine_bulk.userkeytabtype;
542: WF_Api_l_owner_roles wf_engine_bulk.ownerroletabtype;
543: /* End of WF Bulk API ER #8601238 */
544: --
545: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
546: --
755: l_my_index_ind := l_item_keys.NEXT(l_my_index_ind);
756: END LOOP;
757:
758: -- Calling WF Bulk APIs for Creating the Workflow Process Definition
759: WF_ENGINE_BULK.CreateProcess
760: ( itemtype => OE_GLOBALS.G_WFI_LIN
761: , itemkeys => WF_Api_l_item_keys
762: , process => l_process_name_tbl(l_process_name_ind)
763: , user_keys => WF_Api_l_user_keys
775: END LOOP;
776: END IF;
777:
778: -- Calling WF Bulk APIs for setting Item attributes of Number and Text type
779: WF_ENGINE_BULK.SetItemAttrText
780: ( itemtype => OE_GLOBALS.G_WFI_LIN
781: , itemkeys => l_itemkeys_4TAttr
782: , anames => l_aname2
783: , avalues => l_avaluetext
782: , anames => l_aname2
783: , avalues => l_avaluetext
784: );
785:
786: WF_ENGINE_BULK.SetItemAttrNumber
787: ( itemtype => OE_GLOBALS.G_WFI_LIN
788: , itemkeys => l_itemkeys_4NAttr
789: , anames => l_aname
790: , avalues => l_avalue
803:
804: /* End of WF Bulk API ER #8601238 */
805:
806: /*Progress Both Header and Line Flows*/
807: WF_ENGINE.StartProcess(OE_GLOBALS.G_WFI_HDR
808: ,to_char(l_header_id));
809:
810: IF p_header_rec.booked_flag(i) = 'Y' THEN
811: -- Call WF_ENGINE to complete the BOOK_ELIGIBLE activity and proceed
807: WF_ENGINE.StartProcess(OE_GLOBALS.G_WFI_HDR
808: ,to_char(l_header_id));
809:
810: IF p_header_rec.booked_flag(i) = 'Y' THEN
811: -- Call WF_ENGINE to complete the BOOK_ELIGIBLE activity and proceed
812: -- to the next activity in the order workflow
813: WF_ENGINE.CompleteActivityInternalName
814: ( itemtype => 'OEOH'
815: , itemkey => to_char(l_header_id)
809:
810: IF p_header_rec.booked_flag(i) = 'Y' THEN
811: -- Call WF_ENGINE to complete the BOOK_ELIGIBLE activity and proceed
812: -- to the next activity in the order workflow
813: WF_ENGINE.CompleteActivityInternalName
814: ( itemtype => 'OEOH'
815: , itemkey => to_char(l_header_id)
816: , activity => 'BOOK_ELIGIBLE'
817: , result => NULL
851: ,p_header_rec => p_header_rec
852: );*/ --Line work flow already created Bug 5261216
853:
854: -- Start Workflow for this line
855: WF_ENGINE.StartProcess(OE_GLOBALS.G_WFI_LIN
856: ,to_char(p_line_rec.line_id(j)));
857:
858: -- Pricing Post-Processing
859: -- Not needed for included items.
887: ,p_line_rec => p_line_rec
888: ,p_header_rec => p_header_rec
889: );*/ --Line work flow already created Bug 5261216
890:
891: WF_ENGINE.StartProcess(OE_GLOBALS.G_WFI_LIN
892: ,to_char(p_line_rec.line_id(l_ii_index)));
893: l_ii_index := l_ii_index + 1;
894:
895: END LOOP;