85: WHERE batch_id = p_batch_id;
86:
87:
88: BEGIN
89: l_resp_id := wf_engine.GetItemAttrNumber
90: (itemtype => itemtype,
91: itemkey => itemkey,
92: aname =>'RESP_ID');
93: l_user_id := wf_engine.GetItemAttrNumber
89: l_resp_id := wf_engine.GetItemAttrNumber
90: (itemtype => itemtype,
91: itemkey => itemkey,
92: aname =>'RESP_ID');
93: l_user_id := wf_engine.GetItemAttrNumber
94: (itemtype => itemtype,
95: itemkey => itemkey,
96: aname =>'USER_ID');
97: l_appl_id := wf_engine.GetItemAttrNumber
93: l_user_id := wf_engine.GetItemAttrNumber
94: (itemtype => itemtype,
95: itemkey => itemkey,
96: aname =>'USER_ID');
97: l_appl_id := wf_engine.GetItemAttrNumber
98: (itemtype => itemtype,
99: itemkey => itemkey,
100: aname =>'APPL_ID');
101: if(funcmode='RUN') then
101: if(funcmode='RUN') then
102:
103: -- get the batch_id from the item attributes
104:
105: l_batch_id := wf_engine.getitemattrnumber(itemtype,
106: itemkey,
107: 'BATCH_ID');
108:
109: -- open the cursor, and raise the business event for each recipient
232: -- Currently we do not need additional attributes. This may change
233: -- when handling the remote instances case.
234:
235: -- get the item attributes from the WF
236: l_batch_id := wf_engine.getitemattrnumber(itemtype,
237: itemkey,
238: 'BATCH_ID');
239:
240: -- We only need to check if invoice is required and set the
294: IF (funcmode = 'RUN') THEN
295:
296: -- Set the attribute to zero
297:
298: wf_engine.setitemattrnumber(itemtype,
299: itemkey,
300: 'NUM_REMOTE_INSTANCE',
301: 0);
302:
363:
364: IF (funcmode = 'RUN') THEN
365:
366: -- get the item attributes from the WF
367: l_batch_id := wf_engine.getitemattrnumber(itemtype,
368: itemkey,
369: 'BATCH_ID');
370:
371: l_trx_id := wf_engine.getitemattrnumber(itemtype,
367: l_batch_id := wf_engine.getitemattrnumber(itemtype,
368: itemkey,
369: 'BATCH_ID');
370:
371: l_trx_id := wf_engine.getitemattrnumber(itemtype,
372: itemkey,
373: 'TRX_ID');
374:
375: l_event_name := wf_engine.getitemattrtext (itemtype,
371: l_trx_id := wf_engine.getitemattrnumber(itemtype,
372: itemkey,
373: 'TRX_ID');
374:
375: l_event_name := wf_engine.getitemattrtext (itemtype,
376: itemkey,
377: 'EVENT_NAME');
378:
379: -- obtain the initiator_id and recipient_id
403: then
404: l_tp_party_id :=l_recipient_id;
405:
406: -- get the Invoice Number
407: l_invoice_num := wf_engine.getitemattrtext (itemtype,
408: itemkey,
409: 'INVOICE_NUM');
410:
411:
428: -- temp solution
429: l_event_key :=to_char(l_batch_id) || '_' || to_char(l_trx_id) || SYS_GUID();
430:
431: --set the WF item value
432: wf_engine.setitemattrtext(itemtype,
433: itemkey,
434: 'RECEIVE_EVENT_NAME',
435: l_new_event_name);
436:
433: itemkey,
434: 'RECEIVE_EVENT_NAME',
435: l_new_event_name);
436:
437: wf_engine.setitemattrtext(itemtype,
438: itemkey,
439: 'LOCAL_EVT_KEY',
440: l_event_key);
441: wf_engine.setitemattrtext(itemtype,
437: wf_engine.setitemattrtext(itemtype,
438: itemkey,
439: 'LOCAL_EVT_KEY',
440: l_event_key);
441: wf_engine.setitemattrtext(itemtype,
442: itemkey,
443: 'INVOICE_NUM',
444: l_invoice_num);
445: else